Vaihe 1/2: asiakkaat, yhteyshenkilöt ja laskutusyksiköt
- customers-moduuli Clean Architecture -kerroksin: asiakas (yritys/kuluttaja), Y-tunnuksen tarkiste ja yksilöllisyys, yhteyshenkilöt, laskutusyksiköt (verkkolaskuosoite vaatii välittäjätunnuksen) - henkilötunnus salattuna (Fernet) ja HMAC-tiiviste päällekkäisyyksiin; pääkäyttäjä ja johto näkevät ja poistavat, muut näkevät peitettynä - sisäinen asiakas data-migraatiolla, ei poistettavissa - yleinen poistonesto käänteisten relaatioiden perusteella (tulevat PROTECT-viiteavaimet estävät poiston automaattisesti) - asiakkaan sivu: lisäys ja muokkaus dialogissa HTMX:llä, fokuksen hallinta ja ruudunlukijailmoitukset; HTMX näyttää nyt 422-validointivirheet - testit: domain, application, integraatio ja selaintestit (axe); yhteiset fixturet apps/conftest.py:hin, FakeUnitOfWork shared-moduuliin - import-linter: moduulien riippumattomuussäännöt - dokumentit päivitetty Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+36
-2
@@ -46,6 +46,8 @@ source_modules = [
|
||||
"apps.shared.application",
|
||||
"apps.users.domain",
|
||||
"apps.users.application",
|
||||
"apps.customers.domain",
|
||||
"apps.customers.application",
|
||||
]
|
||||
forbidden_modules = ["django"]
|
||||
allow_indirect_imports = true
|
||||
@@ -65,13 +67,45 @@ ignore_imports = [
|
||||
"apps.users.presentation.** -> apps.users.container",
|
||||
]
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "customers layers"
|
||||
type = "layers"
|
||||
layers = [
|
||||
"apps.customers.container",
|
||||
"apps.customers.presentation",
|
||||
"apps.customers.infrastructure",
|
||||
"apps.customers.application",
|
||||
"apps.customers.domain",
|
||||
]
|
||||
ignore_imports = ["apps.customers.presentation.** -> apps.customers.container"]
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "Presentation does not use infrastructure directly"
|
||||
type = "forbidden"
|
||||
source_modules = ["apps.users.presentation"]
|
||||
forbidden_modules = ["apps.users.infrastructure"]
|
||||
source_modules = ["apps.users.presentation", "apps.customers.presentation"]
|
||||
forbidden_modules = ["apps.users.infrastructure", "apps.customers.infrastructure"]
|
||||
allow_indirect_imports = true
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "Modules use each other only through application interfaces"
|
||||
type = "forbidden"
|
||||
source_modules = ["apps.customers"]
|
||||
forbidden_modules = [
|
||||
"apps.users.infrastructure",
|
||||
"apps.users.container",
|
||||
"apps.users.application",
|
||||
]
|
||||
ignore_imports = [
|
||||
# Integration tests may arrange data with another module's models.
|
||||
"apps.customers.tests.** -> apps.users.infrastructure.**",
|
||||
]
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "users does not depend on customers"
|
||||
type = "forbidden"
|
||||
source_modules = ["apps.users"]
|
||||
forbidden_modules = ["apps.customers"]
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
name = "shared layers"
|
||||
type = "layers"
|
||||
|
||||
Reference in New Issue
Block a user