Documentation
¶
Overview ¶
Package b2b wires the B2B commerce HTTP surface: companies, employees (with their spending headroom), quotes (accept/reject + message thread), and spend-approvals. Every handler is tenant-scoped via the caller's organization namespace; the REST layer auto-namespaces the default CRUD routes and each custom sub-route passes the Namespace middleware explicitly.
Index ¶
- func AcceptQuote(c *gin.Context)
- func AddQuoteMessage(c *gin.Context)
- func ApproveApproval(c *gin.Context)
- func EmployeeSpending(c *gin.Context)
- func ListQuoteMessages(c *gin.Context)
- func RejectApproval(c *gin.Context)
- func RejectQuote(c *gin.Context)
- func Route(router router.Router, args ...gin.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptQuote ¶
AcceptQuote transitions a pending quote to accepted. Accepting a quote commits the org to a negotiated price, so it is admin-only — enforced inside the handler because the route middleware no-ops on the IAM path (Red HIGH-4).
func AddQuoteMessage ¶
AddQuoteMessage appends a message to a quote's negotiation thread.
func ApproveApproval ¶
ApproveApproval approves a pending approval.
func EmployeeSpending ¶
EmployeeSpending returns an employee's remaining spend headroom. The amount already committed is supplied by the caller (the cart/order in flight) via the `committed` query param in cents, defaulting to 0.
func ListQuoteMessages ¶
ListQuoteMessages lists the messages on a quote's thread.
func RejectApproval ¶
RejectApproval rejects a pending approval.
func RejectQuote ¶
RejectQuote transitions a pending quote to a rejected state. Admin-only (a quote state decision) — gated inside the handler like AcceptQuote.
Types ¶
This section is empty.