draftorder

package
v1.49.48 Latest Latest
Warning

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

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

Documentation

Overview

Package draftorder wires the admin order-builder HTTP surface: CRUD on draft orders and their line items, plus the complete action that converts a draft into a REAL order (models/order) with the same items and total.

Every handler is tenant-scoped via middleware.GetOrganization(c) + org.Namespaced(c.Context()) — the same isolation the rest of the /v1 surface uses — so a caller only ever touches its own org's drafts. Custom sub-routes pass the Namespace middleware explicitly since the REST layer only auto-namespaces default CRUD.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Complete

func Complete(c *zip.Ctx) error

Complete converts a draft order into a real order: it builds one order line per draft line (server-authoritative unit price), sets the order total to the projected draft total, creates the order, and marks the draft complete with a back-reference to the order it produced.

Money action, so it is admin-gated INSIDE the handler (the route middleware no-ops on the IAM path). Idempotent: completing an already-completed draft returns its existing order rather than creating a second one.

func ListItems

func ListItems(c *zip.Ctx) error

ListItems returns a draft's line items plus the projected running total. This is the read the line-item builder polls as the admin adds/removes lines.

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