b2b

package
v1.49.50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 13 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptQuote

func AcceptQuote(c *zip.Ctx) error

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

func AddQuoteMessage(c *zip.Ctx) error

AddQuoteMessage appends a message to a quote's negotiation thread.

func ApproveApproval

func ApproveApproval(c *zip.Ctx) error

ApproveApproval approves a pending approval.

func EmployeeSpending

func EmployeeSpending(c *zip.Ctx) error

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

func ListQuoteMessages(c *zip.Ctx) error

ListQuoteMessages lists the messages on a quote's thread.

func RejectApproval

func RejectApproval(c *zip.Ctx) error

RejectApproval rejects a pending approval.

func RejectQuote

func RejectQuote(c *zip.Ctx) error

RejectQuote transitions a pending quote to a rejected state. Admin-only (a quote state decision) — gated inside the handler like AcceptQuote.

func Route

func Route(router zip.Router, args ...zip.Handler)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL