fix(sales): wire missing berth-rule triggers + portal company-billed invoices

- G-C4: deposit_received in invoices.ts
- G-C4 + G-I2: interest_archived + notifyNextInLine in archiveInterest
- G-C4: interest_completed in setInterestOutcome
- G-C4: berth_unlinked in removeInterestBerth
- G-I5: portal invoices include billingEntityType='company' when client is the director

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 13:53:10 +02:00
parent 1b00c8a7a2
commit c0e5af8b92
5 changed files with 149 additions and 17 deletions

View File

@@ -124,7 +124,12 @@ export const deleteHandler: RouteHandler = async (_req, ctx, params) => {
await loadScopedRow(interestId, berthId, ctx.portId);
await removeInterestBerth(interestId, berthId, ctx.portId);
await removeInterestBerth(interestId, berthId, ctx.portId, {
userId: ctx.userId,
portId: ctx.portId,
ipAddress: ctx.ipAddress,
userAgent: ctx.userAgent,
});
void createAuditLog({
userId: ctx.userId,