SPEC-DDD-CFL Rev 0.3.1 · 2026-08-03

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

Department Design — Lead Farmer (หัวตัน)การออกแบบหน่วยงาน — หัวตัน

Documentเอกสาร
SPEC-DDD-CFL
Versionversion (เวอร์ชัน)
0.3.1
Contextcontext
lead_network
Aggregatesaggregate
LeadMandate · NetworkAllocation
Updatedปรับปรุงล่าสุด
2026-08-03
Masterเอกสารหลัก
SPEC-DDD

1. The bounded context1. บริบทที่กำหนดขอบเขต

lead_network is a small context with a single job: hold the second network tier as data. It owns the appointment instrument and the allocation record, and it deliberately owns nothing else. Money runs on the existing financing and settlement rails, land and crops on land_crop_registry and farm_agronomy, books on books. The context adds a tier; it does not add a parallel world.

lead_network เป็น context ขนาดเล็กที่มีหน้าที่เดียว: เก็บชั้นที่สองของเครือข่ายไว้เป็นข้อมูล มันเป็นเจ้าของตราสารการแต่งตั้งและระเบียนการจัดสรร และตั้งใจไม่เป็นเจ้าของสิ่งอื่น เงินเดินบนรางของ financing และการจ่ายเงินเดิม ที่ดินและอ้อยอยู่ที่ land_crop_registry และ farm_agronomy บัญชีอยู่ที่ books context นี้เพิ่มชั้นหนึ่งชั้น ไม่ได้เพิ่มโลกคู่ขนาน

Elementองค์ประกอบContractสัญญา
OwnsLeadMandate · NetworkAllocationLeadMandate · NetworkAllocation
ConsumesTenant · Membership (federation) · Farmer · Quota · Season · CreditLine · Delivery · Field · Crop · FieldAliasTenant · Membership (federation) · Farmer · Quota · Season · CreditLine · Delivery · Field · Crop · FieldAlias
PublishesTen events (Section 3) — the only way another context learns that the tier changed.สิบ event (ข้อ 3) — ทางเดียวที่ context อื่นจะรู้ว่าชั้นนี้เปลี่ยน
Never ownsMoney, land, crops, books or identity. It points at them.เงิน ที่ดิน อ้อย บัญชี และตัวตน — มันชี้ไปหา ไม่ได้เป็นเจ้าของ

2. Aggregates2. aggregate

RootรากMembersสมาชิกTransaction ruleกติกาธุรกรรม
LeadMandateLeadMandateTwo-act: proposed by either side, ACTIVE only on the counterparty acceptance. The two-tier cap is validated inside this boundary on every transition — reject if the lead tenant sits in another lead network, or if any member of his network holds a mandate. Termination never cascades to debt or history (P-9).สองจังหวะ: ฝ่ายใดฝ่ายหนึ่งเสนอ และมีผลเมื่ออีกฝ่ายตอบรับเท่านั้น เพดานสองชั้นตรวจสอบภายในขอบเขตนี้ทุกการเปลี่ยนสถานะ — ปฏิเสธถ้าหัวตันอยู่ในเครือข่ายของหัวตันรายอื่น หรือสมาชิกในเครือข่ายของเขาถือคำแต่งตั้ง การสิ้นสุดไม่ลามไปถึงหนี้หรือประวัติ (P-9)
NetworkAllocationNetworkAllocationAppend-only; a revision writes a new row with revision_no + 1 and a mandatory reason, superseding exactly one earlier row. Exactly one quota anchor per (grantee, season). Over-allocation is signalled, never blocked — a lead may knowingly oversubscribe and answer for it.append-only; การแก้ไขเขียนแถวใหม่ด้วย revision_no + 1 พร้อมเหตุผลบังคับ และแทนที่แถวเดิมหนึ่งแถว มีจุดยึดโควตาเดียวต่อ (ผู้รับ, ฤดูกาล) การจัดสรรเกินเป็นการแจ้งเตือน ไม่ใช่การปิดกั้น — หัวตันอาจรับเกินโดยรู้ตัวและรับผิดชอบเอง

3. Domain events3. domain event

EventeventMeaningความหมายConsumersผู้รับ
LeadMandateProposedEither side proposed; nothing binds until acceptanceฝ่ายใดฝ่ายหนึ่งเสนอ ยังไม่ผูกพันจนกว่าจะตอบรับportal · mobile
LeadMandateActivatedIn force — capability grants and the second financing hop openมีผล — การมอบศักยภาพและช่วงเงินทุนที่สองเปิดportal · mobile · books
LeadMandateTerminatedEnded; growers await explicit re-parenting and NO debt movesสิ้นสุด; ลูกไร่รอการย้ายต้นสังกัดที่ชัดแจ้ง และไม่มีการโยกหนี้portal · mobile · books
LeadNetworkMemberLinkedA grower joined; the two-tier cap was validated at link timeลูกไร่เข้าร่วม; เพดานสองชั้นถูกตรวจตอนเพิ่มportal · mobile
LeadNetworkMemberReparentedA grower moved by explicit act; history stays where it was producedลูกไร่ย้ายด้วยการกระทำที่ชัดแจ้ง; ประวัติอยู่ที่เดิมportal · mobile
LeadLedgerElectionChangedBooks depth elected or reverted — presentation onlyเลือกหรือย้อนระดับบัญชี — เป็นการแสดงผลเท่านั้นportal · mobile
FieldCropAttestationIssuedThe platform vouched for a field and crop upward, with no identity attachedplatform รับรองแปลงและอ้อยส่งขึ้นชั้นบน โดยไม่มีตัวตนแนบไปportal
NetworkAllocationIssuedAn allocation was written at one tierมีการเขียนการจัดสรรที่ชั้นหนึ่งportal · mobile
NetworkAllocationRevisedA new append-only row with a mandatory reason; the superseded figure stays visibleแถวใหม่แบบ append-only พร้อมเหตุผลบังคับ; ตัวเลขที่ถูกแทนที่ยังเห็นได้portal · mobile
NetworkOverAllocationDetectedPromises exceed the allocation received — advisory to both signatoriesคำสัญญามากกว่าที่ได้รับจัดสรร — แจ้งเตือนทั้งสองฝ่ายportal

4. Context map4. แผนที่ context

Neighbourcontext ข้างเคียงRelationshipความสัมพันธ์Contractสัญญา
federationConformistตามอย่างThe lead capacity, its roles and its entitlement row are federation facts. lead_network never writes identity or entitlement and never gates access on its own data (OQ-1).capacity lead, role และแถว entitlement เป็นข้อเท็จจริงของ federation lead_network ไม่เขียนตัวตนหรือ entitlement และไม่ใช้ข้อมูลของตนกั้นการเข้าถึง (OQ-1)
financingCustomerผู้ใช้บริการThe second hop opens ordinary CreditLine rows. No new money rail; an item is financed once across the chain (NFR-83).ช่วงที่สองเปิดแถว CreditLine ปกติ ไม่มีรางเงินใหม่ และรายการหนึ่งได้รับการสนับสนุนครั้งเดียวทั้งสาย (NFR-83)
land_crop_registry · farm_agronomyCustomerผู้ใช้บริการFields and crops are managed one tier down by the lead for his members; the attestation upward is composed here from their facts (P-11).แปลงและอ้อยถูกดูแลที่ชั้นถัดลงมาโดยหัวตันแทนสมาชิก การรับรองส่งขึ้นประกอบขึ้นที่นี่จากข้อเท็จจริงของพวกเขา (P-11)
field_partnershipPartnerคู่ร่วมIdentityDisclosure is the only door through the wall — the lead is the gatekeeper for his own members exactly as the quota farmer is for his.IdentityDisclosure เป็นประตูเดียวผ่านกำแพง — หัวตันเป็นผู้เฝ้าประตูของสมาชิกตนเอง เช่นเดียวกับที่หัวหน้าโควต้าเป็นของลูกไร่ตน
booksCustomerผู้ใช้บริการThe L-0/L-1/L-2 election lives on the existing BooksProfile capacity floor row — packaging, never a data fork (NFR-84).การเลือก L-0/L-1/L-2 อยู่บนแถวขั้นต่ำตาม capacity ของ BooksProfile ที่มีอยู่ — เป็นการจัดชุด ไม่ใช่การแยกสายข้อมูล (NFR-84)
plt / farmer_reliabilityConformistตามอย่างThe reliability score stays per delivering farmer. No lead-level score in v1; the subject is PROP-051 (OQ-9).คะแนนความน่าเชื่อถือคงอยู่รายชาวไร่ที่ส่งมอบ รุ่นแรกไม่มีคะแนนระดับหัวตัน เรื่องนี้เป็นของ PROP-051 (OQ-9)

5. Ubiquitous language5. ภาษาที่ใช้ร่วมกัน

TermคำEnglishอังกฤษMeaningความหมาย
หัวตันlead farmerThe second tier: a sub-farmer looking up, a network principal looking down. Mirrors the quota farmer without a quota; never contracts with a mill.ชั้นที่สอง: เป็นลูกไร่เมื่อมองขึ้น เป็นผู้ดูแลเครือข่ายเมื่อมองลง ถอดแบบหัวหน้าโควต้าแต่ไม่มีโควตา และไม่ทำสัญญากับโรงงาน
ก้อนของหัวตันblockThe tonnage and area a lead answers for upward — his network as the quota farmer reads it, without the members behind it.ปริมาณและพื้นที่ที่หัวตันรับผิดชอบต่อชั้นบน — เครือข่ายของเขาในสายตาหัวหน้าโควต้า โดยไม่เห็นสมาชิกที่อยู่เบื้องหลัง
คำแต่งตั้งหัวตันlead mandateThe dated, two-sided instrument that makes a farmer a lead farmer under one named quota farmer.ตราสารสองฝ่ายที่มีวันที่ ซึ่งทำให้ชาวไร่เป็นหัวตันภายใต้หัวหน้าโควต้ารายหนึ่ง
การรับรองโดย platformattestationA verified field or crop fact released upward without the person behind it.ข้อเท็จจริงเรื่องแปลงหรืออ้อยที่ตรวจแล้ว ส่งขึ้นชั้นบนโดยไม่มีตัวบุคคลติดไปด้วย
Applied — PROP-050 · spec v0.28.0apply แล้ว — PROP-050 · spec v0.28.0

PROP-050 (spec v0.28.0) — cost centres to field & crop level: the farmer's plantation ledger. The grower's books gain a cost dimension, not a second book: five columns on every journal line (centre_id · cost_class · alloc_id · qty · qty_unit) over a derived CostCentre register — holding → field → crop cycle → crop, with asset and overhead-pool attachments and no farmer-defined nesting. The CropCycle (one planting plus its ratoons) becomes the unit of return and carries the establishment asset, capitalised at first revenue, amortised on units of production and impaired only with a named cause and a date. Field capture is two decisions and under fifteen seconds, works offline, and opens from four doors into one sheet; the receipt is photographed into the PROP-048 document vault and the phone releases the file only once the cloud confirms durable storage. Eight artifacts S-1…S-8 — crop P&L · cycle statement · field lifetime · consolidated plantation · cost structure with a k-anonymous benchmark · settlement per crop · practice comparison · scenario & replant signal — every one computed from posted lines only and printing its own uncertainty. Capture, evidence and S-1/S-2/S-3/S-4/S-6 sit in the base grower entitlement, free and permanent; S-5/S-7/S-8 form the analytics tier. Owned land carries no imputed rent and family labour is off by default, so the bottom line is named return to land and own labour. FR-267…312 · NFR-87…106 · WF-96…111. PROP-048's CropExpense is withdrawn as a store and becomes a capture form that posts. The lender's side (Rev 0.2). A quota or lead farmer is borrower and lender at once, so two more centre kinds — network and borrower — form a second branch under the same holding, with a seventh cost class network_lending, the 1160/1161 · 2160 · 4210/4220 · 5710/5720/5730 chart rows, AdvanceEarmark (which field the money went to, reachable only through the per-counterparty alias) and the derived BorrowerPosition, reconciling to the control accounts exactly and printing that line on S-9. Artifacts S-9 network lending book · S-10 money-into-fields map · S-11 network book P&L. No allocation rule crosses between the farm branch and the network branch, and a quota or lead farmer never reads a sub-farmer's cost book — he reads what he funded and its delivery outcome, never a margin, a cost structure or a benchmark position (OQ-12).

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

Related documentsเอกสารที่เกี่ยวข้อง

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

RevฉบับDateวันที่Changeการเปลี่ยนแปลง
0.1.02026-07-27Created by PROP-049 (spec v0.27.0, approved & applied 27 Jul 2026; all 10 open questions client-closed) — the CFL market perspective family opens with six documents. Per the OQ-3 decision the lead farmer gets his own family rather than being folded into CFQ: หัวตัน resembles the quota farmer superficially but differs significantly, and those differences are carried here as follow-on depth work. Rev starts at 0.1.0 per the post-PROP-014 semantic-versioning convention.สร้างโดย PROP-049 (spec v0.27.0 อนุมัติและ apply 27 ก.ค. 2569; ลูกค้าปิดคำถามเปิดครบทั้ง 10 ข้อ) — ตระกูล perspective ฝั่งตลาด CFL เปิดพร้อมเอกสารหกฉบับ ตามคำตัดสิน OQ-3 หัวตันได้ตระกูลของตนเองแทนการฝังไว้ใน CFQ: หัวตันดูคล้ายหัวหน้าโควต้าเพียงผิวเผินแต่ต่างกันอย่างมีนัยสำคัญ และความต่างเหล่านั้นถูกยกมาเป็นงานลงลึกต่อเนื่องในเอกสารชุดนี้ เริ่ม rev ที่ 0.1.0 ตามธรรมเนียม semantic versioning หลัง PROP-014
0.2.02026-07-27PROP-050 (spec v0.28.0, approved & applied 27 Jul 2026; all 26 OQs client-closed): cost centres to field & crop level — the cost dimension on the ledger, the crop cycle and its establishment asset, declared allocation, evidence in the cloud, the network lending branch, FR-267…312 / NFR-87…106 / WF-96…111PROP-050 (spec v0.28.0 อนุมัติและ apply 27 ก.ค. 2569; ปิดคำถามเปิดครบ 26 ข้อ): ศูนย์ต้นทุนถึงระดับแปลงและอ้อยรุ่น — มิติต้นทุนบนสมุดบัญชี รอบปลูกและสินทรัพย์ต้นทุนก่อตั้ง การปันส่วนที่ประกาศไว้ หลักฐานบนคลาวด์ กิ่งการให้ยืมของเครือข่าย FR-267…312 / NFR-87…106 / WF-96…111
0.3.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.3.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