SPEC-ERD-GOV-OCSB Rev 0.4.1 · 2026-08-03

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

Entity Model — OCSB regulator office (สอน.)แบบจำลอง entity — สำนักงานคณะกรรมการอ้อยและน้ำตาลทราย (สอน.)

Documentเอกสาร
SPEC-ERD-GOV-OCSB
Versionversion (เวอร์ชัน)
0.4.1 · Draftฉบับร่าง
Updatedปรับปรุงล่าสุด
2026-08-03
CapacityCapacity
ocsb
Surfaceช่องทางใช้งาน
ocsb
Governed byกำกับโดย
board (กอน.)
Masterเอกสารหลัก
SPEC-ERD
Government clusterกลุ่มหน่วยงานรัฐThis is the OCSB (สอน.) regulator-office perspective (capacity ocsb, surface ocsb). The Fund office OCSF is the sibling ERD-GOV-OCSF. The governing Board (กอน.) is documented in Section 3 below — it is not a separate office, it governs through สอน. as its secretariat.นี่คือมุมมองสำนักงานผู้กำกับ OCSB (สอน.) (capacity ocsb, surface ocsb) สำนักงานกองทุน OCSF อยู่ที่ ERD-GOV-OCSF คณะกรรมการ (กอน.) อยู่ใน Section 3 ด้านล่าง — ไม่ใช่สำนักงานแยก แต่กำกับผ่าน สอน. ที่เป็นฝ่ายเลขานุการ

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

This is the OCSB — regulator office (สอน.) perspective of SPEC-ERD for the ocsb capacity. Cross-cutting content lives in the master; the single source of truth is the graph. Re-homed and renamed by PROP-015 (v0.2.0) — formerly SPEC-ERD-GOV at docs/gov/ocsb/.

นี่คือมุมมอง สำนักงานคณะกรรมการอ้อยและน้ำตาลทราย (สอน.) ของ SPEC-ERD สำหรับ capacity ocsb เนื้อหาข้ามมุมมองอยู่ในเอกสารหลัก แหล่งความจริงเดียวคือ graph ย้ายและเปลี่ยนชื่อโดย PROP-015 (v0.2.0) — เดิมคือ SPEC-ERD-GOV ที่ docs/gov/ocsb/

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

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 ที่ปลายเส้นแต่ละด้าน

10..*10..*10..110..*10..*10..* Seasonฤดูหีบ · FEDMillโรงงานน้ำตาล · MILLRevenueAccountบัญชีรายได้ระบบ 70:30account_id PKseason_id FKsugar_sales_amtbyproduct_amtsystem_costs_amtnet_revenue_amtfarmer_share_amtmill_share_amtproduction_return_per_tstatusCcsAuditการตรวจประเมิน CCSaudit_id PKmill_id FKseason_id FKperiodsample_countmean_ccs_millmean_ccs_auditdeviation_pctfinding+2 more…CanePriceAnnouncementประกาศราคาอ้อยprice_id PKseason_id FKregionprice_typeprice_per_tccs_baseccs_increment_per_trevenue_account_id? FKannounced_atBurntCaneComplianceรายงานกำกับอ้อยไฟไหม้record_id PKmill_id FKdatetotal_intake_tburnt_tburnt_pctcap_pctbreachdeduction_rate_per_t+2 more…SugarBidการประมูลน้ำตาลกลางbid_id PKseason_id FKlot_novolume_tclearing_pricebid_at
Fig. 1 — The regulator’s plane — the season RevenueAccount funds price announcements under the 70:30 split; CCS audits and the nightly burnt-cane compliance record oversee the mills; sugar bids feed the final price.ภาพที่ 1 — ระนาบของผู้กำกับ — RevenueAccount ประจำฤดูรองรับการประกาศราคาใต้การแบ่ง 70:30; การตรวจ CCS และระเบียนกำกับอ้อยไฟไหม้รายคืนกำกับโรงงาน; ผลประมูลน้ำตาลป้อนราคาขั้นสุดท้าย

4. Board (กอน.) governance4. การกำกับของคณะกรรมการ (กอน.)

Office ≠ Boardสำนักงาน ≠ คณะกรรมการThe Cane & Sugar Board (กอน.) is the apex policy board that governs สอน. and the whole industry (Article 9, Act B.E. 2527). Its acts are recorded here — within its executing office — per PROP-015: price-announcement approval (FR-109), production-quota allocation (FR-110), levy & Article 28 fee authorization + 70:30 approval (FR-111). The board capacity remains distinct in the graph.คณะกรรมการอ้อยและน้ำตาลทราย (กอน.) เป็นคณะกรรมการนโยบายสูงสุดที่กำกับ สอน. และทั้งอุตสาหกรรม (ม.9 พ.ร.บ. 2527) บันทึกการกระทำไว้ที่นี่ — ภายในสำนักงานที่ปฏิบัติงานให้ — ตาม PROP-015: อนุมัติประกาศราคา (FR-109) จัดสรรโควตา (FR-110) อนุมัติเงินเก็บและค่าธรรมเนียม ม.28 + บัญชี 70:30 (FR-111) capacity board ยังคงแยกใน graph

5. Persistence profile — home entities5. Persistence profile — entity ที่ home อยู่ฉบับนี้

Normative physical model for the 5 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 ทั้ง 5 รายการที่ 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

CanePriceAnnouncement ประกาศราคาอ้อย append_only public

table cane_price_announcement  ·  aggregate CanePriceAnnouncement  ·  code CPA-25##-##  ·  index (season_id,region,price_type,announced_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
price_iduuid—uuid_v7()PK
season_iduuid——FK → season
regiontext——
price_typetext (enum)——
price_per_tbigint (satang)——
ccs_basenumeric(4,2)——
ccs_increment_per_tbigint (satang)——
revenue_account_iduuid✓—FK → revenue_account
announced_attimestamptz——

SugarBid การประมูลน้ำตาลกลาง append_only public

table sugar_bid  ·  aggregate SugarBid  ·  code BID-25##-###  ·  unique (season_id,lot_no)  ·  index (bid_at)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
bid_iduuid—uuid_v7()PK
season_iduuid——FK → season
lot_nointeger——
volume_tnumeric(12,3) (t)——
clearing_pricebigint (satang)——
bid_attimestamptz——

RevenueAccount บัญชีรายได้ระบบ 70:30 immutable_after_state public

table revenue_account  ·  aggregate RevenueAccount  ·  code RVA-25##  ·  unique (season_id)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
account_iduuid—uuid_v7()PK
season_iduuid——FK → season
sugar_sales_amtbigint (satang)——
byproduct_amtbigint (satang)——
system_costs_amtbigint (satang)——
net_revenue_amtbigint (satang)——
farmer_share_amtbigint (satang)——
mill_share_amtbigint (satang)——
production_return_per_tbigint (satang)——
statustext (enum)——

CcsAudit การตรวจประเมิน CCS immutable_after_state operational

table ccs_audit  ·  aggregate CcsAudit  ·  code AUD-######  ·  unique (mill_id,season_id,period)  ·  index (status,finding)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
audit_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
season_iduuid——FK → season
periodtext——
sample_countinteger——
mean_ccs_millnumeric(4,2)——
mean_ccs_auditnumeric(4,2)——
deviation_pctnumeric(5,2)——
findingtext——
statustext (enum)——
auditor_iduuid——FK → membership

BurntCaneCompliance รายงานกำกับอ้อยไฟไหม้ append_only operational

table burnt_cane_compliance  ·  aggregate BurntCaneCompliance  ·  code BCC-########  ·  unique (mill_id,date)  ·  index (breach,date)

ColumnColumnTypeชนิดNullDefaultค่าตั้งต้นKey / refKey / อ้างอิง
record_iduuid—uuid_v7()PK
mill_iduuid——FK → mill
datedate——
total_intake_tnumeric(12,3) (t)——
burnt_tnumeric(12,3) (t)——
burnt_pctnumeric(5,2)——
cap_pctnumeric(5,2)——
breachboolean——
deduction_rate_per_tbigint (satang)——
measuretext✓—
reported_attimestamptz——

6. Keys, indexes & mutability6. 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
CanePriceAnnouncementcane_price_announcementprice_id—(season_id,region,price_type,announced_at)append_onlypublicSection 5ข้อ 5
SugarBidsugar_bidbid_id(season_id,lot_no)(bid_at)append_onlypublicSection 5ข้อ 5
RevenueAccountrevenue_accountaccount_id(season_id)—immutable_after_statepublicSection 5ข้อ 5
CcsAuditccs_auditaudit_id(mill_id,season_id,period)(status,finding)immutable_after_stateoperationalSection 5ข้อ 5
BurntCaneComplianceburnt_cane_compliancerecord_id(mill_id,date)(breach,date)append_onlyoperationalSection 5ข้อ 5

7. Consistency boundaries7. ขอบเขตความสอดคล้อง (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
RevenueAccountRevenueAccountregulationOne per season; figures mutate until the 70:30 split is finalized, then frozen.หนึ่งรายการต่อฤดู; ตัวเลขแก้ได้จนสรุปการแบ่ง 70:30 แล้วตรึง
CanePriceAnnouncementCanePriceAnnouncementregulationAnnouncements append; a correction is a new announcement superseding by announced_at.ประกาศ append; การแก้คือประกาศใหม่ที่แทนที่ตาม announced_at
CcsAuditCcsAuditregulationFindings freeze on closure; mills annotate — never author — audit records.ผลตรวจตรึงเมื่อปิด; โรงงานหมายเหตุได้แต่ไม่ใช่ผู้เขียนระเบียนตรวจ
BurntCaneComplianceBurntCaneComplianceregulationDerived nightly from CrushingDay closes — system-authored, append-only.คำนวณรายคืนจากการปิดวันหีบ — ระบบเป็นผู้เขียน append-only
SugarBidSugarBidregulationAppend-only auction results.ผลประมูลแบบ append-only

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

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

RevฉบับDateวันที่Changeการเปลี่ยนแปลง
0.2.02026-07-12PROP-015: renamed capacity government→ocsb and surface regulator→ocsb; re-homed to docs/erd/gov/; folded the กอน. Board governance (Section 3) in from the retired SPEC-ERD-BOARD. Redirect left at the old path.PROP-015: เปลี่ยนชื่อ capacity government→ocsb และ surface regulator→ocsb; ย้ายมา docs/erd/gov/; ยุบการกำกับของ กอน. (Section 3) จาก SPEC-ERD-BOARD ที่ยกเลิก มี redirect ที่พาธเดิม
0.1.02026-07-11Initial split from the area master (PROP-014, spec v0.1.0).แยกจากเอกสารหลัก (PROP-014, spec v0.1.0)
0.3.02026-07-13PROP-018 (spec v0.4.0): comprehensive perspective data modeling — scoped entity-relationship diagrams (Fig. 1–1), column-level persistence profiles for the 5 home entities (Section 5), keys / indexes / mutability & PDPA classes (Section 6) and aggregate consistency boundaries (Section 7) — all rendered from the graph's new dataModeling block.PROP-018 (spec v0.4.0): การ model ข้อมูลรายมุมมองฉบับครบ — แผนภาพความสัมพันธ์ entity เฉพาะมุมมอง (ภาพที่ 1–1), persistence profile ระดับ column ของ entity ที่ home อยู่ฉบับนี้ 5 รายการ (ข้อ 5), key / index / ชั้น mutability และ PDPA (ข้อ 6) และขอบเขตความสอดคล้องของ aggregate (ข้อ 7) ทั้งหมด render จาก block ใหม่ dataModeling ใน graph
0.4.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.4.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