pos

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

View Source
const DefaultPageSize = 100

DefaultPageSize is bigger than other lists' default (100 vs 20) since the product grid is a fast-picking screen where cashiers want more on screen.

View Source
const DefaultSessionPageSize = 20

DefaultSessionPageSize is used when no valid per_page query param is supplied.

Variables

View Source
var PageSizes = []int{20, 50, 100}

PageSizes are the selectable "items per page" options for the POS product grid.

View Source
var SessionPageSizes = []int{20, 50, 100}

SessionPageSizes are the selectable "items per page" options for the active sessions list. Named distinctly from order.templ's PageSizes (same package, different list with a different default).

Functions

func ActiveSessions

func ActiveSessions(props ActiveSessionsProps) templ.Component

func Checkout

func Checkout(data layout.AppLayoutData, session model.POSSession, order model.Order, items []model.OrderItem, productNames map[uuid.UUID]string, methods []model.PaymentMethod, formValues map[string]string, errMsg string) templ.Component

func Order

func Order(props OrderProps) templ.Component

func Start

func Start(data layout.AppLayoutData, stations []model.POSStation, errMsg string) templ.Component

Types

type ActiveSessionsProps

type ActiveSessionsProps struct {
	Data         layout.AppLayoutData
	Sessions     []model.POSSession
	Page         int
	PerPage      int
	TotalItems   int
	BranchID     uuid.UUID
	Branches     []model.Branch
	BranchNames  map[uuid.UUID]string
	StationNames map[uuid.UUID]string
	UserNames    map[uuid.UUID]string
	StopErr      string
}

ActiveSessionsProps holds the data needed to render the owner/manager cross-branch active-sessions dashboard.

type OrderProps

type OrderProps struct {
	Data             layout.AppLayoutData
	Session          model.POSSession
	Order            model.Order
	Items            []model.OrderItem
	Products         []model.Product
	ProductNames     map[uuid.UUID]string
	Stocks           map[uuid.UUID]float64
	EmployeeName     string
	CashInDrawer     int64
	Discounts        []model.Discount
	ReceiptNumber    string
	CloseErr         string
	ScanError        string
	DiscountError    string
	AssignedCustomer *model.Customer
	FoundCustomer    *model.Customer
	CustomerQuery    string
	CustomerError    string
	PaginationProps  PaginationProps
}

OrderProps holds the data needed to render the POS order screen.

type PaginationProps

type PaginationProps struct {
	Search     string
	Page       int
	PerPage    int
	TotalItems int
}

PaginationProps holds the search/pagination state for the product grid.

Jump to

Keyboard shortcuts

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