Appendix — Backend Models Index

Source: backend/models/ — Purpose and key fields

CEO Summary

Models map to database tables. Core business: orgs, tenants, users, products, POS carts, invoices. Key conventions: orgId/tenantId for tenant scope; priceCents for money; items/payments JSON in carts.

Core Business

ModelTablePurpose
org.model.jsOrganizationsTenant/org metadata
tenant.model.jsTenantsTenant records (master DB)
user.model.js, User.jsUsersPlatform users
staff.model.jsStaffStaff members (tenant DB)
customer.model.jsCustomersCustomer records
product.model.jsProductsProduct catalog
category.model.jsCategoriesProduct categories
modifier.model.jsModifiersModifiers for products
catalog.model.jsCatalogsCatalog containers
menu.model.jsMenusMenu definitions
menuAssignment.model.jsMenuAssignmentsMenu-to-location assignments

POS & Invoicing

ModelTablePurpose
posCart.model.jspos_cartsPOS cart (items, payments, status)
invoice.model.jsInvoicesInvoices (lines JSON, paymentMethod, crypto fields)
order.model.jsOrdersOrders
payment.model.jsPaymentsPayment records
unifiedPayment.model.jsUnifiedPaymentsUnified payment tracking
tx.model.jsTransactionsTransaction records
charge.model.jsChargesCharge records
dispute.model.jsDisputesDispute records

Crypto

ModelTablePurpose
cryptoConfig.model.jsCryptoConfigsDOGE/LTC/BTC config per org
cryptoInvoice.model.jsCryptoInvoicesCrypto payment invoices
wallet.model.jsWalletsWallet accounts
walletAccount.model.jsWalletAccountsWallet sub-accounts
walletAddress.model.jsWalletAddressesAddresses
walletPolicy.model.jsWalletPoliciesPolicy config
hdAccount.model.jsHDAccountsHD wallet accounts
hdAddress.model.jsHDAddressesHD addresses

Inventory

ModelTablePurpose
inventoryItem.model.jsInventoryItemsItems (variations, barcode, domain)
inventoryLedger.model.jsinventory_ledgerLedger entries
inventoryLevel.model.jsInventoryLevelsStock levels
inventoryLot.model.jsInventoryLotsLot tracking
inventorySerial.model.jsInventorySerialsSerial tracking
inventoryMove.model.jsInventoryMovesMove records
inventoryDomain.model.jsInventoryDomainsDomains (retail, etc.)
inventoryAttr.model.jsInventoryAttrsAttributes
stockLedger.model.jsStockLedgerStock ledger
vendor.model.jsVendorsVendors
purchaseOrder.model.jsPurchaseOrdersPOs
purchaseOrderLine.model.jsPurchaseOrderLinesPO lines
binLocation.model.jsBinLocationsBin locations

KDS & Kitchen

ModelTablePurpose
kitchenTicket.model.jskitchen_ticketsKitchen tickets
preparable.model.jsPreparablesPreparable items
recipe.model.jsRecipesRecipes
seatingLayout.model.jsseating_layoutsFloor layouts

HR & Payroll

ModelTablePurpose
timesheet.model.jsTimesheetsTime entries
shift.model.jsShiftsShift records
payrun.model.jsPayRunsPayroll runs
permissionSet.model.jsPermissionSetsPermission sets
staffPermissions.model.jsStaffPermissionsStaff permissions

Gift Cards & Loyalty

ModelTablePurpose
giftCard.model.jsGiftCardsGift card records
giftCardProgram.model.jsGiftCardProgramsProgram config
giftCardTxn.model.jsGiftCardTxnsGift card transactions
giftcardBatch.model.jsGiftCardBatchesBatch issuance
loyaltyProgram.model.jsLoyaltyProgramsLoyalty programs
loyaltyAccount.model.jsLoyaltyAccountsCustomer loyalty accounts
loyaltyEvent.model.jsLoyaltyEventsLoyalty events

Devices & Bridge

ModelTablePurpose
device.model.jsDevicesDevice records; JSON metadata: posModules / pos_modules (backend/utils/posModules.js; e.g. fuel); fuelSite forecourt config (backend/utils/fuelSite.js, normalized on admin save)
deviceProfile.model.jsDeviceProfilesDevice profiles
deviceSession.model.jsDeviceSessionsDevice sessions
deviceHeartbeat.model.jsDeviceHeartbeatsHeartbeats
deviceCode.model.jsDeviceCodesClaim codes
deviceCatalog.model.jsDeviceCatalogPayment terminals, printers
printerProfile.model.jsPrinterProfilesPrinter config
posMode.model.jsPosModesPOS mode config

Tickets & Appointments

ModelTablePurpose
ticket.model.jsTicketsTicket records
ticketCounter.model.jsTicketCountersTicket numbering
mysql/Ticket.jsticketsMySQL tickets
mysql/TicketWorkflow.jsTicketWorkflowsWorkflows
mysql/TicketSystem.jsTicketSystemsSystem config
mysql/TicketSettings.jsTicketSettingsSettings
mysql/TicketCategory.jsTicketCategoriesCategories
mysql/TicketComment.jsTicketCommentsComments
mysql/Appointment.jsAppointmentsAppointments
mysql/AppointmentStaff.jsAppointmentStaffStaff assignments

Payments & Integrations

ModelTablePurpose
paymentProvider.model.jsPaymentProvidersCoinbase, CoinGate, etc.
paymentHub.model.jsPaymentHubHub config
merchant.model.jsMerchantsMerchant records
cardToken.model.jsCardTokensCard tokens
apiKey.model.jsApiKeysAPI keys
webhookEndpoint.model.jsWebhookEndpointsWebhook config
webhookDelivery.model.jsWebhookDeliveriesDelivery logs
integrationHub.model.jsIntegrationHubIntegration config

System & Audit

ModelTablePurpose
systemSetting.model.jsSystemSettingsSystem settings
orgSettings.model.jsOrgSettingsOrg settings
orgRules.model.jsOrgRulesOrg rules
taxSettings.model.jsTaxSettingsTax config
receiptTemplate.model.jsReceiptTemplatesReceipt templates
brandingSettings.model.jsBrandingSettingsBranding
auditEvent.model.jsAuditEventsAudit log
session.model.jsSessionsSessions
idempotency.model.jsIdempotencyKeysIdempotency
idempotencyKey.model.jsIdempotencyKeysIdempotency keys

Analytics & Reporting

ModelTablePurpose
staffAnalytics.model.jsStaffAnalyticsStaff analytics
customerAnalytics.model.jsCustomerAnalyticsCustomer analytics
transactionTracking.model.jsTransactionTrackingTransaction tracking
offlineTransaction.model.jsOfflineTransactionsOffline txns

MySQL-Specific (Sequelize)

ModelTablePurpose
mysql/Tenant.jsTenantsMaster tenants
mysql/Organization.jsOrganizationsMaster orgs
mysql/User.jsUsersMaster users
mysql/DatabaseConfig.jsDatabaseConfigsDB config
mysql/PasswordResetToken.jsPasswordResetTokensReset tokens

Customer Auth

ModelTablePurpose
customer-auth.model.jsCustomerAuthCustomer login/auth

Key Field Conventions