Backend Structure Blueprint

Enterprise Tracking Tool for Multi‑Vendor Cargo Tracking & Supply Chain Visibility

Complete backend design for a freight visibility platform covering multi-agent collaboration, customer portal, admin control, customs clearance, document management, real-time tracking, door-to-door delivery, finance, reporting and enterprise governance.

22Backend Modules / Service Domains
250+Recommended Database Tables
360°Shipment, Agent, Customs & Delivery Visibility
MVP → ScaleControlled launch with enterprise-ready design

Product Vision & Backend Goal

What the platform must solve

The system must remove fragmented cargo tracking, manual agent follow-ups, spreadsheet-based shipment updates, missing customs visibility, delayed customer communication, and weak profitability control. It should become the single source of truth for shipment movement from origin enquiry to final proof of delivery.

Core backend principle

Every shipment is treated as one operational entity connected to parties, agents, bookings, containers, customs, documents, delivery tasks, events, invoices, vendor bills, exceptions, and audit records. All modules publish and consume shipment events through a shared lifecycle engine.

Required user groups

Super AdminCompany AdminOperations TeamCustomer / ShipperConsigneeOrigin AgentDestination AgentCustoms BrokerCarrier / Shipping LineWarehouse / CFSDriver / CourierFinance TeamManagement

End-to-End Cargo Visibility Lifecycle

The backend lifecycle should be event-driven so every milestone can update customer portal, agent portal, admin dashboard, notification engine, finance, SLA and BI dashboards automatically.

01 EnquiryCustomer request / rate
02 BookingCarrier / agent booking
03 PickupOrigin collection
04 ExportPort / airport / CFS
05 TransitAIS / carrier / container
06 CustomsDeclaration / duty / release
07 DeliveryDoor-to-door POD

Enterprise Backend Architecture

Actors

Customer, shipper, consignee, admin, sales, operations, freight team, customs broker, origin agent, destination agent, warehouse, driver, finance, management, external API partners.

Presentation Layer

Customer Portal, Admin Portal, Agent Portal, Customs Workspace, Driver App, Public Tracking Page, Management Dashboard.

API & Service Layer

API Gateway, Identity, Shipment, Tracking, Customs, Booking, DMS, Delivery, Finance, Notification, Workflow, Reporting and Integration services.

Data Layer

Relational DB for operational records, event store for tracking events, object storage for files, cache for live visibility, analytics warehouse for BI.

Event Layer

RabbitMQ/Kafka style message bus for ShipmentCreated, BookingConfirmed, VesselDeparted, CustomsReleased, OutForDelivery, Delivered, InvoicePosted and ExceptionRaised events.

External Systems

Carrier APIs, AIS providers, customs portals, port systems, payment gateway, map/GPS APIs, WhatsApp/SMS/email providers, accounting ERP and customer webhooks.

Required Modules & Database Tables

The following schema blueprint is intentionally enterprise-ready. Each table includes recommended key columns and the purpose of the table.

PlatformAdmin.API / TenantService

01. Platform, Tenant & Company Administration

Controls SaaS/enterprise instance, companies, branches, departments, subscription plans, tenant isolation and master settings.

Primary Users
Super Admin, Group Admin, Company Admin
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
tenantstenant_id PK, tenant_code, legal_name, trade_name, status, primary_country, base_currency, timezoneRoot tenant for group or multi-company deployment.
companiescompany_id PK, tenant_id FK, company_code, legal_name, tax_registration_no, license_no, address_id FK, statusLegal operating entity within tenant.
branchesbranch_id PK, company_id FK, branch_code, branch_name, city_id FK, airport_code, port_code, is_head_office, statusOperational office, station, port branch or country office.
departmentsdepartment_id PK, company_id FK, name, department_type, cost_center_id FK, statusOperations, customs, finance, customer service, sales, warehouse, delivery.
subscription_plansplan_id PK, plan_name, shipment_limit, user_limit, module_flags JSON, price, billing_cycle, statusControls SaaS plan and enabled modules.
tenant_settingssetting_id PK, tenant_id FK, setting_key, setting_value, data_type, effective_fromTenant-specific configuration.
numbering_sequencessequence_id PK, tenant_id FK, entity_type, prefix, year_format, current_no, reset_policyGenerates shipment/job/tracking/declaration/invoice numbers.
feature_flagsflag_id PK, tenant_id FK, feature_key, is_enabled, rollout_percentage, notesControls phased release of features.
system_announcementsannouncement_id PK, tenant_id FK, title, message, audience_role, start_at, end_at, statusAdmin notices shown in portals.
audit_log_retention_policiespolicy_id PK, tenant_id FK, module_name, retention_days, archive_strategyRetention rules for audit and compliance records.
Identity.API / AccessControlService

02. Identity, RBAC, Security & Access Control

Manages users, roles, permissions, login policies, agent/customer access, API keys, MFA, sessions and auditability.

Primary Users
Super Admin, Company Admin, Agents, Customers, Customs Broker, Drivers
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
usersuser_id PK, tenant_id FK, company_id FK, branch_id FK, full_name, email, phone, user_type, status, last_login_atAll platform users including staff, agents, customers and vendors.
user_profilesprofile_id PK, user_id FK, avatar_url, language, timezone, notification_preferences JSONUser personalization.
rolesrole_id PK, tenant_id FK, role_name, role_scope, is_system_role, statusAdmin, operations, customs, finance, agent, customer, driver.
permissionspermission_id PK, module_code, permission_key, action, descriptionGranular permissions such as shipment.view, customs.approve.
role_permissionsrole_permission_id PK, role_id FK, permission_id FK, allowed, conditions JSONMaps roles to permissions.
user_rolesuser_role_id PK, user_id FK, role_id FK, branch_scope JSON, effective_from, effective_toAssigns roles to users.
login_sessionssession_id PK, user_id FK, device_id, ip_address, user_agent, issued_at, expires_at, revoked_atTracks active sessions and revocation.
mfa_methodsmfa_id PK, user_id FK, method_type, secret_ref, is_verified, last_used_atOTP, authenticator app, email, SMS.
api_clientsclient_id PK, tenant_id FK, client_name, client_type, api_key_hash, scopes JSON, statusExternal integrations and partner systems.
api_access_logslog_id PK, client_id FK, endpoint, method, status_code, latency_ms, requested_atAPI usage tracking.
security_eventsevent_id PK, user_id FK, event_type, severity, ip_address, metadata JSON, created_atFailed login, suspicious access, privilege changes.
data_access_logsaccess_id PK, user_id FK, entity_type, entity_id, action, field_mask JSON, accessed_atTracks sensitive record access.
MasterData.API

03. Master Data & Reference Library

Stores reusable reference data for freight forwarding, customs, tracking, routing and commercial calculation.

Primary Users
Admin, Operations, Pricing, Customs
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
countriescountry_id PK, iso2, iso3, country_name, customs_zone, statusCountry reference.
citiescity_id PK, country_id FK, city_name, timezone, latitude, longitude, statusCity reference.
portsport_id PK, country_id FK, city_id FK, unlocode, port_name, port_type, latitude, longitude, statusSea, dry, inland and river ports.
airportsairport_id PK, country_id FK, city_id FK, iata_code, icao_code, airport_name, statusAir freight route reference.
carrierscarrier_id PK, carrier_type, carrier_code, carrier_name, scac_code, api_enabled, statusShipping lines, airlines, road carriers.
vesselsvessel_id PK, imo_no, mmsi_no, vessel_name, call_sign, flag_country_id FK, capacity_teu, statusVessel master for tracking.
container_typescontainer_type_id PK, iso_code, size_ft, type_name, max_weight_kg, max_volume_cbm20GP, 40HC, reefer, open top etc.
cargo_typescargo_type_id PK, cargo_type_name, handling_requirements, is_hazardous, statusGeneral, DG, reefer, oversized, fragile.
incotermsincoterm_id PK, code, name, risk_transfer_point, cost_responsibility JSONEXW, FOB, CIF, DDP etc.
hs_codeshs_code_id PK, hs_code, description, duty_rate, vat_rate, restricted_flag, country_id FKCustoms HS code catalogue.
currenciescurrency_id PK, iso_code, name, symbol, decimal_places, statusCurrency master.
exchange_ratesrate_id PK, base_currency, quote_currency, rate, source, effective_dateFX rates for costing and billing.
measurement_unitsunit_id PK, unit_code, unit_name, unit_type, conversion_factorKG, CBM, PCS, LTR, pallet.
charge_codescharge_code_id PK, code, name, charge_category, taxable_flag, default_currencyFreight, THC, DO, customs, delivery, fuel surcharge.
Party.API / VendorPortal.API

04. Party, Customer, Agent & Vendor Management

Manages shippers, consignees, notify parties, customers, multi-agent network, brokers, carriers, truckers and warehouses.

Primary Users
Sales, Customer Service, Agents, Vendors, Admin
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
partiesparty_id PK, tenant_id FK, party_type, legal_name, trade_name, tax_no, registration_no, statusUnified party profile.
party_contactscontact_id PK, party_id FK, full_name, designation, email, phone, whatsapp, is_primaryContact persons.
party_addressesaddress_id PK, party_id FK, address_type, line1, line2, city_id FK, postal_code, geo_lat, geo_lngPickup, billing, warehouse, delivery addresses.
customerscustomer_id PK, party_id FK, customer_code, customer_segment, credit_limit, payment_terms_days, account_manager_id FKCustomer-specific commercial data.
agentsagent_id PK, party_id FK, agent_code, agent_role, coverage_countries JSON, settlement_terms, portal_enabledOrigin/destination/co-loader/customs/delivery agents.
agent_network_laneslane_id PK, agent_id FK, origin_country_id FK, destination_country_id FK, service_modes JSON, priority_rankAgent lane coverage.
vendorsvendor_id PK, party_id FK, vendor_type, service_categories JSON, rating, compliance_statusCarrier, transporter, broker, warehouse, surveyor.
customs_brokersbroker_id PK, party_id FK, license_no, customs_authority, valid_until, statusCustoms clearance service providers.
carrier_accountscarrier_account_id PK, carrier_id FK, party_id FK, contract_no, api_credentials_ref, payment_termsCustomer/vendor account with carrier.
party_kyc_documentskyc_id PK, party_id FK, document_type, document_no, file_id FK, expiry_date, verification_statusTrade license, VAT, importer code, ID documents.
party_credit_reviewsreview_id PK, customer_id FK, reviewed_by, credit_score, approved_limit, remarks, reviewed_atCredit governance.
vendor_service_ratesvendor_rate_id PK, vendor_id FK, charge_code_id FK, origin_id, destination_id, rate_basis, buy_rate, currencyVendor buy rates.
CustomerPortal.API

05. Customer Portal & Self-Service

Enables customers to create shipments, upload documents, track cargo, approve quotes, message operations and access invoices.

Primary Users
Customer Admin, Shipper, Consignee, Merchant
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
customer_portal_accountsportal_account_id PK, customer_id FK, primary_user_id FK, portal_status, onboarding_stageCustomer portal access.
customer_user_accessaccess_id PK, customer_id FK, user_id FK, access_role, allowed_branches JSON, allowed_accounts JSONControls customer-side roles.
customer_saved_addressessaved_address_id PK, customer_id FK, address_id FK, label, usage_type, is_defaultReusable pickup/delivery locations.
customer_shipment_draftsdraft_id PK, customer_id FK, created_by FK, draft_payload JSON, current_step, updated_atIncomplete booking drafts.
customer_document_uploadsupload_id PK, customer_id FK, shipment_id FK, file_id FK, document_type, validation_statusUploaded files from customer.
customer_tracking_subscriptionssubscription_id PK, customer_id FK, shipment_id FK, channel, milestone_filter JSON, statusMilestone notification preferences.
customer_messagesmessage_id PK, customer_id FK, shipment_id FK, sender_user_id, message_text, attachment_file_id, created_atShipment conversations.
customer_quote_approvalsapproval_id PK, quotation_id FK, customer_user_id FK, decision, remarks, decided_atQuote approval/rejection by customer.
customer_portal_activityactivity_id PK, customer_id FK, user_id FK, activity_type, metadata JSON, created_atPortal audit trail.
public_tracking_linkstracking_link_id PK, shipment_id FK, token_hash, expires_at, access_count, statusNo-login tracking link.
Quotation.API / PricingEngine

06. Enquiry, Quotation & Rate Management

Captures enquiries, calculates multi-vendor buy/sell pricing, manages tariffs, applies margins, approvals and quote-to-job conversion.

Primary Users
Sales, Pricing, Customer, Agent
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
enquiriesenquirie_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
quotation_headersquotation_header_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
quotation_routesquotation_route_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
quotation_cargo_linesquotation_cargo_line_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
quotation_charge_linesquotation_charge_line_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
rate_cardsrate_card_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
rate_card_linesrate_card_line_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
margin_rulesmargin_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
quotation_approvalsquotation_approval_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
quote_revisionsquote_revision_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
competitor_rate_notescompetitor_rate_note_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
quote_conversion_logsquote_conversion_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Enquiry, Quotation & Rate Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Shipment.API / ShipmentLifecycleEngine

07. Shipment / Job Management Core

Central operational entity connecting customer, vendors, agents, customs, tracking, delivery, finance and document records.

Primary Users
Operations, Customer Service, Agents, Admin
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
shipmentsshipment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_partiesshipment_partie_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_referencesshipment_reference_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_cargoshipment_cargo_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_packagesshipment_package_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_status_historyshipment_status_history_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_assignmentsshipment_assignment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_checklistsshipment_checklist_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_sla_trackingshipment_sla_tracking_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_exceptionsshipment_exception_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_tagsshipment_tag_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_closureshipment_closure_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Shipment / Job Management Core domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
AgentCollaboration.API

08. Multi-Agent Workflow & Collaboration

Coordinates origin agents, destination agents, customs brokers, co-loaders and delivery partners with task ownership and settlement visibility.

Primary Users
Origin Agent, Destination Agent, Customs Broker, Delivery Partner, Operations
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
agent_work_ordersagent_work_order_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_work_order_tasksagent_work_order_task_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_milestonesagent_milestone_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_document_requestsagent_document_request_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_messagesagent_message_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_cost_estimatesagent_cost_estimate_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_invoice_submissionsagent_invoice_submission_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_performance_scoresagent_performance_score_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_access_tokensagent_access_token_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_settlement_accountsagent_settlement_account_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Multi-Agent Workflow & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Booking.API / CarrierIntegration.API

09. Booking, Carrier, Container & Transport Management

Manages carrier bookings, schedules, voyages, containers, equipment, cut-offs, co-loading and multimodal transport legs.

Primary Users
Ocean Freight Team, Air Freight Team, Road Operations, Agents
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
carrier_bookingscarrier_booking_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
booking_leg_segmentsbooking_leg_segment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
containerscontainer_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_containersshipment_container_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
equipment_requestsequipment_request_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
cutoff_datescutoff_date_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
co_load_bookingsco_load_booking_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
voyagesvoyage_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
schedule_search_logsschedule_search_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
booking_amendmentsbooking_amendment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
booking_confirmationsbooking_confirmation_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
transport_leg_coststransport_leg_cost_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Booking, Carrier, Container & Transport Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
DocumentOps.API / BLService

10. Bill of Lading, AWB & Transport Documents

Controls HBL, MBL, AWB, delivery order, arrival notice, shipping instruction, amendments, releases and surrender workflows.

Primary Users
Documentation Team, Operations, Agents, Customer
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
transport_documentstransport_document_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
hbl_recordshbl_record_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
mbl_recordsmbl_record_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
awb_recordsawb_record_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipping_instructionsshipping_instruction_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
bl_draft_reviewsbl_draft_review_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
bl_amendmentsbl_amendment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
document_release_ordersdocument_release_order_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
arrival_noticesarrival_notice_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
delivery_ordersdelivery_order_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
document_version_historydocument_version_history_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
document_compliance_checksdocument_compliance_check_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Bill of Lading, AWB & Transport Documents domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Customs.API / ComplianceEngine

11. Customs Clearance & Compliance

Manages importer/exporter docs, declarations, HS classification, duty/VAT, inspections, holds, broker tasks and release triggers.

Primary Users
Customs Team, Customs Broker, Agent, Customer, Finance
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
customs_casescustoms_case_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_declarationscustoms_declaration_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_declaration_linescustoms_declaration_line_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_duty_calculationscustoms_duty_calculation_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_paymentscustoms_payment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_inspectionscustoms_inspection_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_holdscustoms_hold_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_release_certificatescustoms_release_certificate_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
compliance_screening_resultscompliance_screening_result_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
restricted_goods_checksrestricted_goods_check_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_broker_taskscustoms_broker_task_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_status_polling_logscustoms_status_polling_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Customs Clearance & Compliance domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Warehouse.API / YardService

12. Warehouse, CFS, Yard & Inventory Visibility

Tracks cargo receipt, warehouse stock, CFS/CY activities, stuffing, de-stuffing, damage notes and inventory movement.

Primary Users
Warehouse, Operations, Agents, Customer
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
warehouseswarehouse_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
warehouse_zoneswarehouse_zone_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
warehouse_locationswarehouse_location_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
goods_receiptsgoods_receipt_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
goods_receipt_linesgoods_receipt_line_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
stock_itemsstock_item_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
inventory_movementsinventory_movement_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
cfs_operationscfs_operation_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
stuffing_plansstuffing_plan_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
stuffing_plan_linesstuffing_plan_line_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
damage_reportsdamage_report_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
yard_movementsyard_movement_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Warehouse, CFS, Yard & Inventory Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Tracking.API / VisibilityEngine

13. Tracking, Event Ingestion & Supply Chain Visibility

Provides multi-vendor cargo tracking, AIS/container/carrier API events, ETA prediction, geofencing, exceptions and customer visibility.

Primary Users
Customer, Agent, Operations, Management, Consignee
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
tracking_numberstracking_number_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
tracking_sourcestracking_source_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
tracking_source_credentialstracking_source_credential_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
tracking_eventstracking_event_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
tracking_event_raw_logstracking_event_raw_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
milestone_definitionsmilestone_definition_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_milestonesshipment_milestone_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
eta_predictionseta_prediction_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
delay_eventsdelay_event_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
geofencesgeofence_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
geofence_eventsgeofence_event_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
container_tracking_snapshotscontainer_tracking_snapshot_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
vessel_tracking_snapshotsvessel_tracking_snapshot_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
gps_device_positionsgps_device_position_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
tracking_visibility_rulestracking_visibility_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
tracking_webhook_subscriptionstracking_webhook_subscription_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Tracking, Event Ingestion & Supply Chain Visibility domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Delivery.API / DriverApp.API

14. Last-Mile, Door-to-Door Delivery & POD

Controls pickup, delivery scheduling, driver assignment, route planning, live GPS, delivery attempts, POD and redelivery.

Primary Users
Delivery Coordinator, Driver, Customer, Consignee
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
delivery_ordersdelivery_order_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
delivery_tasksdelivery_task_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
driversdriver_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
vehiclesvehicle_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
driver_vehicle_assignmentsdriver_vehicle_assignment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
route_plansroute_plan_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
route_stopsroute_stop_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
delivery_attemptsdelivery_attempt_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
proof_of_deliveryproof_of_delivery_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
delivery_reschedule_requestsdelivery_reschedule_request_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
driver_app_sessionsdriver_app_session_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
delivery_costsdelivery_cost_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Last-Mile, Door-to-Door Delivery & POD domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Exception.API / Claims.API

15. Exception, Claims, Damage & Risk Management

Manages operational exceptions, cargo damage, delays, claims, insurance cases, disputes and corrective action.

Primary Users
Operations, Customer Service, Claims Team, Customer, Agent
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
exception_casesexception_case_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
exception_actionsexception_action_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customer_complaintscustomer_complaint_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
cargo_claimscargo_claim_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
claim_documentsclaim_document_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
insurance_policiesinsurance_policie_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
insurance_claimsinsurance_claim_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
risk_rulesrisk_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_risk_scoresshipment_risk_score_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
root_cause_analysisroot_cause_analysi_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Exception, Claims, Damage & Risk Management domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Finance.API / Billing.API

16. Finance, Billing, Settlement & Profitability

Handles customer invoicing, vendor bills, duty payments, agent settlement, AR/AP, cost accruals, profitability and financial closure.

Primary Users
Finance, Management, Agents, Customers
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
shipment_charge_actualsshipment_charge_actual_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customer_invoicescustomer_invoice_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customer_invoice_linescustomer_invoice_line_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
vendor_billsvendor_bill_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
vendor_bill_linesvendor_bill_line_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
payment_receiptspayment_receipt_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
payment_allocationspayment_allocation_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
vendor_paymentsvendor_payment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_settlementsagent_settlement_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
profitability_snapshotsprofitability_snapshot_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
cost_accrualscost_accrual_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
credit_notescredit_note_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
debit_notesdebit_note_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
tax_ledgerstax_ledger_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Finance, Billing, Settlement & Profitability domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Notification.API / CommunicationService

17. Notification, Communication & Collaboration

Sends milestone alerts, exception notifications, document reminders, WhatsApp/SMS/email/in-app messages and maintains history.

Primary Users
All Users
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
notification_templatesnotification_template_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
notification_rulesnotification_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
notification_queuenotification_queue_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
notification_delivery_logsnotification_delivery_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
email_threadsemail_thread_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
email_messagesemail_message_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
whatsapp_messageswhatsapp_message_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
in_app_notificationsin_app_notification_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
communication_preferencescommunication_preference_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
broadcast_campaignsbroadcast_campaign_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Notification, Communication & Collaboration domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
FileStorage.API / DMS.API

18. Document Management, Files & Digital Archive

Central repository for shipment, customs, invoices, POD, KYC, compliance and operational records with versioning and access control.

Primary Users
All operational roles
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
filesfile_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
file_metadatafile_metadata_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
file_versionsfile_version_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
document_requirementsdocument_requirement_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_documentsshipment_document_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_documentscustoms_document_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
document_review_tasksdocument_review_task_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
document_ocr_resultsdocument_ocr_result_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
document_access_rulesdocument_access_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
document_expiry_alertsdocument_expiry_alert_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Document Management, Files & Digital Archive domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Reporting.API / AnalyticsWarehouse

19. Analytics, BI, Dashboard & Reporting

Provides dashboards, customer visibility, agent/vendor KPIs, customs cycle time, delivery performance, profitability and reporting.

Primary Users
Management, Operations, Finance, Customer Admin
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
dashboard_widgetsdashboard_widget_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
user_dashboardsuser_dashboard_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
report_definitionsreport_definition_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
scheduled_reportsscheduled_report_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
report_execution_logsreport_execution_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
kpi_snapshotskpi_snapshot_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
shipment_performance_factsshipment_performance_fact_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
agent_performance_factsagent_performance_fact_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customs_performance_factscustoms_performance_fact_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
delivery_performance_factsdelivery_performance_fact_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
customer_visibility_viewscustomer_visibility_view_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
data_export_jobsdata_export_job_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Analytics, BI, Dashboard & Reporting domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
IntegrationHub.API / EDIService

20. Integration Hub, APIs, Webhooks & EDI

Connects carriers, AIS, customs, payment gateways, maps, WhatsApp, customer systems, agent portals and accounting systems.

Primary Users
Technical Admin, Integration Support
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
integration_connectorsintegration_connector_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
connector_endpointsconnector_endpoint_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
connector_credentialsconnector_credential_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
integration_jobsintegration_job_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
integration_job_runsintegration_job_run_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
webhook_inbound_eventswebhook_inbound_event_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
webhook_outbound_eventswebhook_outbound_event_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
edi_messagesedi_message_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
edi_acknowledgementsedi_acknowledgement_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
integration_error_logsintegration_error_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
mapping_rulesmapping_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
idempotency_keysidempotency_key_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Integration Hub, APIs, Webhooks & EDI domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Workflow.API / AutomationEngine

21. Workflow, Automation, SLA & Task Engine

Automates lifecycle transitions, task creation, approval chains, escalation, SLA monitoring and exception triggers.

Primary Users
Admin, Operations, Management
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
workflow_definitionsworkflow_definition_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
workflow_stepsworkflow_step_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
workflow_transitionsworkflow_transition_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
workflow_instancesworkflow_instance_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
workflow_instance_stepsworkflow_instance_step_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
task_templatestask_template_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
taskstask_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
task_commentstask_comment_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
sla_policiessla_policie_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
escalation_rulesescalation_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
automation_rulesautomation_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
automation_execution_logsautomation_execution_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Workflow, Automation, SLA & Task Engine domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
Governance.API / AuditService

22. Audit, Data Governance, Compliance & Enterprise Controls

Provides enterprise-grade auditability, data governance, privacy, approvals, retention, backup controls and regulatory readiness.

Primary Users
Compliance, IT Admin, Management, Auditor
Backend Boundary
Owns APIs, validation, events and table writes for this domain.
Data Control
All writes must be permission checked and audited.
TableKey ColumnsPurpose / Notes
audit_logsaudit_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
approval_policiesapproval_policie_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
approval_requestsapproval_request_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
approval_decisionsapproval_decision_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
data_retention_rulesdata_retention_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
data_archive_jobsdata_archive_job_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
privacy_requestsprivacy_request_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
backup_runsbackup_run_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
restore_testsrestore_test_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
configuration_change_logsconfiguration_change_log_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
data_quality_rulesdata_quality_rule_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.
data_quality_issuesdata_quality_issue_id PK, tenant_id FK, shipment_id FK where applicable, status, created_at, updated_atSupports Audit, Data Governance, Compliance & Enterprise Controls domain. Add FKs to customer, agent, vendor, document, finance or tracking entities as required.

Start Controlled MVP, Design for Full Enterprise Scale

MVP Phase

Launch with identity, customer portal, shipment/job core, tracking events, document upload, agent work orders, customs case tracking, delivery tasks, notifications and basic dashboard. Keep table design enterprise-ready from day one.

Scale Phase

Add carrier API integrations, AIS polling, customs portal integration, agent settlements, advanced finance, automated SLA, workflow engine, mobile driver app, webhooks and BI warehouse.

Enterprise Phase

Enable multi-country setup, data warehouse, event streaming, AI ETA prediction, anomaly detection, customer webhooks, audit retention, backup governance, high availability and Kubernetes deployment.

Important: Even in MVP, use enterprise-grade tenant isolation, role-based access, immutable audit logs, normalized shipment lifecycle events, document versioning, and scalable integration architecture. This avoids rebuilding the foundation later.