SPEC-ERD-MILL Rev 0.27.0 · 2026-08-20

Cane Agency · Specification · Perspective documentสถาบันอ้อย · เอกสารข้อกำหนด · เอกสารรายมุมมอง

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.

เอกสารนี้อ่าน model ข้อมูลจากฝั่งโรงงานน้ำตาล — tenant ผู้ดำเนินการรับอ้อย แท่นชั่ง การนำเข้า re-note CCS ของรัฐ (จับคู่ %N-### อัตโนมัติ) และการปิดงวด เป็นเจ้าของแกนปฏิบัติการ; ทุกนิยามสะท้อน SPEC-ERD และ graph (กราฟ)

2. Entity map2. แผนที่ entity

Relationความเกี่ยวข้องEntitiesEntity
Ownsเป็นเจ้าของMill · Truck · CrushingDay · Delivery · Token · TokenIssuance · TokenTag · TokenBinding · TokenTap · TokenAccessGrant · TokenAccessRead v0.80.0 · DumpPlatform · DumpEvent · HarvesterWorkPlan · WeighTicket · QualityTest · CanePurchasePolicy · PaymentBatch · PaymentItem · StampCheckpoint · CheckpointRate · StampEvent · StrategicAgreement · PremiumAccrual · PremiumRelease v8.0 · ChartTemplate · Invoice · Receipt · PaymentVoucher · CashAccount · BankTransaction · Reconciliation · FiscalPeriod · FinancialStatement v9.0
Sharesใช้ร่วมTenant · Person · Membership · Farmer · Quota · Crop · Season · CreditLine · Repayment · CanePriceAnnouncement · CcsAudit · BurntCaneCompliance · OnwardPremiumSettlement
Contextsบริบทdelivery_weighbridge · quality · settlement · strategic_pricing v8.0 · books · receivables · cash_management v9.0
WorkflowsWorkflowWF-03 · WF-04 · WF-05 · WF-10 · WF-31 · WF-32 · WF-33 · WF-35 v8.0 · WF-36 · WF-37 · WF-38 · WF-39 · WF-40 · WF-41 v9.0

3. Entity relationship diagram3. แผนภาพความสัมพันธ์ entity

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.

มุมมองเฉพาะด้านของ model ทั้ง platform render จาก graph (entities · relationships · dataModeling, v0.4.0) กล่องเส้นทึบคือ entity ที่บันทึกเชิงลึกในเอกสารตระกูลนี้ — ตัวหนา = primary key, สีทอง = foreign key กล่องเส้นประคือ entity ที่ใช้ร่วม โดยป้ายระบุเอกสาร home; อ่าน cardinality ที่ปลายเส้นแต่ละด้าน

0..110..*10..*10..*111110..*10..*10..*10..*11..* Millโรงงานน้ำตาลmill_id PKtenant_id FKnameprovincecapacity_tpdonboard_statusgeo_location?license_no?registry_ref?Truckรถบรรทุกอ้อยtruck_id PKreg_noprovincetruck_typecapacity_towner_tenant_id FKoperator_contractor_id? FKstatusCrushingDayวันหีบcrushing_day_id PKmill_id FKseason_id FKdatecrush_capacity_tbooked_tweighed_tburnt_cap_pctburnt_intake_tstatusDeliveryการส่งมอบdelivery_id PKquota_id FKcrop_id FKtruck_id FKtruck_reg_snapcrushing_day_id FKcane_typeharvest_methodstatus+5 more…WeighTicketบัตรชั่งticket_id PKdelivery_id FKgross_kgtare_kgnet_kgweighed_atoperator_id FKQualityTestผลตรวจ CCStest_id PKdelivery_id FKccstrash_pctstatussampled_atavailable_atlab_refrenote_id FK+2 more…CcsReNoteรีโน้ต CCS (จากภาครัฐ)renote_id PKmill_id FKseason_id FKgov_refissued_atreceived_atsourceQuotaโควตา · CFQCropอ้อยรายฤดู · CFC
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-###
10..*10..110..*10..*11..*1210..*10..*10..*0..10..* Millโรงงานน้ำตาล · MILLCanePurchasePolicyนโยบายรับซื้ออ้อยpolicy_id PKmill_id FKseason_id FKburnt_deduction_per_tgreen_incentive_per_tburnt_daily_cap_pctcontamination_deduction_per_tMillPaymentScheduleตารางจ่ายเงินของโรงงานschedule_id PKmill_id FKseason_id FKcycle_daysfirst_pctsecond_offset_dayseffective_fromPaymentBatchงวดจ่ายเงินbatch_id PKmill_id FKseason_id FKperiodcycle_datestatusapproved_by FKPaymentItemรายการจ่ายต่อการส่งมอบitem_id PKbatch_id FKdelivery_id FKbase_amtccs_premiumcane_type_adjdeductionsnet_amtPaymentInstallmentงวดย่อยของการจ่ายinstallment_id PKitem_id FKinstallment_nopctamountbatch_id FKdue_dateposted_atstatusFinalPriceSettlementการจ่ายส่วนต่างราคาสุดท้ายsettlement_id PKmill_id FKseason_id FKfarmer_tenant_id FKinitial_price_id FKfinal_price_id FKdiff_amtpayerstatuspaid_atDeliveryการส่งมอบ · MILL
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 พร้อมการสรุปราคาสุดท้ายปลายฤดู
10..*10..*0..110..*10..*10..10..10..110..*0..10..*0..10..* StampCheckpointจุดประทับตราcheckpoint_id PKmill_id FKname_thname_en?provincegeo_location?operatordefault_extra_rate_per_tstatusOnwardPremiumSettlementการส่งต่อค่าอ้อยกลยุทธ์สู่ลูกไร่ · CFQCheckpointRateอัตราจุดประทับตรารายชาวไร่rate_id PKcheckpoint_id FKagreement_id? FKtenant_id FKseason_id FKmin_volume_t?max_volume_t?extra_rate_per_tstatusStampEventการประทับตราstamp_id PKcheckpoint_id FKtruck_id FKdelivery_id? FKtenant_id FKplanned_net_t?stamped_atrecorded_by FKStrategicAgreementข้อตกลงค่าอ้อยกลยุทธ์agreement_id PKmill_id FKcounterparty_tenant_id FKseason_id FKpricing_modepremium_per_t?contract_volume_tupfront_pctbenefit_treatment?+7 more…PremiumAccrualการสะสมค่าอ้อยกลยุทธ์accrual_id PKagreement_id FKdelivery_id FKstamp_event_id?net_tpremium_rate_per_tgross_premium_amtupfront_pctupfront_amt+2 more…PremiumReleaseการจ่ายค่าอ้อยกลยุทธ์เป็นงวดrelease_id PKagreement_id FKrelease_typepct?amountdelivery_id? FKmethodpaid_atrecorded_by FKstatusDeliveryการส่งมอบ · MILL
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 ไม่มีเส้นเชื่อมไป regulation
10..*10..*10..*10..*10..110..1 ChartTemplateผังบัญชีแม่แบบtemplate_id PKcapacityversionstatusBooksProfileโปรไฟล์สมุดบัญชีprofile_id PKowner_tenant_id FKdefault_basisbooks_editionledger_viewstatusLedgerAccountบัญชีแยกประเภทaccount_id PKowner_tenant_id FKcodename_thname_en?account_classsystem_flagstatustemplate_id? FKcash_account_id? FKJournalEntryรายการสมุดรายวันentry_id PKowner_tenant_id FKentry_datememo?source_typesource_id?linesstatusreversal_of?Invoiceใบแจ้งหนี้invoice_id PKowner_tenant_id FKdirectioncounterparty_tenant_id FKissue_datedue_datelinessubtotaltax_amt?+4 more…Receiptใบเสร็จรับเงินreceipt_id PKowner_tenant_id FKpayer_tenant_id? FKinvoice_id? FKamountmethodcash_account_id? FKreceived_atrecorded_by FKPaymentVoucherใบสำคัญจ่ายvoucher_id PKowner_tenant_id FKpayee_tenant_id? FKinvoice_id? FKamountmethodcash_account_id? FKpaid_atapproved_by FK
Fig. 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; ทุกเหตุการณ์เงินลงบัญชีอัตโนมัติ
10..*10..*10..*10..*0..10..* CashAccountบัญชีเงินสด/ธนาคารcash_account_id PKowner_tenant_id FKkindbank_name?acct_no_mask?ledger_account_id FKopening_balancestatusBankTransactionรายการเดินบัญชีtxn_id PKcash_account_id FKvalue_dateamountdescriptionexternal_ref?recon_statusimported_atReconciliationการกระทบยอดrecon_id PKcash_account_id FKperiod_id FKstatement_balanceledger_balancedifferencestatusreconciled_by FKclosed_at?FiscalPeriodงวดบัญชีperiod_id PKowner_tenant_id FKlabelstarts_onends_onbasisstatusclosed_by? FKFinancialStatementงบการเงินstatement_id PKowner_tenant_id FKstatement_typeperiod_id FKbasissnapshotgenerated_atshared_via_consent_id? FKConsentGrantการให้ความยินยอมแบ่งปันข้อมูล · FIN
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)

4. Owned entities — the mill’s reading4. Entity ที่เป็นเจ้าของ — การอ่านของโรงงาน

EntityEntityWhat it means to the millความหมายต่อโรงงานRules that biteกฎที่มีผล
CrushingDay วันหีบ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 · WeighTicketThe 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 ผลตรวจ CCSPer-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 มิฉะนั้นติดธง
CanePurchasePolicyMy season pricing levers: burnt deduction, green incentive, daily burnt cap, contamination deduction.คันโยกราคาประจำฤดู: หักไฟไหม้ จูงใจอ้อยสด เพดานไฟไหม้รายวัน หักอ้อยปนเปื้อนOne policy per mill per season; defaults every CrushingDay’s cap.หนึ่งนโยบายต่อโรงงานต่อฤดู; เป็นค่าตั้งต้นเพดานของทุกวันหีบ
PaymentBatch · PaymentItemSettlement: base × net + CCS premium ± cane-type adjustment − deductions (credit offsets).การปิดงวด: ฐาน × สุทธิ + พรีเมียม CCS ± ส่วนต่างประเภทอ้อย − การหัก (หักหนี้)Immutable once approved; batch total = Σ items; a delivery settles at most once — adjustments post as new items.แก้ไขไม่ได้เมื่ออนุมัติ; ยอดชุด = Σ รายการ; การส่งมอบปิดงวดครั้งเดียว — การปรับเป็นรายการใหม่
Truck · MillFleet registry (any owner type) and my mill’s capacity facts.ทะเบียนรถ (เจ้าของทุกประเภท) และข้อมูลกำลังผลิตของโรงงานPlate snapshotted per delivery (truck_reg_snap).snapshot (สแนปช็อต) ทะเบียนต่อการส่งมอบ (truck_reg_snap)
StampCheckpoint · CheckpointRate · StampEvent v8.0Long-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); การประทับตราจับคู่การส่งมอบเมื่อชั่ง
StrategicAgreement · PremiumAccrual · PremiumRelease v8.0The confidential ค่าอ้อยกลยุทธ์ I pay ON TOP of the statutory price — checkpoint or fixed_price (เหมาจ่าย), 25/50/75 step release.ค่าอ้อยกลยุทธ์ที่เป็นความลับที่จ่ายเพิ่มจากราคาตามกฎหมาย — checkpoint หรือ fixed_price (เหมาจ่าย) จ่ายเป็นงวด 25/50/75Accrual 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
ChartTemplate · Invoice · Receipt · PaymentVoucher · CashAccount · BankTransaction · Reconciliation · FiscalPeriod · FinancialStatement · BooksProfile v9.0 · ext v12.0My 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)

Queue-train entities — gate_queue + farmer_reliability (spec v0.12.0)entity ขบวนคิว — gate_queue + farmer_reliability (spec v0.12.0)

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:

แปด entity ของโรงงานมากับขบวนคิว (PROP-020 + PROP-024) แอตทริบิวต์และกติกาความสัมพันธ์เป็น canonical ใน graph; persistence profile (table/pk/fks/indexes/mutability/PDPA) ของชุดนี้ไปกับการตรวจย้อนหลังเฟส Q5 ร่วมกับชุด v0.7.0 สรุป:

EntityRoleบทบาทKey rulesกติกาสำคัญ
QueueTicket
บัตรคิว · QT-25##-#####
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)Effective-forward, versioned; every value board-published (NFR-38); booked_share_mode fixed | intelligent within min/max bounds (Q-03); board_privacy defaults seq_only (Q-07); priority_classes[] empty by default (Q-04 → PROP-034).มีผลไปข้างหน้า เก็บเวอร์ชัน; ทุกค่าประกาศบนป้าย (NFR-38); booked_share_mode fixed | intelligent ภายในขอบเขต (Q-03); board_privacy ค่าเริ่ม seq_only (Q-07); priority_classes[] ว่างโดยค่าเริ่มต้น (Q-04 → PROP-034)
QueueLane
แถวคิว
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)
TokenAccessGrant ·
TokenAccessRead
สิทธิ์อ่านสถานะ / บันทึกการอ่าน
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 personal release: v2
SlotTemplate · TimeSlot
แม่แบบ/ช่วงเวลาจอง
Season slot config (Q-50 family) and its per-CrushingDay materialization.config slot รายฤดู (ตระกูล Q-50) และการสร้างจริงราย CrushingDayTimeSlot 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)kind on_time | late_demoted | no_show | cancelled_in_time | excused (+excuse_cause); full OQ-2 attribution (quota tenant, acting sub-farmer, truck own/hired, contractor); mill-scoped rows — never visible across tenants (OQ-1/NFR-43).kind on_time | late_demoted | no_show | cancelled_in_time | excused (+excuse_cause); attribution ครบตาม OQ-2 (tenant โควตา ลูกไร่ผู้กระทำ รถของตน/จ้าง ผู้รับเหมา); แถวรายโรงงาน — ไม่มีวันข้าม tenant (OQ-1/NFR-43)
ReliabilityScore · ScoringPolicy · BookingPrivilegePolicy
คะแนน/สูตร/สิทธิ์
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)

On-site tier entities — on_site_gateway + mill_stations (spec v0.13.0)entity ชั้นติดตั้งในโรงงาน — on_site_gateway + mill_stations (spec v0.13.0)

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:

หก entity ของโรงงานมากับขบวนติดตั้งในโรงงาน (PROP-021 + PROP-028) แอตทริบิวต์และกติกาความสัมพันธ์เป็น canonical ใน graph; persistence profile ไปกับการตรวจย้อนหลังเฟส Q5 ร่วมกับชุด v0.7.0 และ v0.12.0 มี entity เดิมถูกแก้สองตัว: WeighTicket.ticket_no คือเลขส่งมอบต่อโรงงานต่อฤดูกาล (OQ-4 ของ PROP-021 — จ่ายโดย gateway ที่โรงงานชั้นติดตั้ง สะท้อนที่โรงงานท่าสะท้อน; ชั่งซ้ำแก้ใต้เลขเดิม) และ Token ได้โปรโตคอลยกเลิก-จ่ายใหม่ (OQ-3: TokenVoided → TokenReissued ช่วงสำรอง audit เป็นเส้นด้ายเดียว) สรุป:

EntityRoleบทบาทKey rulesกติกาสำคัญ
GatewayNode
โหนด gateway
The on-site appliance — customer-side DB + graph slice, single local allocator.appliance ในโรงงาน — ฐานข้อมูลฝั่งลูกค้า + slice ของ graph ผู้จ่ายเลขท้องถิ่นหนึ่งเดียว1 per factory (+1 A-2 warm standby, ha_role); allocator_epoch = the F-3 anti-split-brain guard, stamped on every allocation; sealed datastore (F-6, platform-held keys); config_version + ack implement effective-from-acknowledgement (OQ-3); local slice = cache, not archive (OQ-2).1 ต่อโรงงาน (+1 warm standby ชั้น A-2, ha_role); allocator_epoch = ตัวกัน split-brain ตาม F-3 ประทับทุกการจ่ายเลข; ฐานข้อมูลผนึก (F-6 กุญแจอยู่กับ platform); config_version + การยืนยันรับ = มีผลเมื่อยืนยันรับ (OQ-3); slice ท้องถิ่นเป็น cache ไม่ใช่คลังถาวร (OQ-2)
StationClient
สถานี client
Registered station app (queue_booth | weighbridge | coin_tower | lab | tipper | fuel_kiosk).แอปสถานีที่ลงทะเบียน (queue_booth | weighbridge | coin_tower | lab | tipper | fuel_kiosk)Gateway-issued certificate, bounded validity (OQ-5); signed binaries only — verified at install, launch AND handshake (NFR-46); F-5 heartbeat + per-type gateway-down posture; ST-WB = the PROP-031 MAUI app in factory mode.ใบรับรองจาก gateway อายุจำกัด (OQ-5); เฉพาะ binary ลงนาม — ตรวจตอนติดตั้ง เปิด และ handshake (NFR-46); heartbeat F-5 + ท่าเมื่อ gateway ล่มรายประเภท; ST-WB = แอป MAUI ของ PROP-031 โหมดโรงงาน
SyncCheckpoint
จุดตรวจการ sync
Committed sync window, up (facts) and down (config).หน้าต่าง sync ที่ commit แล้ว ขาขึ้น (ข้อเท็จจริง) และขาลง (config)Up: append-only, idempotent replay, platform validates (mill, season) monotonicity — observe, never renumber (NFR-44); down: versioned snapshot binding from acknowledged_at only; freshness feeds the portal badge.ขาขึ้น: append-only, replay แบบ idempotent, platform ตรวจความเรียงต่อ (โรงงาน, ฤดูกาล) — สังเกต ไม่จ่ายเลขใหม่ (NFR-44); ขาลง: snapshot มีเวอร์ชัน มีผลจาก acknowledged_at เท่านั้น; ความสดป้อน badge บน portal
CcsMeasurement
ผลวัด CCS หน้าสาย
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-onlyIdempotency 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

EntityEntityReadingการอ่าน
LineCapacityRevisionAppend-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)
MaintenancePlanPer-season plan (mill, mill_season, status) — production authors; single-act publish (OQ-8).แผนรายฤดู (โรงงาน กรอบฤดู สถานะ) — ฝ่ายผลิตเขียน; เผยแพร่จังหวะเดียว (OQ-8)
MaintenancePlanVersionAppend-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)
MillSeasonPer-mill season frame — planned/actual open & close; close extension is a MillSeason edit (OQ-9).กรอบฤดูรายโรงงาน — วันเปิด/ปิดตามแผนและจริง; การยืดวันปิดคือการแก้ MillSeason (OQ-9)
MillCapacityConfigQ-50 config: downtime cause vocabulary, supervisor-confirm threshold, silence gap + escalation, late-change window, default planned hours.config ตระกูล Q-50: คำศัพท์สาเหตุ downtime เกณฑ์ยืนยันหัวหน้ากะ ช่องเงียบ + การยกระดับ ช่วงธงเปลี่ยนช้า ชั่วโมงตามแผนเริ่มต้น
CrushingLine ·
LineDowntime ·
CrushingDay
Extended: CrushingLine +downtime_operator_id (nameplate = latest LineCapacityRevision); LineDowntime +entered_by/lost_t/source (operator | detector | plan)/plan_version_id; CrushingDay +planned_hours (default 24, OQ-2).ขยาย: CrushingLine +downtime_operator_id (nameplate = LineCapacityRevision มีผลล่าสุด); LineDowntime +entered_by/lost_t/source (operator | detector | plan)/plan_version_id; CrushingDay +planned_hours (เริ่มต้น 24, OQ-2)

5. Shared entities — the view from this side5. Entity ที่ใช้ร่วม — มุมมองจากฝั่งนี้

EntityEntityOwnerเจ้าของWhat the mill reads / writesโรงงานอ่าน / เขียนอะไร
Farmer · Quota · CreditLine · RepaymentCFQReads quota chains at booking; extends factory credit lines (incl. pass-through) and posts repayment offsets at settlement.อ่านสายโควตาตอนจอง; ให้วงเงินโรงงาน (รวมส่งผ่าน) และบันทึกหักกลบตอนปิดงวด
CropCFCReads for traceability — every load names its source crop (field × season × owner).อ่านเพื่อการสอบย้อน — ทุกเที่ยวระบุอ้อยต้นทาง (แปลง × ฤดู × เจ้าของ)
CanePriceAnnouncement · CcsAudit · BurntCaneComplianceGOVReads 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

Mill โรงงานน้ำตาล mutable operational

table mill  ·  aggregate Mill  ·  code MIL-###  ·  unique (license_no (partial: not null))  ·  index (tenant_id) · (province) · (onboard_status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
mill_iduuid—uuid_v7()PK
tenant_iduuid——FK → tenant
nametext——
provincesmallint——Province enum · TIS 1099-2548 (PROP-047)
capacity_tpdnumeric(12,3) (t)——
onboard_statustext (enum)——
geo_locationpoint✓—
license_notext✓—
registry_reftext✓—

Delivery การส่งมอบ immutable_after_state operational

table delivery  ·  aggregate Delivery  ·  code DLV-25##-######  ·  unique (truck_id (partial: status in booked..weighed_out))  ·  index (quota_id,status) · (crushing_day_id,status) · (crop_id) · (coin_no,crushing_line,tipper_slot) · (lead_tenant_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
delivery_iduuid—uuid_v7()PK
quota_iduuid——FK → quota
crop_iduuid✓—FK → crop
truck_iduuid——FK → truck
truck_reg_snaptext——
crushing_day_iduuid——FK → crushing_day
cane_typetext (enum)——
harvest_methodtext (enum)——
statustext (enum)——
booked_attimestamptz——
arrived_attimestamptz——
coin_nointeger——
queue_ticket_iduuid✓—FK → queue_ticket
crushing_linechar(1)——
tipper_slotinteger——
cleanlinesstext (enum)——
classification_statustext (enum)——
classification_sourcetext (enum)——
ccs_sourcetext (enum)——
attribution_statetext (enum)——
lead_tenant_iduuid✓—FK → tenant
lead_mandate_iduuid✓—FK → lead_mandate

WeighTicket บัตรชั่ง append_only operational

table weigh_ticket  ·  aggregate Delivery  ·  code WT-######-A  ·  unique (delivery_id (partial: valid ticket))  ·  index (weighed_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
ticket_iduuid—uuid_v7()PK
delivery_iduuid——FK → delivery
gross_kginteger (kg)——
tare_kginteger (kg)——
net_kginteger (kg)——
weighed_attimestamptz——
operator_iduuid——FK → membership

Token เหรียญ reference operational

table token  ·  aggregate Token  ·  unique (mill_id,truck_class,rail,number)  ·  index (mill_id,status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
token_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
truck_classtext (enum)——
railtext (enum)——
colortext (enum)——
numberinteger——
is_specialboolean——
statustext (enum)——
read_techtext (enum: plain | nfc, default plain)—'plain'
current_tag_iduuid✓—FK → token_tag

TokenIssuance การแจกเหรียญ immutable_after_state operational

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)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
issuance_iduuid—uuid_v7()PK
token_iduuid——FK → token
delivery_iduuid——FK → delivery
issued_attimestamptz——
verified_attimestamptz✓—
returned_attimestamptz✓—
special_approval_reftext✓—

TokenTag แท็กของเหรียญ immutable_after_state operational

table token_tag  ·  aggregate Token  ·  unique (mill_id,nfc_uid (partial: retired_at is null))  ·  index (token_id,fitted_at) · (mill_id,retired_at) · (uid_fingerprint)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
tag_iduuid—uuid_v7()PK
token_iduuid——FK → token
mill_iduuid——FK → mill
nfc_uidtext——
tag_techtext (enum)——
chip_classtext (enum: ntag21x | crypto_ndef)——
crypto_capableboolean——
key_reftext (a POINTER into the Cane-operated key regime — never key material)✓—
uid_fingerprintbytea (keyed fingerprint, holds no coin fact)——
write_protectedboolean——
fitted_attimestamptz——
fitted_bytext——
retired_attimestamptz✓—
retire_reasontext (enum)✓—

TokenBinding การผูกเหรียญกับการส่งมอบ append_only operational

table token_binding  ·  aggregate Delivery  ·  unique (token_id (partial: state = active)) · (delivery_id (partial: state = active))  ·  index (mill_id,state) · (delivery_id) · (token_id,issued_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
binding_iduuid—uuid_v7()PK
token_iduuid——FK → token
tag_iduuid✓—FK → token_tag
delivery_iduuid——FK → delivery
mill_iduuid——FK → mill
season_iduuid——FK → season
statetext (enum: active | returned | voided | superseded)——
issued_attimestamptz——
issued_bytext——
closed_attimestamptz✓—
closed_bytext✓—
close_reasontext (enum)✓—
supersedes_binding_iduuid✓—FK → token_binding
reissue_seqinteger——
coin_no_snaptext——

TokenTap การแตะเหรียญ append_only operational

table token_tap  ·  aggregate Delivery  ·  unique (idempotency_key)  ·  index (binding_id,captured_at) · (mill_id,checkpoint,captured_at) · (token_id,captured_at) · (delivery_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
token_tap_iduuid—uuid_v7()PK
binding_iduuid——FK → token_binding
token_iduuid——FK → token
tag_iduuid——FK → token_tag
nfc_uid_snaptext——
mill_iduuid——FK → mill
delivery_iduuid——FK → delivery
delivering_tenant_id_snapuuid——FK → tenant
quota_id_snapuuid——FK → quota
lead_tenant_id_snapuuid✓—FK → tenant
lead_mandate_id_snapuuid✓—FK → lead_mandate
checkpointtext (enum: weigh_in | coin_tower | tipper | weigh_out | driver_read)——
station_idtext——
station_client_iduuid——FK → station_client
reader_idtext——
reader_serial_snaptext——
gateway_node_iduuid——FK → gateway_node
station_config_versiontext——
crushing_line_assigned_snapchar(1)✓—
tipper_slot_assigned_snaptext✓—
crushing_line_snapchar(1)✓—
tipper_slot_snaptext✓—
queue_lane_snaptext✓—
captured_attimestamptz——
capture_clock_offset_msinteger——
local_seqbigint——
idempotency_keytext——
received_attimestamptz——
synced_attimestamptz✓—
sourcetext (enum: reader | supervisor_degraded | reconciliation)——
resulttext (enum)——
actor_idtext✓—
device_attestation_reftext✓—
override_actor_idtext✓—
override_role_snaptext✓—
override_reason_codetext✓—
override_notetext✓—

TokenAccessGrant สิทธิ์อ่านสถานะของคนขับ immutable_after_state operational

table token_access_grant  ·  aggregate Delivery  ·  unique (binding_id (partial: revoked_at is null))  ·  index (mill_id,expires_at) · (binding_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
grant_iduuid—uuid_v7()PK
binding_iduuid——FK → token_binding
mill_iduuid——FK → mill
secret_hashbytea (never stored in clear, never logged)——
payload_reftext——
issued_attimestamptz——
expires_attimestamptz——
max_readsinteger✓—
read_countinteger——
last_read_attimestamptz✓—
revoked_attimestamptz✓—
revoke_reasontext (enum)✓—

TokenAccessRead บันทึกการอ่านสถานะ append_only personal

table token_access_read  ·  aggregate TokenAccessRead  ·  index (grant_id,read_at) · (mill_id,read_at) · (retain_until)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
read_iduuid—uuid_v7()PK
grant_iduuid——FK → token_access_grant
mill_iduuid——FK → mill
read_attimestamptz——
resulttext (enum)——
client_fingerprint_hashbytea——
network_classtext (coarse class only — never a raw address)——
retain_untiltext——

DumpPlatform แท่นเทอ้อย reference operational

table dump_platform  ·  aggregate DumpPlatform  ·  unique (mill_id,rail,number)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
platform_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
railtext (enum)——
numberinteger——
statustext (enum)——

DumpEvent การเทอ้อย append_only operational

table dump_event  ·  aggregate Delivery  ·  unique (delivery_id)  ·  index (platform_id,dumped_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
dump_event_iduuid—uuid_v7()PK
delivery_iduuid——FK → delivery
platform_iduuid——FK → dump_platform
issuance_iduuid——FK → token_issuance
signaled_attimestamptz——
dumped_attimestamptz——
supervisor_iduuid——FK → membership

HarvesterWorkPlan แผนการทำงานรถตัดอ้อย mutable operational

table harvester_work_plan  ·  aggregate HarvesterWorkPlan  ·  unique (season_id,group_no)  ·  index (season_id,status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
plan_iduuid—uuid_v7()PK
season_iduuid——FK → season
group_nointeger——
owner_tenant_iduuid——FK → tenant
quota_iduuid——FK → quota
operation_kindtext (enum)——
driver_prefixtext (namePrefixes row id)✓nullregister row, never free text (FR-437)แถวทะเบียน ไม่ใช่ข้อความอิสระ (FR-437)
driver_first_nametext——
driver_last_nametext——
mechanic_prefixtext (namePrefixes row id)✓null
mechanic_first_nametext——
mechanic_last_nametext——
coordinator_iduuid——FK → membership
statustext (enum)——

QualityTest ผลตรวจ CCS immutable_after_state operational

table quality_test  ·  aggregate QualityTest  ·  code QT-######  ·  unique (delivery_id (partial: valid test))  ·  index (renote_id) · (ccs_tag) · (status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
test_iduuid—uuid_v7()PK
delivery_iduuid——FK → delivery
ccsnumeric(4,2)——
trash_pctnumeric(5,2)——
statustext (enum)——
sampled_attimestamptz——
available_attimestamptz——
lab_reftext——
renote_iduuid——FK → ccs_re_note
ccs_tagtext——
match_methodtext (enum)——

CcsReNote รีโน้ต CCS (จากภาครัฐ) append_only operational

table ccs_re_note  ·  aggregate CcsReNote  ·  code RN-25##-####  ·  unique (mill_id,gov_ref)  ·  index (season_id,received_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
renote_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
gov_reftext——
issued_attimestamptz——
received_attimestamptz——
sourcetext (enum)——

CanePurchasePolicy นโยบายรับซื้ออ้อย mutable operational

table cane_purchase_policy  ·  aggregate Mill  ·  code CPP-####  ·  unique (mill_id,season_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
policy_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
burnt_deduction_per_tbigint (satang)——
green_incentive_per_tbigint (satang)——
burnt_daily_cap_pctnumeric(5,2)——
contamination_deduction_per_tbigint (satang)——

PaymentBatch งวดจ่ายเงิน immutable_after_state operational

table payment_batch  ·  aggregate PaymentBatch  ·  code PAY-25##-##  ·  unique (mill_id,season_id,period,cycle_date)  ·  index (status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
batch_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
periodtext——
cycle_datedate——
statustext (enum)——
approved_byuuid——FK → membership

PaymentItem รายการจ่ายต่อการส่งมอบ immutable_after_state operational

table payment_item  ·  aggregate PaymentBatch  ·  code PI-########  ·  index (batch_id) · (delivery_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
item_iduuid—uuid_v7()PK
batch_iduuid——FK → payment_batch
delivery_iduuid——FK → delivery
base_amtbigint (satang)——
ccs_premiumtext——
cane_type_adjtext——
deductionstext——
net_amtbigint (satang)——

PaymentInstallment งวดย่อยของการจ่าย immutable_after_state operational

table payment_installment  ·  aggregate PaymentBatch  ·  code PIN-#########  ·  unique (item_id,installment_no)  ·  index (due_date,status) · (batch_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
installment_iduuid—uuid_v7()PK
item_iduuid——FK → payment_item
installment_nointeger——
pctnumeric(5,2)——
amountbigint (satang)——
batch_iduuid——FK → payment_batch
due_datedate——
posted_attimestamptz——
statustext (enum)——

MillPaymentSchedule ตารางจ่ายเงินของโรงงาน reference operational

table mill_payment_schedule  ·  aggregate Mill  ·  code MPS-####  ·  unique (mill_id,season_id,effective_from)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
schedule_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
cycle_daysinteger——
first_pctnumeric(5,2)——
second_offset_daysinteger——
effective_fromtext——

FinalPriceSettlement การจ่ายส่วนต่างราคาสุดท้าย immutable_after_state operational

table final_price_settlement  ·  aggregate FinalPriceSettlement  ·  code FPS-25##-####  ·  unique (mill_id,season_id,farmer_tenant_id)  ·  index (status) · (payer)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
settlement_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
farmer_tenant_iduuid——FK → tenant
initial_price_iduuid——FK → cane_price_announcement
final_price_iduuid——FK → cane_price_announcement
diff_amtbigint (satang)——
payertext (enum)——
statustext (enum)——
paid_attimestamptz——

Truck รถบรรทุกอ้อย mutable operational

table truck  ·  aggregate Truck  ·  code TRK-######  ·  unique (mill_id,reg_no_norm,province) v0.20.0  ·  index (mill_id) · (owner_tenant_id) · (operator_contractor_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
truck_iduuid—uuid_v7()PK
mill_iduuid——FK → mill · v0.20.0 (PROP-025)
reg_notext——
reg_no_normtext✓—T-1 normalized plate · v0.20.0 (PROP-025)
provincesmallint——Province enum · TIS 1099-2548 (PROP-047)
truck_typetext (enum)——
capacity_tnumeric(12,3) (t)——
owner_tenant_iduuid——FK → tenant
operator_contractor_iduuid✓—FK → contractor
chassis_idtext✓—Owner-declared · prerequisite for WF-69 plate change · v0.20.0 (PROP-025)
merged_into_truck_iduuid✓—FK → truck · WF-66 soft-delete lineage · v0.20.0 (PROP-025)
statustext (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).

owner_tenant_id (เจ้าของรถ) และ operator_contractor_id (ผู้ขับปัจจุบัน กรอกเฉพาะเมื่อเป็นผู้รับเหมาที่จ้างมา — PROP-004 Q6) เป็น FK แบบ many-to-one ธรรมดาทั้งคู่ ไม่ใช่ many-to-many: column เก็บเฉพาะผู้ขับปัจจุบัน ส่วนประวัติว่าใครขนเที่ยวไหนมาจาก truck_reg_snap รายการส่งมอบ (FR-29) ไม่ใช้ตารางเชื่อม รถของผู้รับเหมาเองอยู่ใน Machine v0.20.0 (PROP-025): ทะเบียนเป็นระดับโรงงาน — เพิ่ม mill_id และคีย์ไม่ซ้ำเป็น (mill_id, reg_no_norm, จังหวัด); ทะเบียนชนกันในทะเบียนเดียวกันคือ duplicate hint ที่จบด้วยการผสานสองจังหวะ WF-66 (ร่องรอย merged_into_truck_id) ทุกการสร้าง/แก้เข้า pipeline จับคู่ของ PLT แบบ fire-and-forget; ชั้น master ของ operator มีบ้านใน SPEC-ERD-PLT และไม่ render บน surface โรงงาน (NFR-55)

CrushingDay วันหีบ immutable_after_state operational

table crushing_day  ·  aggregate CrushingDay  ·  code CSD-25##-###  ·  unique (mill_id,date)  ·  index (season_id,date) · (status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
crushing_day_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
datedate——
crush_capacity_tnumeric(12,3) (t)——
booked_tnumeric(12,3) (t)——
weighed_tnumeric(12,3) (t)——
burnt_cap_pctnumeric(5,2)——
burnt_intake_tnumeric(12,3) (t)——
statustext (enum)——

LedgerAccount บัญชีแยกประเภท mutable operational

table ledger_account  ·  aggregate LedgerAccount  ·  code LGA-#####  ·  unique (owner_tenant_id,code)  ·  index (account_class) · (template_id) · (cash_account_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
account_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
codetext——
name_thtext——
name_entext✓—
account_classtext (enum)——
system_flagboolean——
statustext (enum)——
template_iduuid✓—FK → chart_template
cash_account_iduuid✓—FK → cash_account

JournalEntry รายการสมุดรายวัน append_only operational

table journal_entry  ·  aggregate JournalEntry  ·  code JRN-########  ·  unique (owner_tenant_id,source_type,source_id (partial: auto-posted))  ·  index (owner_tenant_id,entry_date) · (reversal_of)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
entry_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
entry_datedate——
memotext✓—
source_typetext (enum)——
source_idtext✓—
linesjsonb——
statustext (enum)——
reversal_oftext✓—

ChartTemplate ผังบัญชีแม่แบบ reference operational

table chart_template  ·  aggregate ChartTemplate  ·  code COA-####  ·  unique (capacity,version)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
template_iduuid—uuid_v7()PK
capacitytext (enum)——
versiontext——
statustext (enum)——

Invoice ใบแจ้งหนี้ immutable_after_state operational

table invoice  ·  aggregate Invoice  ·  code IVC-25##-######  ·  index (owner_tenant_id,direction,status) · (counterparty_tenant_id) · (due_date)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
invoice_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
directiontext (enum)——
counterparty_tenant_iduuid——FK → tenant
issue_datedate——
due_datedate——
linesjsonb——
subtotalbigint (satang)——
tax_amtbigint (satang)✓—
total_amtbigint (satang)——
statustext (enum)——
source_typetext (enum)✓—
source_idtext✓—

Receipt ใบเสร็จรับเงิน append_only operational

table receipt  ·  aggregate Receipt  ·  code RCP-########  ·  index (owner_tenant_id,received_at) · (invoice_id) · (cash_account_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
receipt_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
payer_tenant_iduuid✓—FK → tenant
invoice_iduuid✓—FK → invoice
amountbigint (satang)——
methodtext (enum)——
cash_account_iduuid✓—FK → cash_account
received_attimestamptz——
recorded_byuuid——FK → membership

PaymentVoucher ใบสำคัญจ่าย append_only operational

table payment_voucher  ·  aggregate PaymentVoucher  ·  code PVC-########  ·  index (owner_tenant_id,paid_at) · (invoice_id) · (cash_account_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
voucher_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
payee_tenant_iduuid✓—FK → tenant
invoice_iduuid✓—FK → invoice
amountbigint (satang)——
methodtext (enum)——
cash_account_iduuid✓—FK → cash_account
paid_attimestamptz——
approved_byuuid——FK → membership

CashAccount บัญชีเงินสด/ธนาคาร mutable operational

table cash_account  ·  aggregate CashAccount  ·  code CBK-#####  ·  unique (ledger_account_id)  ·  index (owner_tenant_id,status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
cash_account_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
kindtext (enum)——
bank_nametext✓—
acct_no_masktext✓—
ledger_account_iduuid——FK → ledger_account
opening_balancebigint (satang)——
statustext (enum)——

BankTransaction รายการเดินบัญชี append_only operational

table bank_transaction  ·  aggregate CashAccount  ·  code BKT-########  ·  unique (cash_account_id,external_ref (partial: not null))  ·  index (cash_account_id,value_date) · (recon_status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
txn_iduuid—uuid_v7()PK
cash_account_iduuid——FK → cash_account
value_datedate——
amountbigint (satang)——
descriptiontext——
external_reftext✓—
recon_statustext (enum)——
imported_attimestamptz—now()

Reconciliation การกระทบยอด immutable_after_state operational

table reconciliation  ·  aggregate CashAccount  ·  code RCN-25##-###  ·  unique (cash_account_id,period_id)  ·  index (status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
recon_iduuid—uuid_v7()PK
cash_account_iduuid——FK → cash_account
period_iduuid——FK → fiscal_period
statement_balancebigint (satang)——
ledger_balancebigint (satang)——
differencebigint (satang)——
statustext (enum)——
reconciled_byuuid——FK → membership
closed_attimestamptz✓—

FiscalPeriod งวดบัญชี immutable_after_state operational

table fiscal_period  ·  aggregate FiscalPeriod  ·  code FPD-25##-##  ·  unique (owner_tenant_id,label)  ·  index (owner_tenant_id,status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
period_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
labeltext——
starts_ondate——
ends_ondate——
basistext (enum)——
statustext (enum)——
closed_byuuid✓—FK → membership

FinancialStatement งบการเงิน append_only consent_gated

table financial_statement  ·  aggregate FinancialStatement  ·  code FST-########  ·  unique (owner_tenant_id,statement_type,period_id,basis)  ·  index (shared_via_consent_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
statement_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
statement_typetext (enum)——
period_iduuid——FK → fiscal_period
basistext (enum)——
snapshotjsonb——
generated_attimestamptz—now()
shared_via_consent_iduuid✓—FK → consent_grant

BooksProfile โปรไฟล์สมุดบัญชี mutable operational

table books_profile  ·  aggregate BooksProfile  ·  code BKP-#####  ·  unique (owner_tenant_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
profile_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
default_basistext (enum)——
books_editiontext (enum)——
ledger_viewtext (enum)——
statustext (enum)——

StampCheckpoint จุดประทับตรา mutable confidential_wall

table stamp_checkpoint  ·  aggregate StampCheckpoint  ·  code CKP-####  ·  index (mill_id,status) · (province)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
checkpoint_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
name_thtext——
name_entext✓—
provincesmallint——Province enum · TIS 1099-2548 (PROP-047)
geo_locationpoint✓—
operatortext——
default_extra_rate_per_tbigint (satang)——
statustext (enum)——

CheckpointRate อัตราจุดประทับตรารายชาวไร่ append_only confidential_wall

table checkpoint_rate  ·  aggregate StampCheckpoint  ·  code CKR-######  ·  index (checkpoint_id,tenant_id,season_id,status) · (agreement_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
rate_iduuid—uuid_v7()PK
checkpoint_iduuid——FK → stamp_checkpoint
agreement_iduuid✓—FK → strategic_agreement
tenant_iduuid——FK → tenant
season_iduuid——FK → season
min_volume_tnumeric(12,3) (t)✓—
max_volume_tnumeric(12,3) (t)✓—
extra_rate_per_tbigint (satang)——
statustext (enum)——

StampEvent การประทับตรา append_only confidential_wall

table stamp_event  ·  aggregate StampCheckpoint  ·  code STE-########  ·  unique (delivery_id (partial: not null))  ·  index (checkpoint_id,stamped_at) · (truck_id) · (tenant_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
stamp_iduuid—uuid_v7()PK
checkpoint_iduuid——FK → stamp_checkpoint
truck_iduuid——FK → truck
delivery_iduuid✓—FK → delivery
tenant_iduuid——FK → tenant
planned_net_tnumeric(12,3) (t)✓—
stamped_attimestamptz——
recorded_byuuid——FK → membership

StrategicAgreement ข้อตกลงค่าอ้อยกลยุทธ์ immutable_after_state confidential_wall

table strategic_agreement  ·  aggregate StrategicAgreement  ·  code SGA-25##-####  ·  index (mill_id,season_id,status) · (counterparty_tenant_id,season_id) · (supersedes_agreement_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
agreement_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
counterparty_tenant_iduuid——FK → tenant
season_iduuid——FK → season
pricing_modetext (enum)——
premium_per_tbigint (satang)✓—
contract_volume_tnumeric(12,3) (t)——
upfront_pctnumeric(5,2)——
benefit_treatmenttext (enum)✓—
confidentialboolean——
revision_nointeger——
effective_fromtext——
supersedes_agreement_iduuid✓—FK → strategic_agreement
statustext (enum)——
signed_attimestamptz——
signed_byuuid——FK → membership
calc_basistext (enum)✓—
retroboolean✓—
visible_to_quotaboolean✓false

PremiumAccrual การสะสมค่าอ้อยกลยุทธ์ append_only confidential_wall

table premium_accrual  ·  aggregate StrategicAgreement  ·  code PMA-########  ·  unique (agreement_id,delivery_id)  ·  index (posted_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
accrual_iduuid—uuid_v7()PK
agreement_iduuid——FK → strategic_agreement
delivery_iduuid——FK → delivery
stamp_event_idtext✓—
net_tnumeric(12,3) (t)——
premium_rate_per_tbigint (satang)——
gross_premium_amtbigint (satang)——
upfront_pctnumeric(5,2)——
upfront_amtbigint (satang)——
withheld_amtbigint (satang)——
posted_attimestamptz——

PremiumRelease การจ่ายค่าอ้อยกลยุทธ์เป็นงวด append_only confidential_wall

table premium_release  ·  aggregate StrategicAgreement  ·  code PMR-########  ·  index (agreement_id,status) · (delivery_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
release_iduuid—uuid_v7()PK
agreement_iduuid——FK → strategic_agreement
release_typetext (enum)——
pctnumeric(5,2)✓—
amountbigint (satang)——
delivery_iduuid✓—FK → delivery
methodtext (enum)——
paid_attimestamptz——
recorded_byuuid——FK → membership
statustext (enum)——

CostCentre ศูนย์ต้นทุน mutable confidential_wall

table cost_centre  ·  aggregate CostCentre  ·  code CCN-########  ·  unique (owner_tenant_id,code)  ·  index (owner_tenant_id,kind) · (parent_centre_id) · (owner_tenant_id,status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
centre_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
kindtext (enum)——
ref_iduuid (polymorphic by kind — no FK; resolved against Field / CropCycle / Crop / IrrigationAsset / Tenant)✓—
parent_centre_iduuid✓—FK → cost_centre
codetext——
name_thtext——
name_entext✓—
opened_ondate——
closed_ondate✓—
statustext (enum)——

CostCentreBalance ยอดคงเหลือรายศูนย์ต้นทุน mutable confidential_wall

table cost_centre_balance  ·  aggregate CostCentreBalance  ·  unique (centre_id,period_id,account_id)  ·  index (period_id,centre_id) · (account_id,period_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
centre_iduuid——PK
period_iduuid——PK
account_iduuid——PK
debitnumeric(14,2)——
creditnumeric(14,2)——

AllocationRule กฎการปันส่วน immutable_after_state confidential_wall

table allocation_rule  ·  aggregate AllocationRule  ·  code ALR-######  ·  unique (owner_tenant_id,source_centre_id,version)  ·  index (owner_tenant_id,status) · (source_centre_id) · (effective_from_season_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
rule_iduuid—uuid_v7()PK
owner_tenant_iduuid——FK → tenant
source_centre_iduuid——FK → cost_centre
basistext (enum)——
effective_from_season_iduuid——FK → season
effective_to_season_iduuid✓—FK → season
versionsmallint——
superseded_byuuid✓—FK → allocation_rule
target_filterjsonb✓—
statustext (enum)——

CostAllocation การปันส่วนต้นทุน append_only confidential_wall

table cost_allocation  ·  aggregate CostAllocation  ·  code ALC-########  ·  index (period_id) · (source_centre_id,period_id) · (rule_id,rule_version)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
alloc_iduuid—uuid_v7()PK
rule_iduuid——FK → allocation_rule
rule_versionsmallint——
run_attimestamptz——
period_iduuid——FK → fiscal_period
source_centre_iduuid——FK → cost_centre
basis_snapshotjsonb——
total_amountnumeric(14,2)——
line_countinteger——
reversed_byuuid✓—FK → cost_allocation

AmortisationRun การตัดจำหน่ายรายฤดู append_only confidential_wall

table amortisation_run  ·  aggregate AmortisationRun  ·  code AMR-########  ·  unique (cycle_id,season_id)  ·  index (season_id) · (posted_entry_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
run_iduuid—uuid_v7()PK
cycle_iduuid——FK → crop_cycle
season_iduuid——FK → season
basistext (enum)——
qty_basisnumeric(12,3)✓—
charge_amountnumeric(14,2)——
opening_balancenumeric(14,2)——
closing_balancenumeric(14,2)——
posted_entry_iduuid——FK → journal_entry

CycleLossEvent เหตุความเสียหายของรอบปลูก append_only confidential_wall

table cycle_loss_event  ·  aggregate CycleLossEvent  ·  code CLE-########  ·  index (cycle_id,occurred_on) · (cause) · (posted_entry_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
loss_iduuid—uuid_v7()PK
cycle_iduuid——FK → crop_cycle
crop_iduuid✓—FK → crop
causetext (enum)——
occurred_ondate——
declared_ondate——
affected_rainumeric(10,2)——
evidence_doc_iduuid✓—FK → document
ocsb_declaration_reftext✓—
impairment_amountnumeric(14,2)——
ends_cycleboolean——
posted_entry_iduuid——FK → journal_entry

EntryDocumentLink สายเชื่อมเอกสารกับรายการบัญชี immutable_after_state confidential_wall

table entry_document_link  ·  aggregate EntryDocumentLink  ·  code EDL-########  ·  unique (entry_id,document_id,role)  ·  index (document_id) · (entry_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
link_iduuid—uuid_v7()PK
entry_iduuid——FK → journal_entry
document_iduuid——FK → document
roletext (enum)——
linked_byuuid——FK → membership
linked_attimestamptz——
unlinked_attimestamptz✓—

AdvanceEarmark การผูกเงินที่ปล่อยกับแปลง immutable_after_state confidential_wall

table advance_earmark  ·  aggregate AdvanceEarmark  ·  code AEM-########  ·  index (lender_tenant_id,state) · (borrower_tenant_id) · (credit_item_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
earmark_iduuid—uuid_v7()PK
credit_item_iduuid——FK → credit_item
lender_tenant_iduuid——FK → tenant
borrower_tenant_iduuid——FK → tenant
target_kindtext (enum)——
target_ref_iduuid (polymorphic by target_kind — no FK; the lender's handle is target_alias_id, never the field id)——
target_alias_iduuid——FK → field_alias
amountnumeric(14,2)——
qtynumeric(12,3)✓—
qty_unittext✓—
basistext (enum)——
declared_bytext——
declared_attimestamptz——
statetext (enum)——
supersedes_iduuid✓—FK → advance_earmark

BorrowerPosition ยอดคงค้างรายลูกหนี้ในเครือข่าย mutable confidential_wall

table borrower_position  ·  aggregate BorrowerPosition  ·  unique (lender_tenant_id,borrower_centre_id,season_id)  ·  index (lender_tenant_id,season_id) · (borrower_centre_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
lender_tenant_iduuid——PK
borrower_centre_iduuid——PK
season_iduuid——PK
advanced_cashnumeric(14,2)——
advanced_in_kindnumeric(14,2)——
interest_chargednumeric(14,2)——
recoverednumeric(14,2)——
allowancenumeric(14,2)——
written_offnumeric(14,2)——
outstandingnumeric(14,2)——
recovery_ratenumeric(5,2)——

PromotionZone เขตส่งเสริม reference operational

table promotion_zone  ·  aggregate PromotionZone  ·  code PZN-####  ·  unique (mill_id,code)  ·  index (mill_id,status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
zone_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
codetext——
name_thtext——
name_entext——
statustext (enum)——

ContractFarmingProgram โปรแกรมเกษตรพันธสัญญา immutable_after_state confidential_wall

table contract_farming_program  ·  aggregate ContractFarmingProgram  ·  code CFP-########  ·  unique (mill_id,season_id,objective)  ·  index (mill_id,status) · (season_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
program_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
objectivetext (enum)——
budget_amountnumeric(14,2)——
target_area_rainumeric(12,2)——
target_volume_tnumeric(12,3) (t)——
input_packagejsonb——
terms_per_rainumeric(12,2)——
repayment_routetext (enum)——
published_attimestamptz✓—
statustext (enum)——

ProgramEnrollment การเข้าร่วมโปรแกรม immutable_after_state confidential_wall

table program_enrollment  ·  aggregate ProgramEnrollment  ·  code PEN-########  ·  unique (program_id,field_id)  ·  index (program_id,status) · (quota_tenant_id) · (field_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
enrollment_iduuid—uuid_v7()PK
program_iduuid——FK → contract_farming_program
quota_tenant_iduuid——FK → tenant
field_iduuid——FK → field
crop_iduuid✓—FK → crop
alias_iduuid——FK → field_alias
tenure_iduuid——FK → tenure_record
area_rai_snapnumeric(10,2)——
target_yield_t_per_rainumeric(8,3)——
committed_tonnage_tnumeric(12,3) (t)——
funding_amountnumeric(14,2)——
starts_ondate——
ends_ondate——
statustext (enum)——

FuelCredit เครดิตน้ำมัน immutable_after_state operational

table fuel_credit  ·  aggregate FuelCredit  ·  code FC-########  ·  unique (delivery_id)  ·  index (mill_id,redeemed_at) · (quota_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
fuel_credit_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
delivery_iduuid——FK → delivery
quota_iduuid——FK → quota
station_iduuid——FK → fuel_station
cap_amountnumeric(12,2)——
redeemed_amountnumeric(12,2)——
litresnumeric(10,2)——
fuel_typetext (enum)——
pump_price_per_litrenumeric(12,2)——
recorded_bytext——
redeemed_attimestamptz——
statustext (enum)——

FuelStation สถานีน้ำมันบริการ reference operational

table fuel_station  ·  aggregate FuelStation  ·  code FS-####  ·  index (mill_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
station_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
tenant_iduuid✓—FK → tenant
nametext——
locationtext✓—
statustext (enum)——

MillFuelConfig ตั้งค่าบริการน้ำมัน append_only operational

table mill_fuel_config  ·  aggregate MillFuelConfig  ·  index (mill_id,effective_from)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
config_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
enabledboolean——
fuel_cap_pctnumeric(5,2)——
eligibility_scopetext (enum)✓—
subsidy_pricesjsonb✓—
fee_overridejsonb✓—
repayment_allocation_pctnumeric(5,2)✓—
effective_fromtext——
statustext (enum)——

StrategicPlan แผนค่าอ้อยกลยุทธ์ mutable confidential_wall

table strategic_plan  ·  aggregate StrategicPlan  ·  code SPL-25##-###  ·  unique (mill_id,season_id)  ·  index (mill_id,season_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
plan_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
nametext——
target_volume_tnumeric(12,3) (t)——
budget_envelope_amttext——
created_byuuid——FK → membership
created_attimestamptz——
statustext (enum)——

PlanScenario สถานการณ์จำลองของแผน immutable_after_state confidential_wall

table plan_scenario  ·  aggregate StrategicPlan  ·  code PSC-########  ·  index (plan_id,status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
scenario_iduuid—uuid_v7()PK
plan_iduuid——FK → strategic_plan
nametext——
forked_from_scenario_iduuid✓—FK → plan_scenario
forked_from_version_iduuid✓—FK → plan_version
financing_rate_pctnumeric(5,2)——
transport_cost_per_t_kmtext——
expected_ccstext——
price_assumption_amttext——
justificationtext✓—
created_byuuid——FK → membership
created_attimestamptz——
statustext (enum)——

PlanVersion เวอร์ชันแผน immutable_after_state confidential_wall

table plan_version  ·  aggregate StrategicPlan  ·  code PLV-25##-##  ·  unique (plan_id,version_no)  ·  index (plan_id,effective_from)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
version_iduuid—uuid_v7()PK
plan_iduuid——FK → strategic_plan
scenario_iduuid——FK → plan_scenario
version_notext——
effective_fromtext——
authored_byuuid——FK → membership
approved_byuuid——FK → membership
published_attimestamptz——
statustext (enum)——

CalcBasisPolicy นโยบายฐานคำนวณ append_only confidential_wall

table calc_basis_policy  ·  aggregate CalcBasisPolicy  ·  code CBP-########  ·  unique (one ACTIVE row per (mill_id, season_id, scope_kind, scope ref) — partial unique on superseded_by_id IS NULL)  ·  index (mill_id,season_id,scope_kind) · (agreement_id) · (farmer_group_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
policy_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
scope_kindtext——
farmer_group_iduuid✓—FK → farmer_group
tenant_iduuid✓—FK → tenant
agreement_iduuid✓—FK → strategic_agreement
tier_reftext✓—
calc_basistext——
farmer_visibilitytext✓—
plan_version_iduuid✓—FK → plan_version
effective_fromtext——
superseded_by_iduuid✓—FK → calc_basis_policy
created_byuuid——FK → membership
created_attimestamptz——

FarmerGroup กลุ่มชาวไร่ immutable_after_state confidential_wall

table farmer_group  ·  aggregate FarmerGroup  ·  code FGR-25##-###  ·  unique (mill_id,season_id,name)  ·  index (mill_id,season_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
group_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
nametext——
member_tenant_idstext——
source_ruletext✓—
frozen_attimestamptz——
created_byuuid——FK → membership
statustext (enum)——

MillStrategicConfig ตั้งค่าข้อตกลงกลยุทธ์ append_only confidential_wall

table mill_strategic_config  ·  aggregate MillStrategicConfig  ·  unique (mill_id,effective_from)  ·  index (mill_id,status)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
config_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
overlap_allowedboolean——
resolver_ruletext (enum)——
effective_fromtext——
statustext (enum)——

QueueLane แถวคิว mutable public

table queue_lane  ·  aggregate QueueLane  ·  unique (mill_id,season_id,lane_no) · (mill_id,season_id,code)  ·  index (mill_id,active) · (mill_id,cane_class) · (mill_id,season_id,effective_from)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
queue_lane_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
lane_nosmallint——
codevarchar(4)——
labeltext——
label_thtext——
truck_classtext (enum: ten_wheel | six_wheel | etan | transfer | trailer | any)——
cane_classtext (enum: fresh | burnt | harvester | any)——
lane_roletext (enum: standard | express | cut_order | other)—standard
capacity_truckssmallint——
unload_baytext✓—
activeboolean—true
effective_fromdate——

QueueLaneInstance แถวที่เปิดของวัน immutable_after_state public

table queue_lane_instance  ·  aggregate QueueLaneInstance  ·  unique (mill_id,crushing_day_id,queue_lane_id,instance_no)  ·  index (mill_id,crushing_day_id,closed_at) · (queue_lane_id,opened_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
queue_lane_instance_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
crushing_day_iduuid——FK → crushing_day
queue_lane_iduuid——FK → queue_lane
instance_nosmallint—1
opened_attimestamptz—now()
opened_byuuid——FK → membership
opened_reasontext (enum: day_open | previous_full | staff_marked_full)——
depthsmallint—0
closed_attimestamptz✓—

ExpressReason เหตุด่วน mutable public release: v2

table express_reason  ·  aggregate ExpressReason  ·  unique (mill_id,season_id,code)  ·  indexes (mill_id,active) · (mill_id,season_id,effective_from) · (mill_id,category)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นNotesหมายเหตุ
express_reason_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
codevarchar(8)——unique per mill/season
label_th · label_entext——what the console and the board print
categorytext (enum)——perishability | mill_remedy | mill_logistics | other
derivationtext (enum)—staff_claimedsystem_derived | staff_claimed
evidence_requiredtext——what must be attached to a grant
cap_share_pctnumeric(5,2)✓—share of the day's releases; one of the two caps is mandatory
cap_trucks_per_daysmallint✓—absolute cap
may_overrun_ceilingboolean—falsetrue only for mill_remedy
sign_off_leveltext (enum)—millmill | mill_plus_association
published_attimestamptz——unpublished = selectable nowhere
effective_fromdate——effective-forward only
activeboolean—truenever deactivated while today's grants cite it

ExpressGrant การให้สิทธิ์ด่วน append_only operational release: v2

table express_grant  ·  aggregate ExpressGrant  ·  indexes (queue_ticket_id) · (express_reason_id,granted_at) · (granted_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นNotesหมายเหตุ
express_grant_iduuid—uuid_v7()PK
queue_ticket_iduuid——FK → queue_ticket
express_reason_iduuid——FK → express_reason; published before the grant
granted_byuuid——FK → membership; shift-level permission
granted_attimestamptz—now()counted against the day's ceiling at write
evidence_reftext✓—mandatory where the reason requires it
from_lane_instance_iduuid✓—FK → queue_lane_instance
to_lane_instance_iduuid——FK → queue_lane_instance
hours_since_cutnumeric(6,2)✓—denormalised on purpose — the justifying fact
superseded_byuuid✓—FK → express_grant; rows are never edited

ExpressFlag ธงคัดค้านการปล่อยด่วน immutable_after_state personal release: v2

table express_flag  ·  aggregate ExpressGrant  ·  unique (express_grant_id,flagged_by)  ·  indexes (express_grant_id) · (flagged_at) · (reviewed_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นNotesหมายเหตุ
express_flag_iduuid—uuid_v7()PK
express_grant_iduuid——FK → express_grant
flagged_byuuid——FK → membership; one flag per tenant per release
flagged_attimestamptz—now()no queue effect
notetext✓—farmer's own words
reviewed_attimestamptz✓—season close
review_outcometext (enum)✓—upheld | not_upheld | no_finding
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.

journal_entry เพิ่ม captured_by_membership_id? uuid (FK → membership) และ capture_mode? text (enum) สำหรับบรรทัดที่ชาวไร่บันทึกเอง (ค่าใช้จ่ายและสมุดเงินสด) ตาราง append-only จึงเขียนตราครั้งเดียวโดยธรรมชาติ (FR-339, A-71) เป้าหมายอีกสามอย่างในร่างถูกตัดออกตอน apply: queue_ticket delivery และการใช้สิทธิ์ fuel_credit ไม่ใช่ระเบียนที่ชาวไร่เขียนใน V1 — ป้อมออกเลข ตะแกรงชั่งเขียนน้ำหนัก และปั๊มเขียนการใช้สิทธิ์ — การใส่ตราบนระเบียนที่ชาวไร่ไม่ได้เขียนจะทำให้ฟิลด์เดียวมีสองความหมาย สอดคล้องกับที่คิวใน V1 เป็นการกระทำชั้น C-3 บน surface ชาวไร่ (PROP-056) คือเงาของข้อเท็จจริงที่คนอื่นเขียน

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 ฉบับเต็ม

EntityTableตารางPKUniqueKey indexesIndex หลักMutabilityPDPAProfile
Millmillmill_id(license_no (partial: not null))(tenant_id) (province) (onboard_status)mutableoperationalSection 6ข้อ 6
Deliverydeliverydelivery_id(truck_id (partial: status in booked..weighed_out))(quota_id,status) (crushing_day_id,status) (crop_id) (coin_no,crushing_line,tipper_slot)immutable_after_stateoperationalSection 6ข้อ 6
WeighTicketweigh_ticketticket_id(delivery_id (partial: valid ticket))(weighed_at)append_onlyoperationalSection 6ข้อ 6
Tokentokentoken_id(mill_id,truck_class,rail,number)(mill_id,status)referenceoperationalSection 6ข้อ 6
TokenIssuancetoken_issuanceissuance_id(delivery_id partial: open state only)(token_id,issued_at)immutable_after_stateoperationalSection 6ข้อ 6
TokenTagtoken_tagtag_id(mill_id,nfc_uid (partial: retired_at is null))(token_id,fitted_at) · (mill_id,retired_at) · (uid_fingerprint)immutable_after_stateoperationalSection 6ข้อ 6
TokenBindingtoken_bindingbinding_id(token_id (partial: state = active)) · (delivery_id (partial: state = active))(mill_id,state) · (delivery_id) · (token_id,issued_at)append_onlyoperationalSection 6ข้อ 6
TokenTaptoken_taptoken_tap_id(idempotency_key)(binding_id,captured_at) · (mill_id,checkpoint,captured_at) · (token_id,captured_at) · (delivery_id)append_onlyoperationalSection 6ข้อ 6
TokenAccessGranttoken_access_grantgrant_id(binding_id (partial: revoked_at is null))(mill_id,expires_at) · (binding_id)immutable_after_stateoperationalSection 6ข้อ 6
TokenAccessReadtoken_access_readread_id—(grant_id,read_at) · (mill_id,read_at) · (retain_until)append_onlypersonalSection 6ข้อ 6
DumpPlatformdump_platformplatform_id(mill_id,rail,number)—referenceoperationalSection 6ข้อ 6
DumpEventdump_eventdump_event_id(delivery_id)(platform_id,dumped_at)append_onlyoperationalSection 6ข้อ 6
HarvesterWorkPlanharvester_work_planplan_id(season_id,group_no)(season_id,status)mutableoperationalSection 6ข้อ 6
QualityTestquality_testtest_id(delivery_id (partial: valid test))(renote_id) (ccs_tag) (status)immutable_after_stateoperationalSection 6ข้อ 6
CcsReNoteccs_re_noterenote_id(mill_id,gov_ref)(season_id,received_at)append_onlyoperationalSection 6ข้อ 6
CanePurchasePolicycane_purchase_policypolicy_id(mill_id,season_id)—mutableoperationalSection 6ข้อ 6
PaymentBatchpayment_batchbatch_id(mill_id,season_id,period,cycle_date)(status)immutable_after_stateoperationalSection 6ข้อ 6
PaymentItempayment_itemitem_id—(batch_id) (delivery_id)immutable_after_stateoperationalSection 6ข้อ 6
PaymentInstallmentpayment_installmentinstallment_id(item_id,installment_no)(due_date,status) (batch_id)immutable_after_stateoperationalSection 6ข้อ 6
MillPaymentSchedulemill_payment_scheduleschedule_id(mill_id,season_id,effective_from)—referenceoperationalSection 6ข้อ 6
FinalPriceSettlementfinal_price_settlementsettlement_id(mill_id,season_id,farmer_tenant_id)(status) (payer)immutable_after_stateoperationalSection 6ข้อ 6
Trucktrucktruck_id(mill_id,reg_no_norm,province)(mill_id) (owner_tenant_id) (operator_contractor_id)mutableoperationalSection 6ข้อ 6
CrushingDaycrushing_daycrushing_day_id(mill_id,date)(season_id,date) (status)immutable_after_stateoperationalSection 6ข้อ 6
LedgerAccountledger_accountaccount_id(owner_tenant_id,code)(account_class) (template_id) (cash_account_id)mutableoperationalSection 6ข้อ 6
JournalEntryjournal_entryentry_id(owner_tenant_id,source_type,source_id (partial: auto-posted))(owner_tenant_id,entry_date) (reversal_of)append_onlyoperationalSection 6ข้อ 6
ChartTemplatechart_templatetemplate_id(capacity,version)—referenceoperationalSection 6ข้อ 6
Invoiceinvoiceinvoice_id—(owner_tenant_id,direction,status) (counterparty_tenant_id) (due_date)immutable_after_stateoperationalSection 6ข้อ 6
Receiptreceiptreceipt_id—(owner_tenant_id,received_at) (invoice_id) (cash_account_id)append_onlyoperationalSection 6ข้อ 6
PaymentVoucherpayment_vouchervoucher_id—(owner_tenant_id,paid_at) (invoice_id) (cash_account_id)append_onlyoperationalSection 6ข้อ 6
CashAccountcash_accountcash_account_id(ledger_account_id)(owner_tenant_id,status)mutableoperationalSection 6ข้อ 6
BankTransactionbank_transactiontxn_id(cash_account_id,external_ref (partial: not null))(cash_account_id,value_date) (recon_status)append_onlyoperationalSection 6ข้อ 6
Reconciliationreconciliationrecon_id(cash_account_id,period_id)(status)immutable_after_stateoperationalSection 6ข้อ 6
FiscalPeriodfiscal_periodperiod_id(owner_tenant_id,label)(owner_tenant_id,status)immutable_after_stateoperationalSection 6ข้อ 6
FinancialStatementfinancial_statementstatement_id(owner_tenant_id,statement_type,period_id,basis)(shared_via_consent_id)append_onlyconsent_gatedSection 6ข้อ 6
BooksProfilebooks_profileprofile_id(owner_tenant_id)—mutableoperationalSection 6ข้อ 6
StampCheckpointstamp_checkpointcheckpoint_id—(mill_id,status) (province)mutableconfidential_wallSection 6ข้อ 6
CheckpointRatecheckpoint_raterate_id—(checkpoint_id,tenant_id,season_id,status) (agreement_id)append_onlyconfidential_wallSection 6ข้อ 6
StampEventstamp_eventstamp_id(delivery_id (partial: not null))(checkpoint_id,stamped_at) (truck_id) (tenant_id)append_onlyconfidential_wallSection 6ข้อ 6
StrategicAgreementstrategic_agreementagreement_id—(mill_id,season_id,status) (counterparty_tenant_id,season_id) (supersedes_agreement_id)immutable_after_stateconfidential_wallSection 6ข้อ 6
PremiumAccrualpremium_accrualaccrual_id(agreement_id,delivery_id)(posted_at)append_onlyconfidential_wallSection 6ข้อ 6
PremiumReleasepremium_releaserelease_id—(agreement_id,status) (delivery_id)append_onlyconfidential_wallSection 6ข้อ 6
CostCentrecost_centrecentre_id(owner_tenant_id,code)(owner_tenant_id,kind) (parent_centre_id) (owner_tenant_id,status)mutableconfidential_wallSection 6ข้อ 6
CostCentreBalancecost_centre_balancecentre_id,period_id,account_id(centre_id,period_id,account_id)(period_id,centre_id) (account_id,period_id)mutableconfidential_wallSection 6ข้อ 6
AllocationRuleallocation_rulerule_id(owner_tenant_id,source_centre_id,version)(owner_tenant_id,status) (source_centre_id) (effective_from_season_id)immutable_after_stateconfidential_wallSection 6ข้อ 6
CostAllocationcost_allocationalloc_id—(period_id) (source_centre_id,period_id) (rule_id,rule_version)append_onlyconfidential_wallSection 6ข้อ 6
AmortisationRunamortisation_runrun_id(cycle_id,season_id)(season_id) (posted_entry_id)append_onlyconfidential_wallSection 6ข้อ 6
CycleLossEventcycle_loss_eventloss_id—(cycle_id,occurred_on) (cause) (posted_entry_id)append_onlyconfidential_wallSection 6ข้อ 6
EntryDocumentLinkentry_document_linklink_id(entry_id,document_id,role)(document_id) (entry_id)immutable_after_stateconfidential_wallSection 6ข้อ 6
AdvanceEarmarkadvance_earmarkearmark_id—(lender_tenant_id,state) (borrower_tenant_id) (credit_item_id)immutable_after_stateconfidential_wallSection 6ข้อ 6
BorrowerPositionborrower_positionlender_tenant_id,borrower_centre_id,season_id(lender_tenant_id,borrower_centre_id,season_id)(lender_tenant_id,season_id) (borrower_centre_id)mutableconfidential_wallSection 6ข้อ 6
PromotionZonepromotion_zonezone_id(mill_id,code)(mill_id,status)referenceoperationalSection 6ข้อ 6
ContractFarmingProgramcontract_farming_programprogram_id(mill_id,season_id,objective)(mill_id,status) (season_id)immutable_after_stateconfidential_wallSection 6ข้อ 6
ProgramEnrollmentprogram_enrollmentenrollment_id(program_id,field_id)(program_id,status) (quota_tenant_id) (field_id)immutable_after_stateconfidential_wallSection 6ข้อ 6
FuelCreditfuel_creditfuel_credit_id(delivery_id)(mill_id,redeemed_at) (quota_id)immutable_after_stateoperationalSection 6ข้อ 6
FuelStationfuel_stationstation_id—(mill_id)referenceoperationalSection 6ข้อ 6
MillFuelConfigmill_fuel_configconfig_id—(mill_id,effective_from)append_onlyoperationalSection 6ข้อ 6
StrategicPlanstrategic_planplan_id(mill_id,season_id)(mill_id,season_id)mutableconfidential_wallSection 6ข้อ 6
PlanScenarioplan_scenarioscenario_id—(plan_id,status)immutable_after_stateconfidential_wallSection 6ข้อ 6
PlanVersionplan_versionversion_id(plan_id,version_no)(plan_id,effective_from)immutable_after_stateconfidential_wallSection 6ข้อ 6
CalcBasisPolicycalc_basis_policypolicy_id(one ACTIVE row per (mill_id, season_id, scope_kind, scope ref) — partial unique on superseded_by_id IS NULL)(mill_id,season_id,scope_kind) (agreement_id) (farmer_group_id)append_onlyconfidential_wallSection 6ข้อ 6
FarmerGroupfarmer_groupgroup_id(mill_id,season_id,name)(mill_id,season_id)immutable_after_stateconfidential_wallSection 6ข้อ 6
MillStrategicConfigmill_strategic_configconfig_id(mill_id,effective_from)(mill_id,status)append_onlyconfidential_wallSection 6ข้อ 6
QueueLanequeue_lanequeue_lane_id(mill_id,season_id,lane_no) · (mill_id,season_id,code)(mill_id,active) · (mill_id,cane_class)mutablepublicSection 6ข้อ 6
QueueLaneInstancequeue_lane_instancequeue_lane_instance_id(mill_id,crushing_day_id,queue_lane_id,instance_no)(mill_id,crushing_day_id,closed_at)immutable_after_statepublicSection 6ข้อ 6
ExpressReasonexpress_reasonexpress_reason_id(mill_id,season_id,code)(mill_id,active) · (mill_id,season_id,effective_from) · (mill_id,category)mutablepublic
ExpressGrantexpress_grantexpress_grant_id—(queue_ticket_id) · (express_reason_id,granted_at) · (granted_at)append_onlyoperational
ExpressFlagexpress_flagexpress_flag_id(express_grant_id,flagged_by)(express_grant_id) · (flagged_at) · (reviewed_at)immutable_after_statepersonal

8. Consistency boundaries8. ขอบเขตความสอดคล้อง (aggregate)

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).

ขอบเขต transaction ที่เกี่ยวกับมุมมองนี้ จาก dataModeling.aggregates ใน graph ภายในขอบเขต invariant ที่ระบุ commit แบบ atomic ใน database transaction เดียว; ข้ามขอบเขตผลไหลผ่าน domain event (eventual consistency) lifetime ของ repository และ unit of work ของ aggregate เหล่านี้กำหนดในเอกสาร SPEC-DDD พี่น้อง (scoped ต่อคำขอ — ดูผัง lifetime ของ component)

Aggregate rootMembersสมาชิกContextTransaction ruleกติกา transaction
DeliveryDelivery · WeighTicketdelivery_weighbridgeTransitions 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 บัตรฉบับแทน
QualityTestQualityTestqualityOne valid test per delivery (partial unique); re-tests supersede; provisional → confirmed on re-note match.หนึ่งผลที่ใช้ได้ต่อการส่งมอบ (partial unique); ตรวจซ้ำออกฉบับแทน; provisional → confirmed เมื่อจับคู่ re-note
CcsReNoteCcsReNotequalityIngested government document — append-only; matching fans out QualityTest updates in follow-up transactions.เอกสารรัฐที่นำเข้า — append-only; การจับคู่กระจายการปรับ QualityTest ใน transaction ตามหลัง
CrushingDayCrushingDaydelivery_weighbridgeBooking/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 และสัดส่วนเพดานไฟไหม้ที่นี่; การปิดวันสร้างระเบียนกำกับรายคืน
MillMill · CanePurchasePolicy · MillPaymentSchedulefederationFactory profile with season configuration; one policy and an effective-dated schedule per season.โปรไฟล์โรงงานพร้อมการตั้งค่ารายฤดู; หนึ่งนโยบายและตารางจ่ายมีผลตามวันต่อฤดู
TruckTruck · TruckMergeRequestdelivery_weighbridgeFACTORY-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 เดียว ไม่มีครึ่ง ๆ กลาง ๆ
PaymentBatchPaymentBatch · PaymentItem · PaymentInstallmentsettlementBatch 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 วัน)
FinalPriceSettlementFinalPriceSettlementsettlementSeason-end true-up; payer branch (factory vs Cane & Sugar Fund) fixed at creation; paid transition is terminal.การสรุปราคาปลายฤดู; ฝั่งผู้จ่าย (โรงงานหรือกองทุน) กำหนดตอนสร้าง; สถานะจ่ายแล้วเป็นสถานะสุดท้าย
StampCheckpointStampCheckpoint · CheckpointRate · StampEventstrategic_pricingRates 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 และจับคู่การส่งมอบตอนชั่ง
StrategicAgreementStrategicAgreement · PremiumAccrual · PremiumReleasestrategic_pricingAccruals 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)
LedgerAccountLedgerAccountbooksPer-tenant chart row; system_flag accounts are template-seeded and rename-only.แถวผังบัญชีราย tenant; บัญชี system_flag seed จาก template แก้ได้เฉพาะชื่อ
JournalEntryJournalEntrybooksEvery 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)
ChartTemplateChartTemplatebooksVersioned per capacity; seeding copies rows — tenants never share template state.มี version ต่อ capacity; การ seed คัดลอกแถว — tenant ไม่ใช้สถานะ template ร่วมกัน
InvoiceInvoicereceivablesIssue freezes lines and totals; settlement is tracked via Receipt / PaymentVoucher references.การออกใบตรึง lines และยอด; การชำระติดตามผ่านการอ้าง Receipt / PaymentVoucher
ReceiptReceiptreceivablesPosted document — auto-posts its JournalEntry in the same transaction (idempotent).เอกสารที่ post แล้ว — ลง JournalEntry อัตโนมัติใน transaction เดียวกัน (idempotent)
PaymentVoucherPaymentVoucherreceivablesPosted document — auto-posts its JournalEntry in the same transaction (idempotent).เอกสารที่ post แล้ว — ลง JournalEntry อัตโนมัติใน transaction เดียวกัน (idempotent)
CashAccountCashAccount · BankTransaction · Reconciliationcash_managementStatement 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
FiscalPeriodFiscalPeriodbooksClose validates no unposted documents then freezes the period; statements snapshot only from closed periods; periods never overlap per owner.การปิดงวดตรวจว่าไม่มีเอกสารค้าง post แล้วตรึงงวด; งบ snapshot จากงวดที่ปิดแล้วเท่านั้น; งวดต่อเจ้าของไม่ทับกัน
FinancialStatementFinancialStatementbooksFrozen 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)
BooksProfileBooksProfilebooksOne profile per tenant; edition/view are packaging over the same ledger (NFR-32).หนึ่ง profile ต่อ tenant; รุ่น/มุมมองเป็นการจัดแพ็กเกจบนบัญชีเดียวกัน (NFR-32)
CostCentreCostCentrebooksThe 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)
CostCentreBalanceCostCentreBalancebooksA 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 และกระทบยอดกับสมุดบัญชีตรงทุกงวด ไม่มีการเขียนด้วยมือ
AllocationRuleAllocationRulebooksAllocation 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) กติกาไม่ถูกแก้ — การเปลี่ยนคือเวอร์ชันใหม่ที่แทนที่ของเดิม มีผลไปข้างหน้ารายฤดู
CostAllocationCostAllocationbooksAppend-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 การรันหนึ่งครั้งตรึงเวอร์ชันกติกาและเกณฑ์ที่ใช้ เพื่ออ่านย้อนได้ในอีกหลายปี การแก้ไขคือการกลับรายการที่ระบุรันเดิม ไม่ใช่การแก้ค่า
AmortisationRunAmortisationRunbooksOne 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)
CycleLossEventCycleLossEventbooksA 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): การด้อยค่าต้องมีสาเหตุที่ระบุชื่อและวันที่ และวันประกาศเก็บแยกจากวันเกิดเหตุ
EntryDocumentLinkEntryDocumentLinkbooksOne 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) การถอดลิงก์เป็นการกระทำที่มีผู้ทำและเวลา ไม่ใช่การลบ
AdvanceEarmarkAdvanceEarmarkbooksThe 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)
BorrowerPositionBorrowerPositionbooksA 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 การรับชำระได้ แต่ปล่อยกู้ใหม่ไม่ได้
PromotionZonePromotionZonefarm_agronomyA mill's own zoning catalogue, scoped to that mill: zones never cross tenants and never imply a right over a field.บัญชีเขตส่งเสริมของโรงงาน ผูกกับโรงงานนั้น: เขตไม่ข้าม tenant และไม่ก่อสิทธิเหนือแปลง
ContractFarmingProgramContractFarmingProgramfield_partnershipA 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.โปรแกรมที่ประกาศแล้วถูกตรึง: งบประมาณ เงื่อนไขต่อไร่ และเส้นทางการชำระคืนคือข้อเสนอที่ชาวไร่สมัครเข้า การเปลี่ยนคือโปรแกรมใหม่
ProgramEnrollmentProgramEnrollmentfield_partnershipOne 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)
QueueLaneQueueLanegate_queueA 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)
QueueLaneInstanceQueueLaneInstancegate_queueAn 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)
ExpressReasonExpressReasongate_queuePublished, 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.ประกาศ มีผลไปข้างหน้า มีเวอร์ชัน และมีเพดานของตัวเอง การแก้ไม่ย้อนอ่านการให้สิทธิ์ที่เขียนแล้ว และไม่มีเพดาน = ประกาศไม่ได้
ExpressGrantExpressGrant · ExpressFlaggate_queueThe 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. สัญญาข้ามมุมมอง

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).

apply 2026-08-17 เป็น spec v0.73.0 (PROP-085) แบบจำลองที่ apply แล้วไม่มีเอนทิตีบัญชีธนาคารเลย WF-05 ขั้น 5 ลงรายการจ่ายไปยังปลายทางที่กราฟไม่เคยถือไว้ และธนาคารของโรงงานอยู่ในหมายเหตุร้อยแก้วเรื่องเช็คขายลดเพียงแห่งเดียว เพิ่มหกเอนทิตีที่ home ที่นี่ กฎที่ถืออยู่คือ A-105 R-PAYEE ปลายทางเป็นวัตถุที่ผูกกับโควตาหนึ่งบัญชีด้วยการผูกที่มีวันที่และเพิ่มได้ไม่แก้ พร้อม R-RANKED (หลักหนึ่ง สำรองหนึ่ง ไม่มีที่สาม) และ R-CHANNEL (ธนาคารของโรงงานเป็นช่องทางที่จ่ายผ่าน ไม่ใช่ปลายทางที่จ่ายให้)

EntityEntityKeys · uniques · indexesคีย์ · ไม่ซ้ำ · ดัชนีMutability · PDPA · aggregateการแก้ไข · PDPA · aggregateWhat it holdsถืออะไร
PayeeAccount
PAY-########
pk payee_id · fk owner_tenant_id, verified_by · unique (owner_tenant_id, method, bank_code, account_no_enc) · idx (owner_tenant_id, status), (owner_tenant_id, added_at)mutable · personal · PayeeAccountThe 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 ใหม่ เก็บรหัสสามหลักของ ธปท. เป็นข้อความพร้อมศูนย์นำหน้า เลขบัญชีเข้ารหัสและแสดงสี่ตัวท้าย การยืนยันเป็นรายปลายทาง
PayeeAssignmentpk 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 · QuotaThe 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?
PayeeAccountEventpk event_id · fk payee_id, by, evidence_document_id, quota_id · unique (payee_id, event, at) · idx (payee_id, at), (event, at)append_only · personal · PayeeAccountThe 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 · QuotaGroupThe 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
QuotaGroupMemberpk 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 · QuotaGroupDated 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 · MillThe 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-454 FR-462…FR-465 NFR-162 NFR-165 NFR-169 NFR-170 workflow WF-139 WF-140 WF-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 เพราะขาส่งต่อเป็นของมุมมองโควตา

EntityEntityKeys · uniques · indexesคีย์ · ไม่ซ้ำ · ดัชนีMutability · PDPA · aggregateการแก้ไข · PDPA · aggregateWhat it holdsถืออะไร
ResolverPolicyVersionpk policy_version_id · fk mill_tenant_id, published_by, supersedes_id · unique (mill_tenant_id, effective_from) · idx (mill_tenant_id, published_at)append_only · confidential_wall · MillStrategicConfigresolver_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 ต้องมาก่อนการลงนามตอบของข้อตกลงที่ผูกกับเวอร์ชันนั้น
AgreementAssignmentpk 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 · StrategicAgreementcause: 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 ว่างได้เมื่อข้อตกลงเพียงสิ้นสุด
WithheldOutcomepk outcome_id · fk agreement_id, season_id, release_id, two memberships · unique (agreement_id, season_id) · idx (season_id, outcome)append_only · operational · StrategicAgreementoutcome: 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 ตามรายการ มีสถานะเงินหักที่เปิดอยู่หนึ่งรายการต่อข้อตกลงต่อฤดู และปิดได้ด้วยแถวนี้เท่านั้น ผลลัพธ์ริบที่ไม่มีการอ้างข้อสัญญาและลายเซ็นของคู่สัญญาถูกปฏิเสธโดยโครงสร้าง แถวนี้คือสิ่งที่ศาลอ่าน และเขียนตั้งแต่ตอนนั้น ไม่ใช่ตอนเถียงกัน
AgreementNoticepk notice_id · fk agreement_id, served_by · idx (agreement_id, served_at)append_only · operational · StrategicAgreementkind: 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-473 NFR-171…NFR-174 workflow WF-144…WF-147 การตรวจ V-25

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

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

PROP-023 entity digest (v0.16.0) — books, statements & reportingสรุป entity ตาม PROP-023 (v0.16.0) — บัญชี งบการเงิน และรายงาน

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.

ไม่มี entity ใหม่ — PROP-023 ขยายตระกูล books ของ PROP-010/011 โดย block ใหม่ books ใน graph เป็น canonical ของแถวผัง (books.chartTemplates: บัญชีโรงงาน 27 + SME ร่วม 30 แถว พร้อม flag ราย capacity, binding statement_line, ชั้นการล็อก derive) และ posting map (books.postingMap: 22 เหตุการณ์เงิน × capacity ที่ได้รับผล, field ต้นทางตั้งชื่อ) persistence profile ของ attribute ที่ขยายไปกับ back-audit เฟส Q5 ของ PROP-019

EntityentityDeltaสิ่งที่เปลี่ยน
ChartTemplate+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)
FiscalPeriod+lock_requested_by? · +locked_by? · +locked_at? · +lock_source? (manual | timer | season_close) — the FR-157/WF-64 lock completion.+lock_requested_by? · +locked_by? · +locked_at? · +lock_source? (manual | timer | season_close) — การปิดจบ lock ตาม FR-157/WF-64
BooksProfile+coa_code_digits (4…8, default 5) — Factory Settings, pre-seed, immutable after the first posting (OQ-1).+coa_code_digits (4…8, default 5) — Factory Settings ตั้งก่อน seed เปลี่ยนไม่ได้หลัง post รายการแรก (OQ-1)
JournalEntry+effective_date? (late-repost economic date, OQ-10) · +reverses_entry_id? (black reversal, OQ-7).+effective_date? (วันที่ทางเศรษฐกิจของ repost ช้า, OQ-10) · +reverses_entry_id? (black reversal, OQ-7)
FinancialStatementsnapshot semantics pinned — FULL inputs (trial balance + chart version + line-map version, OQ-13); byte-identical regeneration (NFR-51); prior-snapshot comparatives.ความหมาย snapshot ถูกกำหนด — input เต็ม (งบทดลอง + รุ่นผัง + รุ่น line map, OQ-13); สร้างใหม่ได้ byte เหมือนเดิม (NFR-51); งวดเปรียบเทียบจาก snapshot ก่อนหน้า
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
EntityRoleบทบาท
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 ชั้นรายสถานี
TransferContractor · TransferTruck
ผู้รับเหมา/รถขนถ่าย
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
HaulageSettlement · LossClaim
ชำระค่าขนถ่าย/ค่าน้ำหนักหาย
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)
TransportCostPolicy · TransferLossPolicy
นโยบายค่าขนส่ง/หักสูญหาย
Mill-level effective-dated policies: cost bearer farmer | shared | mill (FR-182); farmer-side loss % default 3, any %, waivable (FR-183). Never retroactive.นโยบายระดับโรงงานมีผลตามช่วงวัน: ผู้รับภาระ farmer | shared | mill (FR-182); % หักฝั่งชาวไร่ ค่าปกติ 3 ปรับได้ทุก % ยกเว้นได้ (FR-183) ไม่มีผลย้อนหลัง

Checkpoint-evidence entities — checkpoint_evidence (PROP-043, spec v0.24.0, applied 2026-07-24)entity หลักฐานจุดตรวจ — checkpoint_evidence (PROP-043, spec v0.24.0 ปรับใช้ 24 ก.ค. 2569)

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).

สาม entity ของโรงงานมากับเทอร์มินัล checkpoint (แอตทริบิวต์และกฎความสัมพันธ์เป็น canonical ใน graph; profile การจัดเก็บรอการ back-audit ของ Q5) CheckpointRegistration ห่อ StampEvent ของ PROP-009/029 ด้วยชุดหลักฐาน + วงจร registered → matched | expired (เริ่มต้น 48 ชม., OQ-31) — truck_id = รถแม่, trailer_truck_id? = รถลูก ทั้งคู่เป็นตัวตนหน่วยชั้นหนึ่ง (OQ-30); ถือ qr_payload (ซองลงลายเซ็น A-59) + print_count (โปรโตคอลพิมพ์ซ้ำ OQ-29) และธง accrual_grade (C-1/C-2) EvidencePhoto (append-only) — ชนิด EV-1…EV-5, fix GNSS เท่านั้น ≤ 25 ม., เวลา อุปกรณ์ และ hash; PDPA ตาม OQ-27 (เก็บ 12 เดือน ดูได้เฉพาะ role ที่ระบุ) TripTrace (append-only) — สายติดตามขาเข้าตามความยินยอม (D-8/OQ-32): โรงงานเห็นเฉพาะสถานะเที่ยว ลบเมื่อส่งถึง + ชั่งออก StampCheckpoint แก้ไขเพิ่ม: +operating_area_polygon? / +geofence_radius_m? — พื้นที่ทำงานที่กำหนดผ่าน portal ซึ่งเปิดใช้เครื่อง (C-2a) เครื่องลงทะเบียนเป็นแถว StationClient (PROP-028)

13. Revision history13. ประวัติการแก้ไข

RevฉบับDateวันที่Changesการเปลี่ยนแปลง
1.02026-07-07Initial version — PROP-002 Proposal A (spec v3.0)ฉบับแรก — PROP-002 ข้อเสนอ A (spec (สเปก) v3.0)
1.12026-07-08PROP-005 (FED, spec v6.0): perspective re-keyed from customer group to capacity (document code unchanged); identity defers to the federation context (Person · Tenant · TenantCapacity · Membership); every *_tenant_type + *_tenant_id pair collapses to tenant_id.PROP-005 (FED, spec v6.0): มุมมองเปลี่ยนคีย์จากกลุ่มลูกค้าเป็น capacity (รหัสเอกสารคงเดิม); อัตลักษณ์อ้างอิงบริบท federation (Person · Tenant · TenantCapacity · Membership); คู่ *_tenant_type + *_tenant_id ทั้งหมดยุบเป็น tenant_id
1.22026-07-09PROP-009 (STR, spec v8.0): the mill owns the strategic_pricing core — StampCheckpoint · CheckpointRate · StampEvent · StrategicAgreement · PremiumAccrual · PremiumRelease (ข้อ 2–3); the confidential ค่าอ้อยกลยุทธ์ paid ON TOP of the statutory price, never a PaymentItem component and walled off from สอน. (NFR-21); shares OnwardPremiumSettlement with quota/grower.PROP-009 (STR, spec v8.0): โรงงานเป็นเจ้าของแกน strategic_pricing — StampCheckpoint · CheckpointRate · StampEvent · StrategicAgreement · PremiumAccrual · PremiumRelease (ข้อ 2–3); ค่าอ้อยกลยุทธ์ที่เป็นความลับจ่ายเพิ่มจากราคาตามกฎหมาย ไม่เป็นส่วนของ PaymentItem และกั้นจาก สอน. (NFR-21); ใช้ร่วม OnwardPremiumSettlement กับโควตา/ชาวไร่
1.32026-07-09PROP-010 (GL, spec v9.0): the mill owns the full financial system — ChartTemplate · Invoice · Receipt · PaymentVoucher · CashAccount · BankTransaction · Reconciliation · FiscalPeriod · FinancialStatement (ข้อ 2–3); books/receivables/cash_management contexts; WF-36…41; auto-posting from settlement/เงินเกี๊ยว/loan/strategic, statements shared via ConsentGrant scope books, PROP-009 wall preserved (FR-94, NFR-24…26).PROP-010 (GL, spec v9.0): โรงงานเป็นเจ้าของระบบการเงินเต็ม — ChartTemplate · Invoice · Receipt · PaymentVoucher · CashAccount · BankTransaction · Reconciliation · FiscalPeriod · FinancialStatement (ข้อ 2–3); บริบท books/receivables/cash_management; WF-36…41; ลงอัตโนมัติจากการปิดยอด/เงินเกี๊ยว/สินเชื่อ/กลยุทธ์ แบ่งงบผ่าน ConsentGrant scope books คงกำแพง PROP-009 (FR-94, NFR-24…26)
1.42026-07-10PROP-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.52026-07-10PROP-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)
0.1.02026-07-11PROP-014 (spec v0.1.0): semantic versioning restarted at 0.1.0 (was Rev 1.5 · 2026-07-10); docnav updated for the gov_cluster split — GOV re-homed to docs/gov/ocsb/, new BOARD (กอน.) sibling added.PROP-014 (spec v0.1.0): รีสตาร์ท semantic versioning ที่ 0.1.0 (เดิม Rev 1.5 · 2026-07-10); ปรับ docnav ตามการแยก gov_cluster — ย้าย GOV ไป docs/gov/ocsb/ เพิ่มพี่น้อง BOARD (กอน.)
0.2.02026-07-13PROP-018 (spec v0.4.0): comprehensive perspective data modeling — scoped entity-relationship diagrams (Fig. 1–5), column-level persistence profiles for the 31 home entities (Section 6), keys / indexes / mutability & PDPA classes (Section 7) and aggregate consistency boundaries (Section 8) — all rendered from the graph's new dataModeling block.PROP-018 (spec v0.4.0): การ model ข้อมูลรายมุมมองฉบับครบ — แผนภาพความสัมพันธ์ entity เฉพาะมุมมอง (ภาพที่ 1–5), persistence profile ระดับ column ของ entity ที่ home อยู่ฉบับนี้ 31 รายการ (ข้อ 6), key / index / ชั้น mutability และ PDPA (ข้อ 7) และขอบเขตความสอดคล้องของ aggregate (ข้อ 8) ทั้งหมด render จาก block ใหม่ dataModeling ใน graph
0.2.12026-07-13PROP-012 conformance (spec v0.4.1, patch): Purpose re-grounded — the mill runs re-note CCS intake, not an on-site lab (the stale claim survived in Section 1 prose only; all data sections were already re-note-based).ปรับตาม PROP-012 (spec v0.4.1, patch): แก้วัตถุประสงค์ — โรงงานนำเข้า re-note CCS ไม่ได้มีแล็บประจำโรงงาน (ข้อความตกค้างอยู่ในเนื้อหาข้อ 1 เท่านั้น; ส่วนข้อมูลใช้ re-note อยู่แล้ว)
0.2.22026-07-16PROP-029 (spec v0.6.0): five field-verified entities join the mill perspective — Token · TokenIssuance · DumpPlatform · DumpEvent (the yard chain: token pair at entry weigh → tower verification at the dump call → return at exit weigh, pairing each load with its CCS sample) and HarvesterWorkPlan (quota_planning); persistence profiles (Section 6) and keys/mutability rows (Section 7) added; TokenIssuance and DumpEvent join the Delivery aggregate. Fig. 1 diagram refresh deferred to the next PROP-018 render pass.PROP-029 (spec v0.6.0): entity ที่ยืนยันจากหน้างานห้ารายการเข้ามุมมองโรงงาน — Token · TokenIssuance · DumpPlatform · DumpEvent (สายลานอ้อย: เหรียญคู่ตอนชั่งเข้า → หอลานตรวจตอนเรียกเท → คืนตอนชั่งออก จับคู่ทุกคันกับตัวอย่าง CCS) และ HarvesterWorkPlan (quota_planning); เพิ่ม persistence profile (ข้อ 6) และแถว key/mutability (ข้อ 7); TokenIssuance และ DumpEvent เข้า aggregate Delivery ส่วนการปรับภาพที่ 1 ยกไปรอบ render PROP-018 ถัดไป
0.3.02026-07-17PROP-027 accepted (spec v0.10.0): +FuelCredit / +FuelStation / +MillFuelConfig (financing context, homed here) + 3 relationships; callout added — diagrams regenerate next render pass.รับ PROP-027 (spec v0.10.0): +FuelCredit / +FuelStation / +MillFuelConfig (context financing บ้านที่นี่) + ความสัมพันธ์ 3 เส้น; เพิ่ม callout — แผนภาพ regenerate รอบ render ถัดไป
0.4.02026-07-17PROP-020 + PROP-024 accepted as ONE queue train (spec v0.12.0, 2026-07-17): Section 4 gains the queue-train entity digest — QueueTicket, QueuePolicy, SlotTemplate, TimeSlot (gate_queue) + ReliabilityEvent, ReliabilityScore, BookingPrivilegePolicy, ScoringPolicy (farmer_reliability); Delivery gains queue_ticket_id; 12 relationship edges. Persistence profiles ride the Q5 back-audit with the v0.7.0 batch.รับ PROP-020 + PROP-024 เป็นขบวนคิวเดียว (spec v0.12.0, 17 ก.ค. 2569): ข้อ 4 เพิ่มสรุป entity ขบวนคิว — QueueTicket, QueuePolicy, SlotTemplate, TimeSlot (gate_queue) + ReliabilityEvent, ReliabilityScore, BookingPrivilegePolicy, ScoringPolicy (farmer_reliability); Delivery เพิ่ม queue_ticket_id; ความสัมพันธ์ 12 เส้น persistence profile ไปกับการตรวจย้อนหลัง Q5
0.5.02026-07-19PROP-021 + PROP-028 applied as ONE train (spec v0.13.0): Section 4 gains the on-site-tier entity digest — GatewayNode · StationClient · SyncCheckpoint · CcsMeasurement · IntakeMatchSet · StationJournal (+7 relationships); WeighTicket.ticket_no unified with the delivery ID (OQ-4); Token gains void-and-reissue (OQ-3). Persistence profiles ride the Q5 back-audit.ปรับใช้ PROP-021 + PROP-028 เป็นขบวนเดียว (spec v0.13.0): ข้อ 4 เพิ่มสรุป entity ชั้นติดตั้งในโรงงาน — GatewayNode · StationClient · SyncCheckpoint · CcsMeasurement · IntakeMatchSet · StationJournal (+7 ความสัมพันธ์); ticket_no ของ WeighTicket รวมกับเลขส่งมอบ (OQ-4); Token ได้โปรโตคอลยกเลิก-จ่ายใหม่ (OQ-3) persistence profile ไปกับการตรวจย้อนหลัง Q5
0.6.02026-07-19PROP-022 applied (spec v0.14.0): +StrategicPlan · PlanScenario · PlanVersion · CalcBasisPolicy · FarmerGroup (strategic_pricing, homed here) + 7 relationships; StrategicAgreement +retro? (OQ-1); full persistence profiles & aggregates in the graph (canonical, all confidential_wall). Diagrams/entity sections regenerate next render pass.ปรับใช้ PROP-022 (spec v0.14.0): เพิ่ม StrategicPlan · PlanScenario · PlanVersion · CalcBasisPolicy · FarmerGroup (strategic_pricing บ้านอยู่ที่นี่) + ความสัมพันธ์ 7 เส้น; StrategicAgreement เพิ่ม retro? (OQ-1); โปรไฟล์การจัดเก็บและ aggregate ครบใน graph (canonical ทั้งหมด confidential_wall) แผนภาพ/หมวด entity regenerate รอบ render ถัดไป
0.7.02026-07-20PROP-032 accepted (spec v0.15.0): +LineCapacityRevision, +MaintenancePlan, +MaintenancePlanVersion, +MillSeason, +MillCapacityConfig (delivery_weighbridge); CrushingLine/LineDowntime/CrushingDay extended; 7 new relationships. New Section 4 digest; persistence profiles ride the Q5 back-audit.รับ PROP-032 (spec v0.15.0): +LineCapacityRevision, +MaintenancePlan, +MaintenancePlanVersion, +MillSeason, +MillCapacityConfig (delivery_weighbridge); ขยาย CrushingLine/LineDowntime/CrushingDay; ความสัมพันธ์ใหม่ 7 เส้น เพิ่มสรุปข้อ 4; persistence profile ไปกับ back-audit รอบ Q5
0.8.02026-07-22PROP-023 applied (spec v0.16.0): entity digest added — ChartTemplate carries the normative rows (books.chartTemplates canonical), FiscalPeriod gains the lock fields, BooksProfile gains coa_code_digits, JournalEntry gains effective_date/reverses_entry_id; FinancialStatement snapshot semantics pinned (full inputs, NFR-51). Persistence-profile back-fill rides the Q5 back-audit.PROP-023 ปรับใช้ (spec v0.16.0): เพิ่มสรุป entity — ChartTemplate ถือแถวเชิงบรรทัดฐาน (books.chartTemplates เป็น canonical), FiscalPeriod ได้ field การ lock, BooksProfile ได้ coa_code_digits, JournalEntry ได้ effective_date/reverses_entry_id; กำหนดความหมาย snapshot ของ FinancialStatement (input เต็ม, NFR-51) การเติม persistence profile ไปกับ back-audit เฟส Q5
0.9.12026-07-22Editorial: clarifying note under the Truck persistence profile — owner_tenant_id vs operator_contractor_id are both many-to-one (not many-to-many); current-operator-only, history via truck_reg_snap (FR-29). Graph Truck note extended in the same change set.แก้ไขเชิงบรรณาธิการ: เพิ่มหมายเหตุใต้โปรไฟล์การจัดเก็บของ Truck — owner_tenant_id กับ operator_contractor_id เป็น many-to-one ทั้งคู่ (ไม่ใช่ many-to-many); เก็บเฉพาะผู้ขับปัจจุบัน ประวัติดูจาก truck_reg_snap (FR-29) ขยาย note ของ Truck ใน graph ในชุดเดียวกัน
0.9.02026-07-22PROP-042 applied (spec v0.17.0): StrategicAgreement gains visible_to_quota? (boolean, mill-set, default false — whether the network's quota farmer may see this agreement's premium, OQ-14/FR-164); its column profile back-fills the PROP-019/PROP-022 attributes calc_basis? and retro?. The strategic permission model itself is federation infrastructure — see SPEC-PRD-FED Section 11.ปรับใช้ PROP-042 (spec v0.17.0): StrategicAgreement เพิ่ม visible_to_quota? (boolean โรงงานเป็นผู้ตั้ง ค่าเริ่มต้น false — หัวหน้าโควต้าของเครือข่ายเห็น premium ของข้อตกลงนี้หรือไม่, OQ-14/FR-164); ตาราง column เติมย้อนหลัง attribute calc_basis? และ retro? ของ PROP-019/PROP-022 ด้วย model permission กลยุทธ์เองเป็นโครงสร้างพื้นฐาน federation — ดู SPEC-PRD-FED ข้อ 11
0.10.02026-07-23PROP-047 (spec v0.19.0): Thai administrative geography in code — Mill.province, Truck.province and StampCheckpoint.province re-typed text → smallint carrying the Province enum code (TIS 1099-2548); registry in the shared kernel, CHECK generated from the enum — no reference table / FK / seed. Amphor (4-digit, smallint) and Tumboon (6-digit, integer) registries established for future columns. A-32 unique (reg_no, province) unchanged in shape.PROP-047 (spec v0.19.0): ภูมิศาสตร์การปกครองไทยอยู่ใน code — Mill.province, Truck.province และ StampCheckpoint.province เปลี่ยนชนิดจาก text → smallint เก็บรหัส enum Province (มอก. 1099-2548); ทะเบียนอยู่ใน shared kernel, CHECK generate จาก enum — ไม่มีตารางอ้างอิง / FK / seed ทะเบียน Amphor (4 หลัก smallint) และ Tumboon (6 หลัก integer) ตั้งไว้สำหรับ column ในอนาคต unique (reg_no, province) ตาม A-32 รูปทรงเดิม
0.11.02026-07-23PROP-025 applied (spec v0.20.0): the Truck register goes FACTORY-SCOPED — +mill_id (FK), +reg_no_norm (T-1 normalized plate), +chassis_id? (owner-declared, WF-69 prerequisite), +merged_into_truck_id? (WF-66 soft-delete lineage); unique re-keyed (reg_no, province) → (mill_id, reg_no_norm, province); +TruckMergeRequest (two-act duplicate merge, joins the Truck aggregate row). The operator master layer (MasterTruck · TruckLink · MasterPlatePeriod · PlateChangeDeclaration) homes in SPEC-ERD-PLT. One-time migration per FR-171 (rows split per factory-with-deliveries, masters seeded via seed_truck_id).ปรับใช้ PROP-025 (spec v0.20.0): ทะเบียนรถเป็นระดับโรงงาน — +mill_id (FK), +reg_no_norm (ทะเบียน normalize ชั้น T-1), +chassis_id? (เจ้าของแจ้ง เงื่อนไข WF-69), +merged_into_truck_id? (ร่องรอย soft-delete ของ WF-66); คีย์ไม่ซ้ำเปลี่ยน (reg_no, จังหวัด) → (mill_id, reg_no_norm, จังหวัด); +TruckMergeRequest (การผสานสองจังหวะ เข้าแถว aggregate ของ Truck) ชั้น master ของ operator มีบ้านใน SPEC-ERD-PLT migration ครั้งเดียวตาม FR-171
0.12.02026-07-23PROP-030 applied (spec v0.21.0): transfer-station department — +10 entities in the new transfer_station context (TransferStation · TransferContractor · TransferTruck · CraneToken · StationBill · HaulageSettlement · LossClaim · HaulageRateCard · TransportCostPolicy · TransferLossPolicy) + 9 relationships; entity digest added; persistence profiles ride the Q5 back-audit.ปรับใช้ PROP-030 (spec v0.21.0): หน่วยงานสถานีขนถ่าย — เพิ่ม entity 10 ตัวใน context ใหม่ transfer_station + ความสัมพันธ์ 9 เส้น; เพิ่มตารางสรุป entity; persistence profile ตามรอบ back-audit ของ Q5
0.13.02026-07-23PROP-045 applied (spec v0.22.0): StrategicAgreement gains the five explicit scope attributes (scope_checkpoint_ids / scope_field_ids / scope_date_from / scope_date_to / scope_distance_band); +MillStrategicConfig (overlap_allowed default false · resolver_rule lowest_cost, append-only effective-dated, confidential wall); overlap predicate + lowest-cost resolution normative in the graph; profiles back-fill at the Q5 back-audit.ปรับใช้ PROP-045 (spec v0.22.0): StrategicAgreement ได้ attribute scope ชัดเจนห้าตัว; +MillStrategicConfig (overlap_allowed ค่าเริ่มต้น false · resolver_rule lowest_cost); predicate การทับซ้อนและการ resolve ต้นทุนต่ำสุดเป็นบรรทัดฐานในกราฟ; โปรไฟล์เติมเต็มตอน back-audit Q5
0.14.02026-07-24PROP-043 approved & applied (spec v0.24.0): +CheckpointRegistration · EvidencePhoto · TripTrace (new checkpoint_evidence context); StampCheckpoint +operating_area_polygon?/+geofence_radius_m? (C-2a); 7 new relationship rules (registration wraps StampEvent 1—1, nullable Delivery match, StationClient device binding, both rig plates). Persistence profiles ride the Q5 back-audit.PROP-043 อนุมัติและปรับใช้ (spec v0.24.0): +CheckpointRegistration · EvidencePhoto · TripTrace (context ใหม่ checkpoint_evidence); StampCheckpoint เพิ่มพื้นที่ทำงาน (C-2a); กฎความสัมพันธ์ใหม่ 7 ข้อ; profile การจัดเก็บรอ back-audit ของ Q5
0.15.02026-07-28Physical-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.02026-07-28Physical-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.12026-07-28Rendering 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.02026-07-28PROP-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.02026-07-28PROP-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.0 QueuePolicy ตัดฟิลด์เข้าคิวระยะไกลทั้งสามตัวไปกับ QL-1, queue_level คงค่า 1 เป็นสมาชิกที่ยกเลิก และ entity ฝั่งการจองมีป้าย release: v2
0.19.02026-07-29PROP-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.02026-07-29PROP-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.02026-07-30PROP-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.0 journal_entry เพิ่มคู่ฟิลด์ผู้บันทึกสำหรับบรรทัดที่ชาวไร่บันทึกเอง (append-only เขียนครั้งเดียว) ส่วน queue_ticket delivery และการใช้สิทธิ์ fuel_credit ตัดออกตอน apply เพราะไม่ใช่ระเบียนที่ชาวไร่เขียนใน V1 FR-339 · A-71
0.22.02026-07-30PROP-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.0 QueueTicket ได้ lead_tenant_id? + lead_mandate_id? (FR-349): การระบุที่มาเชิงเครือข่ายของบันทึกพฤติกรรมในฤดูแรก เขียนครั้งเดียวตอนสร้างแถวจากหัวตันของเจ้าของ แก้ภายหลังไม่ได้ เป็นค่าว่างเมื่ออยู่ใต้หัวหน้าโควต้า และเข้าถึงไม่ได้ตาม NFR-109 จัดชั้น PDPA confidential_wall เก็บตามช่วงหลักฐาน (ฤดูนี้บวกอีกหนึ่งฤดู) สองคอลัมน์รอเข้า batch profile dataModeling ของ v0.12.0 เพราะ entity นี้มีมาก่อนกติกาอำนาจข้อ 6
0.23.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) 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): คำเดียว — Tenant Party → 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.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
0.24.02026-08-07PROP-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.0 HarvesterWorkPlan.driver_name และ mechanic_name แยกเป็นส่วนย่อยเดียวกับชื่อคนทุกตัวในคลังเอกสาร — *_prefix? · *_first_name · *_last_name (FR-437 R-NAMEPARTS ลูกค้าตัดสิน OQ-4) ทั้งสองเป็นชื่อที่พิมพ์ของคนที่แพลตฟอร์มไม่มีบัญชีให้ ตรงกับชนิดของข้อบกพร่องพอดี ไม่มีชื่อเล่น เพราะชื่อเล่นคือคำเรียกขาน และแพลตฟอร์มไม่เคยเรียกขานคนเหล่านี้ ส่วน CheckpointRegistration.driver_name? แยกแบบเดียวกันในกราฟ และไม่บังคับทั้งสามส่วน
0.25.02026-08-17Where 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.02026-08-17Hardening 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 แล้วห้าจุด ได้แก่ StrategicAgreement PremiumAccrual MillStrategicConfig OnwardPremiumSettlement และเหตุการณ์การส่งออกแบบไม่ปิดบัง เพิ่มข้อ 11
0.27.02026-08-20The 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