ReviewOS

stacks/smakelo

B2.7: Farms - shop mode and CSA subscriptions

#10
Closed chris opened this 9 days ago ·
9 days ago

Part of #1.

  • Business capability shop: product catalog presentation (no prep times/tables), pickup/delivery-day picker on checkout
  • CsaPlan (weekly box tiers) + CsaSubscription via @stacksjs/payments Stripe subscriptions (sandbox); pause/skip week; delivery-day scheduling feeding the dispatch pipeline
  • Tests: subscription lifecycle against the local subscriptions table, schedule generation
9 days ago

Done and verified in production: /shares, with the shares themselves on the farm pages (Cardoon Farm).

Why it is not a subscription to a product. The grower does not know in March what will be ready in July. A CsaPlan promises a size, a cadence and a packing day, and deliberately promises no contents; the copy on the card says so. Modelling it as a recurring order of fixed line items would misdescribe the arrangement and break in the first bad year, which is the season a farm most needs its members.

Pausing is a first-class state with a date on it. Members go away in August, and a farm that reads a holiday as a cancellation loses the member and packs a box nobody collects. "Pause indefinitely" is refused for the same reason: the farm ends up holding a share nobody has told them about. Resuming moves the next box to the following packing day, so somebody returning mid-week is not told their box came yesterday.

Five shares seeded across Cardoon Farm and Two Crows Orchard, including a fortnightly one for people who still have chard.

A bug caught in testing: the next-box date was formatted with toISOString, which converts to UTC first. West of Greenwich any evening is already tomorrow in UTC, so every member was told their Wednesday box came on Thursday. It now formats from local parts, and the test walks every weekday from every weekday so it cannot come back.

Verified live: joined a share through the browser (first box 2026-09-02, a Wednesday), and the membership appears on /shares with pause, resume and leave. Ownership is checked on every state change, so a share is not somebody else's to pause.

Not wired: charging for a share. That waits on Stripe test keys, same as checkout (see #12).

Sign in to comment on this issue.