Repository navigation
docs: accounts payable module page - #89
Merged
Merged
Conversation
Adds docs/modules/ap.md for the AP module: the vendor bill (ApInvoice), the approve and void transitions, the vendor payment (ApPayment), the aging by vendor and the GL postings (2010 Accounts Payable, 1010 Cash). Lists the seven AP routes under /api/v1/ap, the bill and line fields, the lifecycle with its blockers (has_payments, entry_not_linked, entry_unbalanced, period_closed, account_missing, line_needs_account, invoice_not_approved, exceeds_open), the events the module writes (vendor_invoice.created, .approved, .partial, .paid, .voided), the admin/owner/finance role guard behind the branch wall and the stated limits from C4-1b (unlinked legacy bills stay approved and payable; across-branch payments show whole). Adds the page to docs/modules/README.md's module table and the ap segment to the convention block, and removes AP from the not-in-brief sentence. Backed by docs/gable-v1/mm/docs-ap-claims.md: every sentence on the page traces to a row in that table (routes, bill fields, payment fields, statuses, blockers, role and scope checks, events, postings, branch wall behaviour, money ceilings and the ADR rule sentences). Migration 106 brought the AP tables onto the wire contract; C4-1b (PR 78) owns the conversion. ADR 0008 sections 7.4 and 12-13 hold the design; ADR 0001 sections 7, 7a, 9 and 11 hold the wire contract; ADR 0007 section 5.5 holds the branch bound key rule the payload branch_id applies. Signed-off-by: colton <colton@futurebuild.ai>
Address the Sonnet 5.5 review for PR 89 (round 1): P1-1 clarify that the payload branch rule applies to POST /ap/invoices only; POST /ap/payments carries no branch_id and is held to the wall through the bills it names via LockForPayment. P2-1 an omitted currency is USD (Parse fills it in input.go); the currency.default setting is not read on the create path. P2-2 the id-order lock prevents deadlock and serialises payments on a bill; repeats are caught by Idempotency-Key and the open amount check. P2-3 remove the invented UI clause about the desk typing dollars. P2-4 MarkVoided leaves gl_entry_id set; the bill rows agree. P2-5 ApPaymentApplication is a storage row, not on the wire. P3 notes: entry_not_linked reachable from approved only (a partial bill is refused has_payments first); every route reads included is behind scoped; name the field the AP code returns (branch_id); the approver is the caller-given id; error envelope is ADR 0001 section 3; dev mode needs no bearer; method is accepted case insensitively; remove 'Loader has reviewed'; add the machine key role guard sentence from ADR 0002 section 4. Claims table rows in mm/docs-ap-claims.md bind each change. Signed-off-by: colton <colton@futurebuild.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs: accounts payable module page
Adds docs/modules/ap.md for the AP module: the vendor bill (ApInvoice), the approve and void transitions, the vendor payment (ApPayment), the aging by vendor and the GL postings (2010 Accounts Payable, 1010 Cash). Lists the seven AP routes under /api/v1/ap, the bill and line fields, the lifecycle with its blockers (has_payments, entry_not_linked, entry_unbalanced, period_closed, account_missing, line_needs_account, invoice_not_approved, exceeds_open), the events the module writes (vendor_invoice.created, .approved, .partial, .paid, .voided), the admin/owner/finance role guard behind the branch wall and the stated limits from C4-1b (unlinked legacy bills stay approved and payable; across-branch payments show whole). Adds the page to docs/modules/README.md's module table and the ap segment to the convention block, and removes AP from the not-in-brief sentence.
Every sentence on the page traces to a row in the claims table below.
Claims table (rows A through M, source paths and the proof that backs each row): see
/home/colton/Desktop/FBHQ/gable-v1/mm/docs-ap-claims.md(off repository).The groups:
core/api/ROUTES.txt.ApVendorInvoice,ApVendorInvoiceSummaryandApVendorInvoiceLine.ApPaymentand theApCreatePaymentRequestbody.ApAgingSummarybucket fields.core/internal/ap/model.go:53-62, blockershas_payments,entry_not_linked,entry_unbalanced,invoice_not_approved,exceeds_open, plus theIf-Match428 /stale_revision409 rule.period_closed,account_missing,entry_unbalanced,line_needs_accountmapped inservice.go.scoped("admin", "owner", "finance")atserve.go:679;BranchGuard.CheckPayloadBranchfor the payloadbranch_id.vendor_invoice.created,.approved,.partial,.paid,.voidedfromservice.go:49-55; written in transaction per ADR 0003 section 2.DR 2010 / CR 1010; void reverses throughgl.PostReversal. AccountsAccountCodeAP = "2010"andAccountCodeCash = "1010".tax_cents,lines[i].unit_price_ten_thousandths,lines[i].quantity,linessubtotal, lines-and-tax together,amount_cents: all999999999999cents;unit_price999999999999ten-thousandths. Defined atinput.go:261-265.File changes:
apsegment in the convention block; removes AP from the "not in the brief's list" sentence.🤖 Generated with Claude Code