api

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequestIDKey is the context key for request ID.
	RequestIDKey contextKey = "request_id"
)

Variables

This section is empty.

Functions

func GetRequestID

func GetRequestID(ctx context.Context) string

GetRequestID retrieves the request ID from context.

func LogError

func LogError(ctx context.Context, msg string, err error, args ...any)

LogError logs an error with request context.

func LogInfo

func LogInfo(ctx context.Context, msg string, args ...any)

LogInfo logs an info message with request context.

func LogWarn

func LogWarn(ctx context.Context, msg string, args ...any)

LogWarn logs a warning with request context.

func NewRouter

func NewRouter(services *service.Services, hub *realtime.Hub) http.Handler

NewRouter creates the HTTP router with all routes.

func RequestLogger

func RequestLogger(next http.Handler) http.Handler

RequestLogger is middleware that logs HTTP requests with timing and correlation IDs.

Types

type AcceptQuoteRequest

type AcceptQuoteRequest struct {
	OptionID string `json:"option_id"`
}

AcceptQuoteRequest represents a request to accept a quote with a chosen option.

type AddDesignRequest

type AddDesignRequest struct {
	DesignID  string `json:"design_id"`
	Quantity  int    `json:"quantity"`
	IsPrimary bool   `json:"is_primary"`
	Notes     string `json:"notes"`
}

AddDesignRequest represents the request body for adding a design to a template.

type AddItemRequest

type AddItemRequest struct {
	ProjectID  *uuid.UUID `json:"project_id,omitempty"`  // Link to project (product catalog)
	TemplateID *uuid.UUID `json:"template_id,omitempty"` // Legacy: for backwards compatibility
	SKU        string     `json:"sku"`
	Quantity   int        `json:"quantity"`
	Notes      string     `json:"notes"`
}

AddItemRequest represents a request to add an item to an order.

type AddMaterialRequest

type AddMaterialRequest struct {
	MaterialType  string           `json:"material_type"`
	ColorSpec     *model.ColorSpec `json:"color_spec,omitempty"`
	WeightGrams   float64          `json:"weight_grams"`
	AMSPosition   *int             `json:"ams_position,omitempty"`
	SequenceOrder int              `json:"sequence_order"`
	Notes         string           `json:"notes"`
}

AddMaterialRequest represents the request body for adding a material.

type AlertsHandler

type AlertsHandler struct {
	// contains filtered or unexported fields
}

AlertsHandler handles alert-related HTTP requests.

func NewAlertsHandler

func NewAlertsHandler(svc *service.AlertService) *AlertsHandler

NewAlertsHandler creates a new AlertsHandler.

func (*AlertsHandler) Dismiss

func (h *AlertsHandler) Dismiss(w http.ResponseWriter, r *http.Request)

Dismiss dismisses an alert.

func (*AlertsHandler) GetCounts

func (h *AlertsHandler) GetCounts(w http.ResponseWriter, r *http.Request)

GetCounts returns alert counts by severity.

func (*AlertsHandler) List

func (h *AlertsHandler) List(w http.ResponseWriter, r *http.Request)

List returns all active alerts.

func (*AlertsHandler) Undismiss

func (h *AlertsHandler) Undismiss(w http.ResponseWriter, r *http.Request)

Undismiss removes a dismissal.

func (*AlertsHandler) UpdateMaterialThreshold

func (h *AlertsHandler) UpdateMaterialThreshold(w http.ResponseWriter, r *http.Request)

UpdateMaterialThreshold updates the low threshold for a material.

type BackupHandler

type BackupHandler struct {
	// contains filtered or unexported fields
}

BackupHandler handles database backup HTTP requests.

func (*BackupHandler) Create

func (h *BackupHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new backup.

func (*BackupHandler) Delete

func (h *BackupHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a backup.

func (*BackupHandler) GetConfig

func (h *BackupHandler) GetConfig(w http.ResponseWriter, r *http.Request)

GetConfig returns the backup configuration.

func (*BackupHandler) List

func (h *BackupHandler) List(w http.ResponseWriter, r *http.Request)

List returns all available backups.

func (*BackupHandler) Restore

func (h *BackupHandler) Restore(w http.ResponseWriter, r *http.Request)

Restore restores the database from a backup. WARNING: This will restart the application!

func (*BackupHandler) UpdateConfig

func (h *BackupHandler) UpdateConfig(w http.ResponseWriter, r *http.Request)

UpdateConfig updates the backup configuration.

type BambuCloudHandler

type BambuCloudHandler struct {
	// contains filtered or unexported fields
}

BambuCloudHandler handles Bambu Cloud integration endpoints.

func (*BambuCloudHandler) AddDevice

func (h *BambuCloudHandler) AddDevice(w http.ResponseWriter, r *http.Request)

AddDevice creates a printer from a cloud device.

func (*BambuCloudHandler) Devices

func (h *BambuCloudHandler) Devices(w http.ResponseWriter, r *http.Request)

Devices fetches the list of printers from Bambu Cloud.

func (*BambuCloudHandler) Login

Login authenticates with Bambu Cloud.

func (*BambuCloudHandler) Logout

Logout clears stored Bambu Cloud credentials.

func (*BambuCloudHandler) Status

Status returns the current Bambu Cloud auth status.

func (*BambuCloudHandler) Verify

Verify completes login with a verification code.

type ConfigureEtsyRequest

type ConfigureEtsyRequest struct {
	ClientID    string `json:"client_id"`
	RedirectURI string `json:"redirect_uri,omitempty"`
}

ConfigureEtsyRequest represents the request body for configuring the Etsy integration.

type ConnectRequest

type ConnectRequest struct {
	APIKey string `json:"api_key"`
}

ConnectRequest represents the request body for connecting to Squarespace.

type CreateCustomerRequest

type CreateCustomerRequest struct {
	Name            string         `json:"name"`
	Email           string         `json:"email"`
	Company         string         `json:"company"`
	Phone           string         `json:"phone"`
	Notes           string         `json:"notes"`
	BillingAddress  *model.Address `json:"billing_address"`
	ShippingAddress *model.Address `json:"shipping_address"`
}

CreateCustomerRequest represents a request to create a customer.

type CreateFeedbackRequest

type CreateFeedbackRequest struct {
	Type    string `json:"type"`
	Message string `json:"message"`
	Contact string `json:"contact,omitempty"`
	Page    string `json:"page,omitempty"`
}

CreateFeedbackRequest is the request body for submitting feedback.

type CreateLineItemRequest

type CreateLineItemRequest struct {
	Type           string  `json:"type"`
	Description    string  `json:"description"`
	Quantity       float64 `json:"quantity"`
	Unit           string  `json:"unit"`
	UnitPriceCents int     `json:"unit_price_cents"`
	TotalCents     int     `json:"total_cents"`
	SortOrder      int     `json:"sort_order"`
	ProjectID      *string `json:"project_id,omitempty"`
}

CreateLineItemRequest represents a request to add a line item.

type CreateOptionRequest

type CreateOptionRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	SortOrder   int    `json:"sort_order"`
}

CreateOptionRequest represents a request to add an option to a quote.

type CreateOrderRequest

type CreateOrderRequest struct {
	CustomerName  string     `json:"customer_name"`
	CustomerEmail string     `json:"customer_email"`
	DueDate       *time.Time `json:"due_date"`
	Priority      int        `json:"priority"`
	Notes         string     `json:"notes"`
}

CreateOrderRequest represents a request to create a new order.

type CreateQuoteRequest

type CreateQuoteRequest struct {
	CustomerID       string         `json:"customer_id"`
	Title            string         `json:"title"`
	Notes            string         `json:"notes"`
	ValidUntil       *time.Time     `json:"valid_until"`
	DiscountType     string         `json:"discount_type"`
	DiscountValue    *int           `json:"discount_value"`
	RushFeeCents     *int           `json:"rush_fee_cents"`
	TaxRate          *int           `json:"tax_rate"`
	Terms            string         `json:"terms"`
	RequestedDueDate *time.Time     `json:"requested_due_date"`
	BillingAddress   *model.Address `json:"billing_address"`
	ShippingAddress  *model.Address `json:"shipping_address"`
}

CreateQuoteRequest represents a request to create a new quote.

type CreateTagRequest

type CreateTagRequest struct {
	Name  string `json:"name"`
	Color string `json:"color"`
}

CreateTagRequest represents a request to create a new tag.

type CustomerHandler

type CustomerHandler struct {
	// contains filtered or unexported fields
}

CustomerHandler handles customer-related HTTP requests.

func NewCustomerHandler

func NewCustomerHandler(svc *service.CustomerService) *CustomerHandler

NewCustomerHandler creates a new CustomerHandler.

func (*CustomerHandler) Create

func (h *CustomerHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new customer.

func (*CustomerHandler) Delete

func (h *CustomerHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a customer.

func (*CustomerHandler) Get

Get retrieves a single customer by ID.

func (*CustomerHandler) List

List returns customers with optional search filtering.

func (*CustomerHandler) Update

func (h *CustomerHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a customer.

type DesignHandler

type DesignHandler struct {
	// contains filtered or unexported fields
}

DesignHandler handles design endpoints.

func (*DesignHandler) Create

func (h *DesignHandler) Create(w http.ResponseWriter, r *http.Request)

Create uploads a new design version.

func (*DesignHandler) Download

func (h *DesignHandler) Download(w http.ResponseWriter, r *http.Request)

Download returns the design file.

func (*DesignHandler) Get

Get returns a design by ID.

func (*DesignHandler) ListByPart

func (h *DesignHandler) ListByPart(w http.ResponseWriter, r *http.Request)

ListByPart returns all designs for a part.

func (*DesignHandler) OpenExternal

func (h *DesignHandler) OpenExternal(w http.ResponseWriter, r *http.Request)

OpenExternal opens a design file in an external application.

type DismissRequest

type DismissRequest struct {
	Duration string `json:"duration"` // "1h", "4h", "24h", "permanent"
}

DismissRequest represents a request to dismiss an alert.

type DispatchHandler

type DispatchHandler struct {
	// contains filtered or unexported fields
}

DispatchHandler handles dispatch-related endpoints.

func NewDispatchHandler

func NewDispatchHandler(svc *service.DispatcherService) *DispatchHandler

NewDispatchHandler creates a new dispatch handler.

func (*DispatchHandler) Confirm

func (h *DispatchHandler) Confirm(w http.ResponseWriter, r *http.Request)

Confirm confirms a dispatch request. POST /api/dispatch/requests/{id}/confirm

func (*DispatchHandler) GetGlobalSettings

func (h *DispatchHandler) GetGlobalSettings(w http.ResponseWriter, r *http.Request)

GetGlobalSettings returns global auto-dispatch settings. GET /api/dispatch/settings

func (*DispatchHandler) GetPrinterSettings

func (h *DispatchHandler) GetPrinterSettings(w http.ResponseWriter, r *http.Request)

GetPrinterSettings returns auto-dispatch settings for a printer. GET /api/printers/{id}/dispatch-settings

func (*DispatchHandler) ListPending

func (h *DispatchHandler) ListPending(w http.ResponseWriter, r *http.Request)

ListPending returns all pending dispatch requests. GET /api/dispatch/requests

func (*DispatchHandler) Reject

func (h *DispatchHandler) Reject(w http.ResponseWriter, r *http.Request)

Reject rejects a dispatch request. POST /api/dispatch/requests/{id}/reject

func (*DispatchHandler) Skip

Skip skips the current job and tries the next compatible one. POST /api/dispatch/requests/{id}/skip

func (*DispatchHandler) UpdateGlobalSettings

func (h *DispatchHandler) UpdateGlobalSettings(w http.ResponseWriter, r *http.Request)

UpdateGlobalSettings updates global auto-dispatch settings. PUT /api/dispatch/settings

func (*DispatchHandler) UpdatePrinterSettings

func (h *DispatchHandler) UpdatePrinterSettings(w http.ResponseWriter, r *http.Request)

UpdatePrinterSettings updates auto-dispatch settings for a printer. PUT /api/printers/{id}/dispatch-settings

type EtsyHandler

type EtsyHandler struct {
	// contains filtered or unexported fields
}

EtsyHandler handles Etsy integration endpoints.

func NewEtsyHandler

func NewEtsyHandler(svc *service.EtsyService, orderSvc *service.OrderService) *EtsyHandler

NewEtsyHandler creates a new EtsyHandler.

func (*EtsyHandler) Callback

func (h *EtsyHandler) Callback(w http.ResponseWriter, r *http.Request)

Callback handles the OAuth callback from Etsy. GET /api/integrations/etsy/callback

func (*EtsyHandler) Configure

func (h *EtsyHandler) Configure(w http.ResponseWriter, r *http.Request)

Configure saves the Etsy Client ID and activates the integration. PUT /api/integrations/etsy/configure

func (*EtsyHandler) Disconnect

func (h *EtsyHandler) Disconnect(w http.ResponseWriter, r *http.Request)

Disconnect removes the Etsy integration. POST /api/integrations/etsy/disconnect

func (*EtsyHandler) GetListing

func (h *EtsyHandler) GetListing(w http.ResponseWriter, r *http.Request)

GetListing returns a single listing by ID. GET /api/integrations/etsy/listings/{id}

func (*EtsyHandler) GetReceipt

func (h *EtsyHandler) GetReceipt(w http.ResponseWriter, r *http.Request)

GetReceipt returns a single receipt by ID. GET /api/integrations/etsy/receipts/{id}

func (*EtsyHandler) GetStatus

func (h *EtsyHandler) GetStatus(w http.ResponseWriter, r *http.Request)

GetStatus returns the current Etsy integration status. GET /api/integrations/etsy/status

func (*EtsyHandler) HandleWebhook

func (h *EtsyHandler) HandleWebhook(w http.ResponseWriter, r *http.Request)

HandleWebhook processes incoming Etsy webhook events. POST /api/integrations/etsy/webhook

func (*EtsyHandler) LinkListing

func (h *EtsyHandler) LinkListing(w http.ResponseWriter, r *http.Request)

LinkListing links a listing to a template. POST /api/integrations/etsy/listings/{id}/link

func (*EtsyHandler) ListListings

func (h *EtsyHandler) ListListings(w http.ResponseWriter, r *http.Request)

ListListings returns stored Etsy listings. GET /api/integrations/etsy/listings

func (*EtsyHandler) ListReceipts

func (h *EtsyHandler) ListReceipts(w http.ResponseWriter, r *http.Request)

ListReceipts returns stored Etsy receipts. GET /api/integrations/etsy/receipts

func (*EtsyHandler) ListWebhookEvents

func (h *EtsyHandler) ListWebhookEvents(w http.ResponseWriter, r *http.Request)

ListWebhookEvents returns webhook event history. GET /api/integrations/etsy/webhook/events

func (*EtsyHandler) ProcessReceipt

func (h *EtsyHandler) ProcessReceipt(w http.ResponseWriter, r *http.Request)

ProcessReceipt creates a project from a receipt. POST /api/integrations/etsy/receipts/{id}/process

func (*EtsyHandler) ReprocessWebhookEvent

func (h *EtsyHandler) ReprocessWebhookEvent(w http.ResponseWriter, r *http.Request)

ReprocessWebhookEvent retries processing a failed webhook event. POST /api/integrations/etsy/webhook/events/{id}/reprocess

func (*EtsyHandler) SetTemplateSvc

func (h *EtsyHandler) SetTemplateSvc(svc *service.TemplateService)

SetTemplateSvc sets the template service for receipt processing.

func (*EtsyHandler) SetWebhookSecret

func (h *EtsyHandler) SetWebhookSecret(secret string)

SetWebhookSecret sets the webhook secret for signature verification.

func (*EtsyHandler) StartAuth

func (h *EtsyHandler) StartAuth(w http.ResponseWriter, r *http.Request)

StartAuth initiates the OAuth flow and returns the authorization URL. GET /api/integrations/etsy/auth

func (*EtsyHandler) SyncInventory

func (h *EtsyHandler) SyncInventory(w http.ResponseWriter, r *http.Request)

SyncInventory pushes local inventory to Etsy. POST /api/integrations/etsy/listings/{id}/sync-inventory

func (*EtsyHandler) SyncListings

func (h *EtsyHandler) SyncListings(w http.ResponseWriter, r *http.Request)

SyncListings fetches active listings from Etsy. POST /api/integrations/etsy/listings/sync

func (*EtsyHandler) SyncReceipts

func (h *EtsyHandler) SyncReceipts(w http.ResponseWriter, r *http.Request)

SyncReceipts fetches new receipts from Etsy. POST /api/integrations/etsy/receipts/sync

func (*EtsyHandler) UnlinkListing

func (h *EtsyHandler) UnlinkListing(w http.ResponseWriter, r *http.Request)

UnlinkListing removes a link between a listing and a template. DELETE /api/integrations/etsy/listings/{id}/link

type ExpenseHandler

type ExpenseHandler struct {
	// contains filtered or unexported fields
}

ExpenseHandler handles expense endpoints.

func (*ExpenseHandler) Confirm

func (h *ExpenseHandler) Confirm(w http.ResponseWriter, r *http.Request)

Confirm confirms an expense and applies inventory changes.

func (*ExpenseHandler) Delete

func (h *ExpenseHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete deletes an expense.

func (*ExpenseHandler) Get

Get returns an expense by ID with its items.

func (*ExpenseHandler) List

List returns all expenses.

func (*ExpenseHandler) Retry

func (h *ExpenseHandler) Retry(w http.ResponseWriter, r *http.Request)

Retry re-triggers AI parsing for a failed or stuck expense.

func (*ExpenseHandler) UploadReceipt

func (h *ExpenseHandler) UploadReceipt(w http.ResponseWriter, r *http.Request)

UploadReceipt handles receipt file upload.

type FeedbackHandler

type FeedbackHandler struct {
	// contains filtered or unexported fields
}

FeedbackHandler handles feedback endpoints.

func (*FeedbackHandler) Delete

func (h *FeedbackHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete handles DELETE /api/feedback/{id}.

func (*FeedbackHandler) List

List handles GET /api/feedback.

func (*FeedbackHandler) Submit

func (h *FeedbackHandler) Submit(w http.ResponseWriter, r *http.Request)

Submit handles POST /api/feedback.

type FileHandler

type FileHandler struct {
	// contains filtered or unexported fields
}

FileHandler handles file endpoints.

func (*FileHandler) Get

func (h *FileHandler) Get(w http.ResponseWriter, r *http.Request)

Get returns a file by ID.

type InstantiateRequest

type InstantiateRequest struct {
	OrderQuantity   int    `json:"order_quantity"`
	CustomerNotes   string `json:"customer_notes"`
	ExternalOrderID string `json:"external_order_id"`
	Source          string `json:"source"`
	MaterialSpoolID string `json:"material_spool_id"`
}

InstantiateRequest represents the request body for instantiating a template.

type LinkListingRequest

type LinkListingRequest struct {
	TemplateID    string `json:"template_id"`
	SKU           string `json:"sku"`
	SyncInventory bool   `json:"sync_inventory"`
}

LinkListingRequest represents the request body for linking a listing to a template.

type LinkProductRequest

type LinkProductRequest struct {
	TemplateID string `json:"template_id"`
	SKU        string `json:"sku"`
}

LinkProductRequest represents the request body for linking a product to a template.

type MarkShippedRequest

type MarkShippedRequest struct {
	TrackingNumber string `json:"tracking_number"`
}

MarkShippedRequest represents a request to mark an order as shipped.

type MaterialHandler

type MaterialHandler struct {
	// contains filtered or unexported fields
}

MaterialHandler handles material endpoints.

func (*MaterialHandler) Create

func (h *MaterialHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new material.

func (*MaterialHandler) Delete

func (h *MaterialHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a material by ID.

func (*MaterialHandler) Get

Get returns a material by ID.

func (*MaterialHandler) List

List returns all materials.

type OrderHandler

type OrderHandler struct {
	// contains filtered or unexported fields
}

OrderHandler handles order-related HTTP requests.

func NewOrderHandler

func NewOrderHandler(svc *service.OrderService) *OrderHandler

NewOrderHandler creates a new OrderHandler.

func (*OrderHandler) AddItem

func (h *OrderHandler) AddItem(w http.ResponseWriter, r *http.Request)

AddItem adds an item to an order.

func (*OrderHandler) Create

func (h *OrderHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new manual order.

func (*OrderHandler) Delete

func (h *OrderHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes an order.

func (*OrderHandler) Get

Get retrieves a single order by ID.

func (*OrderHandler) GetCounts

func (h *OrderHandler) GetCounts(w http.ResponseWriter, r *http.Request)

GetCounts returns order counts by status.

func (*OrderHandler) GetProgress

func (h *OrderHandler) GetProgress(w http.ResponseWriter, r *http.Request)

GetProgress returns the progress of an order.

func (*OrderHandler) List

func (h *OrderHandler) List(w http.ResponseWriter, r *http.Request)

List returns orders with optional filtering.

func (*OrderHandler) MarkShipped

func (h *OrderHandler) MarkShipped(w http.ResponseWriter, r *http.Request)

MarkShipped marks an order as shipped.

func (*OrderHandler) ProcessItem

func (h *OrderHandler) ProcessItem(w http.ResponseWriter, r *http.Request)

ProcessItem creates a task from an order item's project (product catalog entry).

func (*OrderHandler) RemoveItem

func (h *OrderHandler) RemoveItem(w http.ResponseWriter, r *http.Request)

RemoveItem removes an item from an order.

func (*OrderHandler) Update

func (h *OrderHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates an order.

func (*OrderHandler) UpdateStatus

func (h *OrderHandler) UpdateStatus(w http.ResponseWriter, r *http.Request)

UpdateStatus updates the status of an order.

type PartHandler

type PartHandler struct {
	// contains filtered or unexported fields
}

PartHandler handles part endpoints.

func (*PartHandler) Create

func (h *PartHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new part. Supports JSON body or multipart/form-data with an optional file.

func (*PartHandler) Delete

func (h *PartHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a part.

func (*PartHandler) Get

func (h *PartHandler) Get(w http.ResponseWriter, r *http.Request)

Get returns a part by ID.

func (*PartHandler) ListByProject

func (h *PartHandler) ListByProject(w http.ResponseWriter, r *http.Request)

ListByProject returns all parts for a project.

func (*PartHandler) Update

func (h *PartHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a part.

type PrintJobHandler

type PrintJobHandler struct {
	// contains filtered or unexported fields
}

PrintJobHandler handles print job endpoints.

func (*PrintJobHandler) Cancel

func (h *PrintJobHandler) Cancel(w http.ResponseWriter, r *http.Request)

Cancel cancels the print job.

func (*PrintJobHandler) Create

func (h *PrintJobHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new print job.

func (*PrintJobHandler) Get

Get returns a print job by ID.

func (*PrintJobHandler) GetEvents

func (h *PrintJobHandler) GetEvents(w http.ResponseWriter, r *http.Request)

GetEvents returns all events for a print job.

func (*PrintJobHandler) GetRetryChain

func (h *PrintJobHandler) GetRetryChain(w http.ResponseWriter, r *http.Request)

GetRetryChain returns all jobs in a retry chain.

func (*PrintJobHandler) GetWithEvents

func (h *PrintJobHandler) GetWithEvents(w http.ResponseWriter, r *http.Request)

GetWithEvents returns a print job with its full event timeline.

func (*PrintJobHandler) List

List returns all print jobs.

func (*PrintJobHandler) ListByDesign

func (h *PrintJobHandler) ListByDesign(w http.ResponseWriter, r *http.Request)

ListByDesign returns all print jobs for a design.

func (*PrintJobHandler) ListByRecipe

func (h *PrintJobHandler) ListByRecipe(w http.ResponseWriter, r *http.Request)

ListByRecipe returns all print jobs for a recipe.

func (*PrintJobHandler) MarkAsScrap

func (h *PrintJobHandler) MarkAsScrap(w http.ResponseWriter, r *http.Request)

MarkAsScrap marks a failed job as scrap (no retry intended).

func (*PrintJobHandler) Pause

Pause pauses the print job.

func (*PrintJobHandler) PreflightCheck

func (h *PrintJobHandler) PreflightCheck(w http.ResponseWriter, r *http.Request)

PreflightCheck validates a job is ready to start.

func (*PrintJobHandler) RecordFailure

func (h *PrintJobHandler) RecordFailure(w http.ResponseWriter, r *http.Request)

RecordFailure records a failure for a job.

func (*PrintJobHandler) RecordOutcome

func (h *PrintJobHandler) RecordOutcome(w http.ResponseWriter, r *http.Request)

RecordOutcome records the outcome of a completed print job.

func (*PrintJobHandler) Resume

func (h *PrintJobHandler) Resume(w http.ResponseWriter, r *http.Request)

Resume resumes the print job.

func (*PrintJobHandler) Retry

Retry creates a new job from a failed job.

func (*PrintJobHandler) Start

Start sends the job to the printer.

func (*PrintJobHandler) Update

func (h *PrintJobHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a print job.

func (*PrintJobHandler) UpdatePriority

func (h *PrintJobHandler) UpdatePriority(w http.ResponseWriter, r *http.Request)

UpdatePriority updates a job's priority in the queue.

type PrinterHandler

type PrinterHandler struct {
	// contains filtered or unexported fields
}

PrinterHandler handles printer endpoints.

func (*PrinterHandler) Create

func (h *PrinterHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new printer.

func (*PrinterHandler) Delete

func (h *PrinterHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a printer.

func (*PrinterHandler) Discover

func (h *PrinterHandler) Discover(w http.ResponseWriter, r *http.Request)

Discover scans the network for printers.

func (*PrinterHandler) Get

Get returns a printer by ID.

func (*PrinterHandler) GetAllStates

func (h *PrinterHandler) GetAllStates(w http.ResponseWriter, r *http.Request)

GetAllStates returns the real-time state of all printers.

func (*PrinterHandler) GetJobStats

func (h *PrinterHandler) GetJobStats(w http.ResponseWriter, r *http.Request)

GetJobStats returns job statistics for a printer.

func (*PrinterHandler) GetPrinterAnalytics

func (h *PrinterHandler) GetPrinterAnalytics(w http.ResponseWriter, r *http.Request)

GetPrinterAnalytics returns comprehensive analytics for a printer.

func (*PrinterHandler) GetState

func (h *PrinterHandler) GetState(w http.ResponseWriter, r *http.Request)

GetState returns the real-time state of a printer.

func (*PrinterHandler) List

List returns all printers.

func (*PrinterHandler) ListJobs

func (h *PrinterHandler) ListJobs(w http.ResponseWriter, r *http.Request)

ListJobs returns all print jobs for a printer.

func (*PrinterHandler) Update

func (h *PrinterHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a printer.

type ProjectHandler

type ProjectHandler struct {
	// contains filtered or unexported fields
}

ProjectHandler handles project endpoints.

func (*ProjectHandler) Create

func (h *ProjectHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new project.

func (*ProjectHandler) Delete

func (h *ProjectHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a project.

func (*ProjectHandler) Get

Get returns a project by ID.

func (*ProjectHandler) GetJobStats

func (h *ProjectHandler) GetJobStats(w http.ResponseWriter, r *http.Request)

GetJobStats returns job statistics for a project.

func (*ProjectHandler) GetProjectSummary

func (h *ProjectHandler) GetProjectSummary(w http.ResponseWriter, r *http.Request)

GetProjectSummary returns derived analytics for a project.

func (*ProjectHandler) List

List returns all projects.

func (*ProjectHandler) ListJobs

func (h *ProjectHandler) ListJobs(w http.ResponseWriter, r *http.Request)

ListJobs returns all print jobs for a project.

func (*ProjectHandler) StartProduction

func (h *ProjectHandler) StartProduction(w http.ResponseWriter, r *http.Request)

StartProduction auto-assigns resources and starts all queued jobs for a project.

func (*ProjectHandler) Update

func (h *ProjectHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a project.

type ProjectSupplyHandler

type ProjectSupplyHandler struct {
	// contains filtered or unexported fields
}

ProjectSupplyHandler handles project supply HTTP requests.

func (*ProjectSupplyHandler) Create

Create creates a new project supply.

func (*ProjectSupplyHandler) Delete

Delete removes a project supply.

func (*ProjectSupplyHandler) List

List retrieves all supplies for a project.

type QuoteHandler

type QuoteHandler struct {
	// contains filtered or unexported fields
}

QuoteHandler handles quote-related HTTP requests.

func NewQuoteHandler

func NewQuoteHandler(svc *service.QuoteService) *QuoteHandler

NewQuoteHandler creates a new QuoteHandler.

func (*QuoteHandler) Accept

func (h *QuoteHandler) Accept(w http.ResponseWriter, r *http.Request)

Accept transitions a quote to accepted and creates an order.

func (*QuoteHandler) Create

func (h *QuoteHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new quote.

func (*QuoteHandler) CreateLineItem

func (h *QuoteHandler) CreateLineItem(w http.ResponseWriter, r *http.Request)

CreateLineItem adds a line item to a quote option.

func (*QuoteHandler) CreateOption

func (h *QuoteHandler) CreateOption(w http.ResponseWriter, r *http.Request)

CreateOption adds an option to a quote.

func (*QuoteHandler) Delete

func (h *QuoteHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a quote.

func (*QuoteHandler) DeleteLineItem

func (h *QuoteHandler) DeleteLineItem(w http.ResponseWriter, r *http.Request)

DeleteLineItem removes a line item.

func (*QuoteHandler) DeleteOption

func (h *QuoteHandler) DeleteOption(w http.ResponseWriter, r *http.Request)

DeleteOption removes a quote option.

func (*QuoteHandler) Get

Get retrieves a single quote by ID.

func (*QuoteHandler) GetByShareToken

func (h *QuoteHandler) GetByShareToken(w http.ResponseWriter, r *http.Request)

GetByShareToken retrieves a quote by its public share token.

func (*QuoteHandler) List

func (h *QuoteHandler) List(w http.ResponseWriter, r *http.Request)

List returns quotes with optional filtering.

func (*QuoteHandler) Reject

func (h *QuoteHandler) Reject(w http.ResponseWriter, r *http.Request)

Reject transitions a quote to rejected.

func (*QuoteHandler) Send

func (h *QuoteHandler) Send(w http.ResponseWriter, r *http.Request)

Send transitions a quote from draft to sent.

func (*QuoteHandler) Update

func (h *QuoteHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a quote.

func (*QuoteHandler) UpdateLineItem

func (h *QuoteHandler) UpdateLineItem(w http.ResponseWriter, r *http.Request)

UpdateLineItem updates a line item.

func (*QuoteHandler) UpdateOption

func (h *QuoteHandler) UpdateOption(w http.ResponseWriter, r *http.Request)

UpdateOption updates a quote option.

type RecordFailureRequest

type RecordFailureRequest struct {
	FailureCategory string `json:"failure_category"`
	ErrorCode       string `json:"error_code"`
	ErrorMessage    string `json:"error_message"`
}

RecordFailureRequest represents the request body for recording a failure.

type RetryRequest

type RetryRequest struct {
	PrinterID       string `json:"printer_id,omitempty"`
	MaterialSpoolID string `json:"material_spool_id,omitempty"`
	FailureCategory string `json:"failure_category,omitempty"`
	Notes           string `json:"notes,omitempty"`
}

RetryRequest represents the request body for retrying a job.

type SaleHandler

type SaleHandler struct {
	// contains filtered or unexported fields
}

SaleHandler handles sale endpoints.

func (*SaleHandler) Create

func (h *SaleHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new sale.

func (*SaleHandler) Delete

func (h *SaleHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete deletes a sale.

func (*SaleHandler) Get

func (h *SaleHandler) Get(w http.ResponseWriter, r *http.Request)

Get returns a sale by ID.

func (*SaleHandler) GetWeeklyInsights

func (h *SaleHandler) GetWeeklyInsights(w http.ResponseWriter, r *http.Request)

GetWeeklyInsights returns this-week vs last-week sales comparison.

func (*SaleHandler) List

func (h *SaleHandler) List(w http.ResponseWriter, r *http.Request)

List returns all sales.

func (*SaleHandler) Update

func (h *SaleHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a sale.

type SettingsHandler

type SettingsHandler struct {
	// contains filtered or unexported fields
}

SettingsHandler handles settings endpoints.

func (*SettingsHandler) Delete

func (h *SettingsHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a setting.

func (*SettingsHandler) Get

Get returns a single setting (with sensitive values masked).

func (*SettingsHandler) List

List returns all settings (with sensitive values masked).

func (*SettingsHandler) Set

Set creates or updates a setting.

type ShopifyHandler

type ShopifyHandler struct {
	// contains filtered or unexported fields
}

ShopifyHandler handles Shopify integration HTTP requests.

func NewShopifyHandler

func NewShopifyHandler(svc *service.ShopifyService, orderSvc *service.OrderService, config service.ShopifyConfig) *ShopifyHandler

NewShopifyHandler creates a new ShopifyHandler.

func (*ShopifyHandler) Callback

func (h *ShopifyHandler) Callback(w http.ResponseWriter, r *http.Request)

Callback handles the OAuth callback.

func (*ShopifyHandler) Disconnect

func (h *ShopifyHandler) Disconnect(w http.ResponseWriter, r *http.Request)

Disconnect removes the Shopify integration.

func (*ShopifyHandler) GetAuthURL

func (h *ShopifyHandler) GetAuthURL(w http.ResponseWriter, r *http.Request)

GetAuthURL returns the OAuth authorization URL.

func (*ShopifyHandler) GetOrder

func (h *ShopifyHandler) GetOrder(w http.ResponseWriter, r *http.Request)

GetOrder returns a single Shopify order.

func (*ShopifyHandler) GetStatus

func (h *ShopifyHandler) GetStatus(w http.ResponseWriter, r *http.Request)

GetStatus returns the current integration status.

func (*ShopifyHandler) LinkProduct

func (h *ShopifyHandler) LinkProduct(w http.ResponseWriter, r *http.Request)

LinkProduct links a Shopify product to a template.

func (*ShopifyHandler) ListOrders

func (h *ShopifyHandler) ListOrders(w http.ResponseWriter, r *http.Request)

ListOrders returns synced Shopify orders.

func (*ShopifyHandler) ProcessOrder

func (h *ShopifyHandler) ProcessOrder(w http.ResponseWriter, r *http.Request)

ProcessOrder creates a unified Order from a Shopify order.

func (*ShopifyHandler) SyncOrders

func (h *ShopifyHandler) SyncOrders(w http.ResponseWriter, r *http.Request)

SyncOrders triggers an order sync.

func (*ShopifyHandler) UnlinkProduct

func (h *ShopifyHandler) UnlinkProduct(w http.ResponseWriter, r *http.Request)

UnlinkProduct removes a product-template link.

type ShopifyLinkProductRequest

type ShopifyLinkProductRequest struct {
	TemplateID string `json:"template_id"`
	SKU        string `json:"sku"`
}

ShopifyLinkProductRequest represents a request to link a Shopify product to a template.

type SpoolHandler

type SpoolHandler struct {
	// contains filtered or unexported fields
}

SpoolHandler handles spool endpoints.

func (*SpoolHandler) Create

func (h *SpoolHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new spool.

func (*SpoolHandler) Delete added in v1.1.3

func (h *SpoolHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete deletes a spool by ID.

func (*SpoolHandler) Get

Get returns a spool by ID.

func (*SpoolHandler) List

func (h *SpoolHandler) List(w http.ResponseWriter, r *http.Request)

List returns all spools.

type SquarespaceHandler

type SquarespaceHandler struct {
	// contains filtered or unexported fields
}

SquarespaceHandler handles Squarespace integration endpoints.

func NewSquarespaceHandler

func NewSquarespaceHandler(svc *service.SquarespaceService, orderSvc *service.OrderService) *SquarespaceHandler

NewSquarespaceHandler creates a new SquarespaceHandler.

func (*SquarespaceHandler) Connect

Connect validates the API key and saves the integration. POST /api/integrations/squarespace/connect

func (*SquarespaceHandler) Disconnect

func (h *SquarespaceHandler) Disconnect(w http.ResponseWriter, r *http.Request)

Disconnect removes the Squarespace integration. POST /api/integrations/squarespace/disconnect

func (*SquarespaceHandler) GetOrder

func (h *SquarespaceHandler) GetOrder(w http.ResponseWriter, r *http.Request)

GetOrder returns a single order by ID. GET /api/integrations/squarespace/orders/{id}

func (*SquarespaceHandler) GetProduct

func (h *SquarespaceHandler) GetProduct(w http.ResponseWriter, r *http.Request)

GetProduct returns a single product by ID. GET /api/integrations/squarespace/products/{id}

func (*SquarespaceHandler) GetStatus

func (h *SquarespaceHandler) GetStatus(w http.ResponseWriter, r *http.Request)

GetStatus returns the current Squarespace integration status. GET /api/integrations/squarespace/status

func (*SquarespaceHandler) LinkProduct

func (h *SquarespaceHandler) LinkProduct(w http.ResponseWriter, r *http.Request)

LinkProduct links a Squarespace product to a template. POST /api/integrations/squarespace/products/{id}/link

func (*SquarespaceHandler) ListOrders

func (h *SquarespaceHandler) ListOrders(w http.ResponseWriter, r *http.Request)

ListOrders returns stored Squarespace orders. GET /api/integrations/squarespace/orders

func (*SquarespaceHandler) ListProducts

func (h *SquarespaceHandler) ListProducts(w http.ResponseWriter, r *http.Request)

ListProducts returns stored Squarespace products. GET /api/integrations/squarespace/products

func (*SquarespaceHandler) ProcessOrder

func (h *SquarespaceHandler) ProcessOrder(w http.ResponseWriter, r *http.Request)

ProcessOrder creates a unified order from a Squarespace order. POST /api/integrations/squarespace/orders/{id}/process

func (*SquarespaceHandler) SyncOrders

func (h *SquarespaceHandler) SyncOrders(w http.ResponseWriter, r *http.Request)

SyncOrders fetches new orders from Squarespace. POST /api/integrations/squarespace/orders/sync

func (*SquarespaceHandler) SyncProducts

func (h *SquarespaceHandler) SyncProducts(w http.ResponseWriter, r *http.Request)

SyncProducts fetches products from Squarespace. POST /api/integrations/squarespace/products/sync

func (*SquarespaceHandler) UnlinkProduct

func (h *SquarespaceHandler) UnlinkProduct(w http.ResponseWriter, r *http.Request)

UnlinkProduct removes a product-template link. DELETE /api/integrations/squarespace/products/{id}/link

type StatsHandler

type StatsHandler struct {
	// contains filtered or unexported fields
}

StatsHandler handles statistics endpoints.

func (*StatsHandler) GetExpensesByCategory

func (h *StatsHandler) GetExpensesByCategory(w http.ResponseWriter, r *http.Request)

GetExpensesByCategory returns expense totals grouped by category.

func (*StatsHandler) GetFinancialSummary

func (h *StatsHandler) GetFinancialSummary(w http.ResponseWriter, r *http.Request)

GetFinancialSummary returns aggregated financial statistics. Accepts an optional "period" query param (30d, 60d, 90d, 12m) to filter by time range.

func (*StatsHandler) GetSalesByChannel

func (h *StatsHandler) GetSalesByChannel(w http.ResponseWriter, r *http.Request)

GetSalesByChannel returns sales totals grouped by channel.

func (*StatsHandler) GetSalesByProject

func (h *StatsHandler) GetSalesByProject(w http.ResponseWriter, r *http.Request)

GetSalesByProject returns sales aggregated by project.

func (*StatsHandler) GetTimeSeries

func (h *StatsHandler) GetTimeSeries(w http.ResponseWriter, r *http.Request)

GetTimeSeries returns time-series data for revenue, expenses, and profit.

type TagsHandler

type TagsHandler struct {
	// contains filtered or unexported fields
}

TagsHandler handles tag-related HTTP requests.

func NewTagsHandler

func NewTagsHandler(svc *service.TagService) *TagsHandler

NewTagsHandler creates a new TagsHandler.

func (*TagsHandler) AddTagToDesign

func (h *TagsHandler) AddTagToDesign(w http.ResponseWriter, r *http.Request)

AddTagToDesign adds a tag to a design.

func (*TagsHandler) AddTagToPart

func (h *TagsHandler) AddTagToPart(w http.ResponseWriter, r *http.Request)

AddTagToPart adds a tag to a part.

func (*TagsHandler) Create

func (h *TagsHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new tag.

func (*TagsHandler) Delete

func (h *TagsHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a tag.

func (*TagsHandler) Get

func (h *TagsHandler) Get(w http.ResponseWriter, r *http.Request)

Get retrieves a single tag by ID.

func (*TagsHandler) GetDesignTags

func (h *TagsHandler) GetDesignTags(w http.ResponseWriter, r *http.Request)

GetDesignTags returns all tags for a design.

func (*TagsHandler) GetPartTags

func (h *TagsHandler) GetPartTags(w http.ResponseWriter, r *http.Request)

GetPartTags returns all tags for a part.

func (*TagsHandler) List

func (h *TagsHandler) List(w http.ResponseWriter, r *http.Request)

List returns all tags.

func (*TagsHandler) ListDesignsByTag

func (h *TagsHandler) ListDesignsByTag(w http.ResponseWriter, r *http.Request)

ListDesignsByTag returns all designs with a given tag.

func (*TagsHandler) ListPartsByTag

func (h *TagsHandler) ListPartsByTag(w http.ResponseWriter, r *http.Request)

ListPartsByTag returns all parts with a given tag.

func (*TagsHandler) RemoveTagFromDesign

func (h *TagsHandler) RemoveTagFromDesign(w http.ResponseWriter, r *http.Request)

RemoveTagFromDesign removes a tag from a design.

func (*TagsHandler) RemoveTagFromPart

func (h *TagsHandler) RemoveTagFromPart(w http.ResponseWriter, r *http.Request)

RemoveTagFromPart removes a tag from a part.

func (*TagsHandler) Update

func (h *TagsHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a tag.

type TaskHandler

type TaskHandler struct {
	// contains filtered or unexported fields
}

TaskHandler handles task HTTP requests.

func NewTaskHandler

func NewTaskHandler(service *service.TaskService) *TaskHandler

NewTaskHandler creates a new TaskHandler.

func (*TaskHandler) CancelTask

func (h *TaskHandler) CancelTask(w http.ResponseWriter, r *http.Request)

CancelTask marks a task as cancelled.

func (*TaskHandler) CompleteTask

func (h *TaskHandler) CompleteTask(w http.ResponseWriter, r *http.Request)

CompleteTask marks a task as completed.

func (*TaskHandler) Create

func (h *TaskHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new task.

func (*TaskHandler) Delete

func (h *TaskHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a task.

func (*TaskHandler) Get

func (h *TaskHandler) Get(w http.ResponseWriter, r *http.Request)

Get returns a task by ID.

func (*TaskHandler) GetChecklist

func (h *TaskHandler) GetChecklist(w http.ResponseWriter, r *http.Request)

GetChecklist returns checklist items for a task.

func (*TaskHandler) GetProgress

func (h *TaskHandler) GetProgress(w http.ResponseWriter, r *http.Request)

GetProgress returns the progress of a task.

func (*TaskHandler) List

func (h *TaskHandler) List(w http.ResponseWriter, r *http.Request)

List returns all tasks with optional filters.

func (*TaskHandler) ListByProject

func (h *TaskHandler) ListByProject(w http.ResponseWriter, r *http.Request)

ListByProject returns tasks for a project.

func (*TaskHandler) PrintFromChecklist

func (h *TaskHandler) PrintFromChecklist(w http.ResponseWriter, r *http.Request)

PrintFromChecklist creates a print job for a checklist item's linked part.

func (*TaskHandler) RegenerateChecklist

func (h *TaskHandler) RegenerateChecklist(w http.ResponseWriter, r *http.Request)

RegenerateChecklist regenerates checklist items from project parts.

func (*TaskHandler) StartTask

func (h *TaskHandler) StartTask(w http.ResponseWriter, r *http.Request)

StartTask marks a task as in_progress.

func (*TaskHandler) ToggleChecklistItem

func (h *TaskHandler) ToggleChecklistItem(w http.ResponseWriter, r *http.Request)

ToggleChecklistItem toggles a checklist item's completed state.

func (*TaskHandler) Update

func (h *TaskHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a task.

func (*TaskHandler) UpdateStatus

func (h *TaskHandler) UpdateStatus(w http.ResponseWriter, r *http.Request)

UpdateStatus updates the status of a task.

type TemplateHandler

type TemplateHandler struct {
	// contains filtered or unexported fields
}

TemplateHandler handles template endpoints.

func (*TemplateHandler) AddDesign

func (h *TemplateHandler) AddDesign(w http.ResponseWriter, r *http.Request)

AddDesign adds a design to a template.

func (*TemplateHandler) AddMaterial

func (h *TemplateHandler) AddMaterial(w http.ResponseWriter, r *http.Request)

AddMaterial adds a material to a template/recipe.

func (*TemplateHandler) AddSupply

func (h *TemplateHandler) AddSupply(w http.ResponseWriter, r *http.Request)

AddSupply adds a supply item to a recipe.

func (*TemplateHandler) Create

func (h *TemplateHandler) Create(w http.ResponseWriter, r *http.Request)

Create creates a new template.

func (*TemplateHandler) Delete

func (h *TemplateHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a template.

func (*TemplateHandler) Get

Get returns a template by ID with its designs.

func (*TemplateHandler) GetAnalytics

func (h *TemplateHandler) GetAnalytics(w http.ResponseWriter, r *http.Request)

GetAnalytics returns aggregated performance analytics for a template.

func (*TemplateHandler) GetCompatiblePrinters

func (h *TemplateHandler) GetCompatiblePrinters(w http.ResponseWriter, r *http.Request)

GetCompatiblePrinters returns printers that match recipe constraints.

func (*TemplateHandler) GetCompatibleSpools

func (h *TemplateHandler) GetCompatibleSpools(w http.ResponseWriter, r *http.Request)

GetCompatibleSpools returns spools that match recipe material requirements.

func (*TemplateHandler) GetCostEstimate

func (h *TemplateHandler) GetCostEstimate(w http.ResponseWriter, r *http.Request)

GetCostEstimate returns the cost breakdown for a recipe.

func (*TemplateHandler) Instantiate

func (h *TemplateHandler) Instantiate(w http.ResponseWriter, r *http.Request)

Instantiate creates a project from a template.

func (*TemplateHandler) List

List returns all templates.

func (*TemplateHandler) ListMaterials

func (h *TemplateHandler) ListMaterials(w http.ResponseWriter, r *http.Request)

ListMaterials returns all materials for a template/recipe.

func (*TemplateHandler) ListSupplies

func (h *TemplateHandler) ListSupplies(w http.ResponseWriter, r *http.Request)

ListSupplies returns all supply items for a recipe.

func (*TemplateHandler) RemoveDesign

func (h *TemplateHandler) RemoveDesign(w http.ResponseWriter, r *http.Request)

RemoveDesign removes a design from a template.

func (*TemplateHandler) RemoveMaterial

func (h *TemplateHandler) RemoveMaterial(w http.ResponseWriter, r *http.Request)

RemoveMaterial removes a material from a template/recipe.

func (*TemplateHandler) RemoveSupply

func (h *TemplateHandler) RemoveSupply(w http.ResponseWriter, r *http.Request)

RemoveSupply removes a supply item from a recipe.

func (*TemplateHandler) Update

func (h *TemplateHandler) Update(w http.ResponseWriter, r *http.Request)

Update updates a template.

func (*TemplateHandler) UpdateMaterial

func (h *TemplateHandler) UpdateMaterial(w http.ResponseWriter, r *http.Request)

UpdateMaterial updates a material in a template/recipe.

func (*TemplateHandler) UpdateSupply

func (h *TemplateHandler) UpdateSupply(w http.ResponseWriter, r *http.Request)

UpdateSupply updates a supply item in a recipe.

func (*TemplateHandler) ValidatePrinter

func (h *TemplateHandler) ValidatePrinter(w http.ResponseWriter, r *http.Request)

ValidatePrinter checks if a printer meets recipe constraints.

type TimelineHandler

type TimelineHandler struct {
	// contains filtered or unexported fields
}

TimelineHandler handles timeline-related HTTP requests.

func NewTimelineHandler

func NewTimelineHandler(svc *service.TimelineService) *TimelineHandler

NewTimelineHandler creates a new TimelineHandler.

func (*TimelineHandler) GetOrderTimeline

func (h *TimelineHandler) GetOrderTimeline(w http.ResponseWriter, r *http.Request)

GetOrderTimeline returns a detailed timeline for a single order.

func (*TimelineHandler) GetProjectTimeline

func (h *TimelineHandler) GetProjectTimeline(w http.ResponseWriter, r *http.Request)

GetProjectTimeline returns a detailed timeline for a single project.

func (*TimelineHandler) GetTimeline

func (h *TimelineHandler) GetTimeline(w http.ResponseWriter, r *http.Request)

GetTimeline returns timeline items for the Gantt view.

type UpdateCustomerRequest

type UpdateCustomerRequest struct {
	Name            *string        `json:"name,omitempty"`
	Email           *string        `json:"email,omitempty"`
	Company         *string        `json:"company,omitempty"`
	Phone           *string        `json:"phone,omitempty"`
	Notes           *string        `json:"notes,omitempty"`
	BillingAddress  *model.Address `json:"billing_address,omitempty"`
	ShippingAddress *model.Address `json:"shipping_address,omitempty"`
}

UpdateCustomerRequest represents a request to update a customer.

type UpdateLineItemRequest

type UpdateLineItemRequest struct {
	Type           *string  `json:"type,omitempty"`
	Description    *string  `json:"description,omitempty"`
	Quantity       *float64 `json:"quantity,omitempty"`
	Unit           *string  `json:"unit,omitempty"`
	UnitPriceCents *int     `json:"unit_price_cents,omitempty"`
	TotalCents     *int     `json:"total_cents,omitempty"`
	SortOrder      *int     `json:"sort_order,omitempty"`
	ProjectID      *string  `json:"project_id,omitempty"`
}

UpdateLineItemRequest represents a request to update a line item.

type UpdateOptionRequest

type UpdateOptionRequest struct {
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	SortOrder   *int    `json:"sort_order,omitempty"`
}

UpdateOptionRequest represents a request to update a quote option.

type UpdateOrderRequest

type UpdateOrderRequest struct {
	CustomerName  *string            `json:"customer_name,omitempty"`
	CustomerEmail *string            `json:"customer_email,omitempty"`
	DueDate       *time.Time         `json:"due_date,omitempty"`
	Priority      *int               `json:"priority,omitempty"`
	Notes         *string            `json:"notes,omitempty"`
	Status        *model.OrderStatus `json:"status,omitempty"`
}

UpdateOrderRequest represents a request to update an order.

type UpdateQuoteRequest

type UpdateQuoteRequest struct {
	Title            *string        `json:"title,omitempty"`
	Notes            *string        `json:"notes,omitempty"`
	ValidUntil       *time.Time     `json:"valid_until,omitempty"`
	CustomerID       *string        `json:"customer_id,omitempty"`
	DiscountType     *string        `json:"discount_type,omitempty"`
	DiscountValue    *int           `json:"discount_value,omitempty"`
	RushFeeCents     *int           `json:"rush_fee_cents,omitempty"`
	TaxRate          *int           `json:"tax_rate,omitempty"`
	Terms            *string        `json:"terms,omitempty"`
	RequestedDueDate *time.Time     `json:"requested_due_date,omitempty"`
	BillingAddress   *model.Address `json:"billing_address,omitempty"`
	ShippingAddress  *model.Address `json:"shipping_address,omitempty"`
}

UpdateQuoteRequest represents a request to update a quote.

type UpdateThresholdRequest

type UpdateThresholdRequest struct {
	ThresholdGrams int `json:"threshold_grams"`
}

UpdateThresholdRequest represents a request to update a material's low threshold.

Jump to

Keyboard shortcuts

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