code wiki / _hdl_build / nx_cms_ecommerce.nx

nx_cms_ecommerce.nx

buildroot/runtime/_hdl_build/nx_cms_ecommerce.nx

2996 B61 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic cms
docsdependenciesstructsconstsfunctions

about

nx_cms_ecommerce.nx -- CMS ECOMMERCE core (sovereign cart, exact money, inventory, order FSM). The WooCommerce class, made Nishi-native: ALL money is INTEGER CENTS (basis-point tax/discount) so there is ZERO floating-point rounding drift (the exceed angle -- float money is a real WooCommerce/Stripe pain), inventory is OVERSELL-PROOF (stock can never go negative, an over-quantity is refused not clamped), and the order lifecycle is an EXACT state machine. Pure deterministic integer logic -- the payment gateway is the only last-mile boundary; the commerce core is sovereign. Rates are the data-driven seam (rule 11). license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_cms_ecommerce.nx nx_aw_devserver.nx nx_cms_ecommerce_gate.nx

imports: nx_syscalls.nx

imported by: nx_aw_devserver.nxnx_cms_ecommerce_gate.nx

structs

none

consts

11const NX_ORD_CART: i64 = 0
12const NX_ORD_PENDING: i64 = 1 // placed, awaiting payment
13const NX_ORD_PAID: i64 = 2
14const NX_ORD_SHIPPED: i64 = 3
15const NX_ORD_CANCELLED: i64 = 4
17const NX_EC_BPS: i64 = 10000 // basis-point denominator (100.00% = 10000 bps)

functions

20func ec_line_total(unit_cents: i64, qty: i64) -> i64 { return unit_cents * qty }
23func ec_cart_subtotal(unit_cents: *i64, qty: *i64, n: i64) -> i64
called by 1: main calls 1: ec_line_total
31func ec_apply_tax(subtotal_cents: i64, tax_bps: i64) -> i64
called by 1: main
36func ec_apply_discount(subtotal_cents: i64, discount_bps: i64) -> i64
called by 1: main
41func ec_stock_ok(available: i64, requested: i64) -> i64
48func ec_decrement_stock(available: i64, requested: i64) -> i64
called by 1: main calls 1: ec_stock_ok
54func ec_order_can_transition(from: i64, to: i64) -> i64
called by 1: main