- Shared sale-invoice creation was introduced and must be injected/exported correctly in consuming modules (example failure: `UnknownDependenciesException` for `SharedSaleInvoiceCreateService`).
- In `SalesInvoiceTspService.revoke`, prepare all creation/update data from `relatedInvoice` (no external `dataToUpdate` argument expected).
- Prisma client is generated to `src/generated/prisma` via:
-`provider = "prisma-client"`
-`output = "../../src/generated/prisma"`
-`moduleFormat = "cjs"`
- Docker/runtime must include generated Prisma artifacts and `@prisma/client` runtime; missing `@prisma/client/runtime/client` indicates build/copy/install mismatch.
- Seeder commands that use `tsx` require dev dependencies/runtime tools; if running in slim production container, use a dedicated seed target/container or run seed from build/dev image.
-`pnpm` invocation in containers should use executable form (`pnpm ...`), not `node /app/pnpm`.
- Added SQL/Prisma error normalization utility: `src/common/utils/prisma-error.util.ts`; prefer mapping duplicate/constraint DB errors to domain-friendly messages.
- Partner-module list endpoints were standardized toward `ResponseMapper.paginate` where pagination response contract is expected.
- For heavy license provisioning (100+), request path should not synchronously insert all licenses; queue/background + batching is required.
## Migration Drift Playbook (Prisma/MySQL)
- If Prisma reports `modified after applied`, never edit an already-applied migration in-place for shared environments; create a new forward migration instead.
- If migration history and DB drift mismatch:
1. Verify local migration folders are complete and ordered.
2. Check `_prisma_migrations` for missing/applied names.
3. Use `prisma migrate resolve` only to reconcile history state, then apply a forward fix migration.
- Duplicate FK error seen in this repo: `sales_invoices_ref_id_fkey` (MySQL 1826). Recheck migration SQL for repeated `ADD CONSTRAINT` statements before rerun.
- Drift that repeatedly showed in this project: missing FK/unique on `sale_invoice_tsp_attempts.invoice_id`. Validate both schema and migration SQL produce the same final state.
-`prisma migrate status` may show up-to-date while `migrate dev` still detects drift (shadow DB/application history issue); treat `migrate dev` output as source of truth for fixing local history.