validate

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateBatchSize

func ValidateBatchSize(count, max int, name string) error

ValidateBatchSize checks that count does not exceed max.

func ValidateControlChars

func ValidateControlChars(s string) error

ValidateControlChars rejects strings containing ASCII control characters other than TAB (0x09), LF (0x0A), and CR (0x0D).

func ValidateDate

func ValidateDate(s string) error

ValidateDate checks that s is a valid YYYY-MM-DD date.

func ValidateDateRange

func ValidateDateRange(start, end string) error

ValidateDateRange checks that start and end are valid dates and start <= end.

func ValidateEnum

func ValidateEnum(value string, allowed []string) error

ValidateEnum checks that value is one of the allowed values.

func ValidateFilePath

func ValidateFilePath(path string) error

ValidateFilePath resolves symlinks and rejects paths containing traversal components.

func ValidateInvoiceCreateRequest added in v0.2.0

func ValidateInvoiceCreateRequest(req *invoicemodel.CreateBillingRequest) error

ValidateInvoiceCreateRequest applies client-side checks before posting an invoice draft. Mirrors the spec's `required` and `maxLength` / enum constraints; keeps the API call as the source of truth for everything else (e.g. department membership).

func ValidateInvoiceDate added in v0.2.0

func ValidateInvoiceDate(s string) error

ValidateInvoiceDate checks that s is a valid invoice-style date.

func ValidateInvoiceUpdateRequest added in v0.2.0

func ValidateInvoiceUpdateRequest(req *invoicemodel.UpdateBillingRequest) error

ValidateInvoiceUpdateRequest validates the optional fields on an update payload. No top-level field is required; we only check format when a value is supplied.

func ValidateJournalType

func ValidateJournalType(s string) error

ValidateJournalType checks that s is a valid journal type.

func ValidateTransitionType

func ValidateTransitionType(s string) error

ValidateTransitionType checks that s is a valid transition type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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