Introduction

Stock

Cloudflare Worker for per-site stock count lists and manager-run stock takes. Platform API at apis/stock, mounted on the Venue, Garage, and Maya Assets gateways.

Authentication is required. User types: admin, area-manager, manager, member (from Directory memberships for service stock). Garage roles on garage-crm map onto those types. Directory tokens omit actorType.


What it owns

  • Per-site count lists (stock_items) in D1
  • Stock take sessions (stock_takes) and counted line items (stock_take_lines)
  • Stock sites. locationId and brandId are opaque ids from the calling site

What it does not own

  • Today's task board (Venue) — stock counts can be scheduled as Venue tasks; completion is client-side in v1
  • Purchasing or receipts (Expense)
  • Membership assignment (Directory)

Roles

RoleCount listStart / submit takesHistory
member———
area-managerread/writeread onlyread
managerread/writeread/write/submitread
adminallallall + Directory ingest

Stack

Hono, Zod, OpenAPI, D1. API base path /v1. Reached on the gateway as /stock/*.

See the Stock API reference.