validation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAtLeastOneCardRequired

func ValidateAtLeastOneCardRequired(cs pdfcardsummary.CardSummary) error

ValidateAtLeastOneCardRequired ensures the statement has at least one card

func ValidateCardMovementsHaveReceiptNumbers

func ValidateCardMovementsHaveReceiptNumbers(cs pdfcardsummary.CardSummary) error

ValidateCardMovementsHaveReceiptNumbers ensures all card movements have receipt numbers. Anomaly adjustment movements (with detail exactly matching AnomalyAdjustmentDetail) are exempt from this requirement.

func ValidateCardOwnerNonEmpty

func ValidateCardOwnerNonEmpty(cs pdfcardsummary.CardSummary) error

ValidateCardOwnerNonEmpty ensures all cards have a non-empty owner

func ValidateCardTotalsMatchMovements

func ValidateCardTotalsMatchMovements(cs pdfcardsummary.CardSummary) error

ValidateCardTotalsMatchMovements ensures each card's totals match the sum of its movements

func ValidateCloseDateBeforeExpirationDate

func ValidateCloseDateBeforeExpirationDate(cs pdfcardsummary.CardSummary) error

ValidateCloseDateBeforeExpirationDate ensures the close date is before or equal to the expiration date

func ValidateDateRangeReasonableness

func ValidateDateRangeReasonableness(cs pdfcardsummary.CardSummary) error

ValidateDateRangeReasonableness ensures dates are within reasonable bounds

func ValidateDocumentTotalsMatchComponents

func ValidateDocumentTotalsMatchComponents(cs pdfcardsummary.CardSummary) error

ValidateDocumentTotalsMatchComponents ensures document totals match the sum of all components

func ValidateMovementDatesWithinStatementPeriod

func ValidateMovementDatesWithinStatementPeriod(cs pdfcardsummary.CardSummary) error

ValidateMovementDatesWithinStatementPeriod ensures all movement dates are within a reasonable range of the close date (typically within 30 days before or after)

func ValidateMovementsHaveAmounts

func ValidateMovementsHaveAmounts(cs pdfcardsummary.CardSummary) error

ValidateMovementsHaveAmounts ensures all movements have at least one non-zero amount. SALDO ANTERIOR is an exception and can have zero amounts.

func ValidateSaldoAnteriorPresence

func ValidateSaldoAnteriorPresence(cs pdfcardsummary.CardSummary) error

ValidateSaldoAnteriorPresence ensures SALDO ANTERIOR is present and is the first past payment movement

func ValidateTaxMovementsHaveNoReceiptNumbers

func ValidateTaxMovementsHaveNoReceiptNumbers(cs pdfcardsummary.CardSummary) error

ValidateTaxMovementsHaveNoReceiptNumbers ensures tax movements do not have receipt numbers

Types

type Validator

type Validator struct{}

Validator validates CardSummary objects

func NewValidator

func NewValidator() *Validator

NewValidator creates a new validator

func (*Validator) Validate

func (v *Validator) Validate(cs pdfcardsummary.CardSummary) error

Validate runs all validations on the CardSummary and returns the first error encountered

Jump to

Keyboard shortcuts

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