Data Model — Sugar Factory Perspectivemodel ข้อมูล — มุมมองโรงงานน้ำตาล
Documentเอกสาร
SPEC-ERD-MILL
Versionversion (เวอร์ชัน)
0.27.0 · Draftฉบับร่าง
Updatedปรับปรุงล่าสุด
2026-08-20
Parentเอกสารแม่
SPEC-ERD
Perspectiveมุมมอง
Sugar factory (โรงงานน้ำตาล)โรงงานน้ำตาล
Siblingsเอกสารพี่น้อง
SPEC-DDD-MILL · SPEC-PWF-MILL
1. Purpose1. วัตถุประสงค์
This document reads the platform data model from the sugar factory’s side — the tenant that runs intake, the weighbridge, government re-note CCS intake (%N-### auto-match) and settlement. It owns the operational core; every definition mirrors SPEC-ERD and the graph.
Scoped view of the platform model from this perspective, rendered from the graph (entities · relationships · dataModeling, v0.4.0). Solid boxes are entities documented at full depth in this family — bold = primary key, gold = foreign key. Dashed boxes are shared entities; the label names their home document. Cardinalities read at each line end.
Fig. 1 — The operational core — deliveries book into a CrushingDay under capacity and burnt-cap guards, weigh in/out on an immutable ticket, and receive CCS from the สอน. re-note auto-matched on the %N-### tag.ภาพที่ 1 — แกนปฏิบัติการ — การส่งมอบจองเข้าวันหีบภายใต้เพดานกำลังและสัดส่วนไฟไหม้ ชั่งเข้า/ออกด้วยบัตรชั่งที่แก้ไม่ได้ และรับ CCS จาก re-note ของ สอน. จับคู่อัตโนมัติด้วยแท็ก %N-###Fig. 2 — Settlement — base × net + CCS premium ± cane-type adjustment − deductions per delivery, split into the statutory two installments from MillPaymentSchedule, with the season-end final-price true-up.ภาพที่ 2 — การปิดงวด — ฐาน × สุทธิ + พรีเมียม CCS ± ส่วนต่างประเภทอ้อย − การหัก ต่อการส่งมอบ แบ่งจ่ายสองงวดตามกฎหมายจาก MillPaymentSchedule พร้อมการสรุปราคาสุดท้ายปลายฤดูFig. 3 — ค่าอ้อยกลยุทธ์ — checkpoint stamps and volume-tiered rates, or a fixed-price contract; accruals post per delivery (idempotent) with the 25/50/75 step release. No edge to regulation.ภาพที่ 3 — ค่าอ้อยกลยุทธ์ — การประทับตราที่จุดตรวจกับอัตราแบ่งช่วงปริมาณ หรือสัญญาเหมาจ่าย; การสะสมลงต่อการส่งมอบ (idempotent) พร้อมการจ่ายเป็นขั้น 25/50/75 ไม่มีเส้นเชื่อมไป regulationFig. 4 — The general-ledger family homed here (PROP-010/011) — template-seeded chart, balanced append-only journal, and the AR/AP document set; every money-event auto-posts.ภาพที่ 4 — ตระกูลบัญชีแยกประเภทที่ home อยู่ฉบับนี้ (PROP-010/011) — ผังบัญชี seed จาก template, สมุดรายวันดุลแบบ append-only และชุดเอกสาร AR/AP; ทุกเหตุการณ์เงินลงบัญชีอัตโนมัติFig. 5 — Cash & bank reconciliation and period close — statements are frozen snapshots from closed periods, shared to a bank only via ConsentGrant scope books (the สอน. share excludes strategic postings, FR-94).ภาพที่ 5 — การกระทบยอดเงินสด/ธนาคารและการปิดงวดบัญชี — งบเป็น snapshot ตรึงจากงวดที่ปิดแล้ว แบ่งให้ธนาคารผ่าน ConsentGrant scope books เท่านั้น (ฉบับที่ให้ สอน. ตัดการลงกลยุทธ์, FR-94)
The operating day: capacity, booked/weighed tonnage, burnt-share cap and intake so far.วันเดินเครื่อง: กำลังหีบ ตันจอง/ชั่งแล้ว เพดานสัดส่วนอ้อยไฟไหม้ และยอดรับเข้า
One per mill per date; booked_t ≤ crush_capacity_t; burnt_intake_t / weighed_t ≤ burnt_cap_pct; closing derives the nightly compliance record.หนึ่งรายการต่อโรงงานต่อวัน; booked_t ≤ crush_capacity_t; burnt_intake_t / weighed_t ≤ burnt_cap_pct; การปิดวันสร้างระเบียนกำกับรายคืน
Delivery · WeighTicket
The truck at my gate: crop-traceable load, cane type + harvest method confirmed at weigh-in, immutable ticket.รถที่ประตูโรงงาน: เที่ยวที่สอบย้อนถึงอ้อยได้ ยืนยันประเภทอ้อย + วิธีเก็บเกี่ยวตอนชั่ง บัตรชั่งแก้ไขไม่ได้
net_kg = gross − tare > 0; one open delivery per truck; re-weighs supersede, never edit; quota must belong to the crop owner’s chain.net_kg = gross − tare > 0; รถหนึ่งคันมีการส่งมอบเปิดหนึ่งรายการ; ชั่งใหม่ออกบัตรแทน; โควตาต้องอยู่ในสายเจ้าของอ้อย
QualityTest ผลตรวจ CCS
Per-truck CCS from the government (สอน.) re-note I ingest — auto-matched to the delivery on the %N-### tag; CCS & trash %, provisional then confirmed. No mill lab.ค่า CCS รายคันรถจากรีโน้ตของรัฐ (สอน.) ที่ฉันนำเข้า — จับคู่กับการส่งมอบด้วยแท็ก %N-###; CCS และ % สิ่งปนเปื้อน ค่า provisional แล้ว confirmed ไม่มีแล็บของโรงงาน
Exactly one valid test per delivery; re-tests supersede; CCS plausibility 5–16 else flagged.หนึ่งผลที่ใช้ได้ต่อการส่งมอบ; ตรวจซ้ำออกผลแทน; CCS สมเหตุสมผล 5–16 มิฉะนั้นติดธง
CanePurchasePolicy
My season pricing levers: burnt deduction, green incentive, daily burnt cap, contamination deduction.คันโยกราคาประจำฤดู: หักไฟไหม้ จูงใจอ้อยสด เพดานไฟไหม้รายวัน หักอ้อยปนเปื้อน
One policy per mill per season; defaults every CrushingDay’s cap.หนึ่งนโยบายต่อโรงงานต่อฤดู; เป็นค่าตั้งต้นเพดานของทุกวันหีบ
Immutable once approved; batch total = Σ items; a delivery settles at most once — adjustments post as new items.แก้ไขไม่ได้เมื่ออนุมัติ; ยอดชุด = Σ รายการ; การส่งมอบปิดงวดครั้งเดียว — การปรับเป็นรายการใหม่
Truck · Mill
Fleet registry (any owner type) and my mill’s capacity facts.ทะเบียนรถ (เจ้าของทุกประเภท) และข้อมูลกำลังผลิตของโรงงาน
Plate snapshotted per delivery (truck_reg_snap).snapshot (สแนปช็อต) ทะเบียนต่อการส่งมอบ (truck_reg_snap)
StampCheckpoint · CheckpointRate · StampEventv8.0
Long-haul cane stamped into my factory system before the mill; per-farmer, volume-tiered extra ฿/t; mill- or platform-operated.อ้อยทางไกลถูกประทับตราเข้าระบบโรงงานก่อนถึงโรงงาน; ฿/ตันเพิ่มรายชาวไร่แบ่งตามช่วงปริมาณ; โรงงานหรือ platform ดำเนินการ
Rates append-only supersede (NFR-22); a stamp matches a delivery at weigh-in.อัตรา append-only แทนที่ (NFR-22); การประทับตราจับคู่การส่งมอบเมื่อชั่ง
The confidential ค่าอ้อยกลยุทธ์ I pay ON TOP of the statutory price — checkpoint or fixed_price (เหมาจ่าย), 25/50/75 step release.ค่าอ้อยกลยุทธ์ที่เป็นความลับที่จ่ายเพิ่มจากราคาตามกฎหมาย — checkpoint หรือ fixed_price (เหมาจ่าย) จ่ายเป็นงวด 25/50/75
Accrual off the weigh-ticket net, append-only & idempotent (NFR-22); never a PaymentItem component, no edge to สอน. (NFR-21); renegotiation non-retroactive; ledger releases post to books.สะสมจากน้ำหนักสุทธิ append-only และ idempotent (NFR-22); ไม่เป็นส่วนของ PaymentItem ไม่มีเส้นไป สอน. (NFR-21); เจรจาใหม่ไม่ย้อนหลัง; การจ่ายแบบ ledger ลง books
My full financial system (PROP-010); BooksProfile (v12.0, PROP-011) fixes my books to the split edition with an accrual default: a seeded mill chart, AR/AP against growers & suppliers, cash/bank reconciliation, monthly + season fiscal periods and the four statements. Every settlement, เงินเกี๊ยว, loan and strategic release auto-posts here.ระบบการเงินเต็มของโรงงาน (PROP-010); BooksProfile (v12.0, PROP-011) ตั้งสมุดของโรงงานเป็นรุ่น split เกณฑ์คงค้าง: ผังโรงงานที่ seed มา AR/AP ต่อชาวไร่และผู้ขาย การกระทบยอดเงินสด/ธนาคาร งวดบัญชีรายเดือน+รายฤดู และงบสี่ประเภท ทุกการปิดยอด เงินเกี๊ยว สินเชื่อ และการจ่ายกลยุทธ์ลงอัตโนมัติที่นี่
Every JournalEntry balances; auto-postings idempotent & source-attributed (NFR-24); statements are frozen snapshots shared to a bank only via ConsentGrant scope books; a statement shared to สอน. excludes strategic postings (FR-94, NFR-26).ทุก JournalEntry ดุล; ลงอัตโนมัติ idempotent ระบุที่มา (NFR-24); งบเป็น snapshot ตรึง แบ่งให้ธนาคารผ่าน ConsentGrant scope books; งบที่ให้ สอน. ตัดการลงกลยุทธ์ออก (FR-94, NFR-26)
Eight mill-owned entities land with the queue train (PROP-020 + PROP-024). Attributes and relationship rules are canonical in the graph; persistence profiles (table/pk/fks/indexes/mutability/PDPA) for these entities ride the Q5 back-audit with the v0.7.0 batch. Digest:
The digital queue ticket — its own aggregate preceding the Delivery (channel walk_in | remote | booking).บัตรคิวดิจิทัล — aggregate ของตัวเอง มาก่อน Delivery (channel walk_in | remote | booking)
quota_id + plate_snap + cane_type mandatory at issuance (A-51/Q-05); seq_no unique per mill/day/lane instance (re-scoped v0.33.0, PROP-061); the identity with Delivery.coin_no is dropped — the coin stays a weighbridge fact; one open ticket per truck per mill; qr_token account-free status view; remote provenance crop_id / checkpoint_id / join_distance_km (Q-06); slot_id on the booking channel. v0.40.0 (PROP-064): +lead_tenant_id? +lead_mandate_id? — the season-one network attribution (FR-349), written once at row creation from the OWNER's active lead and that lead's mandate (never the device holder — A-71 records that separately), immutable thereafter, null under a quota farmer, unreachable under NFR-109, PDPA confidential_wall. The two columns join this entity's pending v0.12.0 dataModeling profile batch.quota_id + plate_snap + cane_type บังคับตอนออกบัตร (A-51/Q-05); seq_no ไม่ซ้ำต่อโรงงาน/วัน/แถวที่เปิดจริง (เปลี่ยนขอบเขต v0.33.0, PROP-061) และตัดความเท่ากันกับ Delivery.coin_no — เหรียญยังเป็นข้อเท็จจริงของห้องชั่ง; หนึ่งบัตรเปิดต่อรถต่อโรงงาน; qr_token หน้าสถานะไม่ต้องมีบัญชี; ที่มาระยะไกล crop_id / checkpoint_id / join_distance_km (Q-06); slot_id บนช่องจอง v0.40.0 (PROP-064): +lead_tenant_id? +lead_mandate_id? — การระบุที่มาเชิงเครือข่ายในฤดูแรก (FR-349) เขียนครั้งเดียวตอนสร้างแถวจากหัวตันที่ใช้อยู่ของเจ้าของและ mandate ของหัวตันนั้น (ไม่ใช่ผู้ถือเครื่อง ซึ่ง A-71 เก็บแยก) แก้ภายหลังไม่ได้ เป็นค่าว่างเมื่ออยู่ใต้หัวหน้าโควต้า เข้าถึงไม่ได้ตาม NFR-109 จัดชั้น PDPA เป็น confidential_wall สองคอลัมน์นี้รอเข้า batch profile dataModeling ของ v0.12.0
QueuePolicy นโยบายคิว
One active per mill/season — QL level, lane shares, grace, no-show, board privacy, and v0.33.0 lane_display + eta_min_releases (remote-join bounds retired v0.32.0 with QL-1).ใช้งานหนึ่งชุดต่อโรงงาน/ฤดู — ระดับ QL สัดส่วนช่อง ช่วงผ่อนผัน no-show ความเป็นส่วนตัวของป้าย และ v0.33.0 เพิ่ม lane_display + eta_min_releases (ขอบเขตเข้าคิวระยะไกลถูกยกเลิก v0.32.0 พร้อม QL-1)
The mill’s DEFINITION of one waiting line — truck_class × cane_class × lane_role plus the mill’s own label and a 2–4 char code (v0.33.0, PROP-061).นิยามของแถวรอหนึ่งแถวที่โรงงานกำหนด — ชนิดรถ × ชนิดอ้อย × บทบาท พร้อมชื่อที่โรงงานตั้งเองและรหัสย่อ 2–4 อักขระ (v0.33.0, PROP-061)
One active row per (mill, season, lane_no) and per code; effective-forward, versioned, every value board-published (NFR-38). capacity_trucks is the fill threshold. The register names lines and never counts them — how many stand in the yard today is QueueLaneInstance (D-5). Transfer-station lanes are ordinary rows (truck_class = transfer, D-4).หนึ่งแถวที่ใช้งานต่อ (โรงงาน, ฤดู, lane_no) และต่อรหัส; มีผลไปข้างหน้า เก็บเวอร์ชัน ทุกค่าประกาศบนป้าย (NFR-38) capacity_trucks คือเกณฑ์ความเต็ม ทะเบียน ตั้งชื่อ แถว ไม่นับจำนวน — จำนวนแถวที่ยืนอยู่ในลานวันนี้อยู่ที่ QueueLaneInstance (D-5) แถวของสถานีขนถ่ายเป็นแถวปกติ (truck_class = transfer, D-4)
QueueLaneInstance แถวที่เปิดของวัน
The lines that ACTUALLY stand in the yard on a given day — opened by overflow, never by an operator (v0.33.0, PROP-061 D-5).แถวที่ยืนอยู่จริงในลานของแต่ละวัน — เปิดเพราะแถวเดิมเต็ม ไม่ใช่เพราะมีคนสั่งเปิด (v0.33.0, PROP-061 D-5)
Created implicitly at the booth when a ticket cannot enter the open instance (opened_reason = day_open | previous_full | staff_marked_full, FR-322). Unique per (mill, day, lane, instance_no); QueueTicket.lane_seq_no is unique per instance (Y-11). Closes when its last ticket is released.ถูกสร้างโดยปริยายที่ป้อมเมื่อบัตรลงแถวที่เปิดอยู่ไม่ได้ (opened_reason, FR-322) ไม่ซ้ำต่อ (โรงงาน, วัน, แถว, instance_no) และ QueueTicket.lane_seq_no ไม่ซ้ำ ต่อแถวที่เปิดจริง (Y-11) ปิดเมื่อบัตรใบสุดท้ายถูกปล่อย
TokenTag แท็กของเหรียญ
v0.80.0 (PROP-033) — the REPLACEABLE chip fitted to a coin, dated: nfc_uid, chip_class (ntag21x | crypto_ndef), crypto_capable, key_ref? (a pointer into the Cane-operated key regime and never key material) and write_protected. A re-chipped coin keeps token_id, its printed number and its whole history; uniqueness is inside the tenant and a cross-tenant collision surfaces only through the blind operator-side fingerprint index (FR-569, NFR-229).v0.80.0 (PROP-033) — ชิปที่เปลี่ยนได้ซึ่งติดกับเหรียญ พร้อมวันที่: nfc_uid, chip_class, crypto_capable, key_ref? (ตัวชี้เข้าระบบกุญแจที่ Cane ดำเนินการ ไม่ใช่สาระกุญแจ) และ write_protected เหรียญที่เปลี่ยนชิปยังคง token_id เลขพิมพ์ และประวัติทั้งหมด; ความไม่ซ้ำอยู่ภายใน tenant และการชนกันข้าม tenant ปรากฏผ่าน index fingerprint ตาบอดฝั่งผู้ให้บริการเท่านั้น (FR-569, NFR-229)
TokenBinding การผูกเหรียญกับการส่งมอบ
v0.80.0 (PROP-033) — coin-to-delivery CUSTODY as an explicit row with a state and a close reason, the named refinement of TokenIssuance. Both invariants live in the database: one active delivery per coin, one active coin per delivery. Everything the coin does — taps, driver access, release — hangs off it, so closing a binding takes its whole surface with it (FR-570, FR-571).v0.80.0 (PROP-033) — การครอบครองระหว่างเหรียญกับการส่งมอบเป็นแถวที่ชัดแจ้ง มีสถานะและเหตุผลปิด เป็นการขยายที่ตั้งชื่อของ TokenIssuanceข้อคงที่ทั้งสองอยู่ที่ฐานข้อมูล: เหรียญหนึ่งอันต่อการส่งมอบที่ใช้งานหนึ่งรายการ และการส่งมอบหนึ่งรายการต่อเหรียญที่ใช้งานหนึ่งอัน ทุกอย่างที่เหรียญทำห้อยอยู่บนการผูก (FR-570, FR-571)
TokenTap การแตะเหรียญ
v0.80.0 (PROP-033) — the append-only checkpoint fact at weigh_in | coin_tower | tipper | weigh_out, carrying the tenants in force (delivering tenant, quota account, lead mandate), the reader, station client, gateway node and station configuration version, the tower ASSIGNMENT or the tipper OBSERVATION, the capture and receipt times, the local sequence and the idempotency key. A refusal is a tap too. No group_id and no cross-mill key (FR-572, FR-576, FR-597).v0.80.0 (PROP-033) — ข้อเท็จจริงจุดตรวจแบบ append-only ที่ weigh_in | coin_tower | tipper | weigh_out พ่วงคู่กรณีที่มีผล (ผู้ส่งมอบ บัญชีโควตา หัวตัน) เครื่องอ่าน station client, gateway เวอร์ชันการตั้งค่าสถานี การกำหนดของหอเหรียญหรือการสังเกตของช่องเท เวลาที่เก็บและที่รับ ลำดับภายใน และคีย์กันซ้ำ การปฏิเสธก็เป็นการแตะ ไม่มี group_id และไม่มีคีย์ข้ามโรงงาน (FR-572, FR-576, FR-597)
v0.80.0 (PROP-033) — the driver’s binding-scoped capability (unguessable, expiring, revocable, written to the tag at weigh-in and destroyed at weigh-out) and its short-lived append-only access log (result, coarse network class, hashed client fingerprint — no raw address, no plate, no phone number). Possession of the coin is the credential; access is pseudonymous and never anonymous (FR-580, FR-581, NFR-230).v0.80.0 (PROP-033) — capability ของคนขับที่จำกัดเฉพาะการผูก (เดาไม่ได้ หมดอายุ เพิกถอนได้ เขียนลงแท็กตอนชั่งเข้าและทำลายตอนชั่งออก) และ log การเข้าถึงอายุสั้นแบบ append-only (ผลลัพธ์ ชั้นเครือข่ายแบบหยาบ fingerprint ที่ hash แล้ว — ไม่มีที่อยู่ดิบ ทะเบียนรถ หรือเบอร์โทร) การถือเหรียญคือหลักฐานสิทธิ์; การเข้าถึงเป็นนามแฝง ไม่ใช่นิรนาม (FR-580, FR-581, NFR-230)
ExpressReason เหตุด่วน
v0.34.0 (PROP-063) — the mill's published catalogue of WHY a truck may be released out of turn: category perishability | mill_remedy | mill_logistics | other, derivation system_derived | staff_claimed, required evidence, a per-reason cap (share or absolute) and a sign-off level. No purchasable category exists — PROP-034 abandoned in the same change set. release: v2v0.34.0 (PROP-063) — แคตาล็อกเหตุผลที่โรงงานประกาศว่าเหตุใดรถจะถูกปล่อยแทรกลำดับ พร้อมหมวด การอนุมาน หลักฐาน เพดาน และระดับการลงนาม ไม่มีหมวดที่ซื้อได้ release: v2
ExpressGrant การให้สิทธิ์ด่วน
v0.34.0 (PROP-063) — one immutable row per truck released out of turn, written at the decision and never edited (a wrong grant is superseded). Denormalised hours_since_cut keeps the justifying fact readable years later. release: v2v0.34.0 (PROP-063) — หนึ่งแถวที่แก้ไม่ได้ต่อรถหนึ่งคันที่ถูกปล่อยแทรกลำดับ เขียนตอนตัดสิน ที่ผิดให้ออกใหม่ release: v2
ExpressFlag ธงคัดค้านการปล่อยด่วน
v0.34.0 (PROP-063) — a farmer's flag against a grant: one per tenant per release, no queue effect, answered at season close. PDPA personal. release: v2v0.34.0 (PROP-063) — ธงของชาวไร่ต่อการให้สิทธิ์: หนึ่งธงต่อคู่สัญญาต่อการปล่อย ไม่มีผลต่อคิว ตอบตอนปิดฤดู PDPA personalrelease: v2
SlotTemplate · TimeSlot แม่แบบ/ช่วงเวลาจอง
Season slot config (Q-50 family) and its per-CrushingDay materialization.config slot รายฤดู (ตระกูล Q-50) และการสร้างจริงราย CrushingDay
TimeSlot materializes at day open; per-slot caps sum within booked_share_pct; slot + day booked_t draw down in ONE transaction (WF-10 pattern); A-18 cut shrinks last-booked-first; demotion boundary = slot end + opt-in grace_min (OQ-5).TimeSlot สร้างตอนเปิดวัน; เพดานต่อ slot รวมภายใน booked_share_pct; หัก booked_t ของ slot + วันใน transaction เดียว (แบบ WF-10); การลดตาม A-18 หดแบบจองหลังโดนก่อน; เส้นลดชั้น = สิ้นสุด slot + grace_min แบบ opt-in (OQ-5)
ReliabilityEvent เหตุการณ์ความน่าเชื่อถือ
Append-only booking-outcome facts, machine-written only (R1).ข้อเท็จจริงผลการจองแบบ append-only เขียนโดยระบบเท่านั้น (R1)
The platform-wide score read model, the operator-published formula, and the mill's band → privilege mapping.read model คะแนนระดับ platform สูตรที่ operator ประกาศ และการ map ชั้น → สิทธิ์ของโรงงาน
Score platform-wide per scored tenant per perspective (mill | chain | contractor, OQ-1/OQ-2); full recompute byte-identical (NFR-41); formula versioned, never retroactive in-season; bands B-0…B-3 published (NFR-42); PDPA personal (NFR-43).คะแนนทั้ง platform ต่อผู้ถูกให้คะแนนต่อมุมมอง (mill | chain | contractor, OQ-1/OQ-2); คำนวณซ้ำตรงทุกไบต์ (NFR-41); สูตรเก็บเวอร์ชัน ไม่ย้อนหลังในฤดู; ชั้น B-0…B-3 ประกาศ (NFR-42); PDPA personal (NFR-43)
Six mill-owned entities land with the on-site train (PROP-021 + PROP-028). Attributes and relationship rules are canonical in the graph; persistence profiles (table/pk/fks/indexes/mutability/PDPA) ride the Q5 back-audit with the v0.7.0 and v0.12.0 batches. Two existing entities are amended: WeighTicket.ticket_no IS the per-mill per-season delivery ID (PROP-021 OQ-4 — dispensed by the gateway at on-site-tier factories, mirrored at mirror-posture factories; re-weighs amend under the same number), and Token gains the void-and-reissue protocol (OQ-3: TokenVoided → TokenReissued, reserve band, one audited thread). Digest:
The on-site appliance — customer-side DB + graph slice, single local allocator.appliance ในโรงงาน — ฐานข้อมูลฝั่งลูกค้า + slice ของ graph ผู้จ่ายเลขท้องถิ่นหนึ่งเดียว
ST-LAB digital capture of the OCSB sequence sheet (S4).การบันทึกดิจิทัลของแผ่นลำดับ สอน. ที่ ST-LAB (S4)
Coin number space per line per day, trap order; OCSB's act and record (P-4); feeds the %N-### auto-match; the re-note (CcsReNote) stays the settlement authority (PROP-012); import fallback permanent.space เลขเหรียญต่อ line ต่อวัน ตามลำดับ trap; การกระทำและระเบียนของ สอน. (P-4); ป้อนการจับคู่ %N-###; re-note (CcsReNote) คงเป็นผู้มีอำนาจการปิดงวด (PROP-012); fallback นำเข้าคงถาวร
IntakeMatchSet ชุดจับคู่รับอ้อย
The continuous S6 join — one thread per delivery.การจับคู่ S6 แบบต่อเนื่อง — หนึ่งเส้นด้ายต่อการส่งมอบ
Joins coin + CCS + dump + delivery note on %N-###; match_state open | auto_matched | exception | resolved; immutable facts never merge — conflicts are exceptions in mill-match; the void/reissue pair is ONE thread.รวมเหรียญ + CCS + การเท + ใบส่งอ้อยบน %N-###; match_state open | auto_matched | exception | resolved; ข้อเท็จจริง immutable ไม่ merge — ความขัดแย้งเป็นข้อยกเว้นใน mill-match; คู่ยกเลิก/จ่ายใหม่คือเส้นด้ายเดียว
StationJournal journal ของสถานี
Append-only per-station local journal.journal ท้องถิ่นราย สถานีแบบ append-only
Idempotency key per record; lossless replay; PDPA personal ordinary class (OQ-7): encrypted at rest on station + gateway, role-gated logged access, post-sync purge window (purge_after).idempotency key ทุกระเบียน; replay ไม่สูญหาย; PDPA ข้อมูลส่วนบุคคลชั้นธรรมดา (OQ-7): เข้ารหัสขณะจัดเก็บบนสถานี + gateway เข้าถึงตามบทบาทพร้อมบันทึก ล้างหลัง sync (purge_after)
4.x PROP-032 entities (v0.15.0) — capacity model depth4.x Entity ของ PROP-032 (v0.15.0) — ความลึกของ model กำลังหีบ
Five entities join delivery_weighbridge; CrushingLine, LineDowntime and CrushingDay extend. Persistence profiles ride the Q5 back-audit (v0.12.0 precedent). Full attribute lists in the graph.Entity ใหม่ห้าตัวเข้า delivery_weighbridge; CrushingLine, LineDowntime และ CrushingDay ขยาย Persistence profile ไปกับ back-audit รอบ Q5 (ตามแบบ v0.12.0) รายการ attribute เต็มอยู่ใน graph
EntityEntity
Readingการอ่าน
LineCapacityRevision
Append-only effective-dated nameplate history per line — {value, effective_from, revised_by, revised_at, previous_value, reason}; the line's current capacity is the latest effective record (OQ-1 audit trail).ประวัติ nameplate รายสายแบบ append-only มีวันมีผล — ค่ากำลังปัจจุบันของสายคือระเบียนมีผลล่าสุด (audit trail ตาม OQ-1)
MaintenancePlan
Per-season plan (mill, mill_season, status) — production authors; single-act publish (OQ-8).แผนรายฤดู (โรงงาน กรอบฤดู สถานะ) — ฝ่ายผลิตเขียน; เผยแพร่จังหวะเดียว (OQ-8)
MaintenancePlanVersion
Append-only published version — one-off windows + per-line recurrence patterns expanded at publish; overlaps merge at fold; PROP-044 semantics as pattern (OQ-7).version เผยแพร่แบบ append-only — หน้าต่างครั้งเดียว + จังหวะเกิดซ้ำรายสายกระจายตอนเผยแพร่; หน้าต่างซ้อน merge ตอนรวม; ความหมาย PROP-044 เป็นแบบแผน (OQ-7)
MillSeason
Per-mill season frame — planned/actual open & close; close extension is a MillSeason edit (OQ-9).กรอบฤดูรายโรงงาน — วันเปิด/ปิดตามแผนและจริง; การยืดวันปิดคือการแก้ MillSeason (OQ-9)
Reads the base price and ฿/CCS step; is audited (never edits audit records); annotates — never authors — the daily compliance record.อ่านราคาฐานและอัตราบาท/CCS; ถูกตรวจประเมิน (แก้ระเบียนตรวจไม่ได้); หมายเหตุได้แต่ไม่ใช่ผู้เขียนระเบียนกำกับรายวัน
6. Persistence profile — home entities6. Persistence profile — entity ที่ home อยู่ฉบับนี้
Normative physical model for the 62 entities homed in this document, rendered from the graph's dataModeling block. Types derive from typeConventions (first rule wins): money = bigint satang · weights = integer kg · tonnage = numeric(12,3) · timestamps = timestamptz UTC · ids = uuid v7. Every FK is indexed by convention (ON DELETE RESTRICT); listed indexes are additional. Enum value sets live in the graph's entity and state-machine notes.
Model เชิงกายภาพที่เป็นบรรทัดฐานของ entity ทั้ง 62 รายการที่ home อยู่ในเอกสารนี้ render จาก block dataModeling ใน graph ชนิดข้อมูลอนุมานจาก typeConventions (กติกาแรกที่เข้าเป็นผล): เงิน = bigint สตางค์ · น้ำหนัก = integer กก. · ตัน = numeric(12,3) · เวลา = timestamptz UTC · id = uuid v7 ทุก FK มี index ตามข้อตกลง (ON DELETE RESTRICT); index ที่ระบุคือส่วนเพิ่ม ชุดค่า enum อยู่ในหมายเหตุ entity และ state machine ของ graph
table token_issuance · aggregate Delivery · unique (delivery_id — partial: open state only, the full unique RETIRED at v0.80.0 per PROP-033 F-1) · index (token_id,issued_at)
Owner-declared · prerequisite for WF-69 plate change · v0.20.0 (PROP-025)
merged_into_truck_id
uuid
✓
—
FK → truck · WF-66 soft-delete lineage · v0.20.0 (PROP-025)
status
text (enum)
—
—
owner_tenant_id (who owns the truck) and operator_contractor_id (who currently drives it, set only when that is a hired contractor — PROP-004 Q6) are both plain many-to-one FKs, not a many-to-many: the column holds only the current operator, and historical haulage attribution comes from the per-delivery truck_reg_snap (FR-29), never a join table. A contractor's own vehicles live in Machine. v0.20.0 (PROP-025): the register is FACTORY-SCOPED — mill_id joins the row and the unique key becomes (mill_id, reg_no_norm, province); a normalized-plate collision inside one register is a duplicate hint resolved by the WF-66 two-act merge (merged_into_truck_id lineage). Every create/edit enters the PLT matching pipeline fire-and-forget; the operator master layer (MasterTruck · TruckLink · MasterPlatePeriod · PlateChangeDeclaration) homes in SPEC-ERD-PLT and never renders on a factory surface (NFR-55).
Applied — PROP-054 · spec v0.38.0 — the authorship pair, and what deliberately does NOT carry itapply แล้ว — PROP-054 · spec v0.38.0 — คู่ฟิลด์ผู้บันทึก และสิ่งที่ตั้งใจไม่ใส่
journal_entry gains captured_by_membership_id?uuid (FK → membership) + capture_mode?text (enum) — self | assisted | delegated — for the lines a farmer captures himself (spend capture, the cash book). Append-only, so the stamp is write-once by construction (FR-339, A-71). The draft's other three targets are excluded at application:queue_ticket, delivery and the fuel_credit redemption are not farmer-authored in V1 — the booth issues the number, the weighbridge writes the weights and the pump writes the redemption — and stamping a record the farmer never wrote would make the field mean two different things. This is consistent with the V1 queue being act class C-3 on the farmer surface (PROP-056): a mirror of someone else's fact.
7. Keys, indexes & mutability7. Key, index และ mutability
One row per entity in this perspective. Mutability: mutable · immutable_after_state (frozen once a terminal/approved state is reached) · append_only (corrections supersede or reverse, never edit) · reference (catalogue). PDPA class: personal · consent_gated · confidential_wall · operational · public. Entities homed in a sibling document link to their full profile.
หนึ่งแถวต่อ entity ในมุมมองนี้ Mutability: mutable · immutable_after_state (ตรึงเมื่อถึงสถานะอนุมัติ/สุดท้าย) · append_only (การแก้คือออกฉบับแทนหรือกลับรายการ ไม่แก้ของเดิม) · reference (บัญชีอ้างอิง) ชั้น PDPA: personal · consent_gated · confidential_wall · operational · public Entity ที่ home อยู่เอกสารพี่น้อง link ไป profile ฉบับเต็ม
Entity
Tableตาราง
PK
Unique
Key indexesIndex หลัก
Mutability
PDPA
Profile
Mill
mill
mill_id
(license_no (partial: not null))
(tenant_id) (province) (onboard_status)
mutable
operational
Section 6ข้อ 6
Delivery
delivery
delivery_id
(truck_id (partial: status in booked..weighed_out))
Transaction boundaries touching this perspective, from graph dataModeling.aggregates. Inside a boundary the stated invariants commit atomically in one database transaction; across boundaries effects flow through domain events (eventual consistency). Repository and unit-of-work lifetimes for these aggregates are specified in the sibling SPEC-DDD document (scoped per request — see the component lifetime map).
Transitions follow the delivery state machine; weigh-out writes the ticket and the status change in one transaction; net_kg = gross − tare > 0 enforced here. Re-weighs append a superseding ticket.การเปลี่ยนสถานะตาม state machine ของการส่งมอบ; การชั่งออกเขียนบัตรชั่งพร้อมสถานะใน transaction เดียว; ยึด net_kg = gross − tare > 0 ที่นี่ การชั่งใหม่ append บัตรฉบับแทน
QualityTest
QualityTest
quality
One valid test per delivery (partial unique); re-tests supersede; provisional → confirmed on re-note match.หนึ่งผลที่ใช้ได้ต่อการส่งมอบ (partial unique); ตรวจซ้ำออกฉบับแทน; provisional → confirmed เมื่อจับคู่ re-note
CcsReNote
CcsReNote
quality
Ingested government document — append-only; matching fans out QualityTest updates in follow-up transactions.เอกสารรัฐที่นำเข้า — append-only; การจับคู่กระจายการปรับ QualityTest ใน transaction ตามหลัง
CrushingDay
CrushingDay
delivery_weighbridge
Booking/weighing increments booked_t / weighed_t under optimistic concurrency in the SAME transaction as the delivery write; booked_t ≤ crush_capacity_t and the burnt-cap ratio hold here; closing derives the nightly compliance record.การจอง/ชั่งเพิ่ม booked_t / weighed_t ภายใต้ optimistic concurrency ใน transaction เดียวกับการเขียน delivery; ยึด booked_t ≤ crush_capacity_t และสัดส่วนเพดานไฟไหม้ที่นี่; การปิดวันสร้างระเบียนกำกับรายคืน
Mill
Mill · CanePurchasePolicy · MillPaymentSchedule
federation
Factory profile with season configuration; one policy and an effective-dated schedule per season.โปรไฟล์โรงงานพร้อมการตั้งค่ารายฤดู; หนึ่งนโยบายและตารางจ่ายมีผลตามวันต่อฤดู
Truck
Truck · TruckMergeRequest
delivery_weighbridge
FACTORY-SCOPED fleet registry (v0.20.0, PROP-025): unique (mill_id, reg_no_norm, province); plate snapshots (truck_reg_snap) live on Delivery so registry edits never rewrite history. A WF-66 merge executes atomically — deliveries re-point, the duplicate soft-deletes (merged_into_truck_id) — in ONE transaction, never half-applied.ทะเบียนรถระดับโรงงาน (v0.20.0, PROP-025): ไม่ซ้ำ (mill_id, reg_no_norm, จังหวัด); snapshot ทะเบียน (truck_reg_snap) อยู่บน Delivery การแก้ทะเบียนจึงไม่เขียนประวัติซ้ำ การผสาน WF-66 ดำเนินการ atomic — delivery ชี้ใหม่ แถวซ้ำ soft-delete (merged_into_truck_id) — ใน transaction เดียว ไม่มีครึ่ง ๆ กลาง ๆ
PaymentBatch
PaymentBatch · PaymentItem · PaymentInstallment
settlement
Batch total = Σ items validated at approval; approval freezes batch + items; installments then post per the statutory two-installment schedule (50% next cycle + 50% +30d).ยอดชุด = Σ รายการ ตรวจตอนอนุมัติ; การอนุมัติตรึงชุดและรายการ; จากนั้นงวด post ตามตารางสองงวดตามกฎหมาย (50% รอบถัดไป + 50% +30 วัน)
FinalPriceSettlement
FinalPriceSettlement
settlement
Season-end true-up; payer branch (factory vs Cane & Sugar Fund) fixed at creation; paid transition is terminal.การสรุปราคาปลายฤดู; ฝั่งผู้จ่าย (โรงงานหรือกองทุน) กำหนดตอนสร้าง; สถานะจ่ายแล้วเป็นสถานะสุดท้าย
StampCheckpoint
StampCheckpoint · CheckpointRate · StampEvent
strategic_pricing
Rates append-only supersede (NFR-22) with non-overlapping volume tiers per tenant+season; stamp events append and match a delivery at weigh-in.อัตรา append-only ออกฉบับแทน (NFR-22) ช่วงปริมาณต่อ tenant+ฤดูไม่ทับกัน; การประทับตรา append และจับคู่การส่งมอบตอนชั่ง
Accruals are idempotent per delivery (unique agreement+delivery); releases never exceed the accrued withheld balance; renegotiation appends a new revision effective next day — never retroactive (NFR-22). Confidential — no edge to regulation (NFR-21).การสะสม idempotent ต่อการส่งมอบ (unique agreement+delivery); การจ่ายไม่เกินยอดกันไว้สะสม; เจรจาใหม่ append ฉบับใหม่มีผลวันถัดไป — ไม่ย้อนหลัง (NFR-22) เป็นความลับ — ไม่มีเส้นไป regulation (NFR-21)
LedgerAccount
LedgerAccount
books
Per-tenant chart row; system_flag accounts are template-seeded and rename-only.แถวผังบัญชีราย tenant; บัญชี system_flag seed จาก template แก้ได้เฉพาะชื่อ
JournalEntry
JournalEntry
books
Every entry balances (Σ debit = Σ credit inside lines) — validated before commit; corrections are reversals (reversal_of), never edits; auto-posts are idempotent per source (NFR-24).ทุก entry ดุล (Σ เดบิต = Σ เครดิตใน lines) — ตรวจก่อน commit; การแก้ไขคือการกลับรายการ (reversal_of) ไม่ใช่การแก้; การลงอัตโนมัติ idempotent ต่อแหล่ง (NFR-24)
ChartTemplate
ChartTemplate
books
Versioned per capacity; seeding copies rows — tenants never share template state.มี version ต่อ capacity; การ seed คัดลอกแถว — tenant ไม่ใช้สถานะ template ร่วมกัน
Invoice
Invoice
receivables
Issue freezes lines and totals; settlement is tracked via Receipt / PaymentVoucher references.การออกใบตรึง lines และยอด; การชำระติดตามผ่านการอ้าง Receipt / PaymentVoucher
Receipt
Receipt
receivables
Posted document — auto-posts its JournalEntry in the same transaction (idempotent).เอกสารที่ post แล้ว — ลง JournalEntry อัตโนมัติใน transaction เดียวกัน (idempotent)
PaymentVoucher
PaymentVoucher
receivables
Posted document — auto-posts its JournalEntry in the same transaction (idempotent).เอกสารที่ post แล้ว — ลง JournalEntry อัตโนมัติใน transaction เดียวกัน (idempotent)
CashAccount
CashAccount · BankTransaction · Reconciliation
cash_management
Statement lines append; a reconciliation closes an account-period when difference = 0; the 1—1 ledger mapping is unique.บรรทัด statement append; การกระทบยอดปิดงวดของบัญชีเมื่อ difference = 0; การ map ไป ledger แบบ 1—1 เป็น unique
FiscalPeriod
FiscalPeriod
books
Close validates no unposted documents then freezes the period; statements snapshot only from closed periods; periods never overlap per owner.การปิดงวดตรวจว่าไม่มีเอกสารค้าง post แล้วตรึงงวด; งบ snapshot จากงวดที่ปิดแล้วเท่านั้น; งวดต่อเจ้าของไม่ทับกัน
FinancialStatement
FinancialStatement
books
Frozen snapshot; shared to a bank only via ConsentGrant scope books; a statement shared to สอน. excludes strategic postings (FR-94, NFR-26).snapshot ตรึง; แบ่งให้ธนาคารผ่าน ConsentGrant scope books เท่านั้น; งบที่ให้ สอน. ตัดการลงกลยุทธ์ (FR-94, NFR-26)
BooksProfile
BooksProfile
books
One profile per tenant; edition/view are packaging over the same ledger (NFR-32).หนึ่ง profile ต่อ tenant; รุ่น/มุมมองเป็นการจัดแพ็กเกจบนบัญชีเดียวกัน (NFR-32)
CostCentre
CostCentre
books
The register is derived, never typed (P-2): a centre is opened by the act that creates its subject — a field, a cycle, a crop, an asset, a pool, a network or a member link — and closed by the act that ends it. Roll-up is at most three steps and no farmer-defined nesting exists. A centre never crosses a tenant boundary (A-2).ทะเบียนศูนย์ต้นทุนเกิดจากการกระทำ ไม่ใช่การพิมพ์ (P-2): ศูนย์เปิดเมื่อสิ่งที่มันแทนถูกสร้าง และปิดเมื่อสิ่งนั้นสิ้นสุด รวมยอดไม่เกินสามชั้นและไม่มีการซ้อนที่ชาวไร่กำหนดเอง ศูนย์ไม่ข้ามขอบเขต tenant (A-2)
CostCentreBalance
CostCentreBalance
books
A materialised read model, never a truth: rebuilt from postings and reconciling to the ledger exactly for every period. A balance is never written by hand and never the source of a statement figure.read model ที่ materialise ไว้ ไม่ใช่ความจริง: สร้างใหม่จาก posting และกระทบยอดกับสมุดบัญชีตรงทุกงวด ไม่มีการเขียนด้วยมือ
AllocationRule
AllocationRule
books
Allocation is declared, versioned and reversible or it is a lie (P-6). A rule is never edited: a change writes a new version and supersedes the old one, effective-forward by season; a rule never allocates across a tenant boundary.การปันส่วนต้องประกาศ มีเวอร์ชัน และย้อนกลับได้ มิฉะนั้นเป็นการโกหก (P-6) กติกาไม่ถูกแก้ — การเปลี่ยนคือเวอร์ชันใหม่ที่แทนที่ของเดิม มีผลไปข้างหน้ารายฤดู
CostAllocation
CostAllocation
books
Append-only. One run pins the rule version and the basis it used (basis_snapshot) so the arithmetic can be re-read years later; a correction is a reversal that names the run it reverses, never an edit.append-only การรันหนึ่งครั้งตรึงเวอร์ชันกติกาและเกณฑ์ที่ใช้ เพื่ออ่านย้อนได้ในอีกหลายปี การแก้ไขคือการกลับรายการที่ระบุรันเดิม ไม่ใช่การแก้ค่า
AmortisationRun
AmortisationRun
books
One run per cycle per season, append-only, each carrying its opening and closing balance and the journal entry it posted. The schedule is fixed at first revenue (E-1); a failed planting is a loss, not a longer schedule.หนึ่งรันต่ออ้อยรุ่นต่อฤดู append-only พร้อมยอดยกมาและยอดคงเหลือและรายการบัญชีที่ post ตารางตัดจ่ายตรึงที่รายได้แรก (E-1)
CycleLossEvent
CycleLossEvent
books
A catastrophe is an accounting event (P-9): an impairment needs a named cause and a date, and the declaration date is stored separately from the occurrence date so a late declaration can never pass as a contemporaneous one.ภัยพิบัติคือเหตุการณ์ทางบัญชี (P-9): การด้อยค่าต้องมีสาเหตุที่ระบุชื่อและวันที่ และวันประกาศเก็บแยกจากวันเกิดเหตุ
EntryDocumentLink
EntryDocumentLink
books
One document may back many lines and one entry may carry many documents (EV-1). Capture never blocks posting and posting never blocks capture (EV-3); unlinking is an act with an actor and a timestamp, never a delete (FR-306).เอกสารหนึ่งใบหนุนได้หลายบรรทัด และรายการหนึ่งพ่วงได้หลายเอกสาร (EV-1) การถ่ายรูปไม่ขวางการ post และการ post ไม่ขวางการถ่ายรูป (EV-3) การถอดลิงก์เป็นการกระทำที่มีผู้ทำและเวลา ไม่ใช่การลบ
AdvanceEarmark
AdvanceEarmark
books
The earmark travels with the money, not with the book (P-16): declared, splittable, superseded by a new row, never blocking a disbursement and never a covenant. What it exposes is fixed — aliased field, area, crop class, stage, delivered tonnes — and nothing else, in any view, export or extract (NFR-98, leak L-9).การผูกเงินเดินทางไปกับเงิน ไม่ใช่กับสมุดบัญชี (P-16): ประกาศได้ แบ่งได้ แทนที่ด้วยแถวใหม่ ไม่ขวางการจ่าย และไม่ใช่ข้อผูกพัน สิ่งที่เปิดเผยถูกตรึงไว้เท่านั้น (NFR-98, L-9)
BorrowerPosition
BorrowerPosition
books
A derived read model reconciling to the 1160/1161 control accounts exactly for every period, with the reconciliation line printed on S-9 rather than assumed (NFR-99). On departure the borrower centre moves to closed_with_balance: recovery may still post, no new advance may.read model ที่กระทบยอดกับบัญชีคุม 1160/1161 ตรงทุกงวด และพิมพ์บรรทัดกระทบยอดบน S-9 (NFR-99) เมื่อสมาชิกออก ศูนย์ลูกหนี้เป็น closed_with_balance: post การรับชำระได้ แต่ปล่อยกู้ใหม่ไม่ได้
PromotionZone
PromotionZone
farm_agronomy
A mill's own zoning catalogue, scoped to that mill: zones never cross tenants and never imply a right over a field.บัญชีเขตส่งเสริมของโรงงาน ผูกกับโรงงานนั้น: เขตไม่ข้าม tenant และไม่ก่อสิทธิเหนือแปลง
ContractFarmingProgram
ContractFarmingProgram
field_partnership
A published program is frozen: budget, terms per rai and repayment route are the offer growers enrolled against, and a change is a new program rather than an edit.โปรแกรมที่ประกาศแล้วถูกตรึง: งบประมาณ เงื่อนไขต่อไร่ และเส้นทางการชำระคืนคือข้อเสนอที่ชาวไร่สมัครเข้า การเปลี่ยนคือโปรแกรมใหม่
ProgramEnrollment
ProgramEnrollment
field_partnership
One enrollment per (program, field), pinning the area, the tenure that justified it and the alias the mill sees. The mill reads the alias, never the field identity (W-5).หนึ่งการสมัครต่อ (โปรแกรม, แปลง) ตรึงพื้นที่ การถือครองที่รองรับ และรหัสแทนที่โรงงานเห็น โรงงานอ่านรหัสแทน ไม่ใช่ตัวตนของแปลง (W-5)
QueueLane
QueueLane
gate_queue
A lane definition is a published, effective-forward, versioned row: edits take effect from a future date and never rewrite a day already queued, and a lane may not be deactivated while it has a live instance. The definition NAMES a line and never counts them (PROP-061 D-5).นิยามแถวคือแถวข้อมูลที่ประกาศแล้ว มีผลไปข้างหน้า และมีเวอร์ชัน: การแก้มีผลจากวันในอนาคต ไม่เขียนทับวันที่เข้าคิวไปแล้ว และปิดแถวไม่ได้ขณะยังมีแถวเปิดอยู่จริง นิยาม ตั้งชื่อ แถว ไม่ใช่นับจำนวน (PROP-061 D-5)
QueueLaneInstance
QueueLaneInstance
gate_queue
An instance is opened INSIDE the issuing transaction that overflowed the previous one — allocating instance_no and the ticket’s lane_seq_no in the same commit is what makes the per-lane sequence gap-free and the record complete (FR-322, NFR-112). Identity fields are fixed at open; only depth and closed_at move. A lane change spans two instances only as a PENDING record (D-3).แถวที่เปิดถูกสร้างภายใน transaction เดียวกับการออกบัตรที่ทำให้แถวเดิมล้น — การจอง instance_no และ lane_seq_no ใน commit เดียวกันทำให้ลำดับรายแถวไม่มีช่องว่างและบันทึกครบ (FR-322, NFR-112) ฟิลด์ที่เป็นตัวตนตรึงตอนเปิด มีเพียง depth และ closed_at ที่เปลี่ยน การเปลี่ยนแถวคร่อมสองแถวได้ในฐานะบันทึกที่รอผลเท่านั้น (D-3)
ExpressReason
ExpressReason
gate_queue
Published, effective-forward, versioned, with its own cap: an edit never re-reads a grant already written, and a reason with no cap may not be published at all.ประกาศ มีผลไปข้างหน้า มีเวอร์ชัน และมีเพดานของตัวเอง การแก้ไม่ย้อนอ่านการให้สิทธิ์ที่เขียนแล้ว และไม่มีเพดาน = ประกาศไม่ได้
ExpressGrant
ExpressGrant · ExpressFlag
gate_queue
The grant commits with the lane change it justifies AND the increment of the day's express count — that single transaction is what makes the ceiling a limit rather than a note. Flags attach afterwards and change nothing in the yard.การให้สิทธิ์ commit พร้อมการย้ายแถวและตัวนับของวัน transaction เดียวนี้ทำให้เพดานเป็นขีดจำกัดจริง ธงผูกภายหลังและไม่เปลี่ยนอะไรในลาน
9. Cross-perspective contracts9. สัญญาข้ามมุมมอง
To farmers: tickets are immutable and QR-linked; net tonnage is shown instantly at weigh-out and CCS online once the government re-note is ingested & auto-matched; statements itemize every deduction.
To quota farmers: repayment offsets post exactly against the deductions they explain; virtual-farmer shares route through the quota farmer’s split.
To สอน.: the สอน. re-note CCS lines I ingest and daily intake publish to oversight; compliance records are derived from my CrushingDay data, not written by me.
10. Where the money goes — the payment destination, the bank channel and the account group (PROP-085)10. เงินไปที่ไหน — ปลายทางการรับเงิน ช่องทางธนาคาร และกลุ่มบัญชี (PROP-085)
Applied 2026-08-17 as spec v0.73.0 (PROP-085). The applied model had no bank-account entity at all: WF-05 step 5 posted a payment to a destination the graph never held, and a factory's own banks lived in one prose note about a discounted cheque. Six entities enter, homed here. The rule they carry is A-105 R-PAYEE — a destination is an OBJECT bound to one quota account by a dated, append-only assignment, never a set of columns edited in place — with R-RANKED (a main and one optional backup, no third) and R-CHANNEL (the factory's bank is something it pays THROUGH, never a destination it pays TO).
The destination money is actually sent to. method: bank_transfer | promptpay | cheque | cash — cheque is first-class because the applied เงินเกี๊ยว instrument IS a post-dated cheque. bank_code is a row of the new banks register (A-80 R-DATA), the BOT three-digit code stored as text with its leading zero. The number is encrypted and displayed as last four. Verification is per DESTINATION: an unverified, rejected or withdrawn destination is never paid, in either rank.ปลายทางที่เงินถูกส่งไปจริง method ตามรายการ เช็คเป็นชั้นหนึ่งเพราะเครื่องมือเงินเกี๊ยวที่ apply แล้วคือเช็คลงวันที่ล่วงหน้า bank_code เป็นแถวของทะเบียน banks ใหม่ เก็บรหัสสามหลักของ ธปท. เป็นข้อความพร้อมศูนย์นำหน้า เลขบัญชีเข้ารหัสและแสดงสี่ตัวท้าย การยืนยันเป็นรายปลายทาง
PayeeAssignment
pk assignment_id · fk quota_id, payee_id, requested_by, approved_by, supersedes_assignment_id · unique (quota_id, rank) partial WHERE status = 'active' · idx (payee_id), (quota_id, effective_from)
append_only · operational · Quota
The dated binding of a destination to ONE quota account. rank: primary | secondary and no third; status: pending | active | superseded | cancelled. approved_by may not equal requested_by. PaymentInstallment gains payee_assignment_id?, so "where did the money for the 12 January cycle actually go, and who authorised that" is answerable from stored rows alone (NFR-162).การผูกปลายทางกับโควตาหนึ่งบัญชี พร้อมวันที่ rank มีเพียงหลักและสำรอง approved_by ต้องไม่เท่ากับ requested_by และ PaymentInstallment เพิ่ม payee_assignment_id?
The banking track record the client asked for on 13 Aug 2026: added · evidence_attached · verified · reverified · rejected · ranked_primary · ranked_secondary · unranked · withdrawn · reinstated, each with who and when, reason mandatory on rejected, unranked and withdrawn. It answers when a detail was added, verified and withdrawn for a detail that has entered and left the active set several times — which a mutable verified flag cannot (NFR-169).ประวัติธนาคารตามคำสั่งลูกค้า 13 ส.ค. 2569 ทุกเหตุการณ์ระบุใครและเมื่อใด reason บังคับสำหรับการปฏิเสธ การถอดอันดับ และการถอน ตอบได้แม้ปลายทางเข้าออกชุดที่ใช้งานหลายครั้ง ซึ่งธงยืนยันที่แก้ได้ทำไม่ได้
QuotaGroup QGR-######
pk group_id · fk mill_id, lead_quota_id, created_by · unique (mill_id, group_no) partial WHERE group_no IS NOT NULL · idx (mill_id, status)
mutable · operational · QuotaGroup
The factory's own instrument, never spanning factories. purpose: consolidated_view | financing | settlement; netting: none (default) | within_group, and within_group requires agreement_ref. The consolidated VIEW is release v1; the consolidated RECOVERY is release v2 (OQ-3). Deliberately not the applied FarmerGroup, which freezes a per-season set of TENANTS for analytics.เครื่องมือของโรงงานเอง ไม่ข้ามโรงงาน การหักกลบปิดเป็นค่าเริ่มต้น และ within_group ต้องมี agreement_refมุมมองรวมเป็น v1 ส่วนการเรียกคืนรวมเป็น v2 และไม่ใช่ FarmerGroup
QuotaGroupMember
pk member_id · fk group_id, quota_id, recorded_by · unique (quota_id) partial WHERE to_date IS NULL AND the group's netting = 'within_group' · idx (group_id, from_date)
append_only · operational · QuotaGroup
Dated membership on the applied GroupMembership pattern. Two guards carry the money rule: a member's mill_id must equal the group's, and an account may sit in at most ONE netting group at a time — otherwise two groups could each claim the same baht.สมาชิกภาพที่มีวันที่ ตามรูปแบบ GroupMembership ที่ apply แล้ว สองการ์ดถือกฎเรื่องเงินไว้
MillBankChannel MBC-######
pk channel_id · fk mill_id, declared_by · unique (mill_id, bank_code, purpose) partial WHERE effective_to IS NULL · idx (mill_id, status)
mutable · operational · Mill
The bank, or banks, a factory transacts through — one row per bank, ranked, so "single bank or multiple banks" is data and never a schema choice. purpose: payout | credit | both — the applied เงินเกี๊ยว cheque discounted at a bank the factory holds credit with IS this row, finally stored. cross_bank_fee_bearer is holder by the OQ-14 decision; a factory may declare mill or shared and never the reverse, and the fee reaches the grower as an itemised deduction or it does not exist. A Factory Settings topic (FR-112) that shows no grower and routes no money.ธนาคารที่โรงงานใช้ทำธุรกรรม หนึ่งแถวต่อธนาคาร มีอันดับ จึงเป็นข้อมูล ไม่ใช่การเลือกโครงสร้าง ผู้รับภาระค่าธรรมเนียมข้ามธนาคารคือผู้ถือตามคำตัดสิน OQ-14 โรงงานประกาศเป็นของตนหรือแบ่งกันได้ แต่กลับทางไม่ได้ และค่าธรรมเนียมต้องเป็นรายการหักที่แจกแจง มิฉะนั้นถือว่าไม่มี
Two new aggregate roots — PayeeAccount (with its event history, so a verification can never disagree with the row it describes) and QuotaGroup (with its dated membership, which is what makes "one netting group per account" enforceable) — deliberately apart from the account root in SPEC-ERD-CFQ: verifying a bank account never touches a group, and grouping never touches a season figure. Amended applied rows: CreditLine +quota_id? (required where the lender holds the mill capacity), PaymentInstallment +payee_assignment_id?, Truck +suspended_from?/suspended_to?/suspension_reason?/suspended_by? (FR-465, suspension by plate — a fact about the VEHICLE that appears on no holder's reliability band). Requirements FR-450…FR-454, FR-462…FR-465, NFR-162, NFR-165, NFR-169, NFR-170; workflows WF-139, WF-140, WF-143; check V-21; register banks.สอง aggregate ใหม่ คือ PayeeAccount พร้อมประวัติของมัน และ QuotaGroup พร้อมสมาชิกภาพที่มีวันที่ แยกจากรากบัญชีใน SPEC-ERD-CFQ โดยเจตนา การยืนยันบัญชีธนาคารไม่แตะกลุ่ม และการจัดกลุ่มไม่แตะตัวเลขรายฤดู ข้อกำหนด FR-450…FR-454FR-462…FR-465NFR-162NFR-165NFR-169NFR-170 workflow WF-139WF-140WF-143 การตรวจ V-21 และทะเบียน banks แถวที่ apply แล้วซึ่งถูกแก้ ได้แก่ CreditLine +quota_id? (บังคับเมื่อผู้ให้ถือ capacity โรงงาน) PaymentInstallment +payee_assignment_id? และ Truck +suspended_from?/suspended_to?/suspension_reason?/suspended_by? (การระงับรายทะเบียนตาม FR-465 ซึ่งเป็นข้อเท็จจริงของรถ และไม่ปรากฏบนแถบความน่าเชื่อถือของผู้ถือรายใด)
11. Hardening the strategic plane — four entities and five amendments (PROP-090)11. ทำให้ระนาบกลยุทธ์แน่นขึ้น — สี่เอนทิตีและการแก้ห้าจุด (PROP-090)
Applied 2026-08-17 as spec v0.74.0 (PROP-090, on A-109). Nothing here redesigns the plane; it closes the places where a private price could cost somebody money he could not prove. Four entities home here and one — RelayDeclaration — homes in SPEC-ERD-CFQ, because the onward leg belongs to the quota perspective.
apply 2026-08-17 เป็น spec v0.74.0 (PROP-090 บน A-109) ไม่มีข้อใดออกแบบระนาบใหม่ แต่ปิดจุดที่ราคาลับทำให้บางคนเสียเงินโดยพิสูจน์ไม่ได้ สี่เอนทิตี home ที่นี่ และ RelayDeclaration home ที่ SPEC-ERD-CFQ เพราะขาส่งต่อเป็นของมุมมองโควตา
resolver_rule: lowest_cost | highest_to_grower | most_specific | earliest_signed. There is no tie_rule column — the tie is reject, fixed platform-wide, and a column that can hold one value is a false affordance. published_at must precede the countersignature of any agreement bound to the version; a version with no published date binds nothing.resolver_rule ตามรายการ ไม่มีคอลัมน์ tie_rule เพราะกฎเสมอคือ reject ตายตัวทั้งแพลตฟอร์ม และคอลัมน์ที่ถือได้ค่าเดียวคือช่องว่างที่หลอกให้คิดว่าเลือกได้ published_at ต้องมาก่อนการลงนามตอบของข้อตกลงที่ผูกกับเวอร์ชันนั้น
AgreementAssignment
pk assignment_id · fk agreement_id, quota_id, from_tenant_id, to_tenant_id, three memberships · unique (agreement_id) partial WHERE cause <> 'replaced' · idx (quota_id, effective_on)
append_only · operational · StrategicAgreement
cause: ended | assigned | inherited | claimed | replaced. It FREEZES the two figures that matter at the moment the ground moves — accrued_t_at_transfer and withheld_amt_at_transfer — so neither party reconstructs them later from a revision chain. to_tenant_id is null where the agreement simply ends; the incoming signature is mandatory where it does not, and the mill signs either way.cause ตามรายการ ตรึงตัวเลขสองตัวที่สำคัญไว้ ณ วินาทีที่พื้นขยับ คือปริมาณที่สะสมและยอดที่หักไว้ ทั้งสองฝ่ายจึงไม่ต้องประกอบขึ้นใหม่จากสายรุ่น to_tenant_id ว่างได้เมื่อข้อตกลงเพียงสิ้นสุด
WithheldOutcome
pk outcome_id · fk agreement_id, season_id, release_id, two memberships · unique (agreement_id, season_id) · idx (season_id, outcome)
append_only · operational · StrategicAgreement
outcome: released | settled | forfeited. Exactly one open withheld position per agreement per season, and it closes only through this row. A forfeited outcome without a clause_ref and a counterparty signature is refused by construction. The row is what a court reads, and it is written at the time, not at the argument.outcome ตามรายการ มีสถานะเงินหักที่เปิดอยู่หนึ่งรายการต่อข้อตกลงต่อฤดู และปิดได้ด้วยแถวนี้เท่านั้น ผลลัพธ์ริบที่ไม่มีการอ้างข้อสัญญาและลายเซ็นของคู่สัญญาถูกปฏิเสธโดยโครงสร้าง แถวนี้คือสิ่งที่ศาลอ่าน และเขียนตั้งแต่ตอนนั้น ไม่ใช่ตอนเถียงกัน
AgreementNotice
pk notice_id · fk agreement_id, served_by · idx (agreement_id, served_at)
append_only · operational · StrategicAgreement
kind: dormancy | contractual_notice | competing_offer. response: justified | revised_delivery_date | released | none. cure_ends_on is served_at plus seven calendar days — calendar and not working days, because a deadline a grower can count on a wall calendar is the point of publishing it. A competing_offer records only the grower’s assertion: the platform never sees, stores or verifies the other factory’s terms.kind และ response ตามรายการ cure_ends_on คือ served_at บวกเจ็ดวันตามปฏิทิน ไม่ใช่วันทำการ เพราะเส้นตายที่นับบนปฏิทินติดผนังได้คือเหตุผลของการประกาศมัน ส่วน competing_offer บันทึกเพียงคำยืนยันของชาวไร่
Five applied rows amended. StrategicAgreement +scope_quota_ids? (the fifth axis — an object filter, never a permission scope) · +withheld_clause_ref? · +shortfall_treatment (pro_rata default) · +shortfall_confirmed_by_mill/_by_counterparty (BOTH required, for all three values) · +resolver_policy_version_id? · +notice_days?. PremiumAccrual +quota_id required — derivable from the delivery but STORED, because the account is what the grower recognises and a derived join at read time is what makes two screens disagree — plus resolved_rule?, resolved_policy_version_id? and candidate_agreement_ids?, written only where more than one agreement matched. MillStrategicConfig +resolver_policy_version_id?: the resolver moves from a scalar setting to a versioned policy on the applied PlanVersion shape. OnwardPremiumSettlement +declared_scheme_ref, required. And the unmasked-export event gains filters and reason, both required. Read model strategic_reconciliation declares NO writer. Requirements FR-466…FR-473, NFR-171…NFR-174; workflows WF-144…WF-147; check V-25.แก้แถวที่ apply แล้วห้าจุด StrategicAgreement +scope_quota_ids? (แกนที่ห้า เป็นตัวกรองวัตถุ ไม่ใช่ขอบเขตสิทธิ) +withheld_clause_ref? +shortfall_treatment (ค่าเริ่มต้น pro_rata) +shortfall_confirmed_by_mill/_by_counterparty (บังคับทั้งสอง ครบทั้งสามค่า) +resolver_policy_version_id? +notice_days? · PremiumAccrual +quota_id บังคับ พร้อม resolved_rule?resolved_policy_version_id? และ candidate_agreement_ids? · MillStrategicConfig +resolver_policy_version_id? · OnwardPremiumSettlement +declared_scheme_ref บังคับ และเหตุการณ์การส่งออกแบบไม่ปิดบังเพิ่ม filters กับ reason บังคับทั้งคู่ read model strategic_reconciliation ไม่ประกาศผู้เขียน ข้อกำหนด FR-466…FR-473NFR-171…NFR-174 workflow WF-144…WF-147 การตรวจ V-25
PROP-027 accepted (spec v0.10.0, 2026-07-17)รับ PROP-027 แล้ว (spec v0.10.0, 17 ก.ค. 2569)The fuel-credit service adds three entities homed in this document — FuelCredit (single fill per delivery note, unique(delivery_id); money as baht 2-dp per A-43), FuelStation (normally a separate entity from the factory, optionally its own tenant) and MillFuelConfig (the mill-settings fuel topic) — in the financing context, with three relationships (Delivery 1—0..1 FuelCredit · FuelStation 1—0..* FuelCredit · Mill 1—0..* FuelStation) and full persistence profiles in the graph (canonical). Diagrams and the entity sections regenerate from the graph on the next render pass (PROP-018 renderer).บริการเครดิตน้ำมันเพิ่ม entity สามตัวที่มีบ้านในเอกสารนี้ — FuelCredit (เติมครั้งเดียวต่อใบ unique(delivery_id); เงินเป็นบาททศนิยม 2 ตำแหน่งตาม A-43), FuelStation (ปกติเป็นนิติบุคคลแยกจากโรงงาน อาจเป็น tenant ของตนเอง) และ MillFuelConfig (หัวข้อน้ำมันของ mill-settings) — ใน context financing พร้อมความสัมพันธ์สามเส้น (Delivery 1—0..1 FuelCredit · FuelStation 1—0..* FuelCredit · Mill 1—0..* FuelStation) และโปรไฟล์การจัดเก็บครบใน graph (canonical) แผนภาพและหมวด entity จะ regenerate จาก graph ในรอบ render ถัดไป (ตัว render ของ PROP-018)
PROP-022 applied (spec v0.14.0, 2026-07-19)ปรับใช้ PROP-022 แล้ว (spec v0.14.0, 19 ก.ค. 2569)The strategic planning & analytics suite adds five entities homed in this document, extending strategic_pricing — StrategicPlan (one per mill+season, unique), PlanScenario (sandbox drafts, per-scenario price/CCS assumptions), PlanVersion (immutable two-act publish, unique(plan_id, version_no)), CalcBasisPolicy (append-only cascade rows, one active row per scope key — partial unique) and FarmerGroup (static per season, unique(mill_id, season_id, name)) — with seven relationships, StrategicAgreement gaining retro? (OQ-1), and full persistence profiles + aggregates in the graph (canonical; all rows pdpa confidential_wall). Diagrams and the entity sections regenerate from the graph on the next render pass (PROP-018 renderer).ชุดวางแผนและวิเคราะห์กลยุทธ์เพิ่ม entity ห้าตัวที่มีบ้านในเอกสารนี้ ขยาย strategic_pricing — StrategicPlan (หนึ่งต่อโรงงาน+ฤดู, unique), PlanScenario (ร่าง sandbox สมมติฐานราคา/CCS รายสถานการณ์), PlanVersion (publish สอง act แก้ไขไม่ได้, unique(plan_id, version_no)), CalcBasisPolicy (แถวลำดับชั้นแบบ append-only หนึ่งแถว active ต่อ scope key — partial unique) และ FarmerGroup (คงที่ต่อฤดู, unique(mill_id, season_id, name)) — พร้อมความสัมพันธ์เจ็ดเส้น, StrategicAgreement ได้ retro? (OQ-1) และโปรไฟล์การจัดเก็บ + aggregate ครบใน graph (canonical; ทุกแถว pdpa confidential_wall) แผนภาพและหมวด entity จะ regenerate จาก graph ในรอบ render ถัดไป (ตัว render ของ PROP-018)
PROP-045 applied (spec v0.22.0, 2026-07-23)ปรับใช้ PROP-045 แล้ว (spec v0.22.0, 23 ก.ค. 2569)The scope-overlap predicate is now DEFINED (OQ-15…18 client-decided): StrategicAgreement gains explicit scope attributes — scope_checkpoint_ids? · scope_field_ids? · scope_date_from? · scope_date_to? · scope_distance_band? (null = unrestricted axis; the delivery-matching set = deliveries matching ALL non-null axes). Overlap = same counterparty + same season + intersecting delivery-matching sets. Default: overlapping agreements are REJECTED at save (str.err.overlap). A mill may enable layering via the new MillStrategicConfig (mill-settings strategic topic, str_config-gated): the shared resolver then picks the matching agreement with the LOWEST cost to the factory; ties still reject. Scope changes are effective-forward only, re-validated on every mutation; accrued rows untouched. Plan-scenario drafts are never checked — the check fires at publish only, with SUPERSEDE (two-act approval; old ends today, new effective next day) as an explicit choice. One resolver serves accrual and analytics (FR-185/FR-186, NFR-58). New columns and the mill_strategic_config persistence profile are registered in the graph (dataModeling); the full column-profile render back-fills with the Q5 back-audit.predicate การทับซ้อนของ scope ถูกนิยามแล้ว (ลูกค้าตัดสิน OQ-15…18): StrategicAgreement ได้ attribute scope ชัดเจน — scope_checkpoint_ids? · scope_field_ids? · scope_date_from? · scope_date_to? · scope_distance_band? (ค่าว่าง = ไม่จำกัดแกนนั้น; เซตการ match = การส่งมอบที่ตรงทุกแกนที่ไม่ว่าง) การทับซ้อน = คู่สัญญาเดียวกัน + ฤดูเดียวกัน + เซตการ match ตัดกัน ค่าเริ่มต้น: ข้อตกลงทับซ้อนถูกปฏิเสธตอน save (str.err.overlap) โรงงานเปิดการซ้อนชั้นได้ผ่าน MillStrategicConfig ใหม่ (หัวข้อกลยุทธ์ใน mill-settings, ผ่านสิทธิ์ str_config): resolver ที่ใช้ร่วมจะเลือกข้อตกลงที่ match ซึ่งมีต้นทุนต่ำสุดต่อโรงงาน; เสมอกันยังคงปฏิเสธ การเปลี่ยน scope มีผลไปข้างหน้าเท่านั้น ตรวจซ้ำทุก mutation; แถวที่ accrue แล้วไม่แตะ ร่าง scenario ของแผนไม่ถูกตรวจ — ตรวจเฉพาะตอน publish โดยมี SUPERSEDE (อนุมัติสองขั้น; ฉบับเก่าสิ้นสุดวันนี้ ฉบับใหม่มีผลวันถัดไป) เป็นทางเลือกชัดเจน resolver เดียวใช้ทั้ง accrual และงานวิเคราะห์ (FR-185/FR-186, NFR-58) column ใหม่และ persistence profile ของ mill_strategic_config ลงทะเบียนในกราฟแล้ว; การ render โปรไฟล์ column เต็มตามมากับ back-audit ของ Q5
No new entities — PROP-023 extends the PROP-010/011 books family. The graph's new books block is canonical for the chart rows (books.chartTemplates: 27 mill + 30 shared-SME accounts, capacity flags, statement_line bindings, derived lock classes) and the posting map (books.postingMap: 22 money-events × affected capacities, named source fields). Persistence profiles for the extended attributes ride the PROP-019 Q5 back-audit.
+rows (the normative account payload) · +line_map_version; two templates only — deep mill + ONE shared SME with capacity flags (OQ-3); additive-only versions effective next period open (OQ-2).+rows (payload บัญชีเชิงบรรทัดฐาน) · +line_map_version; สอง template เท่านั้น — โรงงานฉบับลึก + SME ร่วมพร้อม flag (OQ-3); รุ่นเพิ่มได้อย่างเดียว มีผลเมื่อเปิดงวดถัดไป (OQ-2)
PROP-030 applied (spec v0.21.0, 2026-07-23)ปรับใช้ PROP-030 แล้ว (spec v0.21.0, 23 ก.ค. 2569)The transfer-station department adds ten entities homed in this document under the new transfer_station context — a second intake front where the station is ONE tenant with three faces: intake site toward farmers, quota holder toward the mill, haulage principal toward contractors. Persistence profiles ride the Q5 back-audit.หน่วยงานสถานีขนถ่ายเพิ่ม entity สิบตัวที่ home ในเอกสารนี้ ภายใต้ context ใหม่ transfer_station — แนวรับอ้อยที่สองซึ่งสถานีเป็น tenant เดียวสามหน้า: จุดรับอ้อยต่อชาวไร่ เจ้าของโควตาต่อโรงงาน และผู้ว่าจ้างขนส่งต่อผู้รับเหมา ส่วน persistence profile ตามรอบ back-audit ของ Q5
Entity
Roleบทบาท
TransferStation สถานีขนถ่ายอ้อย
Own quota number; delivery prefix NN (10–99) deriving the 7-digit note range (FR-179, max 90/mill); GPS lat/long, weighbridge capacity, distance to mill (FR-180); per-station 4-ply routing config.เลขโควตาของตน; prefix NN (10–99) กำหนดช่วงเลขใบชั่ง 7 หลัก (FR-179 สูงสุด 90/โรงงาน); พิกัด GPS พิกัดชั่ง ระยะทางถึงโรงงาน (FR-180); config เส้นทางสำเนา 4 ชั้นรายสถานี
Four-document dossier, exactly one home station (FR-174); mother/daughter units referencing the PROP-025 register — per-unit load state for CCS attribution.เอกสาร 4 รายการ สังกัดสถานีเดียว (FR-174); ตัวแม่/ลูกอ้างทะเบียน PROP-025 — สถานะโหลดรายตัวเพื่อการระบุ CCS
CraneToken เหรียญเครน
Pins each farmer load to a transfer unit at crane time; surrendered at station exit weigh (FR-175).ผูกการโหลดของชาวไร่กับรถขนถ่ายตัวใดตัวหนึ่งตอนเครนโหลด; คืนตอนชั่งออกสถานี (FR-175)
StationBill ใบชั่งอ้อยสถานี
The SAME statutory 4-ply ใบชั่งอ้อย form, numbered inside the station prefix range; cut-and-reopen keeps the audit link via cut_from_bill_id (FR-176); NOT an FR-114 fuel-credit note.ฟอร์มใบชั่งอ้อย 4 สำเนาตามกฎหมายแบบเดียวกัน ออกเลขในช่วง prefix ของสถานี; ตัด-เปิดใหม่คงลิงก์ตรวจสอบผ่าน cut_from_bill_id (FR-176); ไม่นับเป็นใบส่งตาม FR-114
Per-trip contractor settlement on mill weigh-in × rate card, net of the claim; claim = above-threshold shortfall × per-kg charge, cause shortfall | accident (FR-177/184).ชำระผู้รับเหมารายเที่ยวจากชั่งเข้าโรงงาน × rate card หักค่าเรียก; ค่าเรียก = ส่วนหายเกินเกณฑ์ × อัตราต่อ กก. สาเหตุ shortfall | accident (FR-177/184)
HaulageRateCard อัตราค่าขนถ่าย
Per contractor × station price for the station→mill leg; multi-contractor, allocation on availability + cost (FR-181).ราคารายผู้รับเหมา × สถานีสำหรับช่วงสถานี→โรงงาน; หลายราย จัดสรรตามความพร้อม + ต้นทุน (FR-181)
Three mill-owned entities land with the checkpoint terminal (attributes and relationship rules canonical in the graph; persistence profiles ride the Q5 back-audit). CheckpointRegistration (CRG-########) wraps the PROP-009/029 StampEvent with the evidence pack + lifecycle registered → matched | expired (48 h default, OQ-31) — truck_id = mother, trailer_truck_id? = child, both first-class unit identities (OQ-30); carries qr_payload (A-59 signed envelope) + print_count (OQ-29 reprint protocol) and an accrual_grade flag (C-1/C-2). EvidencePhoto (EVP-########, append-only) — kind EV-1…EV-5, GNSS-only fix ≤ 25 m, taken_at, device id, content hash; PDPA per OQ-27 (12-month retention, named-role viewing only). TripTrace (TRT-########, append-only) — the consented in-bound stream (D-8/OQ-32): trip status only to the mill, purged at delivery + weigh-out. StampCheckpoint is amended: +operating_area_polygon? / +geofence_radius_m? — the portal-designated operating area that arms the terminal (C-2a). Terminals enroll as StationClient rows (PROP-028).
PROP-012 (settlement & CCS-by-re-note correction, spec v10.0): the mill's QualityTest is re-grounded to the government (สอน.) re-note it ingests and auto-matches on the %N-### tag (no on-site lab, no "same day"); settlement becomes the statutory two-installment schedule on the initial price from MillPaymentSchedule with a season-end final-price true-up; cross-perspective contracts updated (instant tonnage + CCS on re-note receipt).PROP-012 (แก้การจ่ายเงินและ CCS จากรีโน้ต, spec v10.0): QualityTest ของโรงงานอิงรีโน้ตของรัฐ (สอน.) ที่นำเข้าและจับคู่อัตโนมัติด้วยแท็ก %N-### (ไม่มีแล็บในโรงงาน ไม่มี "วันเดียว"); การจ่ายเป็นสองงวดตามกฎหมายบนราคาขั้นต้นจาก MillPaymentSchedule พร้อมสรุปราคาสุดท้ายปลายฤดู; อัปเดตสัญญาข้ามมุมมอง
1.5
2026-07-10
PROP-011 (GL, spec v12.0): the mill owns a BooksProfile — its books are fixed to the split edition (first-class AR/AP + treasury) with an accrual default_basis; edition/view are packaging over the same ledger (NFR-32).PROP-011 (GL, spec v12.0): โรงงานเป็นเจ้าของ BooksProfile — สมุดถูกตั้งเป็นรุ่น split (AR/AP + เงินสดเป็นหน้าหลัก) เกณฑ์ตั้งต้นคงค้าง; รุ่น/มุมมองเป็นการจัดแพ็กเกจบนบัญชีเดียวกัน (NFR-32)
Physical-model batch 1 (spec v0.28.1) — the first batch of the approved physical-model mandate (docs/graph/CLAUDE.md authority rule 6, client-approved 28 Jul 2026). Persistence profiles authored for the nine v0.28.0 cost-dimension entities homed here — CostCentre · CostCentreBalance · AllocationRule · CostAllocation · AmortisationRun · CycleLossEvent · EntryDocumentLink · AdvanceEarmark · BorrowerPosition — with Section 7 key rows and Section 8 consistency boundaries. No model change: profiles render what v0.28.0 already applied.ก้อนที่ 1 ของแบบจำลองเชิงกายภาพ (spec v0.28.1) — ก้อนแรกตามข้อบังคับที่อนุมัติแล้ว (กติกาอำนาจข้อ 6) เขียน persistence profile ให้ entity มิติต้นทุนเก้าตัวของ v0.28.0 ที่ home ในเอกสารนี้ พร้อมแถวข้อ 7 และขอบเขตข้อ 8 ไม่มีการเปลี่ยนแบบจำลอง
0.16.0
2026-07-28
Physical-model batch 2 (spec v0.28.2) — the mill-authored share of the v0.26.0 block: persistence profiles, key rows and consistency boundaries for PromotionZone (a mill's own zoning catalogue — zones never cross tenants and never imply a right over a field), ContractFarmingProgram (a published program is frozen; a change is a new program) and ProgramEnrollment (one enrollment per program × field, pinning area, tenure and the alias the mill sees — never the field identity, W-5). No model change.ก้อนที่ 2 ของแบบจำลองเชิงกายภาพ (spec v0.28.2) — ส่วนที่โรงงานเป็นผู้เขียนของก้อน v0.26.0: profile แถวคีย์ และขอบเขตของ PromotionZone · ContractFarmingProgram · ProgramEnrollment โรงงานเห็นรหัสแทน ไม่ใช่ตัวตนของแปลง (W-5) ไม่มีการเปลี่ยนแบบจำลอง
0.16.1
2026-07-28
Rendering repair + completeness sweep. (a) The batch 1/2 consistency-boundary rows had been spliced past </html> by a stale section-9 anchor and never reached Section 8 — the twelve rows are now in the table where their revision entries said they were. (b) Nine entities profiled in the graph but never rendered here — FuelCredit · FuelStation · MillFuelConfig (v0.10.0) and StrategicPlan · PlanScenario · PlanVersion · CalcBasisPolicy · FarmerGroup · MillStrategicConfig (v0.14.0) — gain their Section 6 profiles and Section 7 rows. The document now renders all 57 MILL-homed profiles. No graph change.ซ่อมการ render และกวาดความครบถ้วน (ก) แถวขอบเขตความสอดคล้องของก้อน 1/2 ถูกแทรกเลย </html> เพราะจุดยึดข้อ 9 ที่ล้าสมัย ตอนนี้อยู่ในตารางข้อ 8 แล้ว (ข) entity เก้าตัวที่มี profile ใน graph แต่ไม่เคย render ที่นี่ ได้ profile ข้อ 6 และแถวข้อ 7 แล้ว เอกสารนี้ render ครบทั้ง 57 รายการ ไม่มีการเปลี่ยน graph
0.17.0
2026-07-28
PROP-052 applied (spec v0.30.0) — the lead-tier retention contract. Delivery gains lead_tenant_id? and lead_mandate_id?: the lead farmer (หัวตัน) and his mandate in force at delivery creation, stamped once like truck_reg_snap, immutable, null where the grower sits directly under the quota farmer, never recomputed and never back-filled (FR-316); both FKs and the (lead_tenant_id) index render in Section 6. The Delivery block is re-rendered in full from the graph — the six columns that had drifted out of the render (queue_ticket_id · cleanliness · classification_status · classification_source · ccs_source · attribution_state) are restored and crop_id is marked nullable. Retained but unreachable in v1 (NFR-109); no behaviour change.apply PROP-052 (spec v0.30.0) — Delivery เพิ่ม lead_tenant_id? และ lead_mandate_id?: หัวตันและ mandate ที่มีผลขณะสร้างการส่งมอบ เขียนครั้งเดียวเหมือน truck_reg_snap แก้ไม่ได้ ว่างได้เมื่อชาวไร่อยู่ใต้หัวหน้าโควต้าโดยตรง ไม่คำนวณใหม่และไม่เติมย้อนหลัง (FR-316) พร้อม FK และ index (lead_tenant_id) ในข้อ 6 อีกทั้ง render block ของ Delivery ใหม่ทั้งชุดจาก graph — คืนหกคอลัมน์ที่หลุดจากการ render และทำเครื่องหมาย crop_id ว่าเป็น null ได้ เก็บไว้แต่เข้าไม่ถึงใน v1 (NFR-109) ไม่เปลี่ยนพฤติกรรม
0.18.0
2026-07-28
PROP-060 applied — spec v0.32.0.QueuePolicy loses remote_join, remote_join_geofence_km and remote_join_min_band with QL-1 (no replacement admission attribute); queue_level keeps 1 as a retired enum member and QueueTicket.channel loses remote. The booking entities (SlotTemplate · TimeSlot · MillBookingPolicy) carry release: v2.apply PROP-060 — spec v0.32.0QueuePolicy ตัดฟิลด์เข้าคิวระยะไกลทั้งสามตัวไปกับ QL-1, queue_level คงค่า 1 เป็นสมาชิกที่ยกเลิก และ entity ฝั่งการจองมีป้าย release: v2
0.19.0
2026-07-29
PROP-061 applied — spec v0.33.0. The yard is several parked lines, so the queue becomes lane-shaped. Two new entities: QueueLane (the mill’s lane DEFINITIONS — truck_class × cane_class × lane_role, mill-named, published, versioned) and QueueLaneInstance (the lines that actually stand in the yard today, opened by overflow and never by an operator, D-5) — both with full Section 6 profiles, Section 7 rows and Section 8 boundaries in the same pass (authority rule 6). QueueTicket gains lane_id + lane_instance_id + pending_lane_id?, promotes lane_seq_no to required and re-scopes seq_no to mill/day/lane instance, dropping its identity with Delivery.coin_no (the coin stays a weighbridge fact). QueuePolicy gains lane_display and eta_min_releases.apply PROP-061 — spec v0.33.0 ลานคือหลายแถวจอด คิวจึงมีรูปเป็นแถว เพิ่มสอง entity: QueueLane (นิยามแถวของโรงงาน — ชนิดรถ × ชนิดอ้อย × บทบาท ตั้งชื่อเอง ประกาศ และมีเวอร์ชัน) และ QueueLaneInstance (แถวที่ยืนอยู่จริงในลานวันนี้ เปิดเพราะแถวเดิมเต็ม ไม่ใช่เพราะมีคนสั่ง D-5) พร้อม profile ข้อ 6 แถวข้อ 7 และขอบเขตข้อ 8 ในรอบเดียวกัน (กติกาอำนาจข้อ 6) QueueTicket เพิ่ม lane_id + lane_instance_id + pending_lane_id? ยก lane_seq_no เป็นบังคับ และเปลี่ยนขอบเขต seq_no เป็นต่อโรงงาน/วัน/แถวที่เปิดจริง พร้อมตัดความเท่ากันกับ Delivery.coin_no ส่วน QueuePolicy เพิ่ม lane_display และ eta_min_releases
0.20.0
2026-07-29
PROP-063 applied — spec v0.34.0. Three entities with full physical profiles in the same pass (authority rule 6): express_reason (mutable · public · unique (mill_id,season_id,code)), express_grant (append_only · operational · denormalised hours_since_cut · superseded_by) and express_flag (immutable_after_state · personal · unique (express_grant_id,flagged_by)) — all release: v2, in two aggregates. QueuePolicy gains V1 express_ceiling_per_day + express_ceiling_published_at and LOSES priority_classes[]; QueueTicket loses priority_class — both retired with PROP-034's abandonment.apply PROP-063 — spec v0.34.0 สาม entity พร้อม profile กายภาพในรอบเดียวกัน (กติกาอำนาจข้อ 6) และ QueuePolicy ได้เพดานแถวด่วนของ V1 แทน priority_classes[] ที่เลิกใช้พร้อม PROP-034
0.21.0
2026-07-30
PROP-054 applied — spec v0.38.0.journal_entry gains captured_by_membership_id? + capture_mode? for farmer-captured lines (append-only, write-once). queue_ticket, delivery and the fuel_credit redemption are excluded at application — none is farmer-authored in V1 (see the Section 6 note). FR-339 · A-71.apply PROP-054 — spec v0.38.0journal_entry เพิ่มคู่ฟิลด์ผู้บันทึกสำหรับบรรทัดที่ชาวไร่บันทึกเอง (append-only เขียนครั้งเดียว) ส่วน queue_ticketdelivery และการใช้สิทธิ์ fuel_credit ตัดออกตอน apply เพราะไม่ใช่ระเบียนที่ชาวไร่เขียนใน V1 FR-339 · A-71
0.22.0
2026-07-30
PROP-064 applied — spec v0.40.0.QueueTicket gains lead_tenant_id? + lead_mandate_id? (FR-349): the network attribution of the season-one conduct record, written once at row creation from the owner's lead, immutable, null under a quota farmer and unreachable under NFR-109. PDPA class confidential_wall, retained for the evidence window (the season plus the season after). The columns join the entity's pending v0.12.0 dataModeling profile batch — the entity predates authority rule 6.apply PROP-064 — spec v0.40.0QueueTicket ได้ lead_tenant_id? + lead_mandate_id? (FR-349): การระบุที่มาเชิงเครือข่ายของบันทึกพฤติกรรมในฤดูแรก เขียนครั้งเดียวตอนสร้างแถวจากหัวตันของเจ้าของ แก้ภายหลังไม่ได้ เป็นค่าว่างเมื่ออยู่ใต้หัวหน้าโควต้า และเข้าถึงไม่ได้ตาม NFR-109 จัดชั้น PDPA confidential_wall เก็บตามช่วงหลักฐาน (ฤดูนี้บวกอีกหนึ่งฤดู) สองคอลัมน์รอเข้า batch profile dataModeling ของ v0.12.0 เพราะ entity นี้มีมาก่อนกติกาอำนาจข้อ 6
0.23.0
2026-08-03
PROP-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) and the dangling A-86/A-87/A-88 citations are re-pointed at the ids they were actually given, A-81/A-82/A-83.PROP-073 (spec v0.47.0): คำเดียว — TenantParty → Tenant, party_id ทุกรูป → tenant_id, PartyCapacity/PartyQualification/PartyFounded → Tenant*, cross-party → cross-tenant และเลิกใช้ ผู้เล่น เป็นคำแทนวัตถุนี้ในภาษาไทย (ใช้คำละติน tenant ตาม R-THAI) รายการห้ามแตะไม่ถูกแตะ: คู่สัญญา · third party · คณะทำงานไตรภาคี · Person*/person_id รอบเดียวกันแก้ค้างจาก PROP-075: domain → department (A-82) และแก้การอ้าง A-86/A-87/A-88 ที่ไม่มีอยู่จริงเป็น A-81/A-82/A-83
0.23.1
2026-08-03
PROP-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
0.24.0
2026-08-07
PROP-078 approved & applied — spec v0.54.0.HarvesterWorkPlan.driver_name and mechanic_name split into the same parts every human name in this corpus now takes — *_prefix? · *_first_name · *_last_name (FR-437 R-NAMEPARTS, OQ-4 decided by the client). They are typed-in names of people the platform holds no account for, which is exactly the class the finding describes: a family name recoverable only by splitting on a space. No nickname — a nickname is a form of address and the platform never addresses these people. CheckpointRegistration.driver_name? splits the same way in the graph and stays optional at all three parts; it prints in no document.PROP-078 อนุมัติและ apply — spec v0.54.0HarvesterWorkPlan.driver_name และ mechanic_name แยกเป็นส่วนย่อยเดียวกับชื่อคนทุกตัวในคลังเอกสาร — *_prefix? · *_first_name · *_last_name (FR-437 R-NAMEPARTS ลูกค้าตัดสิน OQ-4) ทั้งสองเป็นชื่อที่พิมพ์ของคนที่แพลตฟอร์มไม่มีบัญชีให้ ตรงกับชนิดของข้อบกพร่องพอดี ไม่มีชื่อเล่น เพราะชื่อเล่นคือคำเรียกขาน และแพลตฟอร์มไม่เคยเรียกขานคนเหล่านี้ ส่วน CheckpointRegistration.driver_name? แยกแบบเดียวกันในกราฟ และไม่บังคับทั้งสามส่วน
0.25.0
2026-08-17
Where the money goes — spec v0.73.0 (PROP-085 approved & applied 17 Aug 2026). The platform had no bank-account entity: six enter, homed here with physical profiles and two new aggregate roots (authority rule 6) — PayeeAccount · PayeeAssignment · PayeeAccountEvent · QuotaGroup · QuotaGroupMember · MillBankChannel — plus the banks reference register. Amended: CreditLine +quota_id?, PaymentInstallment +payee_assignment_id?, Truck + the four suspension columns of FR-465. New Section 10.เงินไปที่ไหน — spec v0.73.0 (PROP-085 อนุมัติและ apply 17 ส.ค. 2569) แพลตฟอร์มไม่เคยมีเอนทิตีบัญชีธนาคาร เพิ่มหกตัวที่ home ที่นี่ พร้อมโปรไฟล์เชิงกายภาพและ aggregate ใหม่สองราก และทะเบียนอ้างอิง banks แก้แถวที่ apply แล้วสามตัว เพิ่มข้อ 10
0.26.0
2026-08-17
Hardening the strategic plane — spec v0.74.0 (PROP-090 approved & applied 17 Aug 2026). Four entities homed here with physical profiles (ResolverPolicyVersion · AgreementAssignment · WithheldOutcome · AgreementNotice) and five applied rows amended: StrategicAgreement (the quota-account axis, the shortfall treatment with both confirmations, the policy pin, notice_days), PremiumAccrual (quota_id required plus the resolution columns), MillStrategicConfig (scalar → versioned policy), OnwardPremiumSettlement (declared_scheme_ref) and the unmasked-export event (filters, reason). New Section 11.ทำให้ระนาบกลยุทธ์แน่นขึ้น — spec v0.74.0 (PROP-090 อนุมัติและ apply 17 ส.ค. 2569) สี่เอนทิตี home ที่นี่พร้อมโปรไฟล์เชิงกายภาพ (ResolverPolicyVersion · AgreementAssignment · WithheldOutcome · AgreementNotice) และแก้แถวที่ apply แล้วห้าจุด ได้แก่ StrategicAgreementPremiumAccrualMillStrategicConfigOnwardPremiumSettlement และเหตุการณ์การส่งออกแบบไม่ปิดบัง เพิ่มข้อ 11
0.27.0
2026-08-20
The NFC reusable queue coin — spec v0.80.0 (PROP-033 approved & applied 20 Aug 2026, MINOR MARKED BREAKING under A-120). Five entities homed here with full physical profiles — TokenTag (the replaceable chip, unique per mill among live rows) · TokenBinding (custody, with BOTH invariants as database partial uniques) · TokenTap (the append-only checkpoint fact, idempotency-keyed) · TokenAccessGrant · TokenAccessRead — and three applied rows amended: Token gains read_tech (plain | nfc, default plain) and current_tag_id?; TokenIssuance’s FULL unique on delivery_id is narrowed to the open state (finding F-1 — the applied void-and-reissue links a replacement coin to the same delivery, which a full unique forbids; the retirement is registered at releases.retired and the break at releases.breaking); and DumpEvent gains token_tap_id?. The Token aggregate takes the tag, the Delivery aggregate takes binding, tap and grant, and TokenAccessRead is its own boundary. Section 6 count 57 → 62.เหรียญคิว NFC ใช้ซ้ำได้ — spec v0.80.0 (PROP-033 อนุมัติและ apply 20 ส.ค. 2569, MINOR MARKED BREAKING ตาม A-120) ห้าเอนทิตี home ที่นี่พร้อมโปรไฟล์เชิงกายภาพครบ — TokenTag (ชิปที่เปลี่ยนได้ ไม่ซ้ำต่อโรงงานในกลุ่มแถวที่ใช้งาน) · TokenBinding (การครอบครอง โดยข้อคงที่ทั้งสองเป็น partial unique ที่ฐานข้อมูล) · TokenTap (ข้อเท็จจริงจุดตรวจแบบ append-only มีคีย์กันซ้ำ) · TokenAccessGrant · TokenAccessRead — และแก้แถวที่ apply แล้วสามจุด: Token เพิ่ม read_tech (plain | nfc ค่าเริ่มต้น plain) และ current_tag_id?; unique เต็มรูปของ TokenIssuance บน delivery_idแคบลงเหลือสถานะที่เปิดอยู่ (ผลตรวจ F-1; บันทึกการปลดที่ releases.retired และการ break ที่ releases.breaking); และ DumpEvent เพิ่ม token_tap_id? aggregate Token รับแท็ก, aggregate Delivery รับการผูก การแตะ และ grant, และ TokenAccessRead เป็นขอบเขตของตัวเอง จำนวนในข้อ 6 จาก 57 เป็น 62