Muluhabt ERP modules

This commit is contained in:
Mulu Mehari
2026-08-25 00:11:39 +03:00
parent 5c2100e76d
commit 70171fa9d8
441 changed files with 68587 additions and 214 deletions

View File

@@ -0,0 +1,22 @@
-- Bootstrap for the single, schema-separated platform database.
--
-- Runs once, on an empty data volume (postgres image initdb hook). Every app owns
-- exactly one schema and applies its own migrations into it; nothing here creates
-- tables. Ownership map:
--
-- iam edr-freight-api (`pnpm iam:migration:run`, ships with @tria-plc/iamapi-common)
-- -> history in iam.typeorm_migrations
-- freight edr-freight-api -> history in freight.migrations
-- passenger edr-passenger-api (Prisma) -> history in passenger._prisma_migrations
-- edr_payment edr-payment-api -> its own TypeORM history
-- audit @tria-plc/auditlog consumer
--
-- Cross-schema references stay SOFT (plain UUID columns + denormalized display
-- fields). Co-location makes hard FKs possible; the platform deliberately does not
-- use them, so IAM stays independently deployable and the audit trail outlives a
-- deleted user.
CREATE SCHEMA IF NOT EXISTS iam;
CREATE SCHEMA IF NOT EXISTS freight;
CREATE SCHEMA IF NOT EXISTS passenger;
CREATE SCHEMA IF NOT EXISTS edr_payment;
CREATE SCHEMA IF NOT EXISTS audit;