Neural LogDocumentation
Developer reference

Neural Log Data Model and Entity Catalog

Developer overview of the Neural Log schema: legacy Access mapping, key entity families, generated XPO model and where current model counts are kept.

Neural Log maps a legacy 41-table, 838-field Access schema into a modern XPO entity model generated from a maintained mapping. This developer reference summarizes the legacy source, the main entity families and where to find authoritative counts.

Model statistics#

Metric Value
Source legacy tables 41
Source legacy fields 838
Source legacy indexes 90
Target entities See the generated validation manifest

Key entity families#

Traffic and customers#

Entity Purpose
Advertiser Formerly Customers. Billing name, contact, address, revenue type, and representative.
Agency Separate agency identity linked to advertisers.
SalesRepresentative Formerly AccountReps. Commercial representative, distinct from authentication users.
AdvertisingOrder Formerly Orders. Contract header with advertiser, dates, and status.
AdvertisingOrderLine Formerly OrderLines. Line items with creative, time class, and scheduling policy.
Creative Formerly CopyManager. Copy, rotator, packet, and schedule variants tracked by KindCode.

Scheduling and logs#

Entity Purpose
BroadcastLog Daily log header per station and date.
BroadcastEvent Scheduled events, package charges, and on-air spots.
LogTemplate Station template with named events and fill rules.
LogTemplateEvent Template event ordinals within a template.

Billing and A/R#

Entity Purpose
Invoice Issued billing snapshot with advertiser, address, and tax.
InvoiceDraft Pending invoice items before final issuance.
InvoiceScriptSnapshot Immutable script snapshot per invoice.
Payment Payment header with deposit and allocation links.
BankDeposit Deposit manifest linked to current receipts through BankDepositItem records.
ReceivableEntry A/R ledger entries (invoices, payments, adjustments).
ReceivablePeriodClose Calendar-month close record with beginning/ending balances.

Setup and configuration#

Entity Purpose
Station Radio group station with time zone and kind.
RadioGroup Singleton configuration per database.
TimeClass Day-grouped time windows for scheduling.
TaxDefinition Tax rate, basis, and type rules.
ProductCategory Commercial protection categories.
AvailabilityType Avail type codes used in orders and templates.

Generated model workflow#

The model is maintained through these scripts:

  1. Mapping source: docs/database/mapping.json is the maintained structural source.
  2. Generation: tools/generate_xpo.py generates entity files and ui-metadata.json.
  3. Validation: tools/validate_design.py checks model coverage and consistency.
  4. SQL verification: tools/Verify-SqlSchema.ps1 captures the actual SQL schema for comparison.

Do not rerun the historical tools/build_design.py bootstrap over maintained extensions. It omits later model additions.

Legacy mapping highlights#

  • All legacy keys are preserved in ImportKeyMap for deterministic migration.
  • Composite keys such as (CustID, OrderID, LineID) are resolved into single GUID references.
  • Repeating groups (month columns, weekday slots) are unpivoted into child rows.
  • Invoice and script snapshots are immutable and do not follow master edits.

Open migration gates#

Several legacy meanings remain unresolved and are documented as gates in docs/database/migration.md. Key open questions include station zero semantics, year-zero sales targets, and package event classification. Unresolved objects cannot become active orders or issued invoices until their gates are cleared.