SPEC-APP-CFC Rev 0.7.1 · 2026-08-03

Cane Agency · APP Seriesสถาบันอ้อย · ชุดเอกสาร APP

Application Design Requirements — Cane farmer (grower)ข้อกำหนดการออกแบบแอปพลิเคชัน — ลูกไร่อ้อย

Documentเอกสาร
SPEC-APP-CFC
Versionversion (เวอร์ชัน)
0.7.1 · Draftฉบับร่าง
CapacityCapacity
grower
Surfaceช่องทางใช้งาน
mobile
Updatedปรับปรุงล่าสุด
2026-08-03
Masterเอกสารหลัก
SPEC-APP

1. Scope & perspective1. ขอบเขตและมุมมอง

This is the Cane farmer (grower) perspective of SPEC-APP — the application design requirements slice for the grower capacity (mobile surface). Cross-cutting content lives in the master; the single source of truth is the graph (docs/graph/spec-graph.json). Created by PROP-014 (v0.1.0) as part of the APP perspective split.

นี่คือมุมมอง ลูกไร่อ้อย ของ SPEC-APP — ส่วนข้อกำหนดการออกแบบแอปพลิเคชันสำหรับ capacity grower (ช่องทางใช้งาน mobile) เนื้อหาข้ามมุมมองอยู่ในเอกสารหลัก แหล่งความจริงเดียวคือ graph (docs/graph/spec-graph.json) สร้างโดย PROP-014 (v0.1.0) เป็นส่วนหนึ่งของการแยกมุมมอง APP

2. In this perspective2. สิ่งที่อยู่ในมุมมองนี้

3. Access contract3. สัญญาการเข้าถึง

Rendered from the graph (v0.4.0, PROP-018 P3 — federation.entitlementMatrix · roles · requirements). A tenant's surface entitlement is the UNION over its active capacities and the compiled srf claim must equal it (NFR-15); the roles below are the role set grantable on this capacity's surfaces (one role per surface per membership), and the requirement index lists every functional requirement whose surfaces intersect this capacity's entitlement.

Render จาก graph (v0.4.0, PROP-018 P3 — federation.entitlementMatrix · roles · requirements) สิทธิ์ surface ของ tenant คือ UNION ของ capacity ที่ active และ claim srf ที่คอมไพล์ต้องเท่ากันเสมอ (NFR-15); role ด้านล่างคือชุด role ที่ให้ได้บน surface ของ capacity นี้ (หนึ่ง role ต่อ surface ต่อ membership) และดัชนีข้อกำหนดแสดง functional requirement ทุกข้อที่ surface ตัดกับสิทธิ์ของ capacity นี้

entitled surfacessurface ที่มีสิทธิ์ account · mobile

Role idNameชื่อSurfacesSurfaceNoteหมายเหตุ
ownerOwner (fixed-full role) · เจ้าของevery entitled surfaceทุก surface ที่มีสิทธิ์Fixed-full role — holds every permission, undeletable.Role เต็มแบบตรึง — ถือทุกสิทธิ์ ลบไม่ได้
cane_farmerCane farmer (sub or independent) · ลูกไร่อ้อยmobile—

Functional-requirement index (62)ดัชนี functional requirement (62 ข้อ)

FRRequirementข้อกำหนดSurfacesSurfacePriorityลำดับ
FR-02Field registry — land facts only (area, GPS boundary)mobile · portalP0
FR-04Delivery recording with offline queue (per crop)mobileP0
FR-06Net tonnage captured at the weighbridge and surfaced to the farmer in real time; CCS captured from the government (สอน.) re-note, auto-matched to the delivery — not an on-site same-day labportal · mobileP0
FR-07Statutory two-installment settlement on the initial price: 50% in the mill's next payment cycle after delivery, remaining 50% 30 days later; both installments computed, scheduled and shown at acceptance with itemized deductions; เงินเกี๊ยว / loan offsets deduct from installment 1, spread across multiple cyclesportal · mobileP0
FR-08Sub-farmer network management (CRM)portal · mobileP1
FR-09Notifications (queue, ticket, payment, credit)mobileP1
FR-11Bilingual UI (Thai default, English secondary)website · portal · mobile · ocsbP0
FR-12Dark theme for night operationsmobile · portalP1
FR-13QR ticket scan (paper→digital link)mobileP1
FR-14Tenant provisioning & membership linking (org tenants + individual tenants, invitation/linking) — v6.0: superseded in substance by FR-60…63; retained for traceabilityaccount · portal · websiteP0
FR-15Credit lines & contract-farming items (inputs, services; credit or direct purchase)portal · mobileP0
FR-16Credit request & approval flow (cane farmer → quota farmer / factory)mobile · portalP0
FR-18Cane type (burnt/green) recording & per-mill purchase policymobile · portalP0
FR-21In-app messaging & announcements (quota farmer ↔ sub-farmers)mobile · portalP1
FR-22Season crop registry (field × season; plant/ratoon class; variety; expected yield; carry-forward wizard)mobile · portalP0
FR-23Crop ownership transfer & outright purchase (บาท/ไร่) with append-only deed trailmobile · portalP0
FR-24Virtual cane farmer lifecycle (create, debt ledger, invite, claim with history intact)portal · mobileP0
FR-25Variety & soil reference catalogues (seed + admin curation)portal · mobileP1
FR-26Farm activity log per crop incl. credit-item linkage, offline capturemobile · portalP0
FR-27Weather per field/zone — manual observation (P1) + external feed adapter (P2)mobile · portalP1
FR-28Yield estimation — declared (P1); model-assisted from variety × soil × rain (P2)mobile · portalP1
FR-29Truck registry & assignment at queue entryportal · mobileP1
FR-35Data-sharing consent (PDPA): scoped, time-boxed, revocable; enforced on every cross-tenant readfinance · account · mobile · portalP0
FR-38Loan application, scoring-assisted underwriting & approval workflowfinance · mobileP0
FR-44Contractor onboarding: contractor capacity on an tenant, registered or not (WF-24/25 branch); verification; capacity move keeps the recorddispatch · account · websiteP0
FR-46Contractor directory & search by service, area, price range, rating, endorsement; ranking never sold (NFR-12); mill/quota capacity disclosed on the profile (PROP-005 Section 8.3)mobile · portal · websiteP0
FR-47Service request → quote → award (RFQ + direct booking) anchored to fields, crops and harvest windowsmobile · portal · dispatchP0
FR-49Field progress logging (photos, GPS, quantities), completion hand-off, requester verification incl. weigh-ticket-assisted for harvest/haulagecrew · mobile · portalP0
FR-51Service payments on four rails: escrow lifecycle (fund/hold/release/refund), cash recording, เงินเกี๊ยว-financed items, settlement offset; commission on escrow orders onlydispatch · mobile · portalP0 (escrow P1)
FR-52Verified ratings & reviews: three dimensions + overall stars, one per verified order, public replies, endorsements, moderationmobile · portal · dispatch · websiteP0
FR-55Dispute & mediation flow on work orders; escrow funds held until resolutiondispatch · mobile · portalP1
FR-57Instant dispatch (จองด่วน): broadcast matching with eligibility filters, fixed district reference pricing, accept window with auto re-broadcast, live GPS tracking, no-show strikesmobile · crew · dispatchP1
FR-60One federated sign-in per person (phone OTP + external OIDC providers); tenant-context switcher; exactly one active tenant per token; re-issue on switchaccount · allP0
FR-61Tenant & capacity management: found tenant, request/grant/suspend/revoke capacities, per-capacity verification levels, exclusivity enforcementaccountP0
FR-62Entitlement compiler: srf = union of the entitlement matrix over active capacities; surface switcher renders exactly the claimaccount · allP0
FR-63Memberships & surface-role grants: invite by phone, one role per surface per membership, owner fixed-full, template role sets per capacityaccountP0
FR-64Permission catalogs & role × permission matrix authoring per surface, owner column locked, locked chips for unreachable surfacesaccountP1
FR-65Scope overrides: province / district / mill_zone / quota_network / field_set, equal-or-narrower enforcedaccountP1
FR-66ConsentGrant generalized to tenant↔tenant with capacity-aware scopes; grant/revoke UI on account surfaceaccount · financeP0
FR-68Platform view-as sessions: permission-gated start, persistent banner, dual logging, session recordaccount · portal · dispatchP1
FR-69Migration & merge tooling: tenant→party and user→person mapping, phone-verified assisted person merge, full audit of every mergeaccountP0
FR-70Admission classes: capacities carry `admission` (self_serve | invitation); invitation-only capacities (mill, bank, government, operator) grantable ONLY against an open operator-issued Invitation; self-requests rejected with an explain-and-redirect state (WF-25/28)admin · accountP0
FR-72Representative mills: operator creates & stewards representative mill tenants with preliminary facts; growers/quota may designate one as a delivery destination (Quota.mill_id) for planningadmin · mobile · portalP0
FR-73Representative → active conversion preserves mill_id, tenant_id and every quota/designation/plan link (continuity promise, WF-29)admin · accountP0
FR-79Checkpoint stamp capture — register a long-haul truck into the factory system and match it to a deliveryportal · mobileP1
FR-82Step release — upfront % per delivery at payment due; withheld balance on contract-volume fulfilment; cash / settlement-offset / ledgerportal · mobileP0
FR-83Quota→cane-farmer onward relay recorded against the factory delivery receipt (cash / ledger)portal · mobileP1
FR-84Confidentiality controls — hard wall from the government surface + ConsentGrant scope strategic_terms for private cross-tenant sharingportal · accountP0
FR-85Strategic-pricing statements & exports per agreement / season, visible only to the mill and its counterpartyportal · mobileP1
FR-86Agreement renegotiation — new revision effective the next day, non-retroactive to posted accruals; and multiple concurrent per-season agreements per counterpartyportal · mobileP1
FR-87Preset chart of accounts per tenant capacity (mill / quota / grower / contractor); seed system_flag accounts + user-added custom accountsportal · mobile · dispatchP0
FR-88Auto-posting from settlement, เงินเกี๊ยว, service payment, loan & PROP-009 strategic events — balanced, idempotent, source-attributedportal · mobileP0
FR-89Receivables & payables — auto/manual invoices, receipts, payment vouchers, partial settlement, agingportal · mobileP1
FR-92Statements — P&L, balance sheet, trial balance, cash flow; per period/season; append-only frozen snapshotsportal · mobile · financeP1
FR-94Confidential inheritance — PROP-009 strategic postings visible in the owner's books but excluded from any statement shared to the government capacityportal · accountP0
FR-95Statutory due-date engine: compute each installment's due_date from MillPaymentSchedule (cycle_days, first_pct, second_offset_days); the platform must not post earlier than the statutory scheduleportal · mobileP0
FR-97Instant tonnage: the delivered net weight is visible to the farmer (mobile) and quota farmer (portal) at weigh-out, before CCS or paymentmobile · portalP0
FR-98CCS re-note ingestion & auto-match: ingest the government re-note (MVP: mill upload of the สอน. paper/Excel), auto-match each row to its delivery on the %N-### tag, surface CCS online on received_at; a manual-match fallback with an audit trailportal · mobileP0
FR-99Final-price true-up: at season end, settle (final − initial price) × tonnage per farmer; the factory pays the farmer when positive; when negative the Cane & Sugar Fund (CSF) reimburses the factory, subject to fund availabilityportal · mobileP1
FR-105Per-tenant accounting basis: BooksProfile.default_basis seeds each new FiscalPeriod (cash | accrual), editable by the books owner; a change applies to the next open period only, never a closed or in-flight one (reproducibility, NFR-25)portal · mobile · accountP1
FR-106Simplified single-column cash-book view (ledger_view = cash_book) showing money-in / money-out while the platform posts full balanced double-entry underneath; default for growers, toggleable to double_entrymobile · portalP1
FR-107Books editions — unified vs split AR/AP + cash surfaces: mill fixed split, grower fixed unified, quota & contractor upgradeable to split via the operator-granted books_split entitlement; books_edition is a derived read, not a data forkportal · admin · accountP2

Full requirement definitions and the non-functional set live in SPEC-APP Sections 4–6 (unchanged addresses).

นิยามข้อกำหนดฉบับเต็มและชุด non-functional อยู่ใน SPEC-APP ข้อ 4–6 (ตำแหน่งเดิม)

Applied — PROP-050 · spec v0.28.0apply แล้ว — PROP-050 · spec v0.28.0

PROP-050 (spec v0.28.0) — cost centres to field & crop level: the farmer's plantation ledger. The grower's books gain a cost dimension, not a second book: five columns on every journal line (centre_id · cost_class · alloc_id · qty · qty_unit) over a derived CostCentre register — holding → field → crop cycle → crop, with asset and overhead-pool attachments and no farmer-defined nesting. The CropCycle (one planting plus its ratoons) becomes the unit of return and carries the establishment asset, capitalised at first revenue, amortised on units of production and impaired only with a named cause and a date. Field capture is two decisions and under fifteen seconds, works offline, and opens from four doors into one sheet; the receipt is photographed into the PROP-048 document vault and the phone releases the file only once the cloud confirms durable storage. Eight artifacts S-1…S-8 — crop P&L · cycle statement · field lifetime · consolidated plantation · cost structure with a k-anonymous benchmark · settlement per crop · practice comparison · scenario & replant signal — every one computed from posted lines only and printing its own uncertainty. Capture, evidence and S-1/S-2/S-3/S-4/S-6 sit in the base grower entitlement, free and permanent; S-5/S-7/S-8 form the analytics tier. Owned land carries no imputed rent and family labour is off by default, so the bottom line is named return to land and own labour. FR-267…312 · NFR-87…106 · WF-96…111. PROP-048's CropExpense is withdrawn as a store and becomes a capture form that posts.

PROP-050 (spec v0.28.0) — ศูนย์ต้นทุนถึงระดับแปลงและอ้อยรุ่น: สมุดต้นทุนไร่ของชาวไร่ สมุดบัญชีของชาวไร่ได้ มิติต้นทุน ไม่ใช่สมุดเล่มที่สอง: ห้าคอลัมน์บนทุกบรรทัดบัญชี (centre_id · cost_class · alloc_id · qty · qty_unit) บนทะเบียน CostCentre ที่ระบบสร้างเอง — ทั้งไร่ → แปลง → รอบปลูก → อ้อยรุ่น พร้อมส่วนที่มาเกาะคือสินทรัพย์และกองต้นทุน และไม่มีการซ้อนชั้นที่ชาวไร่กำหนดเอง CropCycle (การปลูกหนึ่งครั้งพร้อมอ้อยตอ) เป็นหน่วยของผลตอบแทนและถือสินทรัพย์ต้นทุนก่อตั้ง ซึ่งบันทึกเป็นสินทรัพย์เมื่อมีรายได้ครั้งแรก ตัดจำหน่ายตามหน่วยผลผลิต และด้อยค่าได้เฉพาะเมื่อมีสาเหตุและวันที่ระบุ การบันทึกหน้างานใช้การตัดสินใจสองครั้ง ไม่เกินสิบห้าวินาที ทำงานออฟไลน์ และเปิดได้จากสี่ประตูเข้าสู่แบบเดียวกัน ใบเสร็จถูกถ่ายเก็บเข้าคลังเอกสารของ PROP-048 และโทรศัพท์ปล่อยไฟล์ออกเมื่อคลาวด์ยืนยันแล้วเท่านั้น ชิ้นงานแปดชิ้น S-1…S-8 คำนวณจากบรรทัดที่ลงบัญชีแล้วเท่านั้น และแสดงความไม่แน่นอนของตัวเองทุกชิ้น การบันทึก หลักฐาน และ S-1/S-2/S-3/S-4/S-6 อยู่ในสิทธิพื้นฐานของชาวไร่ ฟรีถาวร ส่วน S-5/S-7/S-8 เป็นรุ่นวิเคราะห์ ที่ดินของตนเองไม่คิดค่าเช่าโดยอนุมาน และแรงงานครอบครัวปิดไว้เป็นค่าตั้งต้น บรรทัดสุดท้ายจึงเรียกว่า ผลตอบแทนต่อที่ดินและแรงงานตนเอง FR-267…312 · NFR-87…106 · WF-96…111 และ CropExpense ของ PROP-048 ถูกถอนออกจากการเป็นที่เก็บข้อมูล กลายเป็นแบบบันทึกที่ลงรายการบัญชี

4. Related documents4. เอกสารที่เกี่ยวข้อง

Revision historyประวัติการแก้ไข

RevฉบับDateวันที่Changeการเปลี่ยนแปลง
0.1.02026-07-11Initial split from the area master (PROP-014, spec v0.1.0). Semantic versioning restarted at 0.1.0; the legacy master line reached v12.0. States its scope and defers depth to the graph, to deepen in later patches.แยกจากเอกสารหลัก (PROP-014, spec v0.1.0) รีสตาร์ท semantic versioning ที่ 0.1.0 (สายเดิมถึง v12.0) ระบุขอบเขตและอ้างอิงรายละเอียดจาก graph จะลงลึกในแพตช์ถัดไป
0.2.02026-07-13PROP-018 P3 (spec v0.4.0): generated Access contract (Section 3) — entitled surfaces, grantable role set and the functional-requirement index binding this capacity, rendered from the graph (federation.entitlementMatrix · roles · requirements).PROP-018 P3 (spec v0.4.0): เพิ่มสัญญาการเข้าถึงที่ generate (ข้อ 3) — surface ที่มีสิทธิ์ ชุด role ที่ให้ได้ และดัชนี functional requirement ที่ผูกพัน render จาก graph (federation.entitlementMatrix · roles · requirements)
0.3.02026-07-27PROP-050 (spec v0.28.0, approved & applied 27 Jul 2026; all 26 OQs client-closed): cost centres to field & crop level — the cost dimension on the ledger, the crop cycle and its establishment asset, declared allocation, evidence in the cloud, the network lending branch, FR-267…312 / NFR-87…106 / WF-96…111PROP-050 (spec v0.28.0 อนุมัติและ apply 27 ก.ค. 2569; ปิดคำถามเปิดครบ 26 ข้อ): ศูนย์ต้นทุนถึงระดับแปลงและอ้อยรุ่น — มิติต้นทุนบนสมุดบัญชี รอบปลูกและสินทรัพย์ต้นทุนก่อตั้ง การปันส่วนที่ประกาศไว้ หลักฐานบนคลาวด์ กิ่งการให้ยืมของเครือข่าย FR-267…312 / NFR-87…106 / WF-96…111
0.4.02026-07-28PROP-060 applied — spec v0.32.0. FR-29 re-worded to "at queue entry"; the farmer-side V1 queue is QL-0 only (no remote join, no booking, no score) and NFR-111 makes the day’s capacity, headroom and freeze readable before cutting.apply PROP-060 — spec v0.32.0 แก้ถ้อยคำ FR-29 เป็น "ตอนเข้าคิว"; คิวฝั่งชาวไร่ใน V1 เป็น QL-0 เท่านั้น และ NFR-111 ให้อ่านกำลังรับก่อนตัดอ้อย
0.5.02026-08-01PROP-069 approved & applied — spec v0.44.0. Section 2 records the re-cut of the farmer surface into five sections (FR-384…FR-390, NFR-140, convention A-77): หน้าแรก · ไร่ · การเงิน · เครือข่าย · บัญชี, glyph above label, one bar shape in every capacity, ld-home absorbed into เครือข่าย, and the core budget re-counted against working screens with the five fronts on the new shell tier. Screen-level detail: SPEC-UIX-CFC Section 11.1.PROP-069 อนุมัติและ apply — spec v0.44.0 ข้อ 2 บันทึกการจัดใหม่ของ surface ชาวไร่เป็นห้าหมวด (FR-384…FR-390, NFR-140, ธรรมเนียม A-77): หน้าแรก · ไร่ · การเงิน · เครือข่าย · บัญชี glyph เหนือป้าย แถบรูปเดียวทุก capacity รวม ld-home เข้า เครือข่าย และนับงบ core ใหม่กับหน้าจอทำงานโดยหน้าหน้าหมวดอยู่ชั้น shell ใหม่ รายละเอียดระดับหน้าจอ: SPEC-UIX-CFC ข้อ 11.1
0.6.02026-08-03PROP-075 approved & applied — spec v0.46.0. Editorial: the customer-profile line stops calling a tenant “an individual or organization tenant” — a tenant is a container (A-81, R-CONTAINER) and the registered legal body is a Department carrying a legal_form. department_id / department_path → department_* where cited.PROP-075 อนุมัติและ apply — spec v0.46.0 เชิงบรรณาธิการ: เลิกเรียก tenant ว่า tenant แบบบุคคลหรือองค์กร
0.7.02026-08-03PROP-073 (spec v0.47.0): one word — Tenant. Party → Tenant, party_id (and every prefixed form) → tenant_id, PartyCapacity/PartyQualification/PartyFounded → Tenant*, party context/switcher → tenant context/switcher, cross-party → cross-tenant, organisation → organization, and ผู้เล่น retired as the Thai gloss (the Latin word tenant instead, R-THAI). Hold list untouched: counterparty · third party · tripartite working group · Person*/person_id; display codes and token claims were held by R-NULL for one release and then MOVED at v0.47.1 on client decision (C-1), because no token has ever been SIGNED — no auth exists in the built ocsb/ocsf prototypes — and the only printed codes were eight fixture strings in apps/ocsf/fund-shell.jsx, swept in the same pass: PTY- → TNT-, TCA- → TCA-, TQL- → TQL-, claim tnt → tnt, claim dep → dep. Carried in the same pass: the PROP-075 rectification — the retired directory noun domain becomes department (A-82 R-ONETREE), so one tree has one name.PROP-073 (spec v0.47.0): คำเดียว — Tenant Party → Tenant, party_id ทุกรูป → tenant_id, PartyCapacity/PartyQualification/PartyFounded → Tenant*, cross-party → cross-tenant และเลิกใช้ ผู้เล่น เป็นคำแทนวัตถุนี้ในภาษาไทย (ใช้คำละติน tenant ตาม R-THAI) รายการห้ามแตะไม่ถูกแตะ: คู่สัญญา · third party · คณะทำงานไตรภาคี · Person*/person_id; รหัสแสดงผลและ claim ถูก R-NULL คงไว้หนึ่งรุ่น แล้วย้ายที่ v0.47.1 ตามการตัดสินของลูกค้า (C-1) เพราะยังไม่มีโทเคนใดถูกลงนาม (ต้นแบบ ocsb/ocsf ที่สร้างแล้วไม่มีระบบ auth) และรหัสที่พิมพ์มีเพียงแปดสายใน apps/ocsf/fund-shell.jsx ซึ่งถูกกวาดในรอบเดียวกัน: PTY- → TNT-, TCA- → TCA-, TQL- → TQL-, claim tnt → tnt, claim dep → dep รอบเดียวกันแก้ค้างจาก PROP-075: คำนามไดเรกทอรีที่เลิกใช้ domain เปลี่ยนเป็น department (A-82 R-ONETREE)
0.7.12026-08-03PROP-073 PATCH 1 (spec v0.47.1 / v0.47.2 / v0.47.3 as applicable): the identifiers v0.47.0 had held, moved on client decision. PTY-######## → TNT-######## · PCA-######## → TCA-######## · PQL-######## → TQL-######## · token claim pty → tnt · token claim dom → dep (v0.47.1, C-1 — R-NULL had held them as a stored VALUE and a wire format; reversed because no token has ever been signed and the only printed codes were fixture strings). quota_org_officer → quota_officer · lead_org_officer → lead_officer (v0.47.2, C-2 — org is organization abbreviated, not a resemblance). The retired role LABEL swept as a phrase family and quota organization naming the tenant → quota group / กลุ่มโควตา (v0.47.3). All retired forms are in the FR-396 crosswalk and refused in new text by NFR-142.PROP-073 PATCH 1 (spec v0.47.1 / v0.47.2 / v0.47.3 ตามที่เกี่ยวข้อง): ตัวระบุที่ v0.47.0 คงไว้ ถูกย้ายตามการตัดสินของลูกค้า PTY- → TNT- · PCA- → TCA- · PQL- → TQL- · claim pty → tnt · claim dom → dep (v0.47.1, C-1) · quota_org_officer → quota_officer · lead_org_officer → lead_officer (v0.47.2, C-2) · ป้ายชื่อบทบาทที่เลิกใช้และ องค์กรโควตา ที่เรียก tenant → กลุ่มโควตา (v0.47.3) ทุกรูปที่เลิกใช้อยู่ในตารางแปลง FR-396