pub enum PosError {
Show 43 variants
EmptyDocument,
NegativeAmount,
SessionNotOpen,
SessionRegisterMismatch,
NotDraft,
NotFullyTendered {
rounded_total: Decimal,
paid_total: Decimal,
},
NotReturnable(String),
MissingAccount(&'static str),
DuplicateNumber(String),
ProfileNotFound(Uuid),
InvoiceNotFound(Uuid),
SessionNotFound(Uuid),
BillingRejected {
code: String,
message: String,
},
PaymentRejected {
code: String,
message: String,
},
PricingRejected {
code: String,
message: String,
},
InventoryRejected {
code: String,
message: String,
},
InvalidCashMovement(&'static str),
PartialReturnsNotImplemented,
ProfileTaxTemplatesMissing(Uuid),
TaxRejected {
code: String,
message: String,
},
SessionClosedRescueRequired(Uuid),
SyncPartnerMismatch,
SyncSessionMismatch,
RefundParentNotFound(Uuid),
RefundLineageConflict,
InvalidTenderMethod(String),
DuplicateClientUuid(Uuid),
SessionHasDraftOrders(i64),
SessionHasUnpostedInvoices(i64),
SessionAlreadyOpen,
VarianceRejected {
code: String,
message: String,
},
ManagerAuthRequired,
PinNotFound,
PinInvalid,
PinLocked {
until: DateTime<Utc>,
},
PinThrottled,
WeakPin(&'static str),
TableNotFound(Uuid),
TableOccupied {
pos_table_id: Uuid,
draft_invoice_id: Uuid,
},
DiscountNotFound(Uuid),
DiscountNotAllowed,
DiscountInvalid(&'static str),
Db(Error),
}Variants§
EmptyDocument
NegativeAmount
SessionNotOpen
SessionRegisterMismatch
The open session belongs to a different register than the ticket names — a ticket must settle on its own register’s drawer; pairing one register’s config with another’s till would misattribute cash between registers.
NotDraft
NotFullyTendered
NotReturnable(String)
MissingAccount(&'static str)
DuplicateNumber(String)
ProfileNotFound(Uuid)
InvoiceNotFound(Uuid)
SessionNotFound(Uuid)
BillingRejected
PaymentRejected
PricingRejected
InventoryRejected
InvalidCashMovement(&'static str)
PartialReturnsNotImplemented
Forward-compatible seam (council 2026-07-26, #5): return_sale accepts an optional
PartialCredit, but partial-return behavior is not yet implemented — it lands when
backbone-billing’s credit note honors a line subset (ADR-001 park; gate: merchant demand).
ProfileTaxTemplatesMissing(Uuid)
The register carries no tax templates — a ticket cannot be priced. Configure at least one template on the profile (zero-rated included for a non-PKP register).
TaxRejected
The tax compute port refused the request (propagates the seam’s code + message).
SessionClosedRescueRequired(Uuid)
The session the client rang under has since closed and no open rescue session was offered.
SyncPartnerMismatch
The replay would reassign the ticket to a different customer than it was first synced with.
SyncSessionMismatch
The replay names a session the ticket does not belong to (and the original is still open).
RefundParentNotFound(Uuid)
A refund replay’s parent uuid does not resolve to a live ticket of this company.
RefundLineageConflict
A refund ticket already recorded against a different parent refuses to be re-pointed.
InvalidTenderMethod(String)
A tender replay carries a method the payment-method enum does not know.
DuplicateClientUuid(Uuid)
The client uuid is already held by another live ticket (the sync identity namespaces inside the acting unit’s scope once composed; a collision is a client bug or a replay of someone else’s uuid).
SessionHasDraftOrders(i64)
The session still holds DRAFT tickets — post or void them before closing.
SessionHasUnpostedInvoices(i64)
The session holds invoiced tickets whose posting did not complete (billing linked, ticket not paid) — retry recognition before closing.
SessionAlreadyOpen
A second session is already open on this register (enforced by the one-open-session unique).
VarianceRejected
The variance seam refused the booking (propagates the seam’s code + message). Nothing has been written when this surfaces — the close rolls back entirely.
ManagerAuthRequired
A privileged mutation was attempted without manager authorization.
PinNotFound
No live PIN is set for that manager.
PinInvalid
The presented PIN does not match the stored hash.
PinLocked
The manager’s PIN is locked: too many consecutive failures. Carries the unlock instant.
PinThrottled
Too many verification attempts from one source address inside the throttle window.
WeakPin(&'static str)
The chosen PIN does not satisfy the policy (digits + length window).
TableNotFound(Uuid)
The named dining table does not exist (in this tenant).
TableOccupied
The named dining table already holds a live DRAFT ticket — one draft per table; resume, settle, or move that ticket before opening a second one on the table. Carries the occupying ticket so the client can jump to it. (The DB partial unique is the backstop; this is the friendly typed refusal.)
DiscountNotFound(Uuid)
The named discount master row does not exist (in this tenant) or is retired.
DiscountNotAllowed
The register is configured discount-off (allow_discount = false) — a ring naming a
discount master is refused.
DiscountInvalid(&'static str)
The discount master’s stored percentage is unusable (over 100%). The master row is misconfigured; nothing was rung.
Db(Error)
Implementations§
Trait Implementations§
Source§impl Error for PosError
impl Error for PosError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for PosError
impl !UnwindSafe for PosError
impl Freeze for PosError
impl Send for PosError
impl Sync for PosError
impl Unpin for PosError
impl UnsafeUnpin for PosError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more