code wiki / _hdl_build / nx_adnet_crm.nx

nx_adnet_crm.nx

buildroot/runtime/_hdl_build/nx_adnet_crm.nx

8293 B167 linesdepth 4pulls 4 transitivereach 1 importersview sourcekind librarytopic adnet
docsdependenciesstructsconstsfunctions

about

nx_adnet_crm.nx -- LIB: the ADVERTISER RECORD for the sovereign ad network (Data Vault 2.0 shape). WHY A CRM AT ALL: the network can now serve a slot, measure a VIEWABLE impression, price it and emit an invoice -- but it has nowhere to put the party being invoiced. adnet_inventory.txt carries a creative and a click target; adnet_rates.conf carries a price. NEITHER carries a client. Without an advertiser record there is no contact to send an invoice to, no campaign to start and stop, and no way to answer "what did this client buy and what did they get" -- which is the whole job. DV2.0 BY THE HOUSE RULES (rule 8), not by imitation of a warehouse: hub_advertiser advertiser_bk (the business key -- a stable slug the operator chooses) hub_advertiser_hk (derived, never authored -- see the law below) sat_advertiser_contact name/email, load_date, is_current sat_advertiser_billing cpm_milli/cpc_milli/cap_milli terms, load_date, is_current link_advertiser_creative hub_advertiser_hk + the content-addressed creative url ★ THE HASH KEY IS DERIVED, NEVER AUTHORED. A caller may not pass a hub_advertiser_hk in; it is computed from the business key every time. An authorable derived field is how two rows for one client appear. ★ ADDITIVE-ONLY (rule 13). There is NO delete verb in this lib, by construction -- not by convention. Ending a relationship writes a NEW satellite row with is_current=0. History is the audit trail an advertiser is entitled to: "you billed me for March" must remain answerable after they churn. ★ ONE CURRENT ROW PER (hk, aspect). crm_is_current_ok is the invariant a gate can check independently. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_adnet_slot.nx nx_adnet_crm.nx nx_adnet_crm_gate.nx

imports: nx_syscalls.nxnx_adnet_slot.nx

imported by: nx_adnet_crm_gate.nx

structs

none

consts

none

functions

28func crm_bk_ok(bk: *u8) -> i64 { return aslot_id_ok(bk) }
33func crm_hk(bk: *u8) -> i64
47func crm_hk_hex(h: i64, out: *u8) -> i64
62func crm_catd(dst: *u8, off: i64, v: i64) -> i64
79func crm_hub_row(bk: *u8, load_date: i64, out: *u8, cap: i64) -> i64
95func crm_sat_row(aspect: *u8, bk: *u8, load_date: i64, is_current: i64, payload: *u8, out: *u8, cap: i64) -> i64
134func crm_close_row(aspect: *u8, bk: *u8, load_date: i64, reason: *u8, out: *u8, cap: i64) -> i64
called by 1: main calls 1: crm_sat_row
142func crm_current_count(jrnl: *u8, jlen: i64, aspect: *u8, bk: *u8) -> i64