Changelog — GroupBuy
All notable changes to this app are recorded here. Newest entries on top.
[2026-04-28]
- Initial scaffold. A shared workspace where buyers from anywhere pool orders into a single Onitsha-market shipment, and the truck cost is split fairly across every order in the load.
- Agents (verified Onitsha-based curators) open shipments with a fixed transport cost and a truck capacity. As more buyers join, each buyer's share of the transport cost goes down — until the truck is full and ordering closes automatically.
- Buyers see their delivery share update live before they check out. Once the truck closes, the share locks in so it can never change retroactively.
- Three roles: admin (platform staff), agent (Onitsha curator), buyer (everyone else, the default). Buyers apply through an admin-approval queue to become agents — the brief specifies Onitsha-only curation and that needs vetting.
- Shipments move through a 5-stage status: Loading → In Transit → Arrived → Ready for Pickup → Complete. Buyers can track by shipment or by order.
- Public tracking links:
/p/{agentUuid}/groupbuy/shipment?id=... for any shipment, /p/{buyerUuid}/groupbuy/track?token=... for one buyer's order.
Internal
- Shared-DB app. One DB at
data/shared/groupbuy.db with members(pancho_user_id PK, role, status) as the workspace gate.
helpers.php adds three workhorses: groupbuy_recompute_capacity_used(), groupbuy_recompute_provisional_delivery_share(), and groupbuy_close_ordering_if_full(). The provisional / final delivery-share split is preserved as two columns on orders — provisional shifts as new buyers join; final is set once when the truck closes and never recomputed (audit trail).
- API code uses
(string) $member['pancho_user_id'] everywhere — does not inherit RealtyCast's stale (int) cast pattern that pre-dates the identity migration.