01 — Quick Reference

Group Models
Accounts & Statements VoyageAccount · AccountSource · SettlementStatement · SettlementAdjustment · SettlementDispute
Cash & Settlement AgentCollection · CollectionAllocation · AgentPayment · AgentCommission · AgentRemittance · AccountExchangeConversion
Agency & Responsibility AgencyAppointment · CollectionResponsibility · AccountAgent
Control & Audit AccountException · AccountAudit
External Projections AccountExternalSnapshot

Every model (17) — one line each

Model It records Key foreign keys
AccountAgent An agent (the party that acts for the carrier at a port) —
AgencyAppointment An agent's appointment at a port for a carrier: validity, settlement currency, commission basis and rate AccountAgent
VoyageAccount One account per appointment, voyage, port call and currency AgencyAppointment
AccountSource A customer charge or a supplier cost that reached the account as an immutable source obligation (never cash) VoyageAccount
AgentCollection Cash the agent actually received, with evidence; corrected by exact reversal VoyageAccount
CollectionAllocation How much of a receipt settles which source (no over-allocation) AgentCollection, AccountSource
AgentPayment Cash the agent actually paid a supplier for a source; corrected by exact reversal VoyageAccount, AccountSource
AgentCommission Earned commission with the agreement snapshot (taxes excluded) VoyageAccount
AgentRemittance Money to the carrier, or an advance from the carrier VoyageAccount
SettlementStatement The statement for an account; revisions are linked and an issued one is never edited VoyageAccount, SettlementStatement
SettlementAdjustment A signed adjustment, approved independently VoyageAccount
SettlementDispute A dispute over a source or an amount VoyageAccount, AccountSource
AccountAudit Who did what to an account VoyageAccount
AccountExternalSnapshot Durable copy of a voyage, port call, effective cargo or cargo-call fact received from another application (versioned, hashed) —
CollectionResponsibility Who collects an issued charge line: the agent, the carrier directly, or someone else AgencyAppointment
AccountExchangeConversion The approved conversion of a foreign-currency amount into the settlement currency VoyageAccount
AccountException A control exception (unmatched charge, cost mismatch, duplicate cost, settlement variance) and its resolution —

Vocabularies

  • VoyageAccount.status: OPEN · RECONCILING · SUBMITTED · APPROVED · SETTLED · REOPENED
  • AgencyAppointment.status: DRAFT · APPROVED · ENDED
  • SettlementStatement.status: DRAFT · APPROVED · ISSUED
  • AccountSource.status: UNMATCHED · MATCHED · EXCLUDED · APPROVED_EXCEPTION
  • AccountSource.source_type: BILLED_CHARGE · PORT_COST · CARTAGE_COST
  • CollectionResponsibility.collection_scope: AGENT · CARRIER_DIRECT · OTHER
  • AgentCollection / AgentPayment / AgentCommission.status: DRAFT · APPROVED · CANCELLED
  • AgentRemittance.direction: TO_CARRIER · FROM_CARRIER (status DRAFT · CONFIRMED · CANCELLED)

Run, seed, regenerate

python server/run.py coast_07_accounts                    # http://localhost:5160 (standalone copy 5165)
python -m codegen.cli all coast_07_accounts               # regenerate models, controllers and JSON after a schema change
python -m codegen.cli seed coast_07_accounts --reset      # reload the sample data
python scripts/build_diagram_viewer.py coast_07_accounts  # rebuild the interactive diagram