Developer #database #schema #tables #postgres #drizzle #relations #data-model #lineage #herobm_core Raw .md

Database Schema Reference

Comprehensive relational database schema reference, entity definitions, table columns, data types, constraints, and entity-relationship lineage for herobm_core.

Routes: /admin/developers /admin/system-logs

Database Schema Reference

The HeroBM application core database (herobm_core) is a fully typed, relational PostgreSQL database managed via Drizzle ORM. It enforces strict referential integrity, domain state machines, event sourcing audit logs, and transactional outbox queuing.


Architectural Principles & Standards

[!NOTE] 1. UUID Primary Keys: Every operational table uses a uuid primary key with gen_random_uuid() to prevent auto-increment enumeration vulnerabilities and facilitate safe distributed ingestion.

[!IMPORTANT] 2. Enforced Foreign Keys & Referential Integrity: Inter-entity relationships strictly enforce foreign keys. Cascading deletes are restricted to dependent line items (e.g., order lines, bin contents), while master dimension records use RESTRICT rules.

[!TIP] 3. Microsoft CDM & Schema.org Conventions: Column names follow snake_case naming aligned with common enterprise standards (account_number, currency_code, state_code, created_on, modified_on).

[!WARNING] 4. Explicit State & No Magic Defaults: Entity lifecycle states are strictly governed by application state machines and check constraints. No default values are used for critical financial states.


Core Lineage & Entity Relationships

The following entity-relationship diagram illustrates the operational dependencies between CRM, Catalog, Sales, Purchasing, Warehouse, and General Ledger domains:

flowchart TD
    subgraph CRM ["CRM & Stakeholders"]
        organizations["organizations"]
        contacts["contacts"]
        customers["customers"]
        suppliers["suppliers"]
        opportunities["opportunities"]
    end

    subgraph Catalog ["Catalog"]
        products["products"]
    end

    subgraph Sales ["Sales & Fulfilment"]
        sales_orders["sales_orders"]
        sales_order_line_items["sales_order_lines"]
        sales_order_shipments["sales_shipments"]
        sales_invoices["sales_invoices"]
    end

    subgraph Procurement ["Purchasing & Receiving"]
        purchase_orders["purchase_orders"]
        purchase_order_line_items["purchase_order_lines"]
        goods_received["goods_received"]
        purchase_invoices["purchase_invoices"]
    end

    subgraph Inventory ["Warehouse & Ledger"]
        locations["locations"]
        bins["bins"]
        inventory_entries["inventory_entries"]
        inventory_ledger["inventory_ledger"]
    end

    subgraph GL ["General Ledger"]
        gl_accounts["gl_accounts"]
        gl_journal_entries["gl_journal_entries"]
        gl_journal_lines["gl_journal_lines"]
        payment_entries["payment_entries"]
    end

    contacts -->|referred_by_contact_id| contacts
    organizations -->|referred_by_organization_id| contacts
    organizations -->|organization_id| customers
    gl_journal_entries -->|reversed_by| gl_journal_entries
    gl_accounts -->|gl_account_id| gl_journal_lines
    gl_journal_entries -->|journal_entry_id| gl_journal_lines
    locations -->|location_id| goods_received
    suppliers -->|vendor_id| goods_received
    bins -->|bin_id| inventory_ledger
    inventory_entries -->|entry_id| inventory_ledger
    locations -->|location_id| inventory_ledger
    products -->|product_id| inventory_ledger
    contacts -->|referred_by_contact_id| organizations
    organizations -->|referred_by_organization_id| organizations
    gl_accounts -->|gl_account_bank| payment_entries
    purchase_orders -->|purchase_order_id| purchase_invoices
    suppliers -->|vendor_id| purchase_invoices
    locations -->|delivery_location_id| purchase_orders
    suppliers -->|vendor_id| purchase_orders
    customers -->|customer_id| sales_invoices
    sales_orders -->|sales_order_id| sales_invoices
    locations -->|fulfillment_location_id| sales_order_shipments
    sales_orders -->|sales_order_id| sales_order_shipments
    customers -->|customer_id| sales_orders
    locations -->|fulfillment_location_id| sales_orders
    opportunities -->|opportunity_id| sales_orders
    organizations -->|organization_id| suppliers
    locations -->|location_id| work_orders
    bins -->|output_bin_id| work_orders
    products -->|product_id| work_orders
    bins -->|wip_bin_id| work_orders

Schema Summary & Table Directory

The herobm_core schema contains 133 tables, 1449 columns, and 280 foreign key relationships across 8 business domains:

TableDomainPrimary KeyColumnsForeign KeysLive Rows
contactsCRM & Stakeholderscontact_id152—
crm_activitiesCRM & Stakeholdersactivity_id165—
customer_delivery_addressesCRM & Stakeholdersid171—
customer_groupsCRM & Stakeholderscustomer_group_id146—
customersCRM & Stakeholderscustomer_id254—
opportunitiesCRM & Stakeholdersopportunity_id151—
opportunity_contactsCRM & Stakeholdersopportunity_contact_id52—
opportunity_notesCRM & Stakeholdersnote_id52—
opportunity_organizationsCRM & Stakeholdersopportunity_organization_id52—
organization_contact_linksCRM & Stakeholderslink_id62—
organization_notesCRM & Stakeholdersnote_id52—
organization_organization_linksCRM & Stakeholderslink_id52—
organizationsCRM & Stakeholdersorganization_id263—
project_notesCRM & Stakeholdersnote_id52—
projectsCRM & Stakeholdersproject_id235—
trading_termsCRM & Stakeholderstrading_terms_id100—
discount_matrixProducts & Catalogdiscount_matrix_id73—
product_componentsProducts & Catalogcomponent_id72—
product_default_binsProducts & Catalogproduct_default_bin_id93—
product_groupsProducts & Catalogproduct_group_id96—
product_imagesProducts & Catalogimage_id101—
product_suppliersProducts & Catalogproduct_supplier_id182—
product_uomsProducts & Catalogproduct_uom_id72—
productsProducts & Catalogproduct_id326—
uom_dictionaryProducts & Cataloguom_code40—
backordersSales & Distributionbackorder_id1510—
sales_credit_note_linesSales & Distributioncredit_note_line_id134—
sales_credit_notesSales & Distributioncredit_note_id204—
sales_eventsSales & Distributionevent_id80—
sales_invoice_linesSales & Distributioninvoice_line_id62—
sales_invoicesSales & Distributioninvoice_id242—
sales_order_linesSales & Distributionsales_order_line_id195—
sales_order_picksSales & Distributionpick_id104—
sales_order_return_linesSales & Distributionreturn_line_id143—
sales_order_returnsSales & Distributionreturn_id92—
sales_order_shipment_linesSales & Distributionshipment_line_id42—
sales_order_shipmentsSales & Distributionshipment_id122—
sales_ordersSales & Distributionsales_order_id343—
goods_receivedPurchasing & Procurementgoods_received_id102—
goods_received_linesPurchasing & Procurementgoods_received_line_id94—
procurement_eventsPurchasing & Procurementevent_id80—
purchase_debit_note_linesPurchasing & Procurementdebit_note_line_id104—
purchase_debit_note_shipmentsPurchasing & Procurementdebit_note_shipment_id42—
purchase_debit_notesPurchasing & Procurementdebit_note_id203—
purchase_invoice_linesPurchasing & Procurementinvoice_line_id104—
purchase_invoice_receiptsPurchasing & Procurementinvoice_receipt_id42—
purchase_invoicesPurchasing & Procurementinvoice_id232—
purchase_order_linesPurchasing & Procurementpurchase_order_line_id153—
purchase_order_return_linesPurchasing & Procurementreturn_line_id73—
purchase_order_return_shipment_linesPurchasing & Procurementshipment_line_id42—
purchase_order_return_shipmentsPurchasing & Procurementshipment_id102—
purchase_order_returnsPurchasing & Procurementreturn_id81—
purchase_ordersPurchasing & Procurementpurchase_order_id182—
supplier_expiriesPurchasing & Procurementexpiry_id81—
supplier_groupsPurchasing & Procurementsupplier_group_id176—
suppliersPurchasing & Procurementvendor_id274—
bin_contentsWarehouse & Inventorybin_content_id52—
binsWarehouse & Inventorybin_id121—
inventory_entriesWarehouse & Inventoryentry_id100—
inventory_eventsWarehouse & Inventoryevent_id80—
inventory_ledgerWarehouse & Inventoryledger_id75—
locationsWarehouse & Inventorylocation_id140—
transfer_order_linesWarehouse & Inventorytransfer_order_line_id73—
transfer_order_picksWarehouse & Inventorypick_id104—
transfer_order_receipt_linesWarehouse & Inventoryreceipt_line_id74—
transfer_order_receiptsWarehouse & Inventoryreceipt_id71—
transfer_order_shipment_linesWarehouse & Inventoryshipment_line_id64—
transfer_order_shipmentsWarehouse & Inventoryshipment_id111—
transfer_ordersWarehouse & Inventorytransfer_order_id134—
warehouse_eventsWarehouse & Inventoryevent_id80—
zonesWarehouse & Inventoryzone_id91—
activitiesFinancials & General Ledgeractivity_id70—
bank_statement_linesFinancials & General Ledgerline_id134—
cost_centersFinancials & General Ledgercost_center_id70—
csv_mapping_profilesFinancials & General Ledgerprofile_id120—
exchange_ratesFinancials & General Ledgerexchange_rate_id70—
financial_eventsFinancials & General Ledgerevent_id80—
gl_accountsFinancials & General Ledgergl_account_id130—
gl_fiscal_periodsFinancials & General Ledgerperiod_id140—
gl_journal_entriesFinancials & General Ledgerjournal_entry_id131—
gl_journal_linesFinancials & General Ledgerjournal_line_id176—
gl_match_groupsFinancials & General Ledgermatch_group_id51—
gl_reconciliationsFinancials & General Ledgerreconciliation_id81—
gl_settingsFinancials & General Ledgersettings_id3224—
payment_allocationsFinancials & General Ledgerallocation_id71—
payment_entriesFinancials & General Ledgerpayment_id191—
payment_linesFinancials & General Ledgerpayment_line_id52—
reconciliation_eventsFinancials & General Ledgerevent_id80—
reconciliation_rulesFinancials & General Ledgerrule_id173—
tax_categoriesFinancials & General Ledgertax_category_id70—
tax_position_mappingsFinancials & General Ledgermapping_id43—
tax_positionsFinancials & General Ledgertax_position_id30—
work_order_componentsManufacturing & Work Orderswork_order_component_id52—
work_order_picksManufacturing & Work Orderspick_id93—
work_ordersManufacturing & Work Orderswork_order_id174—
_pipeline_jobsSystem, Security & Telemetryjob_id80—
api_keysSystem, Security & Telemetryapi_key_id80—
app_settingsSystem, Security & Telemetrysettings_id347—
business_report_eventsSystem, Security & Telemetryevent_id80—
business_reportsSystem, Security & Telemetryid80—
casbin_ruleSystem, Security & Telemetryid80—
email_eventsSystem, Security & Telemetryevent_id80—
email_outboxSystem, Security & Telemetryid140—
group_eventsSystem, Security & Telemetryevent_id80—
integration_eventsSystem, Security & Telemetryevent_id80—
integrationsSystem, Security & Telemetryintegration_id60—
macrosSystem, Security & Telemetrymacro_id60—
master_data_eventsSystem, Security & Telemetryevent_id80—
outboxSystem, Security & Telemetryoutbox_id100—
pdf_template_contextsSystem, Security & Telemetry—21—
pdf_template_hooksSystem, Security & Telemetryid51—
pdf_templatesSystem, Security & Telemetryid90—
system_eventsSystem, Security & Telemetryevent_id80—
tenant_settingsSystem, Security & Telemetrytenant_settings_id200—
user_eventsSystem, Security & Telemetryevent_id70—
user_settingsSystem, Security & Telemetryuser_id61—
user_two_factorSystem, Security & Telemetryuser_id71—
usersSystem, Security & Telemetryuser_id80—
webhooksSystem, Security & Telemetrywebhook_id60—
crm_activity_contactsSystem, Security & Telemetryactivity_contact_id42—
crm_settingsSystem, Security & Telemetrysettings_id80—
manufacturing_settingsSystem, Security & Telemetrymanufacturing_settings_id30—
product_settingsSystem, Security & Telemetrysettings_id40—
project_budget_linesSystem, Security & Telemetrybudget_line_id154—
project_ledger_entriesSystem, Security & Telemetryledger_id257—
project_resource_assignmentsSystem, Security & Telemetryassignment_id62—
project_resourcesSystem, Security & Telemetryresource_id134—
project_settingsSystem, Security & Telemetrysettings_id40—
project_tasksSystem, Security & Telemetryproject_task_id162—
purchasing_settingsSystem, Security & Telemetrypurchasing_settings_id40—
sales_settingsSystem, Security & Telemetrysales_settings_id50—
stocktake_countsSystem, Security & Telemetrystocktake_count_id104—
stocktake_linesSystem, Security & Telemetrystocktake_line_id103—
stocktakesSystem, Security & Telemetrystocktake_id222—

Foreign Key Relationships Catalog

The table below catalogs all referential constraints across the application database:

From TableColumnTo TableTarget ColumnOn Delete Action
app_settingsdefault_customer_tax_position_idtax_positionstax_position_idRESTRICT
app_settingsdefault_customer_terms_idtrading_termstrading_terms_idRESTRICT
app_settingsdefault_fulfillment_location_idlocationslocation_idRESTRICT
app_settingsdefault_purchase_tax_category_idtax_categoriestax_category_idRESTRICT
app_settingsdefault_sales_tax_category_idtax_categoriestax_category_idRESTRICT
app_settingsdefault_supplier_tax_position_idtax_positionstax_position_idRESTRICT
app_settingsdefault_supplier_terms_idtrading_termstrading_terms_idRESTRICT
backordersdemand_work_order_idwork_orderswork_order_idRESTRICT
backordersproduct_idproductsproduct_idRESTRICT
backorderspurchase_order_idpurchase_orderspurchase_order_idRESTRICT
backorderspurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
backorderssales_order_idsales_orderssales_order_idRESTRICT
backorderssales_order_line_idsales_order_linessales_order_line_idRESTRICT
backorderstransfer_order_idtransfer_orderstransfer_order_idRESTRICT
backorderstransfer_order_line_idtransfer_order_linestransfer_order_line_idRESTRICT
backorderswork_order_component_idwork_order_componentswork_order_component_idRESTRICT
backorderswork_order_idwork_orderswork_order_idRESTRICT
bank_statement_linesgl_account_idgl_accountsgl_account_idRESTRICT
bank_statement_linesmatch_group_idgl_match_groupsmatch_group_idRESTRICT
bank_statement_linesmatched_journal_line_idgl_journal_linesjournal_line_idRESTRICT
bank_statement_linesreconciliation_idgl_reconciliationsreconciliation_idRESTRICT
bin_contentsbin_idbinsbin_idcascade
bin_contentsproduct_idproductsproduct_idcascade
binszone_idzoneszone_idRESTRICT
contactsreferred_by_contact_idcontactscontact_idRESTRICT
contactsreferred_by_organization_idorganizationsorganization_idRESTRICT
crm_activitiesassigned_to_user_idusersuser_idRESTRICT
crm_activitiescompleted_by_user_idusersuser_idRESTRICT
crm_activitiescreated_by_idusersuser_idRESTRICT
crm_activitiesopportunity_idopportunitiesopportunity_idRESTRICT
crm_activitiesorganization_idorganizationsorganization_idRESTRICT
crm_activity_contactsactivity_idcrm_activitiesactivity_idcascade
crm_activity_contactscontact_idcontactscontact_idcascade
customer_delivery_addressescustomer_idcustomerscustomer_idRESTRICT
customer_groupsdefault_activity_idactivitiesactivity_idRESTRICT
customer_groupsdefault_ar_account_idgl_accountsgl_account_idRESTRICT
customer_groupsdefault_cost_center_idcost_centerscost_center_idRESTRICT
customer_groupsdefault_revenue_account_idgl_accountsgl_account_idRESTRICT
customer_groupstax_position_idtax_positionstax_position_idRESTRICT
customer_groupstrading_terms_idtrading_termstrading_terms_idRESTRICT
customerscustomer_group_idcustomer_groupscustomer_group_idRESTRICT
customersorganization_idorganizationsorganization_idRESTRICT
customerstax_position_idtax_positionstax_position_idRESTRICT
customerstrading_terms_idtrading_termstrading_terms_idRESTRICT
discount_matrixcustomer_group_idcustomer_groupscustomer_group_idRESTRICT
discount_matrixcustomer_idcustomerscustomer_idRESTRICT
discount_matrixproduct_group_idproduct_groupsproduct_group_idRESTRICT
gl_journal_entriesreversed_bygl_journal_entriesjournal_entry_idRESTRICT
gl_journal_linesactivity_idactivitiesactivity_idRESTRICT
gl_journal_linescost_center_idcost_centerscost_center_idRESTRICT
gl_journal_linesgl_account_idgl_accountsgl_account_idRESTRICT
gl_journal_linesjournal_entry_idgl_journal_entriesjournal_entry_idRESTRICT
gl_journal_linesmatch_group_idgl_match_groupsmatch_group_idRESTRICT
gl_journal_linesreconciliation_idgl_reconciliationsreconciliation_idRESTRICT
gl_match_groupsrule_idreconciliation_rulesrule_idRESTRICT
gl_reconciliationsgl_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_activity_idactivitiesactivity_idRESTRICT
gl_settingsdefault_ap_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_ar_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_cogs_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_cost_center_idcost_centerscost_center_idRESTRICT
gl_settingsdefault_discounts_given_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_discounts_received_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_expense_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_fee_revenue_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_grni_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_inventory_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_otc_card_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_otc_cash_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_ppv_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_purchase_tax_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_retained_earnings_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_revenue_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_sales_tax_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_shrinkage_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_suspense_account_idgl_accountsgl_account_idRESTRICT
gl_settingsrealised_fx_gain_account_idgl_accountsgl_account_idRESTRICT
gl_settingsrealised_fx_loss_account_idgl_accountsgl_account_idRESTRICT
gl_settingsunrealised_fx_gain_account_idgl_accountsgl_account_idRESTRICT
gl_settingsunrealised_fx_loss_account_idgl_accountsgl_account_idRESTRICT
goods_receivedlocation_idlocationslocation_idRESTRICT
goods_receivedvendor_idsuppliersvendor_idRESTRICT
goods_received_linesgoods_received_idgoods_receivedgoods_received_idRESTRICT
goods_received_linesproduct_idproductsproduct_idRESTRICT
goods_received_linespurchase_order_idpurchase_orderspurchase_order_idRESTRICT
goods_received_linespurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
inventory_ledgerbin_idbinsbin_idRESTRICT
inventory_ledgerentry_idinventory_entriesentry_idRESTRICT
inventory_ledgerlocation_idlocationslocation_idRESTRICT
inventory_ledgerproduct_idproductsproduct_idRESTRICT
inventory_ledgerzone_idzoneszone_idRESTRICT
opportunitiesowner_idusersuser_idRESTRICT
opportunity_contactscontact_idcontactscontact_idRESTRICT
opportunity_contactsopportunity_idopportunitiesopportunity_idRESTRICT
opportunity_notescreated_by_idusersuser_idRESTRICT
opportunity_notesopportunity_idopportunitiesopportunity_idRESTRICT
opportunity_organizationsopportunity_idopportunitiesopportunity_idRESTRICT
opportunity_organizationsorganization_idorganizationsorganization_idRESTRICT
organization_contact_linkscontact_idcontactscontact_idRESTRICT
organization_contact_linksorganization_idorganizationsorganization_idRESTRICT
organization_notescreated_by_idusersuser_idRESTRICT
organization_notesorganization_idorganizationsorganization_idRESTRICT
organization_organization_linkssource_organization_idorganizationsorganization_idRESTRICT
organization_organization_linkstarget_organization_idorganizationsorganization_idRESTRICT
organizationsowner_idusersuser_idRESTRICT
organizationsreferred_by_contact_idcontactscontact_idRESTRICT
organizationsreferred_by_organization_idorganizationsorganization_idRESTRICT
payment_allocationspayment_idpayment_entriespayment_idRESTRICT
payment_entriesgl_account_bankgl_accountsgl_account_idRESTRICT
payment_linesgl_account_idgl_accountsgl_account_idRESTRICT
payment_linespayment_idpayment_entriespayment_idRESTRICT
pdf_template_contextstemplate_idpdf_templatesidcascade
pdf_template_hooksreport_idpdf_templatesidcascade
product_componentschild_product_idproductsproduct_idRESTRICT
product_componentsparent_product_idproductsproduct_idRESTRICT
product_default_binsbin_idbinsbin_idRESTRICT
product_default_binslocation_idlocationslocation_idRESTRICT
product_default_binsproduct_idproductsproduct_idRESTRICT
product_groupsdefault_activity_idactivitiesactivity_idRESTRICT
product_groupsdefault_cost_center_idcost_centerscost_center_idRESTRICT
product_groupsdefault_expense_account_idgl_accountsgl_account_idRESTRICT
product_groupsdefault_revenue_account_idgl_accountsgl_account_idRESTRICT
product_groupspurchase_tax_category_idtax_categoriestax_category_idRESTRICT
product_groupssales_tax_category_idtax_categoriestax_category_idRESTRICT
product_imagesproduct_idproductsproduct_idcascade
product_suppliersproduct_idproductsproduct_idRESTRICT
product_suppliersvendor_idsuppliersvendor_idRESTRICT
product_uomsproduct_idproductsproduct_idRESTRICT
product_uomsuom_codeuom_dictionaryuom_codeRESTRICT
productsbase_uomuom_dictionaryuom_codeRESTRICT
productsdefault_purchase_uom_idproduct_uomsproduct_uom_idRESTRICT
productsdefault_sales_uom_idproduct_uomsproduct_uom_idRESTRICT
productsproduct_group_idproduct_groupsproduct_group_idRESTRICT
productspurchase_tax_category_idtax_categoriestax_category_idRESTRICT
productssales_tax_category_idtax_categoriestax_category_idRESTRICT
project_budget_linesproduct_idproductsproduct_idRESTRICT
project_budget_linesproject_idprojectsproject_idRESTRICT
project_budget_linesproject_task_idproject_tasksproject_task_idRESTRICT
project_budget_linesresource_idproject_resourcesresource_idRESTRICT
project_ledger_entriesbudget_line_idproject_budget_linesbudget_line_idSET NULL
project_ledger_entriesinventory_entry_idinventory_entriesentry_idRESTRICT
project_ledger_entriesproduct_idproductsproduct_idRESTRICT
project_ledger_entriesproject_idprojectsproject_idRESTRICT
project_ledger_entriesproject_task_idproject_tasksproject_task_idRESTRICT
project_ledger_entriesresource_idproject_resourcesresource_idRESTRICT
project_ledger_entriesuser_idusersuser_idRESTRICT
project_notescreated_by_idusersuser_idRESTRICT
project_notesproject_idprojectsproject_idcascade
project_resource_assignmentsproject_idprojectsproject_idcascade
project_resource_assignmentsresource_idproject_resourcesresource_idRESTRICT
project_resourcesbase_uomuom_dictionaryuom_codeRESTRICT
project_resourcesservice_product_idproductsproduct_idRESTRICT
project_resourcesuser_idusersuser_idRESTRICT
project_resourcesvendor_idsuppliersvendor_idRESTRICT
project_tasksparent_task_idproject_tasksproject_task_idRESTRICT
project_tasksproject_idprojectsproject_idRESTRICT
projectscustomer_idcustomerscustomer_idRESTRICT
projectsopportunity_idopportunitiesopportunity_idRESTRICT
projectsproject_manager_idusersuser_idRESTRICT
projectsstaging_bin_idbinsbin_idRESTRICT
projectsstaging_location_idlocationslocation_idRESTRICT
purchase_debit_note_linesaccount_idgl_accountsgl_account_idRESTRICT
purchase_debit_note_linesdebit_note_idpurchase_debit_notesdebit_note_idRESTRICT
purchase_debit_note_linespurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
purchase_debit_note_linestax_category_idtax_categoriestax_category_idRESTRICT
purchase_debit_note_shipmentsdebit_note_line_idpurchase_debit_note_linesdebit_note_line_idRESTRICT
purchase_debit_note_shipmentsshipment_line_idpurchase_order_return_shipment_linesshipment_line_idRESTRICT
purchase_debit_notespurchase_order_idpurchase_orderspurchase_order_idRESTRICT
purchase_debit_notesreturn_idpurchase_order_returnsreturn_idRESTRICT
purchase_debit_notesvendor_idsuppliersvendor_idRESTRICT
purchase_invoice_linesgl_account_idgl_accountsgl_account_idRESTRICT
purchase_invoice_linesinvoice_idpurchase_invoicesinvoice_idRESTRICT
purchase_invoice_linesproduct_idproductsproduct_idRESTRICT
purchase_invoice_linespurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
purchase_invoice_receiptsgoods_received_line_idgoods_received_linesgoods_received_line_idRESTRICT
purchase_invoice_receiptsinvoice_line_idpurchase_invoice_linesinvoice_line_idRESTRICT
purchase_invoicespurchase_order_idpurchase_orderspurchase_order_idRESTRICT
purchase_invoicesvendor_idsuppliersvendor_idRESTRICT
purchase_order_linesproduct_idproductsproduct_idRESTRICT
purchase_order_linespurchase_order_idpurchase_orderspurchase_order_idRESTRICT
purchase_order_linestax_category_idtax_categoriestax_category_idRESTRICT
purchase_order_return_linespurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
purchase_order_return_linesreturn_idpurchase_order_returnsreturn_idRESTRICT
purchase_order_return_linessource_bin_idbinsbin_idRESTRICT
purchase_order_return_shipment_linesreturn_line_idpurchase_order_return_linesreturn_line_idRESTRICT
purchase_order_return_shipment_linesshipment_idpurchase_order_return_shipmentsshipment_idRESTRICT
purchase_order_return_shipmentsfulfillment_location_idlocationslocation_idRESTRICT
purchase_order_return_shipmentsreturn_idpurchase_order_returnsreturn_idRESTRICT
purchase_order_returnspurchase_order_idpurchase_orderspurchase_order_idRESTRICT
purchase_ordersdelivery_location_idlocationslocation_idRESTRICT
purchase_ordersvendor_idsuppliersvendor_idRESTRICT
reconciliation_rulesactivity_idactivitiesactivity_idRESTRICT
reconciliation_rulescost_center_idcost_centerscost_center_idRESTRICT
reconciliation_rulestarget_gl_account_idgl_accountsgl_account_idRESTRICT
sales_credit_note_linesaccount_idgl_accountsgl_account_idRESTRICT
sales_credit_note_linescredit_note_idsales_credit_notescredit_note_idRESTRICT
sales_credit_note_linessales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_credit_note_linestax_category_idtax_categoriestax_category_idRESTRICT
sales_credit_notescustomer_idcustomerscustomer_idRESTRICT
sales_credit_notesinvoice_idsales_invoicesinvoice_idRESTRICT
sales_credit_notesreturn_idsales_order_returnsreturn_idRESTRICT
sales_credit_notessales_order_idsales_orderssales_order_idRESTRICT
sales_invoice_linesinvoice_idsales_invoicesinvoice_idRESTRICT
sales_invoice_linessales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_invoicescustomer_idcustomerscustomer_idRESTRICT
sales_invoicessales_order_idsales_orderssales_order_idRESTRICT
sales_order_linesfulfillment_location_idlocationslocation_idRESTRICT
sales_order_linesparent_line_idsales_order_linessales_order_line_idRESTRICT
sales_order_linesproduct_idproductsproduct_idRESTRICT
sales_order_linessales_order_idsales_orderssales_order_idRESTRICT
sales_order_linestax_category_idtax_categoriestax_category_idRESTRICT
sales_order_picksbin_idbinsbin_idRESTRICT
sales_order_picksproduct_idproductsproduct_idRESTRICT
sales_order_pickssales_order_idsales_orderssales_order_idRESTRICT
sales_order_pickssales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_order_return_linesreturn_idsales_order_returnsreturn_idRESTRICT
sales_order_return_linessales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_order_return_linestax_category_idtax_categoriestax_category_idRESTRICT
sales_order_returnslocation_idlocationslocation_idRESTRICT
sales_order_returnssales_order_idsales_orderssales_order_idRESTRICT
sales_order_shipment_linessales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_order_shipment_linesshipment_idsales_order_shipmentsshipment_idRESTRICT
sales_order_shipmentsfulfillment_location_idlocationslocation_idRESTRICT
sales_order_shipmentssales_order_idsales_orderssales_order_idRESTRICT
sales_orderscustomer_idcustomerscustomer_idRESTRICT
sales_ordersfulfillment_location_idlocationslocation_idRESTRICT
sales_ordersopportunity_idopportunitiesopportunity_idRESTRICT
stocktake_countsbin_idbinsbin_idRESTRICT
stocktake_countsproduct_idproductsproduct_idRESTRICT
stocktake_countsstocktake_idstocktakesstocktake_idcascade
stocktake_countsstocktake_line_idstocktake_linesstocktake_line_idcascade
stocktake_linesbin_idbinsbin_idRESTRICT
stocktake_linesproduct_idproductsproduct_idRESTRICT
stocktake_linesstocktake_idstocktakesstocktake_idcascade
stocktakesinventory_entry_idinventory_entriesentry_idRESTRICT
stocktakeslocation_idlocationslocation_idRESTRICT
supplier_expiriesvendor_idsuppliersvendor_idRESTRICT
supplier_groupsdefault_activity_idactivitiesactivity_idRESTRICT
supplier_groupsdefault_ap_account_idgl_accountsgl_account_idRESTRICT
supplier_groupsdefault_cost_center_idcost_centerscost_center_idRESTRICT
supplier_groupsdefault_expense_account_idgl_accountsgl_account_idRESTRICT
supplier_groupstax_position_idtax_positionstax_position_idRESTRICT
supplier_groupstrading_terms_idtrading_termstrading_terms_idRESTRICT
suppliersorganization_idorganizationsorganization_idRESTRICT
supplierssupplier_group_idsupplier_groupssupplier_group_idRESTRICT
supplierstax_position_idtax_positionstax_position_idRESTRICT
supplierstrading_terms_idtrading_termstrading_terms_idRESTRICT
tax_position_mappingsdestination_tax_category_idtax_categoriestax_category_idcascade
tax_position_mappingssource_tax_category_idtax_categoriestax_category_idcascade
tax_position_mappingstax_position_idtax_positionstax_position_idcascade
transfer_order_linesproduct_idproductsproduct_idRESTRICT
transfer_order_linesproject_task_idproject_tasksproject_task_idRESTRICT
transfer_order_linestransfer_order_idtransfer_orderstransfer_order_idRESTRICT
transfer_order_picksbin_idbinsbin_idRESTRICT
transfer_order_picksproduct_idproductsproduct_idRESTRICT
transfer_order_pickstransfer_order_idtransfer_orderstransfer_order_idRESTRICT
transfer_order_pickstransfer_order_line_idtransfer_order_linestransfer_order_line_idRESTRICT
transfer_order_receipt_linesbin_idbinsbin_idRESTRICT
transfer_order_receipt_linesproduct_idproductsproduct_idRESTRICT
transfer_order_receipt_linesreceipt_idtransfer_order_receiptsreceipt_idRESTRICT
transfer_order_receipt_linestransfer_order_line_idtransfer_order_linestransfer_order_line_idRESTRICT
transfer_order_receiptstransfer_order_idtransfer_orderstransfer_order_idRESTRICT
transfer_order_shipment_linespick_idtransfer_order_pickspick_idRESTRICT
transfer_order_shipment_linesproduct_idproductsproduct_idRESTRICT
transfer_order_shipment_linesshipment_idtransfer_order_shipmentsshipment_idRESTRICT
transfer_order_shipment_linestransfer_order_line_idtransfer_order_linestransfer_order_line_idRESTRICT
transfer_order_shipmentstransfer_order_idtransfer_orderstransfer_order_idRESTRICT
transfer_ordersdestination_location_idlocationslocation_idRESTRICT
transfer_ordersproject_idprojectsproject_idRESTRICT
transfer_ordersproject_task_idproject_tasksproject_task_idRESTRICT
transfer_orderssource_location_idlocationslocation_idRESTRICT
user_settingsuser_idusersuser_idcascade
user_two_factoruser_idusersuser_idcascade
work_order_componentsproduct_idproductsproduct_idRESTRICT
work_order_componentswork_order_idwork_orderswork_order_idRESTRICT
work_order_picksbin_idbinsbin_idRESTRICT
work_order_pickswork_order_component_idwork_order_componentswork_order_component_idRESTRICT
work_order_pickswork_order_idwork_orderswork_order_idRESTRICT
work_orderslocation_idlocationslocation_idRESTRICT
work_ordersoutput_bin_idbinsbin_idRESTRICT
work_ordersproduct_idproductsproduct_idRESTRICT
work_orderswip_bin_idbinsbin_idRESTRICT
zoneslocation_idlocationslocation_idRESTRICT

CRM & Stakeholders

Accounts, contacts, relationship graphs, CRM projects, customer groups, and addresses.

Table: herobm_core.contacts

#ColumnData TypeNullableDefaultConstraints & Relationships
1contact_iduuidNOgen_random_uuid()🔑 PK
2state_codetextNO——
3first_nametextYES——
4last_nametextYES——
5full_nametextYES——
6job_titletextYES——
7emailtextYES——
8phonetextYES——
9mobiletextYES——
10linkedin_profiletextYES——
11referred_by_organization_iduuidYES—🔗 organizations.organization_id
12referred_by_contact_iduuidYES—🔗 contacts.contact_id
13metadatajsonbYES——
14created_ontimestamp with time zoneYESnow()—
15modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.crm_activities

#ColumnData TypeNullableDefaultConstraints & Relationships
1activity_iduuidNOgen_random_uuid()🔑 PK
2typetextNO——
3subjecttextNO——
4descriptiontextYES——
5statustextNO——
6prioritytextNO——
7organization_iduuidYES—🔗 organizations.organization_id
8opportunity_iduuidYES—🔗 opportunities.opportunity_id
9due_datetimestamp with time zoneYES——
10assigned_to_user_iduuidYES—🔗 users.user_id
11completed_attimestamp with time zoneYES——
12completed_by_user_iduuidYES—🔗 users.user_id
13created_bytextNO——
14created_by_iduuidYES—🔗 users.user_id
15created_ontimestamp with time zoneYESnow()—
16modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.customer_delivery_addresses

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2customer_iduuidNO—🔗 customers.customer_id
3address_nametextYES——
4company_nametextYES——
5recipient_nametextYES——
6recipient_phonetextYES——
7address_line1textYES——
8address_line2textYES——
9citytextYES——
10state_or_provincetextYES——
11postal_codetextYES——
12countrytextYES——
13is_primarybooleanNO——
14source_idtextYES——
15sourcetextNO——
16created_ontimestamp with time zoneYESnow()—
17modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.customer_groups

#ColumnData TypeNullableDefaultConstraints & Relationships
1customer_group_iduuidNOgen_random_uuid()🔑 PK
2group_codetextNO—⚡ UNIQUE
3nametextNO——
4state_codetextNO——
5default_ar_account_iduuidYES—🔗 gl_accounts.gl_account_id
6default_revenue_account_iduuidYES—🔗 gl_accounts.gl_account_id
7trading_terms_iduuidYES—🔗 trading_terms.trading_terms_id
8default_cost_center_iduuidYES—🔗 cost_centers.cost_center_id
9default_activity_iduuidYES—🔗 activities.activity_id
10early_payment_discountnumericYES——
11early_payment_discount_daysintegerYES——
12credit_limitnumericYES——
13is_on_credit_holdbooleanNO——
14tax_position_iduuidYES—🔗 tax_positions.tax_position_id

Table: herobm_core.customers

#ColumnData TypeNullableDefaultConstraints & Relationships
1customer_iduuidNOgen_random_uuid()🔑 PK
2customer_numbertextNO—⚡ UNIQUE
3customer_group_iduuidYES—🔗 customer_groups.customer_group_id
4organization_iduuidYES—🔗 organizations.organization_id
5state_codetextNO——
6tax_position_iduuidYES—🔗 tax_positions.tax_position_id
7currency_codetextNO—🏷️ CHECK
8trading_terms_iduuidYES—🔗 trading_terms.trading_terms_id
9early_payment_discountnumericYES——
10early_payment_discount_daysintegerYES——
11credit_limitnumericYES——
12is_on_credit_holdbooleanYES——
13override_credit_hold_untiltimestamp with time zoneYES——
14bank_account_nametextYES——
15bank_bsbtextYES——
16bank_account_numbertextYES——
17external_idtextYES——
18source_idtextYES—⚡ UNIQUE
19sourcetextNO——
20price_tiertextYES——
21notestextYES——
22metadatajsonbYES——
23created_bytextYES——
24created_ontimestamp with time zoneYESnow()—
25modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.opportunities

#ColumnData TypeNullableDefaultConstraints & Relationships
1opportunity_iduuidNOgen_random_uuid()🔑 PK
2state_codetextNO——
3nametextNO——
4statustextNO——
5typetextNO——
6estimated_valuenumericYES——
7currency_codetextYES——
8target_close_datetimestamp with time zoneYES——
9probabilityintegerYES——
10actual_valuenumericYES——
11descriptiontextYES——
12metadatajsonbYES——
13owner_iduuidYES—🔗 users.user_id
14created_ontimestamp with time zoneYESnow()—
15modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.opportunity_contacts

#ColumnData TypeNullableDefaultConstraints & Relationships
1opportunity_contact_iduuidNOgen_random_uuid()🔑 PK
2opportunity_iduuidNO—🔗 opportunities.opportunity_id
3contact_iduuidNO—🔗 contacts.contact_id
4rolestext[]YES——
5created_ontimestamp with time zoneYESnow()—

Table: herobm_core.opportunity_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1note_iduuidNOgen_random_uuid()🔑 PK
2opportunity_iduuidNO—🔗 opportunities.opportunity_id
3contenttextNO——
4created_by_iduuidYES—🔗 users.user_id
5created_ontimestamp with time zoneYESnow()—

Table: herobm_core.opportunity_organizations

#ColumnData TypeNullableDefaultConstraints & Relationships
1opportunity_organization_iduuidNOgen_random_uuid()🔑 PK
2opportunity_iduuidNO—🔗 opportunities.opportunity_id
3organization_iduuidNO—🔗 organizations.organization_id
4rolestext[]YES——
5created_ontimestamp with time zoneYESnow()—

#ColumnData TypeNullableDefaultConstraints & Relationships
1link_iduuidNOgen_random_uuid()🔑 PK
2organization_iduuidNO—🔗 organizations.organization_id
3contact_iduuidNO—🔗 contacts.contact_id
4link_typetextNO——
5primary_fortext[]YES——
6created_ontimestamp with time zoneYESnow()—

Table: herobm_core.organization_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1note_iduuidNOgen_random_uuid()🔑 PK
2organization_iduuidNO—🔗 organizations.organization_id
3contenttextNO——
4created_by_iduuidYES—🔗 users.user_id
5created_ontimestamp with time zoneYESnow()—

#ColumnData TypeNullableDefaultConstraints & Relationships
1link_iduuidNOgen_random_uuid()🔑 PK
2source_organization_iduuidNO—🔗 organizations.organization_id
3target_organization_iduuidNO—🔗 organizations.organization_id
4link_typetextNO——
5created_ontimestamp with time zoneYESnow()—

Table: herobm_core.organizations

#ColumnData TypeNullableDefaultConstraints & Relationships
1organization_iduuidNOgen_random_uuid()🔑 PK
2state_codetextNO——
3nametextNO——
4owner_iduuidYES—🔗 users.user_id
5legal_statustextYES——
6headquarters_address_line1textYES——
7headquarters_address_line2textYES——
8headquarters_citytextYES——
9headquarters_state_or_provincetextYES——
10headquarters_postal_codetextYES——
11headquarters_countrytextYES——
12websitetextYES——
13industrytextYES——
14telephonetextYES——
15faxtextYES——
16emailtextYES——
17business_numbertextYES——
18is_tax_registeredbooleanNO——
19referral_modetextYES——
20referred_by_organization_iduuidYES—🔗 organizations.organization_id
21referred_by_contact_iduuidYES—🔗 contacts.contact_id
22referral_notetextYES——
23tagstext[]YES——
24metadatajsonbYES——
25created_ontimestamp with time zoneYESnow()—
26modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.project_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1note_iduuidNOgen_random_uuid()🔑 PK
2project_iduuidNO—🔗 projects.project_id (cascade)
3contenttextNO——
4created_by_iduuidYES—🔗 users.user_id
5created_ontimestamp with time zoneYESnow()—

Table: herobm_core.projects

#ColumnData TypeNullableDefaultConstraints & Relationships
1project_iduuidNOgen_random_uuid()🔑 PK
2project_numbertextNO—⚡ UNIQUE
3nametextNO——
4descriptiontextYES——
5customer_iduuidNO—🔗 customers.customer_id
6opportunity_iduuidYES—🔗 opportunities.opportunity_id
7state_codetextNO——
8stagetextYES——
9billing_typetextNO——
10project_manager_iduuidYES—🔗 users.user_id
11currency_codetextNO—🏷️ CHECK
12staging_location_iduuidYES—🔗 locations.location_id
13staging_bin_iduuidYES—🔗 bins.bin_id
14start_datetimestamp with time zoneYES——
15target_end_datetimestamp with time zoneYES——
16actual_end_datetimestamp with time zoneYES——
17wip_methodtextNO——
18notestextYES——
19metadatajsonbYES——
20discount_percentagenumeric(5, 2)YES——
21created_bytextYES——
22created_ontimestamp with time zoneYESnow()—
23modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.trading_terms

#ColumnData TypeNullableDefaultConstraints & Relationships
1trading_terms_iduuidNOgen_random_uuid()🔑 PK
2source_idtextYES——
3sourcetextYES——
4codetextNO—⚡ UNIQUE
5descriptiontextNO——
6daysintegerNO——
7typetextNO——
8is_activebooleanNO——
9created_ontimestamp with time zoneYESnow()—
10modified_ontimestamp with time zoneYESnow()—

Products & Catalog

Item masters, product groups, units of measure, supplier pricing matrix, and bills of materials.

Table: herobm_core.discount_matrix

#ColumnData TypeNullableDefaultConstraints & Relationships
1discount_matrix_iduuidNOgen_random_uuid()🔑 PK
2customer_group_iduuidYES—🔗 customer_groups.customer_group_id, ⚡ UNIQUE, 🏷️ CHECK
3customer_iduuidYES—🔗 customers.customer_id, ⚡ UNIQUE, 🏷️ CHECK
4product_group_iduuidYES—🔗 product_groups.product_group_id, ⚡ UNIQUE, ⚡ UNIQUE
5discount_percentagenumericNO——
6created_ontimestamp with time zoneYESnow()—
7modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.product_components

#ColumnData TypeNullableDefaultConstraints & Relationships
1component_iduuidNOgen_random_uuid()🔑 PK
2parent_product_iduuidNO—🔗 products.product_id
3child_product_iduuidNO—🔗 products.product_id
4parent_quantitynumeric(14, 4)NO——
5quantitynumeric(14, 4)NO——
6sequence_numberintegerYES——
7fractional_behaviorfractional_behaviorYES——

Table: herobm_core.product_default_bins

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_default_bin_iduuidNOgen_random_uuid()🔑 PK
2product_iduuidNO—🔗 products.product_id, ⚡ UNIQUE
3location_iduuidNO—🔗 locations.location_id, ⚡ UNIQUE
4bin_iduuidNO—🔗 bins.bin_id, ⚡ UNIQUE
5is_primary_per_locbooleanNO——
6min_quantitynumericYES——
7max_quantitynumericYES——
8created_ontimestamp with time zoneYESnow()—
9modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.product_groups

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_group_iduuidNOgen_random_uuid()🔑 PK
2group_codetextNO—⚡ UNIQUE
3nametextNO——
4default_revenue_account_iduuidYES—🔗 gl_accounts.gl_account_id
5default_expense_account_iduuidYES—🔗 gl_accounts.gl_account_id
6default_cost_center_iduuidYES—🔗 cost_centers.cost_center_id
7default_activity_iduuidYES—🔗 activities.activity_id
8purchase_tax_category_iduuidYES—🔗 tax_categories.tax_category_id
9sales_tax_category_iduuidYES—🔗 tax_categories.tax_category_id

Table: herobm_core.product_images

#ColumnData TypeNullableDefaultConstraints & Relationships
1image_iduuidNOgen_random_uuid()🔑 PK
2product_iduuidNO—🔗 products.product_id (cascade)
3storage_pathtextNO——
4file_nametextNO——
5mime_typetextNO——
6byte_sizeintegerNO——
7is_primarybooleanNO——
8sort_orderintegerNO——
9created_bytextYES——
10created_ontimestamp with time zoneYESnow()—

Table: herobm_core.product_suppliers

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_supplier_iduuidNOgen_random_uuid()🔑 PK
2product_iduuidNO—🔗 products.product_id, ⚡ UNIQUE
3vendor_iduuidNO—🔗 suppliers.vendor_id, ⚡ UNIQUE
4supplier_part_numbertextYES——
5cost_pricenumericYES——
6discount_percentnumericYES——
7price_break_quantitynumericYES——
8is_preferredbooleanNO——
9min_purchase_qtynumericYES——
10purchase_unittextYES——
11effective_fromtimestamp with time zoneYES——
12effective_totimestamp with time zoneYES——
13state_codetextNO——
14source_idtextYES—⚡ UNIQUE
15sourcetextNO——
16created_bytextYES——
17created_ontimestamp with time zoneYESnow()—
18modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.product_uoms

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_uom_iduuidNOgen_random_uuid()🔑 PK
2product_iduuidNO—🔗 products.product_id, ⚡ UNIQUE
3uom_codetextNO—🔗 uom_dictionary.uom_code, ⚡ UNIQUE
4rationumeric(12, 4)NO——
5barcodetextYES——
6is_sales_defaultbooleanYES——
7is_purchase_defaultbooleanYES——

Table: herobm_core.products

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_iduuidNOgen_random_uuid()🔑 PK
2product_numbertextNO—⚡ UNIQUE
3nametextNO——
4product_typeproduct_typeNO——
5structure_typeproduct_structureNO——
6product_group_iduuidYES—🔗 product_groups.product_group_id
7barcodetextYES——
8list_pricenumeric(12, 2)YES——
9standard_costnumeric(12, 2)YES——
10trade_pricenumeric(12, 2)YES——
11price_level_3numeric(12, 2)YES——
12price_level_4numeric(12, 2)YES——
13weighted_average_costnumericYES——
14weightnumeric(12, 4)YES——
15alternate_invoice_descriptiontextYES——
16box_quantitynumericYES——
17base_uomtextNO—🔗 uom_dictionary.uom_code
18default_sales_uom_iduuidYES—🔗 product_uoms.product_uom_id
19default_purchase_uom_iduuidYES—🔗 product_uoms.product_uom_id
20purchase_tax_category_iduuidYES—🔗 tax_categories.tax_category_id
21sales_tax_category_iduuidYES—🔗 tax_categories.tax_category_id
22external_tax_codetextYES——
23alternate_product_numbertextYES——
24image_pathtextYES——
25state_codetextNO——
26notestextYES——
27metadatajsonbYES——
28source_idtextYES—⚡ UNIQUE
29sourcetextNO——
30created_bytextYES——
31created_ontimestamp with time zoneYESnow()—
32modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.uom_dictionary

#ColumnData TypeNullableDefaultConstraints & Relationships
1uom_codetextNO—🔑 PK
2descriptiontextNO——
3categorytextNO——
4created_ontimestamp with time zoneYESnow()—

Sales & Distribution

Sales quotations, confirmed orders, pick lists, shipments, sales invoices, and customer credit notes.

Table: herobm_core.backorders

#ColumnData TypeNullableDefaultConstraints & Relationships
1backorder_iduuidNOgen_random_uuid()🔑 PK
2sales_order_iduuidYES—🔗 sales_orders.sales_order_id
3sales_order_line_iduuidYES—🔗 sales_order_lines.sales_order_line_id
4demand_work_order_iduuidYES—🔗 work_orders.work_order_id
5work_order_component_iduuidYES—🔗 work_order_components.work_order_component_id
6product_iduuidNO—🔗 products.product_id
7purchase_order_iduuidYES—🔗 purchase_orders.purchase_order_id
8purchase_order_line_iduuidYES—🔗 purchase_order_lines.purchase_order_line_id
9transfer_order_iduuidYES—🔗 transfer_orders.transfer_order_id
10transfer_order_line_iduuidYES—🔗 transfer_order_lines.transfer_order_line_id
11work_order_iduuidYES—🔗 work_orders.work_order_id
12quantitynumericNO——
13state_codetextNO——
14created_ontimestamp with time zoneYESnow()—
15modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.sales_credit_note_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1credit_note_line_iduuidNOgen_random_uuid()🔑 PK
2credit_note_iduuidNO—🔗 sales_credit_notes.credit_note_id
3sales_order_line_iduuidYES—🔗 sales_order_lines.sales_order_line_id
4descriptiontextYES——
5account_iduuidYES—🔗 gl_accounts.gl_account_id
6tax_category_iduuidYES—🔗 tax_categories.tax_category_id
7quantity_creditednumericNO——
8price_per_unitnumericNO——
9discount_percentagenumericYES——
10amountnumericNO——
11tax_amountnumericYES——
12product_numbertextYES——
13product_nametextYES——

Table: herobm_core.sales_credit_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1credit_note_iduuidNOgen_random_uuid()🔑 PK
2credit_note_numbertextNO—⚡ UNIQUE
3customer_iduuidNO—🔗 customers.customer_id
4return_iduuidYES—🔗 sales_order_returns.return_id
5sales_order_iduuidYES—🔗 sales_orders.sales_order_id
6invoice_iduuidYES—🔗 sales_invoices.invoice_id
7total_amountnumericNO——
8tax_amountnumericYES——
9fee_amountnumericYES——
10outstanding_amountnumericNO——
11base_total_amountnumericYES——
12base_outstanding_amountnumericYES——
13currency_codetextNO—🏷️ CHECK
14exchange_ratenumericNO——
15state_codetextNO——
16notestextYES——
17metadatajsonbYES——
18created_bytextYES——
19created_ontimestamp with time zoneYESnow()—
20modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.sales_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.sales_invoice_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_line_iduuidNOgen_random_uuid()🔑 PK
2invoice_iduuidNO—🔗 sales_invoices.invoice_id
3sales_order_line_iduuidNO—🔗 sales_order_lines.sales_order_line_id
4quantity_invoicednumericNO——
5price_per_unitnumericNO——
6amountnumericNO——

Table: herobm_core.sales_invoices

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_iduuidNOgen_random_uuid()🔑 PK
2invoice_numbertextNO—⚡ UNIQUE
3sales_order_iduuidNO—🔗 sales_orders.sales_order_id
4customer_iduuidYES—🔗 customers.customer_id
5customer_name_displaytextYES——
6customer_order_numbertextYES——
7total_amountnumericNO——
8outstanding_amountnumericNO——
9tax_amountnumericYES——
10base_total_amountnumericYES——
11base_outstanding_amountnumericYES——
12currency_codetextNO—🏷️ CHECK
13exchange_ratenumericNO——
14state_codetextNO——
15invoice_datetimestamp with time zoneYES——
16due_datetimestamp with time zoneYES——
17terms_descriptiontextYES——
18notestextYES——
19metadatajsonbYES——
20early_payment_discountnumericYES——
21early_payment_discount_daysintegerYES——
22created_bytextYES——
23created_ontimestamp with time zoneYESnow()—
24modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.sales_order_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1sales_order_line_iduuidNOgen_random_uuid()🔑 PK
2sales_order_iduuidNO—🔗 sales_orders.sales_order_id
3line_numberintegerNO——
4line_typetextYES—🏷️ CHECK
5product_iduuidYES—🔗 products.product_id
6product_descriptiontextYES——
7quantitynumericNO——
8price_per_unitnumericNO——
9unit_costnumericYES——
10discount_percentagenumericYES——
11amountnumericYES——
12tax_category_iduuidYES—🔗 tax_categories.tax_category_id, 🏷️ CHECK
13taxnumericYES—🏷️ CHECK
14total_amountnumericYES——
15unit_of_measuretextYES——
16quantity_pickednumericYES——
17fulfillment_location_iduuidYES—🔗 locations.location_id, 🏷️ CHECK
18is_post_confirmationbooleanYES——
19parent_line_iduuidYES—🔗 sales_order_lines.sales_order_line_id

Table: herobm_core.sales_order_picks

#ColumnData TypeNullableDefaultConstraints & Relationships
1pick_iduuidNOgen_random_uuid()🔑 PK
2sales_order_iduuidNO—🔗 sales_orders.sales_order_id
3sales_order_line_iduuidNO—🔗 sales_order_lines.sales_order_line_id
4product_iduuidNO—🔗 products.product_id
5bin_iduuidYES—🔗 bins.bin_id
6quantitynumericNO——
7state_codetextNO—🏷️ CHECK
8created_bytextYES——
9created_ontimestamp with time zoneYESnow()—
10modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.sales_order_return_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1return_line_iduuidNOgen_random_uuid()🔑 PK
2return_iduuidNO—🔗 sales_order_returns.return_id
3sales_order_line_iduuidNO—🔗 sales_order_lines.sales_order_line_id
4quantity_returnednumericNO——
5quantity_receivednumericYES——
6reasontextYES——
7resolutiontextNO——
8return_feenumericYES——
9putaway_statustextNO——
10product_numbertextYES——
11product_nametextYES——
12price_per_unitnumericYES——
13discount_percentagenumericYES——
14tax_category_iduuidYES—🔗 tax_categories.tax_category_id

Table: herobm_core.sales_order_returns

#ColumnData TypeNullableDefaultConstraints & Relationships
1return_iduuidNOgen_random_uuid()🔑 PK
2return_numbertextNO—⚡ UNIQUE
3sales_order_iduuidNO—🔗 sales_orders.sales_order_id
4state_codetextNO—🏷️ CHECK
5location_iduuidYES—🔗 locations.location_id
6notestextYES——
7created_bytextYES——
8created_ontimestamp with time zoneYESnow()—
9modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.sales_order_shipment_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_line_iduuidNOgen_random_uuid()🔑 PK
2shipment_iduuidNO—🔗 sales_order_shipments.shipment_id
3sales_order_line_iduuidNO—🔗 sales_order_lines.sales_order_line_id
4quantity_shippednumericNO——

Table: herobm_core.sales_order_shipments

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_iduuidNOgen_random_uuid()🔑 PK
2shipment_numbertextNO—⚡ UNIQUE
3sales_order_iduuidNO—🔗 sales_orders.sales_order_id
4state_codetextNO—🏷️ CHECK
5notestextYES——
6shipping_notestextYES——
7tracking_numbertextYES——
8delivery_company_nametextYES——
9fulfillment_location_iduuidYES—🔗 locations.location_id
10created_bytextYES——
11created_ontimestamp with time zoneYESnow()—
12modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.sales_orders

#ColumnData TypeNullableDefaultConstraints & Relationships
1sales_order_iduuidNOgen_random_uuid()🔑 PK
2order_numbertextNO—⚡ UNIQUE
3nametextYES——
4customer_iduuidYES—🔗 customers.customer_id
5customer_order_numbertextYES——
6fulfillment_location_iduuidNO—🔗 locations.location_id
7state_codetextNO—🏷️ CHECK
8base_total_amountnumericYES——
9currency_codetextNO—🏷️ CHECK
10exchange_ratenumericNO——
11notestextYES——
12shipping_notestextYES——
13delivery_company_nametextYES——
14delivery_nametextYES——
15delivery_phonetextYES——
16delivery_address_line1textYES——
17delivery_address_line2textYES——
18delivery_citytextYES——
19delivery_statetextYES——
20delivery_postal_codetextYES——
21delivery_countrytextYES——
22custom_fieldsjsonbYES——
23metadatajsonbYES——
24discrepancies_acknowledgedbooleanNO——
25source_idtextYES—⚡ UNIQUE
26sourcetextNO——
27terms_descriptiontextYES——
28credit_hold_override_attimestamp with time zoneYES——
29credit_hold_override_bytextYES——
30credit_hold_override_reasontextYES——
31opportunity_iduuidYES—🔗 opportunities.opportunity_id
32created_bytextYES——
33created_ontimestamp with time zoneYESnow()—
34modified_ontimestamp with time zoneYESnow()—

Purchasing & Procurement

Purchase orders, goods receipts, purchase bills, vendor debit notes, returns, and supplier masters.

Table: herobm_core.goods_received

#ColumnData TypeNullableDefaultConstraints & Relationships
1goods_received_iduuidNOgen_random_uuid()🔑 PK
2receipt_numbertextNO—⚡ UNIQUE
3vendor_iduuidNO—🔗 suppliers.vendor_id
4location_iduuidNO—🔗 locations.location_id
5packing_slip_numbertextYES——
6notestextYES——
7state_codetextNO——
8created_bytextYES——
9created_ontimestamp with time zoneYESnow()—
10modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.goods_received_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1goods_received_line_iduuidNOgen_random_uuid()🔑 PK
2goods_received_iduuidNO—🔗 goods_received.goods_received_id
3product_iduuidNO—🔗 products.product_id
4quantity_receivednumericNO——
5unit_costnumericYES——
6match_statustextNO——
7putaway_statustextNO——
8purchase_order_line_iduuidYES—🔗 purchase_order_lines.purchase_order_line_id
9purchase_order_iduuidYES—🔗 purchase_orders.purchase_order_id

Table: herobm_core.procurement_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.purchase_debit_note_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1debit_note_line_iduuidNOgen_random_uuid()🔑 PK
2debit_note_iduuidNO—🔗 purchase_debit_notes.debit_note_id
3purchase_order_line_iduuidYES—🔗 purchase_order_lines.purchase_order_line_id
4descriptiontextYES——
5account_iduuidYES—🔗 gl_accounts.gl_account_id
6tax_category_iduuidYES—🔗 tax_categories.tax_category_id
7quantity_invoicednumericNO——
8price_per_unitnumericNO——
9amountnumericNO——
10tax_amountnumericYES——

Table: herobm_core.purchase_debit_note_shipments

#ColumnData TypeNullableDefaultConstraints & Relationships
1debit_note_shipment_iduuidNOgen_random_uuid()🔑 PK
2debit_note_line_iduuidNO—🔗 purchase_debit_note_lines.debit_note_line_id
3shipment_line_iduuidNO—🔗 purchase_order_return_shipment_lines.shipment_line_id
4quantity_creditednumericNO——

Table: herobm_core.purchase_debit_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1debit_note_iduuidNOgen_random_uuid()🔑 PK
2debit_note_numbertextNO—⚡ UNIQUE
3supplier_reference_numbertextYES——
4return_iduuidYES—🔗 purchase_order_returns.return_id
5purchase_order_iduuidYES—🔗 purchase_orders.purchase_order_id
6vendor_iduuidNO—🔗 suppliers.vendor_id
7total_amountnumericNO——
8tax_amountnumericYES——
9fee_amountnumericYES——
10outstanding_amountnumericNO——
11base_total_amountnumericYES——
12base_outstanding_amountnumericYES——
13currency_codetextNO—🏷️ CHECK
14exchange_ratenumericNO——
15state_codetextNO—🏷️ CHECK
16notestextYES——
17metadatajsonbYES——
18created_bytextYES——
19created_ontimestamp with time zoneYESnow()—
20modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.purchase_invoice_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_line_iduuidNOgen_random_uuid()🔑 PK
2invoice_iduuidNO—🔗 purchase_invoices.invoice_id
3purchase_order_line_iduuidYES—🔗 purchase_order_lines.purchase_order_line_id
4product_iduuidYES—🔗 products.product_id
5gl_account_iduuidYES—🔗 gl_accounts.gl_account_id
6descriptiontextYES——
7quantity_invoicednumericNO——
8price_per_unitnumericNO——
9amountnumericNO——
10match_statustextNO——

Table: herobm_core.purchase_invoice_receipts

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_receipt_iduuidNOgen_random_uuid()🔑 PK
2invoice_line_iduuidNO—🔗 purchase_invoice_lines.invoice_line_id
3goods_received_line_iduuidNO—🔗 goods_received_lines.goods_received_line_id
4quantity_billednumericNO——

Table: herobm_core.purchase_invoices

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_iduuidNOgen_random_uuid()🔑 PK
2invoice_numbertextNO—⚡ UNIQUE
3vendor_iduuidNO—🔗 suppliers.vendor_id
4purchase_order_iduuidYES—🔗 purchase_orders.purchase_order_id
5supplier_invoice_numbertextYES——
6receipt_filenametextYES——
7total_amountnumericNO——
8outstanding_amountnumericNO——
9tax_amountnumericYES——
10base_total_amountnumericYES——
11base_outstanding_amountnumericYES——
12currency_codetextNO—🏷️ CHECK
13exchange_ratenumericNO——
14state_codetextNO——
15invoice_datetimestamp with time zoneYES——
16due_datetimestamp with time zoneYES——
17terms_descriptiontextYES——
18notestextYES——
19early_payment_discountnumericYES——
20early_payment_discount_daysintegerYES——
21created_bytextYES——
22created_ontimestamp with time zoneYESnow()—
23modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.purchase_order_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1purchase_order_line_iduuidNOgen_random_uuid()🔑 PK
2purchase_order_iduuidNO—🔗 purchase_orders.purchase_order_id
3line_numberintegerNO——
4line_typetextYES—🏷️ CHECK
5product_iduuidYES—🔗 products.product_id
6product_descriptiontextYES——
7quantitynumericNO——
8price_per_unitnumericNO——
9discount_percentagenumericYES——
10amountnumericYES——
11tax_category_iduuidYES—🔗 tax_categories.tax_category_id, 🏷️ CHECK
12taxnumericYES—🏷️ CHECK
13total_amountnumericYES——
14unit_of_measuretextYES——
15quantity_receivednumericYES——

Table: herobm_core.purchase_order_return_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1return_line_iduuidNOgen_random_uuid()🔑 PK
2return_iduuidNO—🔗 purchase_order_returns.return_id
3purchase_order_line_iduuidNO—🔗 purchase_order_lines.purchase_order_line_id
4quantity_returnednumericNO——
5reasontextYES——
6return_feenumericYES——
7source_bin_iduuidYES—🔗 bins.bin_id

Table: herobm_core.purchase_order_return_shipment_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_line_iduuidNOgen_random_uuid()🔑 PK
2shipment_iduuidNO—🔗 purchase_order_return_shipments.shipment_id
3return_line_iduuidNO—🔗 purchase_order_return_lines.return_line_id
4quantity_shippednumericNO——

Table: herobm_core.purchase_order_return_shipments

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_iduuidNOgen_random_uuid()🔑 PK
2shipment_numbertextNO—⚡ UNIQUE
3return_iduuidNO—🔗 purchase_order_returns.return_id
4state_codetextNO—🏷️ CHECK
5notestextYES——
6tracking_numbertextYES——
7fulfillment_location_iduuidYES—🔗 locations.location_id
8created_bytextYES——
9created_ontimestamp with time zoneYESnow()—
10modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.purchase_order_returns

#ColumnData TypeNullableDefaultConstraints & Relationships
1return_iduuidNOgen_random_uuid()🔑 PK
2return_numbertextNO—⚡ UNIQUE
3purchase_order_iduuidNO—🔗 purchase_orders.purchase_order_id
4state_codetextNO—🏷️ CHECK
5notestextYES——
6created_bytextYES——
7created_ontimestamp with time zoneYESnow()—
8modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.purchase_orders

#ColumnData TypeNullableDefaultConstraints & Relationships
1purchase_order_iduuidNOgen_random_uuid()🔑 PK
2order_numbertextNO—⚡ UNIQUE
3nametextYES——
4vendor_iduuidYES—🔗 suppliers.vendor_id
5delivery_location_iduuidNO—🔗 locations.location_id
6reference_numbertextYES——
7state_codetextNO—🏷️ CHECK
8base_total_amountnumericYES——
9currency_codetextNO—🏷️ CHECK
10exchange_ratenumericNO——
11notestextYES——
12custom_fieldsjsonbYES——
13metadatajsonbYES——
14expected_datetimestamp with time zoneYES——
15terms_descriptiontextYES——
16created_bytextYES——
17created_ontimestamp with time zoneYESnow()—
18modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.supplier_expiries

#ColumnData TypeNullableDefaultConstraints & Relationships
1expiry_iduuidNOgen_random_uuid()🔑 PK
2vendor_iduuidNO—🔗 suppliers.vendor_id
3expiry_typetextNO——
4expiry_datedateNO——
5notestextYES——
6created_bytextYES——
7created_ontimestamp with time zoneYESnow()—
8modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.supplier_groups

#ColumnData TypeNullableDefaultConstraints & Relationships
1supplier_group_iduuidNOgen_random_uuid()🔑 PK
2group_codetextNO—⚡ UNIQUE
3nametextNO——
4default_ap_account_iduuidYES—🔗 gl_accounts.gl_account_id
5default_expense_account_iduuidYES—🔗 gl_accounts.gl_account_id
6default_cost_center_iduuidYES—🔗 cost_centers.cost_center_id
7default_activity_iduuidYES—🔗 activities.activity_id
8trading_terms_iduuidYES—🔗 trading_terms.trading_terms_id
9tax_position_iduuidYES—🔗 tax_positions.tax_position_id
10early_payment_discountnumericYES——
11early_payment_discount_daysintegerYES——
12credit_limitnumericYES——
13is_purchasing_blockedbooleanNO——
14purchasing_block_reasontextYES——
15is_payment_blockedbooleanNO——
16payment_block_reasontextYES——
17block_notestextYES——

Table: herobm_core.suppliers

#ColumnData TypeNullableDefaultConstraints & Relationships
1vendor_iduuidNOgen_random_uuid()🔑 PK
2vendor_numbertextNO—⚡ UNIQUE
3supplier_group_iduuidYES—🔗 supplier_groups.supplier_group_id
4organization_iduuidYES—🔗 organizations.organization_id
5trading_terms_iduuidYES—🔗 trading_terms.trading_terms_id
6early_payment_discountnumericYES——
7early_payment_discount_daysintegerYES——
8credit_limitnumericYES——
9is_purchasing_blockedbooleanNO——
10purchasing_block_reasontextYES——
11is_payment_blockedbooleanYES——
12payment_block_reasontextYES——
13block_notestextYES——
14currency_codetextNO—🏷️ CHECK
15state_codetextNO——
16external_idtextYES——
17notestextYES——
18metadatajsonbYES——
19bank_account_nametextYES——
20bank_bsbtextYES——
21bank_account_numbertextYES——
22tax_position_iduuidYES—🔗 tax_positions.tax_position_id
23source_idtextYES—⚡ UNIQUE
24sourcetextNO——
25created_bytextYES——
26created_ontimestamp with time zoneYESnow()—
27modified_ontimestamp with time zoneYESnow()—

Warehouse & Inventory

Locations, warehouse zones, bin storage, stock ledger, stock balances, and internal transfer orders.

Table: herobm_core.bin_contents

#ColumnData TypeNullableDefaultConstraints & Relationships
1bin_content_iduuidNOgen_random_uuid()🔑 PK
2bin_iduuidNO—🔗 bins.bin_id (cascade), ⚡ UNIQUE
3product_iduuidNO—🔗 products.product_id (cascade), ⚡ UNIQUE
4actual_quantitynumericNO——
5modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.bins

#ColumnData TypeNullableDefaultConstraints & Relationships
1bin_iduuidNOgen_random_uuid()🔑 PK
2bin_numbertextNO—⚡ UNIQUE
3zone_iduuidNO—🔗 zones.zone_id, ⚡ UNIQUE
4bin_typebin_type_enumNO——
5is_consignmentbooleanYES——
6is_bondedbooleanYES——
7is_unavailablebooleanYES——
8source_idtextYES—⚡ UNIQUE
9sourcetextNO——
10created_bytextYES——
11created_ontimestamp with time zoneYESnow()—
12modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.inventory_entries

#ColumnData TypeNullableDefaultConstraints & Relationships
1entry_iduuidNOgen_random_uuid()🔑 PK
2entry_numbertextNO—⚡ UNIQUE
3entry_datetimestamp with time zoneNOnow()—
4memotextYES——
5source_typetextNO——
6source_iduuidYES——
7is_reversedbooleanNO——
8reversed_byuuidYES——
9created_bytextYES——
10created_ontimestamp with time zoneYESnow()—

Table: herobm_core.inventory_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.inventory_ledger

#ColumnData TypeNullableDefaultConstraints & Relationships
1ledger_iduuidNOgen_random_uuid()🔑 PK
2entry_iduuidNO—🔗 inventory_entries.entry_id
3product_iduuidNO—🔗 products.product_id
4bin_iduuidNO—🔗 bins.bin_id
5location_iduuidNO—🔗 locations.location_id
6zone_iduuidNO—🔗 zones.zone_id
7quantitynumericNO——

Table: herobm_core.locations

#ColumnData TypeNullableDefaultConstraints & Relationships
1location_iduuidNOgen_random_uuid()🔑 PK
2codetextNO—⚡ UNIQUE
3nametextNO——
4address_line_1textYES——
5address_line_2textYES——
6citytextYES——
7state_or_provincetextYES——
8countrytextYES——
9postal_codetextYES——
10source_idtextYES—⚡ UNIQUE
11sourcetextNO——
12created_bytextYES——
13created_ontimestamp with time zoneYESnow()—
14modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.transfer_order_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1transfer_order_line_iduuidNOgen_random_uuid()🔑 PK
2transfer_order_iduuidNO—🔗 transfer_orders.transfer_order_id
3product_iduuidNO—🔗 products.product_id
4project_task_iduuidYES—🔗 project_tasks.project_task_id
5quantitynumericNO——
6quantity_shippednumericYES——
7quantity_receivednumericYES——

Table: herobm_core.transfer_order_picks

#ColumnData TypeNullableDefaultConstraints & Relationships
1pick_iduuidNOgen_random_uuid()🔑 PK
2transfer_order_iduuidNO—🔗 transfer_orders.transfer_order_id
3transfer_order_line_iduuidNO—🔗 transfer_order_lines.transfer_order_line_id
4product_iduuidNO—🔗 products.product_id
5bin_iduuidYES—🔗 bins.bin_id
6quantitynumericNO——
7state_codetextNO——
8created_bytextYES——
9created_ontimestamp with time zoneYESnow()—
10modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.transfer_order_receipt_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1receipt_line_iduuidNOgen_random_uuid()🔑 PK
2receipt_iduuidNO—🔗 transfer_order_receipts.receipt_id
3transfer_order_line_iduuidNO—🔗 transfer_order_lines.transfer_order_line_id
4product_iduuidNO—🔗 products.product_id
5bin_iduuidNO—🔗 bins.bin_id
6quantitynumericNO——
7putaway_statustextNO——

Table: herobm_core.transfer_order_receipts

#ColumnData TypeNullableDefaultConstraints & Relationships
1receipt_iduuidNOgen_random_uuid()🔑 PK
2transfer_order_iduuidNO—🔗 transfer_orders.transfer_order_id
3receipt_numbertextNO—⚡ UNIQUE
4state_codetextNO——
5received_bytextYES——
6received_ontimestamp with time zoneYESnow()—
7created_ontimestamp with time zoneYESnow()—

Table: herobm_core.transfer_order_shipment_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_line_iduuidNOgen_random_uuid()🔑 PK
2shipment_iduuidNO—🔗 transfer_order_shipments.shipment_id
3transfer_order_line_iduuidNO—🔗 transfer_order_lines.transfer_order_line_id
4pick_iduuidYES—🔗 transfer_order_picks.pick_id
5product_iduuidNO—🔗 products.product_id
6quantitynumericNO——

Table: herobm_core.transfer_order_shipments

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_iduuidNOgen_random_uuid()🔑 PK
2transfer_order_iduuidNO—🔗 transfer_orders.transfer_order_id
3shipment_numbertextNO—⚡ UNIQUE
4tracking_numbertextYES——
5carrier_iduuidYES——
6notestextYES——
7shipping_notestextYES——
8state_codetextNO——
9shipped_bytextYES——
10shipped_ontimestamp with time zoneYESnow()—
11created_ontimestamp with time zoneYESnow()—

Table: herobm_core.transfer_orders

#ColumnData TypeNullableDefaultConstraints & Relationships
1transfer_order_iduuidNOgen_random_uuid()🔑 PK
2order_numbertextNO—⚡ UNIQUE
3source_location_iduuidNO—🔗 locations.location_id
4destination_location_iduuidNO—🔗 locations.location_id
5project_iduuidYES—🔗 projects.project_id
6project_task_iduuidYES—🔗 project_tasks.project_task_id
7is_project_returnbooleanNO——
8state_codetextNO——
9notestextYES——
10shipping_notestextYES——
11created_bytextYES——
12created_ontimestamp with time zoneYESnow()—
13modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.warehouse_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.zones

#ColumnData TypeNullableDefaultConstraints & Relationships
1zone_iduuidNOgen_random_uuid()🔑 PK
2location_iduuidNO—🔗 locations.location_id, ⚡ UNIQUE
3codetextNO—⚡ UNIQUE
4nametextNO——
5source_idtextYES—⚡ UNIQUE
6sourcetextNO——
7created_bytextYES——
8created_ontimestamp with time zoneYESnow()—
9modified_ontimestamp with time zoneYESnow()—

Financials & General Ledger

Chart of accounts, double-entry journals, fiscal periods, bank reconciliation, tax positions, and payments.

Table: herobm_core.activities

#ColumnData TypeNullableDefaultConstraints & Relationships
1activity_iduuidNOgen_random_uuid()🔑 PK
2codetextNO—⚡ UNIQUE
3nametextNO——
4is_systembooleanNO——
5is_activebooleanNO——
6created_ontimestamp with time zoneYESnow()—
7modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.bank_statement_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1line_iduuidNOgen_random_uuid()🔑 PK
2gl_account_iduuidNO—🔗 gl_accounts.gl_account_id
3datedateNO——
4descriptiontextNO——
5amountnumericNO——
6referencetextYES——
7typetextYES——
8payeetextYES——
9is_reconciledbooleanNO——
10reconciliation_iduuidYES—🔗 gl_reconciliations.reconciliation_id
11matched_journal_line_iduuidYES—🔗 gl_journal_lines.journal_line_id
12match_group_iduuidYES—🔗 gl_match_groups.match_group_id
13created_ontimestamp with time zoneYESnow()—

Table: herobm_core.cost_centers

#ColumnData TypeNullableDefaultConstraints & Relationships
1cost_center_iduuidNOgen_random_uuid()🔑 PK
2codetextNO—⚡ UNIQUE
3nametextNO——
4is_systembooleanNO——
5is_activebooleanNO——
6created_ontimestamp with time zoneYESnow()—
7modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.csv_mapping_profiles

#ColumnData TypeNullableDefaultConstraints & Relationships
1profile_iduuidNOgen_random_uuid()🔑 PK
2nametextNO——
3date_columntextNO——
4amount_columntextYES——
5debit_columntextYES——
6credit_columntextYES——
7description_columntextNO——
8type_columntextYES——
9payee_columntextYES——
10reference_columntextYES——
11header_rowsintegerNO——
12created_ontimestamp with time zoneYESnow()—

Table: herobm_core.exchange_rates

#ColumnData TypeNullableDefaultConstraints & Relationships
1exchange_rate_iduuidNOgen_random_uuid()🔑 PK
2currency_codetextNO—⚡ UNIQUE, 🏷️ CHECK
3currency_nametextNO——
4buy_ratenumericNO——
5sell_ratenumericNO——
6effective_datetimestampYESnow()⚡ UNIQUE
7updated_ontimestampYESnow()—

Table: herobm_core.financial_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.gl_accounts

#ColumnData TypeNullableDefaultConstraints & Relationships
1gl_account_iduuidNOgen_random_uuid()🔑 PK
2account_codetextNO—⚡ UNIQUE
3nametextNO——
4account_typetextNO——
5report_categorytextYES——
6parent_account_iduuidYES——
7is_groupbooleanNO——
8is_systembooleanNO——
9is_bank_accountbooleanNO——
10currency_codetextNO—🏷️ CHECK
11metadatajsonbYES——
12is_activebooleanNO——
13created_ontimestamp with time zoneYESnow()—

Table: herobm_core.gl_fiscal_periods

#ColumnData TypeNullableDefaultConstraints & Relationships
1period_iduuidNOgen_random_uuid()🔑 PK
2period_nametextNO—⚡ UNIQUE
3fiscal_yearintegerNO——
4period_numberintegerNO——
5start_datedateNO——
6end_datedateNO——
7statustextNO——
8locked_bytextYES——
9locked_attimestamp with time zoneYES——
10closed_bytextYES——
11closed_attimestamp with time zoneYES——
12notestextYES——
13created_ontimestamp with time zoneYESnow()—
14modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.gl_journal_entries

#ColumnData TypeNullableDefaultConstraints & Relationships
1journal_entry_iduuidNOgen_random_uuid()🔑 PK
2sequence_numberintegerYES——
3entry_numbertextNO—⚡ UNIQUE
4entry_datedateNO——
5memotextYES——
6source_typetextNO——
7source_iduuidYES——
8prev_hashtextYES——
9entry_hashtextYES——
10is_reversedbooleanNO——
11reversed_byuuidYES—🔗 gl_journal_entries.journal_entry_id
12created_bytextYES——
13created_ontimestamp with time zoneYESnow()—

Table: herobm_core.gl_journal_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1journal_line_iduuidNOgen_random_uuid()🔑 PK
2journal_entry_iduuidNO—🔗 gl_journal_entries.journal_entry_id
3gl_account_iduuidNO—🔗 gl_accounts.gl_account_id
4party_typetextYES——
5party_idtextYES——
6debitnumericNO——
7creditnumericNO——
8foreign_debitnumericNO——
9foreign_creditnumericNO——
10foreign_currency_codetextYES——
11exchange_ratenumericYES——
12memotextYES——
13is_reconciledbooleanNO——
14reconciliation_iduuidYES—🔗 gl_reconciliations.reconciliation_id
15cost_center_iduuidYES—🔗 cost_centers.cost_center_id
16activity_iduuidYES—🔗 activities.activity_id
17match_group_iduuidYES—🔗 gl_match_groups.match_group_id

Table: herobm_core.gl_match_groups

#ColumnData TypeNullableDefaultConstraints & Relationships
1match_group_iduuidNOgen_random_uuid()🔑 PK
2match_typetextNO——
3rule_iduuidYES—🔗 reconciliation_rules.rule_id
4created_bytextNO——
5created_ontimestamp with time zoneYESnow()—

Table: herobm_core.gl_reconciliations

#ColumnData TypeNullableDefaultConstraints & Relationships
1reconciliation_iduuidNOgen_random_uuid()🔑 PK
2gl_account_iduuidNO—🔗 gl_accounts.gl_account_id
3statement_datedateNO——
4statement_balancenumericNO——
5statustextNO——
6created_bytextYES——
7created_ontimestamp with time zoneYESnow()—
8posted_ontimestamp with time zoneYES——

Table: herobm_core.gl_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1settings_iduuidNOgen_random_uuid()🔑 PK
2account_metadata_schemajsonbYES——
3fiscal_year_start_monthintegerNO——
4bank_match_date_tolerance_daysintegerNO——
5default_ar_account_iduuidYES—🔗 gl_accounts.gl_account_id
6default_ap_account_iduuidYES—🔗 gl_accounts.gl_account_id
7default_revenue_account_iduuidYES—🔗 gl_accounts.gl_account_id
8default_cogs_account_iduuidYES—🔗 gl_accounts.gl_account_id
9default_sales_tax_account_iduuidYES—🔗 gl_accounts.gl_account_id
10default_purchase_tax_account_iduuidYES—🔗 gl_accounts.gl_account_id
11default_expense_account_iduuidYES—🔗 gl_accounts.gl_account_id
12default_inventory_account_iduuidYES—🔗 gl_accounts.gl_account_id
13default_grni_account_iduuidYES—🔗 gl_accounts.gl_account_id
14realised_fx_gain_account_iduuidYES—🔗 gl_accounts.gl_account_id
15realised_fx_loss_account_iduuidYES—🔗 gl_accounts.gl_account_id
16unrealised_fx_gain_account_iduuidYES—🔗 gl_accounts.gl_account_id
17unrealised_fx_loss_account_iduuidYES—🔗 gl_accounts.gl_account_id
18default_shrinkage_account_iduuidYES—🔗 gl_accounts.gl_account_id
19default_ppv_account_iduuidYES—🔗 gl_accounts.gl_account_id
20default_cost_center_iduuidYES—🔗 cost_centers.cost_center_id
21default_activity_iduuidYES—🔗 activities.activity_id
22base_currencytextNO——
23supported_batch_payment_formatsjsonbYES——
24revenue_routing_precedencetextNO——
25expense_routing_precedencetextNO——
26default_fee_revenue_account_iduuidYES—🔗 gl_accounts.gl_account_id
27default_discounts_received_account_iduuidYES—🔗 gl_accounts.gl_account_id
28default_discounts_given_account_iduuidYES—🔗 gl_accounts.gl_account_id
29default_otc_cash_account_iduuidYES—🔗 gl_accounts.gl_account_id
30default_otc_card_account_iduuidYES—🔗 gl_accounts.gl_account_id
31default_suspense_account_iduuidYES—🔗 gl_accounts.gl_account_id
32default_retained_earnings_account_iduuidYES—🔗 gl_accounts.gl_account_id

Table: herobm_core.payment_allocations

#ColumnData TypeNullableDefaultConstraints & Relationships
1allocation_iduuidNOgen_random_uuid()🔑 PK
2payment_iduuidNO—🔗 payment_entries.payment_id
3reference_typetextNO——
4reference_iduuidNO——
5allocated_amountnumericNO——
6discount_amountnumericYES——
7created_ontimestamp with time zoneYESnow()—

Table: herobm_core.payment_entries

#ColumnData TypeNullableDefaultConstraints & Relationships
1payment_iduuidNOgen_random_uuid()🔑 PK
2payment_numbertextNO—⚡ UNIQUE
3payment_typetextNO——
4party_iduuidYES——
5payment_datetimestamp with time zoneNO——
6mode_of_paymenttextNO——
7total_amountnumericNO——
8unallocated_amountnumericNO——
9gl_account_bankuuidNO—🔗 gl_accounts.gl_account_id
10reference_numbertextYES——
11state_codetextNO——
12base_total_amountnumericYES——
13base_unallocated_amountnumericYES——
14currency_codetextNO——
15exchange_ratenumericNO——
16created_bytextYES——
17aba_exported_attimestamp with time zoneYES——
18created_ontimestamp with time zoneYESnow()—
19modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.payment_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1payment_line_iduuidNOgen_random_uuid()🔑 PK
2payment_iduuidNO—🔗 payment_entries.payment_id
3gl_account_iduuidNO—🔗 gl_accounts.gl_account_id
4amountnumericNO——
5memotextYES——

Table: herobm_core.reconciliation_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.reconciliation_rules

#ColumnData TypeNullableDefaultConstraints & Relationships
1rule_iduuidNOgen_random_uuid()🔑 PK
2gl_account_idsjsonbYES——
3condition_typetextYES——
4condition_valuetextYES——
5type_conditiontextYES——
6payee_condition_typetextYES——
7payee_condition_valuetextYES——
8amount_minnumericYES——
9amount_maxnumericYES——
10target_gl_account_iduuidNO—🔗 gl_accounts.gl_account_id
11cost_center_iduuidYES—🔗 cost_centers.cost_center_id
12activity_iduuidYES—🔗 activities.activity_id
13party_typetextYES——
14party_idtextYES——
15memotextYES——
16priorityintegerNO——
17created_ontimestamp with time zoneYESnow()—

Table: herobm_core.tax_categories

#ColumnData TypeNullableDefaultConstraints & Relationships
1tax_category_iduuidNOgen_random_uuid()🔑 PK
2codetextNO—⚡ UNIQUE
3titletextNO——
4typetextNO——
5ratenumericYES——
6sales_gl_account_iduuidYES——
7purchase_gl_account_iduuidYES——

Table: herobm_core.tax_position_mappings

#ColumnData TypeNullableDefaultConstraints & Relationships
1mapping_iduuidNOgen_random_uuid()🔑 PK
2tax_position_iduuidNO—🔗 tax_positions.tax_position_id (cascade)
3source_tax_category_iduuidNO—🔗 tax_categories.tax_category_id (cascade)
4destination_tax_category_iduuidNO—🔗 tax_categories.tax_category_id (cascade)

Table: herobm_core.tax_positions

#ColumnData TypeNullableDefaultConstraints & Relationships
1tax_position_iduuidNOgen_random_uuid()🔑 PK
2codetextNO—⚡ UNIQUE
3titletextNO——

Manufacturing & Work Orders

Production work orders, component allocations, and manufacturing picking tickets.

Table: herobm_core.work_order_components

#ColumnData TypeNullableDefaultConstraints & Relationships
1work_order_component_iduuidNOgen_random_uuid()🔑 PK
2work_order_iduuidNO—🔗 work_orders.work_order_id
3product_iduuidNO—🔗 products.product_id
4expected_quantitynumericNO——
5unit_costnumericYES——

Table: herobm_core.work_order_picks

#ColumnData TypeNullableDefaultConstraints & Relationships
1pick_iduuidNOgen_random_uuid()🔑 PK
2work_order_iduuidNO—🔗 work_orders.work_order_id
3work_order_component_iduuidNO—🔗 work_order_components.work_order_component_id
4bin_iduuidYES—🔗 bins.bin_id
5quantitynumericNO——
6state_codetextNO—🏷️ CHECK
7created_bytextYES——
8created_ontimestamp with time zoneYESnow()—
9modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.work_orders

#ColumnData TypeNullableDefaultConstraints & Relationships
1work_order_iduuidNOgen_random_uuid()🔑 PK
2order_numbertextNO—⚡ UNIQUE
3product_iduuidNO—🔗 products.product_id
4target_quantitynumericNO——
5completed_quantitynumericNO——
6location_iduuidNO—🔗 locations.location_id
7wip_bin_iduuidYES—🔗 bins.bin_id
8output_bin_iduuidYES—🔗 bins.bin_id
9state_codetextNO—🏷️ CHECK
10putaway_statustextYES——
11assembly_cost_per_unitnumericYES——
12additional_costnumericYES——
13total_costnumericYES——
14metadatajsonbYES——
15created_bytextYES——
16created_ontimestamp with time zoneYESnow()—
17modified_ontimestamp with time zoneYESnow()—

System, Security & Telemetry

User access control, API keys, webhook outbox, PDF reports, async ELT pipeline jobs, and system event logs.

Table: herobm_core._pipeline_jobs

#ColumnData TypeNullableDefaultConstraints & Relationships
1job_idtextNO—🔑 PK
2typetextNO——
3statustextNO——
4config_jsonjsonbYES——
5progress_jsonjsonbYES——
6logs_jsonjsonbYES——
7created_attimestampNOnow()—
8updated_attimestampNOnow()—

Table: herobm_core.api_keys

#ColumnData TypeNullableDefaultConstraints & Relationships
1api_key_iduuidNOgen_random_uuid()🔑 PK
2nametextNO——
3key_hashtextNO——
4prefixtextNO——
5roletextNO——
6is_activebooleanNO——
7created_bytextNO——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.app_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1settings_iduuidNOgen_random_uuid()🔑 PK
2default_fulfillment_location_iduuidYES—🔗 locations.location_id
3default_customer_terms_iduuidYES—🔗 trading_terms.trading_terms_id
4default_supplier_terms_iduuidYES—🔗 trading_terms.trading_terms_id
5default_customer_tax_position_iduuidYES—🔗 tax_positions.tax_position_id
6default_supplier_tax_position_iduuidYES—🔗 tax_positions.tax_position_id
7default_purchase_tax_category_iduuidYES—🔗 tax_categories.tax_category_id
8default_sales_tax_category_iduuidYES—🔗 tax_categories.tax_category_id
9inventory_valuation_methodtextNO——
10inventory_accounting_modetextNO——
11allow_negative_inventorybooleanNO——
12credit_limit_behaviortextNO——
13smtp_hosttextYES——
14smtp_portintegerYES——
15smtp_usertextYES——
16smtp_pass_encryptedtextYES——
17smtp_from_addresstextYES——
18organization_tagsjsonbYES——
19organization_contact_rolesjsonbYES——
20opportunity_contact_rolesjsonbYES——
21opportunity_organization_rolesjsonbYES——
22opportunity_stagesjsonbYES——
23opportunity_typesjsonbYES——
24project_stagesjsonbYES——
25referral_modesjsonbYES——
26activity_typesjsonbYES——
27sales_analysis_codesjsonbYES——
28api_rate_limitnumericNO——
29setup_completed_attimestamp with time zoneYES——
30system_identifiertextYES——
31active_license_keytextYES——
32active_license_payloadjsonbYES——
33tax_provider_mappingsjsonbYES——
34enrichment_provider_mappingsjsonbYES——

Table: herobm_core.business_report_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.business_reports

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2slugtextNO—⚡ UNIQUE
3nametextNO——
4descriptiontextYES——
5data_source_hooktextNO——
6ui_configjsonbNO——
7is_systembooleanNO——
8created_attimestamp with time zoneNOnow()—

Table: herobm_core.casbin_rule

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2ptypetextNO——
3v0textYES——
4v1textYES——
5v2textYES——
6v3textYES——
7v4textYES——
8v5textYES——

Table: herobm_core.email_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.email_outbox

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2entity_typetextYES——
3entity_iduuidYES——
4to_addresstextNO——
5reply_totextYES——
6subjecttextNO——
7html_bodytextNO——
8attachmentsjsonbYES——
9statusemail_statusNO——
10retriesintegerNO——
11last_errortextYES——
12next_retry_attimestamp with time zoneYES——
13created_attimestamp with time zoneNOnow()—
14processed_attimestamp with time zoneYES——

Table: herobm_core.group_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.integration_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.integrations

#ColumnData TypeNullableDefaultConstraints & Relationships
1integration_iduuidNOgen_random_uuid()🔑 PK
2providertextNO—⚡ UNIQUE
3configjsonbNO——
4is_activebooleanNO——
5created_ontimestamp with time zoneYESnow()—
6modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.macros

#ColumnData TypeNullableDefaultConstraints & Relationships
1macro_iduuidNOgen_random_uuid()🔑 PK
2nametextNO—⚡ UNIQUE
3macro_typetextNO——
4contenttextNO——
5created_ontimestamp with time zoneYESnow()—
6modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.master_data_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.outbox

#ColumnData TypeNullableDefaultConstraints & Relationships
1outbox_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7created_ontimestamp with time zoneYESnow()—
8processed_attimestamp with time zoneYES——
9locked_untiltimestamp with time zoneYES——
10last_errortextYES——

Table: herobm_core.pdf_template_contexts

#ColumnData TypeNullableDefaultConstraints & Relationships
1template_iduuidNO—🔗 pdf_templates.id (cascade)
2contexttextNO——

Table: herobm_core.pdf_template_hooks

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2hook_slugtextNO—⚡ UNIQUE
3report_iduuidNO—🔗 pdf_templates.id (cascade)
4context_slugtextNO——
5updated_attimestamp with time zoneNOnow()—

Table: herobm_core.pdf_templates

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2slugtextNO—⚡ UNIQUE
3nametextNO——
4descriptiontextYES——
5templatetextNO——
6mock_datajsonbYES——
7context_resolvertextYES——
8output_name_patterntextYES——
9created_attimestamp with time zoneNOnow()—

Table: herobm_core.system_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO——
3entity_iduuidNO——
4event_typetextNO——
5entity_display_nametextYES——
6payloadjsonbYES——
7actortextYES——
8created_ontimestamp with time zoneYESnow()—

Table: herobm_core.tenant_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1tenant_settings_iduuidNOgen_random_uuid()🔑 PK
2nametextNO——
3address_line_1textYES——
4address_line_2textYES——
5citytextYES——
6statetextYES——
7countrytextYES——
8post_codetextYES——
9emailtextYES——
10phonetextYES——
11websitetextYES——
12company_numbertextYES——
13tax_numbertextYES——
14logo_urltextYES——
15bank_nametextYES——
16bank_account_nametextYES——
17bank_account_numbertextYES——
18bank_swift_bictextYES——
19bank_ibantextYES——
20pdf_theme_configjsonbYES——

Table: herobm_core.user_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2user_iduuidNO——
3event_typetextNO——
4entity_display_nametextYES——
5payloadjsonbYES——
6actortextYES——
7created_ontimestamp with time zoneYESnow()—

Table: herobm_core.user_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1user_iduuidNO—🔑 PK, 🔗 users.user_id (cascade)
2dashboard_configjsonbYES——
3report_configsjsonbYES——
4preferencesjsonbYES——
5created_attimestamp with time zoneNOnow()—
6updated_attimestamp with time zoneNOnow()—

Table: herobm_core.user_two_factor

#ColumnData TypeNullableDefaultConstraints & Relationships
1user_iduuidNO—🔑 PK, 🔗 users.user_id (cascade)
2secret_encryptedtextNO——
3is_enabledbooleanNO——
4backup_codesjsonbNO——
5verified_attimestamp with time zoneYES——
6created_attimestamp with time zoneNOnow()—
7updated_attimestamp with time zoneNOnow()—

Table: herobm_core.users

#ColumnData TypeNullableDefaultConstraints & Relationships
1user_iduuidNOgen_random_uuid()🔑 PK
2usernametextNO—⚡ UNIQUE
3password_hashtextNO——
4display_nametextYES——
5emailtextYES——
6roletextNO——
7is_activebooleanNO——
8created_attimestamp with time zoneNOnow()—

Table: herobm_core.webhooks

#ColumnData TypeNullableDefaultConstraints & Relationships
1webhook_iduuidNOgen_random_uuid()🔑 PK
2target_urltextNO——
3event_typesjsonbNO——
4secret_keytextNO——
5is_activebooleanNO——
6created_ontimestamp with time zoneYESnow()—

Table: herobm_core.crm_activity_contacts

#ColumnData TypeNullableDefaultConstraints & Relationships
1activity_contact_iduuidNOgen_random_uuid()🔑 PK
2activity_iduuidNO—🔗 crm_activities.activity_id (cascade)
3contact_iduuidNO—🔗 contacts.contact_id (cascade)
4created_ontimestamp with time zoneYESnow()—

Table: herobm_core.crm_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1settings_iduuidNOgen_random_uuid()🔑 PK
2organization_metadata_schemajsonbYES——
3opportunity_metadata_schemajsonbYES——
4contact_metadata_schemajsonbYES——
5customer_metadata_schemajsonbYES——
6supplier_metadata_schemajsonbYES——
7created_ontimestamp with time zoneYESnow()—
8modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.manufacturing_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1manufacturing_settings_iduuidNOgen_random_uuid()🔑 PK
2work_order_metadata_schemajsonbYES——
3modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.product_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1settings_iduuidNOgen_random_uuid()🔑 PK
2product_metadata_schemajsonbYES——
3created_ontimestamp with time zoneYESnow()—
4modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.project_budget_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1budget_line_iduuidNOgen_random_uuid()🔑 PK
2project_iduuidNO—🔗 projects.project_id
3project_task_iduuidNO—🔗 project_tasks.project_task_id
4line_typetextNO——
5resource_iduuidYES—🔗 project_resources.resource_id
6product_iduuidYES—🔗 products.product_id
7descriptiontextYES——
8planned_quantitynumericNO——
9unit_costnumeric(12, 2)NO——
10total_costnumeric(12, 2)NO——
11unit_pricenumeric(12, 2)NO——
12discount_percentagenumeric(5, 2)YES——
13total_pricenumeric(12, 2)NO——
14created_ontimestamp with time zoneYESnow()—
15modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.project_ledger_entries

#ColumnData TypeNullableDefaultConstraints & Relationships
1ledger_iduuidNOgen_random_uuid()🔑 PK
2project_iduuidNO—🔗 projects.project_id
3project_task_iduuidNO—🔗 project_tasks.project_task_id
4entry_typetextNO——
5line_typetextNO——
6source_typetextNO——
7source_iduuidYES——
8inventory_entry_iduuidYES—🔗 inventory_entries.entry_id
9resource_iduuidYES—🔗 project_resources.resource_id
10product_iduuidYES—🔗 products.product_id
11user_iduuidYES—🔗 users.user_id
12descriptiontextYES——
13quantitynumericNO——
14unit_cost_basenumeric(12, 2)NO——
15total_cost_basenumeric(12, 2)NO——
16unit_price_basenumeric(12, 2)NO——
17discount_percentagenumeric(5, 2)YES——
18total_price_basenumeric(12, 2)NO——
19is_billablebooleanNO——
20is_billedbooleanNO——
21sales_invoice_line_iduuidYES——
22budget_line_iduuidYES—🔗 project_budget_lines.budget_line_id
23posting_datetimestamp with time zoneNO——
24created_bytextNO——
25created_ontimestamp with time zoneYESnow()—

Table: herobm_core.project_resource_assignments

#ColumnData TypeNullableDefaultConstraints & Relationships
1assignment_iduuidNOgen_random_uuid()🔑 PK
2project_iduuidNO—🔗 projects.project_id (cascade), ⚡ UNIQUE
3resource_iduuidNO—🔗 project_resources.resource_id, ⚡ UNIQUE
4notestextYES——
5created_bytextYES——
6created_ontimestamp with time zoneYESnow()—

Table: herobm_core.project_resources

#ColumnData TypeNullableDefaultConstraints & Relationships
1resource_iduuidNOgen_random_uuid()🔑 PK
2resource_numbertextNO—⚡ UNIQUE
3nametextNO——
4resource_typetextNO——
5user_iduuidYES—🔗 users.user_id
6vendor_iduuidYES—🔗 suppliers.vendor_id
7service_product_iduuidYES—🔗 products.product_id
8base_uomtextNO—🔗 uom_dictionary.uom_code
9direct_unit_costnumeric(12, 2)NO——
10unit_pricenumeric(12, 2)NO——
11is_activebooleanNO——
12created_ontimestamp with time zoneYESnow()—
13modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.project_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1settings_iduuidNOgen_random_uuid()🔑 PK
2project_metadata_schemajsonbYES——
3created_ontimestamp with time zoneYESnow()—
4modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.project_tasks

#ColumnData TypeNullableDefaultConstraints & Relationships
1project_task_iduuidNOgen_random_uuid()🔑 PK
2project_iduuidNO—🔗 projects.project_id
3task_codetextNO——
4nametextNO——
5descriptiontextYES——
6parent_task_iduuidYES—🔗 project_tasks.project_task_id
7state_codetextNO——
8is_milestonebooleanNO——
9is_billablebooleanNO——
10planned_start_datetimestamp with time zoneYES——
11planned_end_datetimestamp with time zoneYES——
12actual_start_datetimestamp with time zoneYES——
13actual_end_datetimestamp with time zoneYES——
14created_bytextYES——
15created_ontimestamp with time zoneYESnow()—
16modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.purchasing_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1purchasing_settings_iduuidNOgen_random_uuid()🔑 PK
2purchase_order_metadata_schemajsonbYES——
3debit_note_metadata_schemajsonbYES——
4modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.sales_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1sales_settings_iduuidNOgen_random_uuid()🔑 PK
2sales_order_metadata_schemajsonbYES——
3sales_invoice_metadata_schemajsonbYES——
4credit_note_metadata_schemajsonbYES——
5modified_ontimestamp with time zoneYESnow()—

Table: herobm_core.stocktake_counts

#ColumnData TypeNullableDefaultConstraints & Relationships
1stocktake_count_iduuidNOgen_random_uuid()🔑 PK
2stocktake_iduuidNO—🔗 stocktakes.stocktake_id (cascade)
3stocktake_line_iduuidYES—🔗 stocktake_lines.stocktake_line_id (cascade)
4product_iduuidNO—🔗 products.product_id
5bin_iduuidNO—🔗 bins.bin_id
6quantitynumericNO——
7count_modetextNO——
8counted_bytextNO——
9counted_attimestamp with time zoneYESnow()—
10notestextYES——

Table: herobm_core.stocktake_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1stocktake_line_iduuidNOgen_random_uuid()🔑 PK
2stocktake_iduuidNO—🔗 stocktakes.stocktake_id (cascade), ⚡ UNIQUE
3product_iduuidNO—🔗 products.product_id, ⚡ UNIQUE
4bin_iduuidNO—🔗 bins.bin_id, ⚡ UNIQUE
5expected_quantitynumericNO——
6counted_quantitynumericYES——
7is_unlistedbooleanNO——
8notestextYES——
9last_counted_attimestamp with time zoneYES——
10last_counted_bytextYES——

Table: herobm_core.stocktakes

#ColumnData TypeNullableDefaultConstraints & Relationships
1stocktake_iduuidNOgen_random_uuid()🔑 PK
2stocktake_numbertextNO—⚡ UNIQUE
3nametextNO——
4location_iduuidNO—🔗 locations.location_id
5state_codetextNO——
6scope_typetextNO——
7zone_filtertextYES——
8bin_patterntextYES——
9is_blind_countbooleanNO——
10notestextYES——
11inventory_entry_iduuidYES—🔗 inventory_entries.entry_id
12created_bytextYES——
13created_ontimestamp with time zoneYESnow()—
14opened_bytextYES——
15opened_attimestamp with time zoneYES——
16reviewed_bytextYES——
17reviewed_attimestamp with time zoneYES——
18submitted_bytextYES——
19submitted_ontimestamp with time zoneYES——
20cancelled_bytextYES——
21cancelled_attimestamp with time zoneYES——
22modified_ontimestamp with time zoneYESnow()—

Field Reference & Data Dictionary

Key database fields, input parameters, and definitions associated with this workflow screen:

Field / Parameter Display Name Description & Rules
table_name Table Name Relational table identifier within herobm_core schema.
primary_key Primary Key Unique UUID identifier generated by gen_random_uuid().
foreign_key Foreign Key Referential integrity link to another domain entity.
column_type Column Type PostgreSQL data type (e.g. uuid, text, numeric, jsonb, boolean, timestamptz).