workervalidator

package
v0.0.0-...-20e6d49 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWorkerProfileRequired = eris.New("worker profile is required for assignment eligibility check")

Functions

This section is empty.

Types

type ValidationContext

type ValidationContext struct {
	IsCreate bool
	IsUpdate bool
	Original *worker.Worker
}

type Validator

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

func NewValidator

func NewValidator(p ValidatorParams) *Validator

func (*Validator) CheckAssignmentEligibility

func (v *Validator) CheckAssignmentEligibility(wrk *worker.Worker) error

func (*Validator) Validate

Validate validates a worker and returns a MultiError if there are any validation errors

type ValidatorParams

type ValidatorParams struct {
	fx.In

	Repo             repositories.WorkerRepository
	HazmatExpRepo    repositories.HazmatExpirationRepository
	ProfileValidator *WorkerProfileValidator
	PTOValidator     *WorkerPTOValidator
}

type WorkerPTOValidator

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

func (*WorkerPTOValidator) Validate

func (v *WorkerPTOValidator) Validate(ctx context.Context, valCtx *validator.ValidationContext, wrk *worker.Worker, pto *worker.WorkerPTO, multiErr *errors.MultiError, index int)

ValidatePTO validates a worker's PTO and returns a MultiError if there are any validation errors This is a wrapper for the individual PTO checks

type WorkerPTOValidatorParams

type WorkerPTOValidatorParams struct {
	fx.In

	Repo repositories.WorkerRepository
}

type WorkerProfileValidator

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

func (*WorkerProfileValidator) Validate

type WorkerProfileValidatorParams

type WorkerProfileValidatorParams struct {
	fx.In

	CompValidator *compliancevalidator.Validator
}

Jump to

Keyboard shortcuts

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