Vaihe 1/1: users-moduuli, kirjautuminen ja käyttäjähallinta
- shared-moduuli: DomainError, EmailAddress, UnitOfWork, tapahtumat, TimestampedModel, daisyUI-lomakerenderöinti ja yhteiset pohjat - users-moduuli Clean Architecture -kerroksin: oma käyttäjämalli (AUTH_USER_MODEL), roolit ja oikeudet, harjoittelija-, vastuuhenkilö- ja viimeisen pääkäyttäjän säännöt - kirjautuminen sähköpostilla, yritysten rajoitus, "muista minut", istunnon katkaisu kun tunnus poistetaan käytöstä tai harjoittelu päättyy - kertakäyttöiset salasanalinkit (72 h / 60 min, uusi mitätöi vanhan), salasanasääntö ja create_admin-komento - käyttäjähallinta: lista (HTMX-haku), lomakkeet ja kopioitava linkki - Tailwind 4 + daisyUI 5 + HTMX + Alpine npm-buildilla, suomennokset - testit: domain, application (fakeilla), integraatio ja selaintestit (axe, vaalea/tumma, 1920/320 px); ruff, mypy ja import-linter - dokumentit päivitetty toteutuksen mukaisiksi Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
[project]
|
||||
name = "toiminnanohjaus"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.14"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
DJANGO_SETTINGS_MODULE = "config.settings"
|
||||
python_files = ["test_*.py"]
|
||||
testpaths = ["apps"]
|
||||
addopts = "-p no:cacheprovider --strict-markers"
|
||||
markers = [
|
||||
"browser: Playwright browser tests (run: pytest tests/browser -m browser)",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 100
|
||||
target-version = "py314"
|
||||
extend-exclude = ["*/migrations/*", "node_modules", "static"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "W", "I", "UP", "B", "DJ", "SIM", "RUF"]
|
||||
ignore = ["RUF001", "RUF002", "RUF003", "RUF012", "DJ008"]
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.14"
|
||||
plugins = ["mypy_django_plugin.main"]
|
||||
ignore_missing_imports = true
|
||||
exclude = ["migrations/", "tests/"]
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = ["apps.*.domain.*", "apps.*.application.*"]
|
||||
strict = true
|
||||
|
||||
[tool.django-stubs]
|
||||
django_settings_module = "config.settings"
|
||||
|
||||
[tool.importlinter]
|
||||
root_package = "apps"
|
||||
include_external_packages = true
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "Domain and application layers do not depend on Django"
|
||||
type = "forbidden"
|
||||
source_modules = [
|
||||
"apps.shared.domain",
|
||||
"apps.shared.application",
|
||||
"apps.users.domain",
|
||||
"apps.users.application",
|
||||
]
|
||||
forbidden_modules = ["django"]
|
||||
allow_indirect_imports = true
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "users layers"
|
||||
type = "layers"
|
||||
layers = [
|
||||
"apps.users.container",
|
||||
"apps.users.presentation",
|
||||
"apps.users.infrastructure",
|
||||
"apps.users.application",
|
||||
"apps.users.domain",
|
||||
]
|
||||
ignore_imports = [
|
||||
# Composition root and presentation may both see the container.
|
||||
"apps.users.presentation.** -> apps.users.container",
|
||||
]
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "Presentation does not use infrastructure directly"
|
||||
type = "forbidden"
|
||||
source_modules = ["apps.users.presentation"]
|
||||
forbidden_modules = ["apps.users.infrastructure"]
|
||||
allow_indirect_imports = true
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "shared layers"
|
||||
type = "layers"
|
||||
layers = [
|
||||
"apps.shared.presentation",
|
||||
"apps.shared.infrastructure",
|
||||
"apps.shared.application",
|
||||
"apps.shared.domain",
|
||||
]
|
||||
Reference in New Issue
Block a user