code wiki / _hdl_build / nx_inventory.nx

nx_inventory.nx

buildroot/runtime/_hdl_build/nx_inventory.nx

12407 B317 linesdepth 3pulls 4 transitivereach 9 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_inventory.nx -- LIB: the UNIVERSAL inventory / supply-chain substrate (operator: "the inventory and other systems hardware-rung-up to manage any and all supply chains -- cataloging for a will all the things a person owns, what's in the pantry and when it's expiring, what can I make, meal planning"). ONE domain-agnostic item store; the pantry, an estate/will asset catalog, and any other supply chain are just different `domain`s over the same engine (the inventory analogue of the universal builder). Sovereign (seg-store, NO TSV), INTEGER only (quantities are counts; money is CENTS -- no float), additive (history kept; consume = a new version). Schema (prefix passed in, e.g. knowledge/store/inv-): inv:<domain>:ids -> TAB list of item ids in the domain inv:<domain>:item:<id> -> name <t> category <t> qty <t> unit <t> location <t> value_cents <t> expiry_day <t> owner (expiry_day = integer day number; 0 = non-perishable. owner = beneficiary for a will, or "" for a pantry.) license_tier: ORIGINAL

dependencies 3 imports · 9 importers

nx_seg_store.nx nx_ad_serve.nx nx_syscalls.nx nx_inventory.nx nx_estate.nx nx_estate_gate.nx nx_household.nx nx_household_gate.nx nx_inventory_gate.nx nx_pantry.nx nx_pantry_meal_gate.nx nx_reorder_gate.nx nx_shopping.nx

imports: nx_seg_store.nxnx_ad_serve.nxnx_syscalls.nx

imported by: nx_estate.nxnx_estate_gate.nxnx_household.nxnx_household_gate.nxnx_inventory_gate.nxnx_pantry.nxnx_pantry_meal_gate.nxnx_reorder_gate.nxnx_shopping.nx

structs

none

consts

16const IV_TAB: i64 = 9

functions

19func iv_field(rec: *u8, rlen: i64, f: i64, out: *u8) -> i64
37func iv_atoi(s: *u8, slen: i64) -> i64
46func iv_num(dst: *u8, off: i64, v: i64) -> i64
58func iv_money(dst: *u8, off: i64, cents: i64) -> i64
69func iv_item_key(domain: *u8, id: *u8, out: *u8) -> i64
called by 2: iv_getiv_add calls 1: as_append
78func iv_ids_key(domain: *u8, out: *u8) -> i64
called by 2: iv_addiv_list calls 1: as_append
86func iv_seg_next(prefix: *u8) -> i64
92func iv_streq_store(prefix: *u8, key: *u8, val: *u8, vlen: i64) -> i64
called by 2: iv_addiv_set_par calls 2: sys_mmapss_get
104func iv_id_in_list(buf: *u8, len: i64, id: *u8) -> i64
called by 1: iv_add calls 1: as_len
127func iv_get(prefix: *u8, domain: *u8, id: *u8, ptrout: *i64, lenout: *i64) -> i64
133func iv_field_of(prefix: *u8, domain: *u8, id: *u8, f: i64, out: *u8) -> i64
140func iv_int_field(prefix: *u8, domain: *u8, id: *u8, f: i64) -> i64
145func iv_qty(prefix: *u8, domain: *u8, id: *u8) -> i64 { return iv_int_field(prefix, domain, id, 2) }
146func iv_value(prefix: *u8, domain: *u8, id: *u8) -> i64 { return iv_int_field(prefix, domain, id, 5) }
147func iv_expiry(prefix: *u8, domain: *u8, id: *u8) -> i64 { return iv_int_field(prefix, domain, id, 6) }
150func iv_add(prefix: *u8, domain: *u8, id: *u8, name: *u8, cat: *u8, qty: i64, unit: *u8, loc: *u8, value: i64, expiry: i64, owner: *u8) -> i64
192func iv_list(prefix: *u8, domain: *u8, outids: *i64) -> i64
224func iv_value_total(prefix: *u8, domain: *u8) -> i64
234func iv_expiring(prefix: *u8, domain: *u8, as_of: i64, within: i64, outids: *i64) -> i64
248func iv_consume(prefix: *u8, domain: *u8, id: *u8, nconsume: i64) -> i64
272func iv_par_key(domain: *u8, id: *u8, out: *u8) -> i64
called by 2: iv_set_pariv_get_par calls 1: as_append
281func iv_set_par(prefix: *u8, domain: *u8, id: *u8, par: i64) -> i64
294func iv_get_par(prefix: *u8, domain: *u8, id: *u8) -> i64
303func iv_low_stock(prefix: *u8, domain: *u8, out_ids: *i64, out_need: *i64) -> i64