models

package
v0.0.0-...-0751cc3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NTSRaw is the raw string value of the NTS Shipment Type
	NTSRaw = "HHG_INTO_NTS_DOMESTIC"
	// NTSrRaw is the raw string value of the NTSr Shipment Type
	NTSrRaw = "HHG_OUTOF_NTS_DOMESTIC"
)

using these also in move.go selected move type

View Source
const (
	// Tariff400ngItemAllowedLocationORIGIN captures enum value "ORIGIN"
	Tariff400ngItemAllowedLocationORIGIN Tariff400ngItemAllowedLocation = "ORIGIN"
	// Tariff400ngItemAllowedLocationDESTINATION captures enum value "DESTINATION"
	Tariff400ngItemAllowedLocationDESTINATION Tariff400ngItemAllowedLocation = "DESTINATION"
	// Tariff400ngItemAllowedLocationNEITHER captures enum value "NEITHER"
	Tariff400ngItemAllowedLocationNEITHER Tariff400ngItemAllowedLocation = "NEITHER"
	// Tariff400ngItemAllowedLocationEITHER captures enum value "EITHER"
	Tariff400ngItemAllowedLocationEITHER Tariff400ngItemAllowedLocation = "EITHER"

	// Tariff400ngItemDiscountTypeHHG captures enum value "HHG"
	Tariff400ngItemDiscountTypeHHG Tariff400ngItemDiscountType = "HHG"
	// Tariff400ngItemDiscountTypeHHGLINEHAUL50 captures enum value "HHG_LINEHAUL_50"
	Tariff400ngItemDiscountTypeHHGLINEHAUL50 Tariff400ngItemDiscountType = "HHG_LINEHAUL_50"
	// Tariff400ngItemDiscountTypeSIT captures enum value "SIT"
	Tariff400ngItemDiscountTypeSIT Tariff400ngItemDiscountType = "SIT"
	// Tariff400ngItemDiscountTypeNONE captures enum value "NONE"
	Tariff400ngItemDiscountTypeNONE Tariff400ngItemDiscountType = "NONE"

	// Tariff400ngItemRateRefCodeDATEDELIVERED captures enum value "DD"
	Tariff400ngItemRateRefCodeDATEDELIVERED Tariff400ngItemRateRefCode = "DD"
	// Tariff400ngItemRateRefCodeFUELSURCHARGE captures enum value "FS"
	Tariff400ngItemRateRefCodeFUELSURCHARGE Tariff400ngItemRateRefCode = "FS"
	// Tariff400ngItemRateRefCodeMILES captures enum value "MI"
	Tariff400ngItemRateRefCodeMILES Tariff400ngItemRateRefCode = "MI"
	// Tariff400ngItemRateRefCodePACKPERCENTAGE captures enum value "PS"
	Tariff400ngItemRateRefCodePACKPERCENTAGE Tariff400ngItemRateRefCode = "PS"
	// Tariff400ngItemRateRefCodePOINTSCHEDULE captures enum value "SC"
	Tariff400ngItemRateRefCodePOINTSCHEDULE Tariff400ngItemRateRefCode = "SC"
	// Tariff400ngItemRateRefCodeTARIFFSECTION captures enum value "SE"
	Tariff400ngItemRateRefCodeTARIFFSECTION Tariff400ngItemRateRefCode = "SE"
	// Tariff400ngItemRateRefCodeNONE captures enum value "NONE"
	Tariff400ngItemRateRefCodeNONE Tariff400ngItemRateRefCode = "NONE"

	// Tariff400ngItemMeasurementUnitWEIGHT captures enum value "BW"
	Tariff400ngItemMeasurementUnitWEIGHT Tariff400ngItemMeasurementUnit = "BW"
	// Tariff400ngItemMeasurementUnitCUBICFOOT captures enum value "CF"
	Tariff400ngItemMeasurementUnitCUBICFOOT Tariff400ngItemMeasurementUnit = "CF"
	// Tariff400ngItemMeasurementUnitEACH captures enum value "EA"
	Tariff400ngItemMeasurementUnitEACH Tariff400ngItemMeasurementUnit = "EA"
	// Tariff400ngItemMeasurementUnitFLATRATE captures enum value "FR"
	Tariff400ngItemMeasurementUnitFLATRATE Tariff400ngItemMeasurementUnit = "FR"
	// Tariff400ngItemMeasurementUnitFUELPERCENTAGE captures enum value "FP"
	Tariff400ngItemMeasurementUnitFUELPERCENTAGE Tariff400ngItemMeasurementUnit = "FP"
	// Tariff400ngItemMeasurementUnitCONTAINER captures enum value "NR"
	Tariff400ngItemMeasurementUnitCONTAINER Tariff400ngItemMeasurementUnit = "NR"
	// Tariff400ngItemMeasurementUnitMONETARYVALUE captures enum value "MV"
	Tariff400ngItemMeasurementUnitMONETARYVALUE Tariff400ngItemMeasurementUnit = "MV"
	// Tariff400ngItemMeasurementUnitDAYS captures enum value "TD"
	Tariff400ngItemMeasurementUnitDAYS Tariff400ngItemMeasurementUnit = "TD"
	// Tariff400ngItemMeasurementUnitHOURS captures enum value "TH"
	Tariff400ngItemMeasurementUnitHOURS Tariff400ngItemMeasurementUnit = "TH"
	// Tariff400ngItemMeasurementUnitNONE captures enum value "NONE"
	Tariff400ngItemMeasurementUnitNONE Tariff400ngItemMeasurementUnit = "NONE"
)
View Source
const (
	// DefaultServiceMemberSITDaysAllowance is the default number of SIT days a service member is allowed
	DefaultServiceMemberSITDaysAllowance = 90
)

These are meant to be the default number of SIT days that a customer is allowed to have. They should be used when creating a shipment and setting the initial value. Other values will likely be added to this once we deal with different types of customers.

View Source
const PoundsPackedPerDay = 5000

PoundsPackedPerDay represents the number of pounds that can be packed in a single day.

View Source
const RecordNotFoundErrorString = "sql: no rows in result set"

RecordNotFoundErrorString is the error string returned when no matching rows exist in the database This is ugly, but the best we can do with go's Postgresql adapter

View Source
const UploadedOrdersDocumentName = "uploaded_orders"

UploadedOrdersDocumentName is the name of an uploaded orders document

Variables

View Source
var ErrCreateViolatesUniqueConstraint = errors.New("CREATE_VIOLATES_UNIQUE")

ErrCreateViolatesUniqueConstraint is returned if you call create and violate a unique constraint.

View Source
var ErrDestroyForbidden = errors.New("DESTROY_FORBIDDEN")

ErrDestroyForbidden means that a model cannot be destroyed in its current state

View Source
var ErrFetchForbidden = errors.New("FETCH_FORBIDDEN")

ErrFetchForbidden means that the record exists but that the user does not have access to it

View Source
var ErrFetchNotFound = errors.New("FETCH_NOT_FOUND")

ErrFetchNotFound means that the requested record does not exist

View Source
var ErrInvalidPatchGate = errors.New("INVALID_PATCH_GATE")

ErrInvalidPatchGate means that an attempt to patch a model was not given the correct set of fields

View Source
var ErrInvalidTransition = errors.New("INVALID_TRANSITION")

ErrInvalidTransition is an error representing an invalid state transition.

View Source
var ErrLocatorGeneration = errors.New("LOCATOR_ERRORS")

ErrLocatorGeneration means that we got errors generating the Locator

View Source
var ErrUserUnauthorized = errors.New("USER_UNAUTHORIZED")

ErrUserUnauthorized means that the user is not authorized to access a record

View Source
var ErrWriteConflict = errors.New("WRITE_CONFLICT")

ErrWriteConflict means that the record creation or update cannot be completed due to a conflict with other records

View Source
var ErrWriteForbidden = errors.New("WRITE_FORBIDDEN")

ErrWriteForbidden means that user is not permitted to write the record

View Source
var OffersPerQualityBand = map[int]int{
	1: 1,
	2: 1,
	3: 1,
	4: 1,
}

OffersPerQualityBand is a map of the number of shipments to be offered per round to each quality band TODO: change these back to [5, 3, 2, 1] after the B&M pilot

View Source
var ValidServiceItemParamNameStrings = []string{
	string(ServiceItemParamNameActualPickupDate),
	string(ServiceItemParamNameContractCode),
	string(ServiceItemParamNameContractYearName),
	string(ServiceItemParamNameCubicFeetBilled),
	string(ServiceItemParamNameCubicFeetCrating),
	string(ServiceItemParamNameDimensionHeight),
	string(ServiceItemParamNameDimensionLength),
	string(ServiceItemParamNameDimensionWidth),
	string(ServiceItemParamNameDistanceZip),
	string(ServiceItemParamNameDistanceZipSITDest),
	string(ServiceItemParamNameDistanceZipSITOrigin),
	string(ServiceItemParamNameEIAFuelPrice),
	string(ServiceItemParamNameEscalationCompounded),
	string(ServiceItemParamNameFSCMultiplier),
	string(ServiceItemParamNameFSCPriceDifferenceInCents),
	string(ServiceItemParamNameFSCWeightBasedDistanceMultiplier),
	string(ServiceItemParamNameIsPeak),
	string(ServiceItemParamNameMarketDest),
	string(ServiceItemParamNameMarketOrigin),
	string(ServiceItemParamNameMTOAvailableToPrimeAt),
	string(ServiceItemParamNameNTSPackingFactor),
	string(ServiceItemParamNameNumberDaysSIT),
	string(ServiceItemParamNamePriceAreaDest),
	string(ServiceItemParamNamePriceAreaIntlDest),
	string(ServiceItemParamNamePriceAreaIntlOrigin),
	string(ServiceItemParamNamePriceAreaOrigin),
	string(ServiceItemParamNamePriceRateOrFactor),
	string(ServiceItemParamNamePSILinehaulDom),
	string(ServiceItemParamNamePSILinehaulDomPrice),
	string(ServiceItemParamNamePSILinehaulShort),
	string(ServiceItemParamNamePSILinehaulShortPrice),
	string(ServiceItemParamNamePSIPriceDomDest),
	string(ServiceItemParamNamePSIPriceDomDestPrice),
	string(ServiceItemParamNamePSIPriceDomOrigin),
	string(ServiceItemParamNamePSIPriceDomOriginPrice),
	string(ServiceItemParamNamePSIShippingLinehaulIntlCO),
	string(ServiceItemParamNamePSIShippingLinehaulIntlCOPrice),
	string(ServiceItemParamNamePSIShippingLinehaulIntlOC),
	string(ServiceItemParamNamePSIShippingLinehaulIntlOCPrice),
	string(ServiceItemParamNamePSIShippingLinehaulIntlOO),
	string(ServiceItemParamNamePSIShippingLinehaulIntlOOPrice),
	string(ServiceItemParamNameRateAreaNonStdDest),
	string(ServiceItemParamNameRateAreaNonStdOrigin),
	string(ServiceItemParamNameReferenceDate),
	string(ServiceItemParamNameRequestedPickupDate),
	string(ServiceItemParamNameServiceAreaDest),
	string(ServiceItemParamNameServiceAreaOrigin),
	string(ServiceItemParamNameServicesScheduleDest),
	string(ServiceItemParamNameServicesScheduleOrigin),
	string(ServiceItemParamNameSITPaymentRequestEnd),
	string(ServiceItemParamNameSITPaymentRequestStart),
	string(ServiceItemParamNameSITScheduleDest),
	string(ServiceItemParamNameSITScheduleOrigin),
	string(ServiceItemParamNameWeightAdjusted),
	string(ServiceItemParamNameWeightBilled),
	string(ServiceItemParamNameWeightEstimated),
	string(ServiceItemParamNameWeightOriginal),
	string(ServiceItemParamNameWeightReweigh),
	string(ServiceItemParamNameZipDestAddress),
	string(ServiceItemParamNameZipPickupAddress),
	string(ServiceItemParamNameZipSITDestHHGFinalAddress),
	string(ServiceItemParamNameZipSITOriginHHGActualAddress),
	string(ServiceItemParamNameZipSITOriginHHGOriginalAddress),
}

ValidServiceItemParamNameStrings lists all valid service item param key names

View Source
var ValidServiceItemParamNames = []ServiceItemParamName{
	ServiceItemParamNameActualPickupDate,
	ServiceItemParamNameContractCode,
	ServiceItemParamNameContractYearName,
	ServiceItemParamNameCubicFeetBilled,
	ServiceItemParamNameCubicFeetCrating,
	ServiceItemParamNameDimensionHeight,
	ServiceItemParamNameDimensionLength,
	ServiceItemParamNameDimensionWidth,
	ServiceItemParamNameDistanceZip,
	ServiceItemParamNameDistanceZipSITDest,
	ServiceItemParamNameDistanceZipSITOrigin,
	ServiceItemParamNameEIAFuelPrice,
	ServiceItemParamNameEscalationCompounded,
	ServiceItemParamNameFSCMultiplier,
	ServiceItemParamNameFSCPriceDifferenceInCents,
	ServiceItemParamNameFSCWeightBasedDistanceMultiplier,
	ServiceItemParamNameIsPeak,
	ServiceItemParamNameMarketDest,
	ServiceItemParamNameMarketOrigin,
	ServiceItemParamNameMTOAvailableToPrimeAt,
	ServiceItemParamNameNTSPackingFactor,
	ServiceItemParamNameNumberDaysSIT,
	ServiceItemParamNamePriceAreaDest,
	ServiceItemParamNamePriceAreaIntlDest,
	ServiceItemParamNamePriceAreaIntlOrigin,
	ServiceItemParamNamePriceAreaOrigin,
	ServiceItemParamNamePriceRateOrFactor,
	ServiceItemParamNamePSILinehaulDom,
	ServiceItemParamNamePSILinehaulDomPrice,
	ServiceItemParamNamePSILinehaulShort,
	ServiceItemParamNamePSILinehaulShortPrice,
	ServiceItemParamNamePSIPriceDomDest,
	ServiceItemParamNamePSIPriceDomDestPrice,
	ServiceItemParamNamePSIPriceDomOrigin,
	ServiceItemParamNamePSIPriceDomOriginPrice,
	ServiceItemParamNamePSIShippingLinehaulIntlCO,
	ServiceItemParamNamePSIShippingLinehaulIntlCOPrice,
	ServiceItemParamNamePSIShippingLinehaulIntlOC,
	ServiceItemParamNamePSIShippingLinehaulIntlOCPrice,
	ServiceItemParamNamePSIShippingLinehaulIntlOO,
	ServiceItemParamNamePSIShippingLinehaulIntlOOPrice,
	ServiceItemParamNameRateAreaNonStdDest,
	ServiceItemParamNameRateAreaNonStdOrigin,
	ServiceItemParamNameReferenceDate,
	ServiceItemParamNameRequestedPickupDate,
	ServiceItemParamNameServiceAreaDest,
	ServiceItemParamNameServiceAreaOrigin,
	ServiceItemParamNameServicesScheduleDest,
	ServiceItemParamNameServicesScheduleOrigin,
	ServiceItemParamNameSITPaymentRequestEnd,
	ServiceItemParamNameSITPaymentRequestStart,
	ServiceItemParamNameSITScheduleDest,
	ServiceItemParamNameSITScheduleOrigin,
	ServiceItemParamNameWeightAdjusted,
	ServiceItemParamNameWeightBilled,
	ServiceItemParamNameWeightEstimated,
	ServiceItemParamNameWeightOriginal,
	ServiceItemParamNameWeightReweigh,
	ServiceItemParamNameZipDestAddress,
	ServiceItemParamNameZipPickupAddress,
	ServiceItemParamNameZipSITDestHHGFinalAddress,
	ServiceItemParamNameZipSITOriginHHGActualAddress,
	ServiceItemParamNameZipSITOriginHHGOriginalAddress,
}

ValidServiceItemParamNames lists all valid service item param key names

ValidServiceItemParamOrigins lists all valid service item param origins

ValidServiceItemParamTypes lists all valid service item param types

Functions

func AllWeightAllotments

func AllWeightAllotments() map[ServiceMemberRank]WeightAllotment

AllWeightAllotments returns all the weight allotments for each rank.

func AssignQualityBandToTSPPerformance

func AssignQualityBandToTSPPerformance(db *pop.Connection, band int, id uuid.UUID) error

AssignQualityBandToTSPPerformance sets the QualityBand value for a TransportationServiceProviderPerformance.

func BoolPointer

func BoolPointer(b bool) *bool

BoolPointer allows you to take the address of a bool literal. It is useful for initializing bool pointer fields in model construction

func CalculateRemainingPPMEntitlement

func CalculateRemainingPPMEntitlement(move Move, totalEntitlement unit.Pound) (unit.Pound, error)

CalculateRemainingPPMEntitlement calculates the remaining PPM entitlement for PPM moves a PPMs remaining entitlement weight is equal to total entitlement - hhg weight

func CentPointer

func CentPointer(c unit.Cents) *unit.Cents

CentPointer allows you to get the pointer to a unit.Cent literal. It is useful for initializing unit.Cent pointer fields in model construction

func CreateElectronicOrder

func CreateElectronicOrder(dbConnection *pop.Connection, order *ElectronicOrder) (*validate.Errors, error)

CreateElectronicOrder inserts an empty set of electronic Orders into the database

func CreateElectronicOrderWithRevision

func CreateElectronicOrderWithRevision(dbConnection *pop.Connection, order *ElectronicOrder, firstRevision *ElectronicOrdersRevision) (*validate.Errors, error)

CreateElectronicOrderWithRevision inserts a new set of electronic Orders into the database with its first Revision

func DeletePrimeUpload

func DeletePrimeUpload(dbConn *pop.Connection, primeUpload *PrimeUpload) error

DeletePrimeUpload deletes an upload from the database

func DeleteUpload

func DeleteUpload(dbConn *pop.Connection, upload *Upload) error

DeleteUpload deletes an upload from the database

func DeleteUserUpload

func DeleteUserUpload(dbConn *pop.Connection, userUpload *UserUpload) error

DeleteUserUpload deletes an upload from the database

func FetchBaseLinehaulRate

func FetchBaseLinehaulRate(tx *pop.Connection, mileage int, weight unit.Pound, date time.Time) (linehaulRate unit.Cents, err error)

FetchBaseLinehaulRate takes a move's distance and weight and queries the tariff400ng_linehaul_rates table to find a move's base linehaul rate.

func FetchDiscountRates

func FetchDiscountRates(db *pop.Connection, originZip string, destinationZip string, cos string, date time.Time) (linehaulDiscount unit.DiscountRate, sitDiscount unit.DiscountRate, err error)

FetchDiscountRates returns the discount linehaul and SIT rates for the TSP with the highest BVS during the specified date, limited to those TSPs in the channel defined by the originZip and destinationZip. In case of more than one TSP having the same highest BVS score, we return the one whose TSPP ID comes first alphabetically.

func FetchRateAreaForZip5

func FetchRateAreaForZip5(db *pop.Connection, zip string) (string, error)

FetchRateAreaForZip5 returns the rate area for a specified zip5.

func FetchRegionForZip5

func FetchRegionForZip5(db *pop.Connection, zip string) (string, error)

FetchRegionForZip5 returns the region for a specified zip5.

func FetchShorthaulRateCents

func FetchShorthaulRateCents(tx *pop.Connection, cwtMiles int, date time.Time) (rateCents unit.Cents, err error)

FetchShorthaulRateCents returns the shorthaul rate for a given Centumweight-Miles (cwtMiles is a unit capturing the movement of 100lbs by 1 mile.) The value returned is in cents of 1 USD.

func FetchTariff400ngFullPackRateCents

func FetchTariff400ngFullPackRateCents(tx *pop.Connection, weight unit.Pound, schedule int, date time.Time) (unit.Cents, error)

FetchTariff400ngFullPackRateCents returns the full unpack rate for a service schedule and weight.

func FetchTariff400ngFullUnpackRateMillicents

func FetchTariff400ngFullUnpackRateMillicents(tx *pop.Connection, serviceSchedule int, date time.Time) (int, error)

FetchTariff400ngFullUnpackRateMillicents returns the full unpack rate for a service schedule.

func Float64Pointer

func Float64Pointer(i float64) *float64

Float64Pointer allows you to take the address of a float64 literal. It is useful for initializing float64 pointer fields in model construction

func FormatCurrentPPMStatus

func FormatCurrentPPMStatus(ppm PersonallyProcuredMove) string

FormatCurrentPPMStatus formats FormatCurrentPPMStatus for the Shipment Summary Worksheet

func FormatDate

func FormatDate(date time.Time) string

FormatDate formats Dates for Shipment Summary Worksheet

func FormatDollars

func FormatDollars(dollars float64) string

FormatDollars formats an int using 000s separator

func FormatEnum

func FormatEnum(s string, outSep string) string

FormatEnum titlecases string const types (e.g. THIS_CONSTANT -> This Constant) outSep specifies the character to use for rejoining the string

func FormatLocation

func FormatLocation(dutyLocation DutyLocation) string

FormatLocation formats AuthorizedOrigin and AuthorizedDestination for Shipment Summary Worksheet

func FormatOrdersType

func FormatOrdersType(order Order) string

FormatOrdersType formats OrdersType for Shipment Summary Worksheet

func FormatOrdersTypeAndOrdersNumber

func FormatOrdersTypeAndOrdersNumber(order Order) string

FormatOrdersTypeAndOrdersNumber formats OrdersTypeAndOrdersNumber for Shipment Summary Worksheet

func FormatPPMNumberAndType

func FormatPPMNumberAndType(i int) string

FormatPPMNumberAndType formats FormatShipmentNumberAndType for the Shipment Summary Worksheet

func FormatPPMPickupDate

func FormatPPMPickupDate(ppm PersonallyProcuredMove) string

FormatPPMPickupDate formats a shipments ActualPickupDate for the Shipment Summary Worksheet

func FormatPPMWeight

func FormatPPMWeight(ppm PersonallyProcuredMove) string

FormatPPMWeight formats a ppms NetWeight for the Shipment Summary Worksheet

func FormatRank

func FormatRank(rank *ServiceMemberRank) string

FormatRank formats the service member's rank for Shipment Summary Worksheet

func FormatServiceMemberAffiliation

func FormatServiceMemberAffiliation(affiliation *ServiceMemberAffiliation) string

FormatServiceMemberAffiliation formats ServiceMemberAffiliation in human friendly format

func FormatServiceMemberFullName

func FormatServiceMemberFullName(serviceMember ServiceMember) string

FormatServiceMemberFullName formats ServiceMember full name for Shipment Summary Worksheet

func FormatSignature

func FormatSignature(sm ServiceMember) string

FormatSignature formats a service member's signature for the Shipment Summary Worksheet

func FormatSignatureDate

func FormatSignatureDate(signature SignedCertification) string

FormatSignatureDate formats the date the service member electronically signed for the Shipment Summary Worksheet

func FormatValuesShipmentSummaryWorksheet

FormatValuesShipmentSummaryWorksheet returns the formatted pages for the Shipment Summary Worksheet

func FormatWeights

func FormatWeights(wtg unit.Pound) string

FormatWeights formats a unit.Pound using 000s separator

func GatherNextEligibleTSPPerformances

func GatherNextEligibleTSPPerformances(tx *pop.Connection, tdlID uuid.UUID, bookDate time.Time, requestedPickupDate time.Time) (map[int]TransportationServiceProviderPerformance, error)

GatherNextEligibleTSPPerformances returns a map of QualityBands to their next eligible TSPPerformance.

func GenerateLocator

func GenerateLocator() string

GenerateLocator constructs a record locator - a unique 6 character alphanumeric string

func GenerateReferenceID

func GenerateReferenceID(db *pop.Connection) (string, error)

GenerateReferenceID generates a reference ID for the MTO

func GetAddressID

func GetAddressID(address *Address) *uuid.UUID

GetAddressID facilitates grabbing the ID from an address that may be nil

func GetEntitlement

func GetEntitlement(rank ServiceMemberRank, hasDependents bool) (int, error)

GetEntitlement calculates the entitlement weight based on rank and dependents. Only includes either TotalWeightSelf or TotalWeightSelfPlusDependents.

func GetRateCycle

func GetRateCycle(year int, peak bool) (start time.Time, end time.Time)

GetRateCycle returns the start date and end dates for a rate cycle of the given year and season (peak/non-peak), inclusive.

func Int32Pointer

func Int32Pointer(i int32) *int32

Int32Pointer allows you to take the address of a int32 literal. It is useful for initializing int32 pointer fields in model construction

func Int64Pointer

func Int64Pointer(i int64) *int64

Int64Pointer allows you to take the address of a int64 literal. It is useful for initializing int64 pointer fields in model construction

func IntPointer

func IntPointer(i int) *int

IntPointer allows you to take the address of a int literal. It is useful for initializing int pointer fields in model construction

func PPMDiscountFetch

func PPMDiscountFetch(db *pop.Connection, logger *zap.Logger, move Move, originZip string, destZip string, moveDate time.Time) (unit.DiscountRate, unit.DiscountRate, error)

PPMDiscountFetch attempts to fetch the discount rates first for COS D, then 2 Most PPMs use COS D, but when there is no COS D rate, the calculation is based on Code 2

func PackDays

func PackDays(weight unit.Pound) int

PackDays returns the number of days it will take to pack the given weight.

func PoundPointer

func PoundPointer(p unit.Pound) *unit.Pound

PoundPointer allows you to get the pointer to a unit.Pound literal. It is useful for initializing unit.Pound pointer fields in model construction

func SaveMoveDependencies

func SaveMoveDependencies(db *pop.Connection, move *Move) (*validate.Errors, error)

SaveMoveDependencies safely saves a Move status, ppms' advances' statuses, orders statuses, and shipment GBLOCs.

func SaveOrder

func SaveOrder(db *pop.Connection, order *Order) (*validate.Errors, error)

SaveOrder saves an order

func SavePersonallyProcuredMove

func SavePersonallyProcuredMove(db *pop.Connection, ppm *PersonallyProcuredMove) (*validate.Errors, error)

SavePersonallyProcuredMove Safely saves a PPM and it's associated Advance.

func SaveServiceMember

func SaveServiceMember(appCtx appcontext.AppContext, serviceMember *ServiceMember) (*validate.Errors, error)

SaveServiceMember takes a serviceMember with Address structs and coordinates saving it all in a transaction

func StringPointer

func StringPointer(s string) *string

StringPointer allows you to take the address of a string literal. It is useful for initializing string pointer fields in model construction

func SubTotalExpenses

func SubTotalExpenses(expenseDocuments MovingExpenses) map[string]float64

SubTotalExpenses groups moving expenses by type and payment method

func TimePointer

func TimePointer(t time.Time) *time.Time

TimePointer allows you to take the address of a time.Time literal. It is useful for initializing time.Time pointer fields in model construction

func TransitDays

func TransitDays(weight unit.Pound, miles int) (int, error)

TransitDays returns the number of days it will take to move the specified weight of goods the specified distance.

func UUIDPointer

func UUIDPointer(u uuid.UUID) *uuid.UUID

UUIDPointer allows you to get the pointer to a uuid.UUID literal. It is useful for initializing uuid.UUID pointer fields in model construction

func UpdateUserLoginGovUUID

func UpdateUserLoginGovUUID(db *pop.Connection, user *User, loginGovID string) error

UpdateUserLoginGovUUID is called upon the first successful login.gov verification of a new user

Types

type Address

type Address struct {
	ID             uuid.UUID `json:"id" db:"id"`
	CreatedAt      time.Time `json:"created_at" db:"created_at"`
	UpdatedAt      time.Time `json:"updated_at" db:"updated_at"`
	StreetAddress1 string    `json:"street_address_1" db:"street_address_1"`
	StreetAddress2 *string   `json:"street_address_2" db:"street_address_2"`
	StreetAddress3 *string   `json:"street_address_3" db:"street_address_3"`
	City           string    `json:"city" db:"city"`
	State          string    `json:"state" db:"state"`
	PostalCode     string    `json:"postal_code" db:"postal_code"`
	Country        *string   `json:"country" db:"country"`
}

Address is an address

func FetchAddressByID

func FetchAddressByID(dbConnection *pop.Connection, id *uuid.UUID) *Address

FetchAddressByID returns an address model by ID

func (*Address) Copy

func (a *Address) Copy() *Address

Copy returns a pointer that is a copy of the original pointer Address

func (*Address) CountryCode

func (a *Address) CountryCode() (*string, error)

CountryCode returns 2-3 character code for country, returns nil if no Country TODO: since we only support CONUS at this time this just returns USA and otherwise throws a NotImplementedCountryCode

func (*Address) Format

func (a *Address) Format() string

Format returns the address in default US mailing address format

func (*Address) LineFormat

func (a *Address) LineFormat() string

LineFormat returns the address as a string, formatted into a single line

func (*Address) MarshalLogObject

func (a *Address) MarshalLogObject(encoder zapcore.ObjectEncoder) error

MarshalLogObject is required to be able to zap.Object log TDLs

func (*Address) Validate

func (a *Address) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Address) ValidateCreate

func (a *Address) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Address) ValidateUpdate

func (a *Address) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Addresses

type Addresses []Address

Addresses is not required by pop and may be deleted

type AdminRole

type AdminRole string

AdminRole represents administrative roles

const (
	// SystemAdminRole represents a role for managing the system
	SystemAdminRole AdminRole = "SYSTEM_ADMIN"
	// ProgramAdminRole represents a role for managing the program (Note: This is deprecated and should be removed)
	ProgramAdminRole AdminRole = "PROGRAM_ADMIN"
)

func (*AdminRole) String

func (ar *AdminRole) String() string

String returns a string representation of the admin role

func (*AdminRole) ValidRoles

func (ar *AdminRole) ValidRoles() []AdminRole

ValidRoles returns a slice of valid roles for an admin

type AdminUser

type AdminUser struct {
	ID             uuid.UUID    `json:"id" db:"id"`
	CreatedAt      time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt      time.Time    `json:"updated_at" db:"updated_at"`
	UserID         *uuid.UUID   `json:"user_id" db:"user_id"`
	User           User         `belongs_to:"user" fk_id:"user_id"`
	Role           AdminRole    `json:"role" db:"role"`
	Email          string       `json:"email" db:"email"`
	FirstName      string       `json:"first_name" db:"first_name"`
	LastName       string       `json:"last_name" db:"last_name"`
	OrganizationID *uuid.UUID   `json:"organization_id" db:"organization_id"`
	Organization   Organization `belongs_to:"organization" fk_id:"organization_id"`
	Active         bool         `json:"active" db:"active"`
}

AdminUser is someone who operates the Milmove systems

func (AdminUser) String

func (a AdminUser) String() string

String is not required by pop and may be deleted

func (*AdminUser) Validate

func (a *AdminUser) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*AdminUser) ValidateCreate

func (a *AdminUser) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*AdminUser) ValidateUpdate

func (a *AdminUser) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type AdminUsers

type AdminUsers []AdminUser

AdminUsers is not required by pop and may be deleted

func (AdminUsers) String

func (a AdminUsers) String() string

String is not required by pop and may be deleted

type AffiliationIsPresent

type AffiliationIsPresent struct {
	Name  string
	Field internalmessages.Affiliation
}

AffiliationIsPresent validates that a branch is present

func (*AffiliationIsPresent) IsValid

func (v *AffiliationIsPresent) IsValid(errors *validate.Errors)

IsValid adds an error if the string value is blank.

type AtLeastOneNotNil

type AtLeastOneNotNil struct {
	FieldName1  string
	FieldValue1 *string
	FieldName2  string
	FieldValue2 *string
}

AtLeastOneNotNil validates that at least one of two fields are not nil

func (*AtLeastOneNotNil) IsValid

func (v *AtLeastOneNotNil) IsValid(errors *validate.Errors)

IsValid adds an error if fieldValue1 and fieldValue2 are nil

type AuditHistories

type AuditHistories []AuditHistory

AuditHistories is not required by pop and may be deleted

type AuditHistory

type AuditHistory struct {
	ID uuid.UUID `json:"id" db:"id"`
	// Database schema audited table for this event is in
	SchemaName string `json:"schema_name" db:"schema_name"`
	// name of database table that was changed
	TableName string `json:"table_name" db:"table_name"`
	// relation OID. Table OID (object identifier). Changes with drop/create
	RelID int64 `json:"rel_id" db:"relid"`
	// id column for the tableName where the data was changed
	ObjectID             *uuid.UUID `json:"object_id" db:"object_id"`
	SessionUserID        *uuid.UUID `json:"session_user_id" db:"session_userid"`
	SessionUserFirstName *string    `json:"session_user_first_name" db:"session_user_first_name"`
	SessionUserLastName  *string    `json:"session_user_last_name" db:"session_user_last_name"`
	SessionUserEmail     *string    `json:"session_user_email" db:"session_user_email"`
	SessionUserTelephone *string    `json:"session_user_telephone" db:"session_user_telephone"`
	Context              *string    `json:"context" db:"context"`
	ContextID            *string    `json:"context_id" db:"context_id"`
	// Identifier of transaction that made the change. May wrap, but unique paired with action_tstamp_tx
	TransactionID *int64 `json:"transaction_id" db:"transaction_id"`
	// Record the text of the client query that triggered the audit event
	ClientQuery *string `json:"client_query" db:"client_query"`
	// Action type; I = insert, D = delete, U = update, T = truncate
	Action string `json:"action" db:"action"`
	// API endpoint name that was called to make the change
	EventName   *string `json:"event_name" db:"event_name"`
	OldData     *string `json:"old_data" db:"old_data"`
	ChangedData *string `json:"changed_data" db:"changed_data"`
	// true if audit event is from an FOR EACH STATEMENT trigger, false for FOR EACH ROW'
	StatementOnly bool `json:"statement_only" db:"statement_only"`
	// Transaction start timestamp for tx in which audited event occurred
	ActionTstampTx time.Time `json:"action_tstamp_tx" db:"action_tstamp_tx"`
	// Statement start timestamp for tx in which audited event occurred
	ActionTstampStm time.Time `json:"action_tstamp_stm" db:"action_tstamp_stm"`
	// Wall clock time at which audited event's trigger call occurred
	ActionTstampClk time.Time `json:"action_tstamp_clk" db:"action_tstamp_clk"`
}

AuditHistory is a record from the audit_history table

type BackupContact

type BackupContact struct {
	ID              uuid.UUID               `json:"id" db:"id"`
	CreatedAt       time.Time               `json:"created_at" db:"created_at"`
	UpdatedAt       time.Time               `json:"updated_at" db:"updated_at"`
	ServiceMemberID uuid.UUID               `json:"service_member_id" db:"service_member_id"`
	ServiceMember   ServiceMember           `belongs_to:"service_member" fk_id:"service_member_id"`
	Permission      BackupContactPermission `json:"permission" db:"permission"`
	Name            string                  `json:"name" db:"name"`
	Email           string                  `json:"email" db:"email"`
	Phone           *string                 `json:"phone" db:"phone"`
}

BackupContact is a model representing a backup contact for a service member

func FetchBackupContact

func FetchBackupContact(db *pop.Connection, session *auth.Session, id uuid.UUID) (BackupContact, error)

FetchBackupContact returns a specific backup contact model

func (*BackupContact) Validate

func (b *BackupContact) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*BackupContact) ValidateCreate

func (b *BackupContact) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*BackupContact) ValidateUpdate

func (b *BackupContact) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type BackupContactPermission

type BackupContactPermission string

BackupContactPermission represents the permissions granted to a backup contact

const (
	// BackupContactPermissionNONE captures enum value "NONE"
	BackupContactPermissionNONE BackupContactPermission = "NONE"
	// BackupContactPermissionVIEW captures enum value "VIEW"
	BackupContactPermissionVIEW BackupContactPermission = "VIEW"
	// BackupContactPermissionEDIT captures enum value "EDIT"
	BackupContactPermissionEDIT BackupContactPermission = "EDIT"
)

type BackupContacts

type BackupContacts []BackupContact

BackupContacts is not required by pop and may be deleted

type CannotBeTrueIfFalse

type CannotBeTrueIfFalse struct {
	Name1  string
	Field1 bool
	Name2  string
	Field2 bool
}

CannotBeTrueIfFalse validates that field1 cannot be true while field2 is false

func (*CannotBeTrueIfFalse) IsValid

func (v *CannotBeTrueIfFalse) IsValid(errors *validate.Errors)

IsValid adds an error if field1 is true while field2 is false

type ClientCert

type ClientCert struct {
	ID                          uuid.UUID `json:"id" db:"id"`
	Sha256Digest                string    `db:"sha256_digest"`
	Subject                     string    `db:"subject"`
	AllowOrdersAPI              bool      `db:"allow_orders_api"`
	CreatedAt                   time.Time `db:"created_at"`
	UpdatedAt                   time.Time `db:"updated_at"`
	AllowAirForceOrdersRead     bool      `db:"allow_air_force_orders_read"`
	AllowAirForceOrdersWrite    bool      `db:"allow_air_force_orders_write"`
	AllowArmyOrdersRead         bool      `db:"allow_army_orders_read"`
	AllowArmyOrdersWrite        bool      `db:"allow_army_orders_write"`
	AllowCoastGuardOrdersRead   bool      `db:"allow_coast_guard_orders_read"`
	AllowCoastGuardOrdersWrite  bool      `db:"allow_coast_guard_orders_write"`
	AllowMarineCorpsOrdersRead  bool      `db:"allow_marine_corps_orders_read"`
	AllowMarineCorpsOrdersWrite bool      `db:"allow_marine_corps_orders_write"`
	AllowNavyOrdersRead         bool      `db:"allow_navy_orders_read"`
	AllowNavyOrdersWrite        bool      `db:"allow_navy_orders_write"`
	AllowPrime                  bool      `db:"allow_prime"`
	UserID                      uuid.UUID `db:"user_id"`
}

ClientCert represents a known x509 Certificate in the database.

func FetchClientCert

func FetchClientCert(db *pop.Connection, sha256Digest string) (*ClientCert, error)

FetchClientCert fetches and validates a client certificate by digest

func (*ClientCert) GetAllowedOrdersIssuersRead

func (c *ClientCert) GetAllowedOrdersIssuersRead() []string

GetAllowedOrdersIssuersRead returns a slice with the issuers of Orders that this ClientCert is allowed to read

func (*ClientCert) Validate

func (c *ClientCert) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*ClientCert) ValidateCreate

func (c *ClientCert) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*ClientCert) ValidateUpdate

func (c *ClientCert) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Contractor

type Contractor struct {
	ID             uuid.UUID `json:"id" db:"id"`
	Name           string    `json:"code" db:"name"`
	Type           string    `json:"type" db:"type"`
	ContractNumber string    `json:"contract_number" db:"contract_number"`
	CreatedAt      time.Time `json:"created_at" db:"created_at"`
}

Contractor is an object representing an access code for a service member

func FetchGHCPrimeTestContractor

func FetchGHCPrimeTestContractor(db *pop.Connection) (*Contractor, error)

FetchGHCPrimeTestContractor returns a test contractor for dev

func (*Contractor) Validate

func (c *Contractor) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Contractor) ValidateCreate

func (c *Contractor) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Contractor) ValidateUpdate

func (c *Contractor) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Contractors

type Contractors []Contractor

Contractors is a slice of Contractor objects

type CustomerContactType

type CustomerContactType string

CustomerContactType determines what type of customer contact for a service item. For domestic destination 1st day SIT.

const (
	// CustomerContactTypeFirst describes customer contacts for a FIRST type.
	CustomerContactTypeFirst CustomerContactType = "FIRST"
	// CustomerContactTypeSecond  describes customer contacts for a SECOND type.
	CustomerContactTypeSecond CustomerContactType = "SECOND"
)

type CustomerSupportRemark

type CustomerSupportRemark struct {
	ID           uuid.UUID  `db:"id"`
	Content      string     `db:"content"`
	OfficeUser   OfficeUser `belongs_to:"office_users" fk_id:"office_user_id"`
	OfficeUserID uuid.UUID  `db:"office_user_id"`
	Move         Move       `belongs_to:"moves" fk_id:"move_id"`
	MoveID       uuid.UUID  `db:"move_id"`
	CreatedAt    time.Time  `db:"created_at"`
	UpdatedAt    time.Time  `db:"updated_at"`
	DeletedAt    *time.Time `db:"deleted_at"`
}

CustomerSupportRemark struct represents the shape of an office move remark

func (CustomerSupportRemark) TableName

func (o CustomerSupportRemark) TableName() string

TableName overrides the table name used by Pop.

type CustomerSupportRemarks

type CustomerSupportRemarks []CustomerSupportRemark

type DateIsWorkday

type DateIsWorkday struct {
	Name     string
	Field    time.Time
	Calendar *cal.BusinessCalendar
}

DateIsWorkday validates that field is on a workday

func (*DateIsWorkday) IsValid

func (v *DateIsWorkday) IsValid(errors *validate.Errors)

IsValid adds error if field is not on valid workday

type DestinationType

type DestinationType string
const (
	DestinationTypeHomeOfRecord           DestinationType = "HOME_OF_RECORD"
	DestinationTypeHomeOfSelection        DestinationType = "HOME_OF_SELECTION"
	DestinationTypePlaceEnteredActiveDuty DestinationType = "PLACE_ENTERED_ACTIVE_DUTY"
	DestinationTypeOtherThanAuthorized    DestinationType = "OTHER_THAN_AUTHORIZED"
)

type DimensionType

type DimensionType string

DimensionType determines what type of dimension for a service item

const (
	// DimensionTypeItem describes dimensions for an ITEM type
	DimensionTypeItem DimensionType = "ITEM"
	// DimensionTypeCrate  describes dimensions for a CRATE type
	DimensionTypeCrate DimensionType = "CRATE"
)

type DiscountRateIsValid

type DiscountRateIsValid struct {
	Name  string
	Field unit.DiscountRate
}

DiscountRateIsValid validates that a DiscountRate contains a value between 0 and 1.

func (*DiscountRateIsValid) IsValid

func (v *DiscountRateIsValid) IsValid(errors *validate.Errors)

IsValid adds an error if the value is not between 0 and 1.

type DistanceCalculation

type DistanceCalculation struct {
	ID                   uuid.UUID `json:"id" db:"id"`
	OriginAddressID      uuid.UUID `json:"origin_address_id" db:"origin_address_id"`
	OriginAddress        Address   `belongs_to:"address" fk_id:"origin_address_id"`
	DestinationAddressID uuid.UUID `json:"destination_address_id" db:"destination_address_id"`
	DestinationAddress   Address   `belongs_to:"address" fk_id:"destination_address_id"`
	DistanceMiles        int       `json:"distance_miles" db:"distance_miles"`
	CreatedAt            time.Time `json:"created_at" db:"created_at"`
	UpdatedAt            time.Time `json:"updated_at" db:"updated_at"`
}

DistanceCalculation represents a distance calculation in miles between an origin and destination address

func NewDistanceCalculation

func NewDistanceCalculation(appCtx appcontext.AppContext, planner distanceCalculator, origin Address, destination Address, useZipOnly bool) (DistanceCalculation, error)

NewDistanceCalculation performs a distance calculation and returns the resulting DistanceCalculation model

func (*DistanceCalculation) Validate

func (d *DistanceCalculation) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type Document

type Document struct {
	ID              uuid.UUID     `db:"id"`
	ServiceMemberID uuid.UUID     `db:"service_member_id"`
	ServiceMember   ServiceMember `belongs_to:"service_members" fk_id:"service_member_id"`
	CreatedAt       time.Time     `db:"created_at"`
	UpdatedAt       time.Time     `db:"updated_at"`
	DeletedAt       *time.Time    `db:"deleted_at"`
	UserUploads     UserUploads   `has_many:"user_uploads" fk_id:"document_id" order_by:"created_at asc"`
}

A Document represents a physical artifact such as a multipage form that was filled out by hand. A Document can have many associated Uploads, which allows for handling multiple files that belong to the same document.

func FetchDocument

func FetchDocument(db *pop.Connection, session *auth.Session, id uuid.UUID, includeDeletedDocs bool) (Document, error)

FetchDocument returns a document if the user has access to that document

func (*Document) Validate

func (d *Document) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type Documents

type Documents []Document

Documents is not required by pop and may be deleted

type Dollar

type Dollar float64

Dollar represents a type for dollar monetary unit

func (Dollar) String

func (d Dollar) String() string

String is a string representation of a Dollar

type DutyLocation

type DutyLocation struct {
	ID                         uuid.UUID                     `json:"id" db:"id"`
	CreatedAt                  time.Time                     `json:"created_at" db:"created_at"`
	UpdatedAt                  time.Time                     `json:"updated_at" db:"updated_at"`
	Name                       string                        `json:"name" db:"name"`
	Affiliation                *internalmessages.Affiliation `json:"affiliation" db:"affiliation"`
	AddressID                  uuid.UUID                     `json:"address_id" db:"address_id"`
	Address                    Address                       `belongs_to:"address" fk_id:"address_id"`
	TransportationOfficeID     *uuid.UUID                    `json:"transportation_office_id" db:"transportation_office_id"`
	TransportationOffice       TransportationOffice          `belongs_to:"transportation_offices" fk_id:"transportation_office_id"`
	ProvidesServicesCounseling bool                          `json:"provides_services_counseling" db:"provides_services_counseling"`
}

DutyLocation represents a military duty location for a specific affiliation

func FetchDutyLocation

func FetchDutyLocation(tx *pop.Connection, id uuid.UUID) (DutyLocation, error)

FetchDutyLocation returns a DutyLocation for a given id

func FetchDutyLocationByName

func FetchDutyLocationByName(tx *pop.Connection, name string) (DutyLocation, error)

FetchDutyLocationByName returns a DutyLocation for a given unique name

func (*DutyLocation) Validate

func (d *DutyLocation) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*DutyLocation) ValidateCreate

func (d *DutyLocation) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*DutyLocation) ValidateUpdate

func (d *DutyLocation) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type DutyLocationName

type DutyLocationName struct {
	ID             uuid.UUID    `json:"id" db:"id"`
	CreatedAt      time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt      time.Time    `json:"updated_at" db:"updated_at"`
	Name           string       `json:"name" db:"name"`
	DutyLocationID uuid.UUID    `json:"duty_location_id" db:"duty_location_id"`
	DutyLocation   DutyLocation `belongs_to:"duty_locations" fk_id:"duty_location_id"`
}

DutyLocationName represents an alternative name for a DutyLocation

type DutyLocationNames

type DutyLocationNames []DutyLocationName

DutyLocationNames is not required by pop and may be deleted

type DutyLocationTransportInfo

type DutyLocationTransportInfo struct {
	Name      string `db:"name"`
	PhoneLine string `db:"number"`
}

DutyLocationTransportInfo contains all info needed for notifications emails

func FetchDLContactInfo

func FetchDLContactInfo(db *pop.Connection, dutyLocationID *uuid.UUID) (*DutyLocationTransportInfo, error)

FetchDLContactInfo loads a duty location's associated transportation office and its first listed office phone number.

type DutyLocations

type DutyLocations []DutyLocation

DutyLocations is not required by pop and may be deleted

func FetchDutyLocationsByPostalCode

func FetchDutyLocationsByPostalCode(tx *pop.Connection, postalCode string) (DutyLocations, error)

FetchDutyLocationsByPostalCode returns a duty location for a given postal code

func FindDutyLocations

func FindDutyLocations(tx *pop.Connection, search string) (DutyLocations, error)

FindDutyLocations returns all duty locations matching a search query

type EDIProcessing

type EDIProcessing struct {
	ID               uuid.UUID `db:"id"`
	EDIType          EDIType   `db:"edi_type"`
	NumEDIsProcessed int       `db:"num_edis_processed"`
	ProcessStartedAt time.Time `db:"process_started_at"`
	ProcessEndedAt   time.Time `db:"process_ended_at"`
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
}

EDIProcessing represents an email sent to a service member

func (*EDIProcessing) MarshalLogObject

func (e *EDIProcessing) MarshalLogObject(encoder zapcore.ObjectEncoder) error

MarshalLogObject is required to be able to zap.Object log this model.

func (*EDIProcessing) TableName

func (e *EDIProcessing) TableName() string

TableName overrides the table name used by Pop.

func (*EDIProcessing) Validate

func (e *EDIProcessing) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type EDIProcessings

type EDIProcessings []EDIProcessing

EDIProcessings is a slice of notification structs

type EDIType

type EDIType string

EDIType represents types of EDI Responses

const (
	// EDIType810 captures enum value "810"
	EDIType810 EDIType = "810"
	// EDIType824 captures enum value "824"
	EDIType824 EDIType = "824"
	// EDIType858 captures enum value "858"
	EDIType858 EDIType = "858"
	// EDIType997 captures enum value "997"
	EDIType997 EDIType = "997"
)

func (EDIType) String

func (e EDIType) String() string

String returns a string representation of the admin role

type EagerAssociations

type EagerAssociations []string

EagerAssociations are a collection of named associations

type EdiError

type EdiError struct {
	ID                         uuid.UUID                                `json:"id" db:"id"`
	CreatedAt                  time.Time                                `json:"created_at" db:"created_at"`
	UpdatedAt                  time.Time                                `json:"updated_at" db:"updated_at"`
	PaymentRequestID           uuid.UUID                                `json:"payment_request_id" db:"payment_request_id"`
	PaymentRequest             PaymentRequest                           `belongs_to:"payment_requests" fk_id:"payment_request_id"`
	InterchangeControlNumberID *uuid.UUID                               `json:"interchange_control_number_id" db:"interchange_control_number_id"`
	InterchangeControlNumber   PaymentRequestToInterchangeControlNumber `belongs_to:"payment_request_to_interchange_control_numbers" fk_id:"interchange_control_number_id"`
	Code                       *string                                  `json:"code" db:"code"`
	Description                *string                                  `json:"description" db:"description"`
	EDIType                    EDIType                                  `json:"edi_type" db:"edi_type"`
}

EdiError stores errors found while sending an 858 and being reported from EDI response files (824, 997)

func (*EdiError) Validate

func (e *EdiError) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type EdiErrors

type EdiErrors []EdiError

EdiErrors is a list of EDI Error

type ElectronicOrder

type ElectronicOrder struct {
	ID           uuid.UUID                 `json:"id" db:"id"`
	CreatedAt    time.Time                 `json:"created_at" db:"created_at"`
	UpdatedAt    time.Time                 `json:"updated_at" db:"updated_at"`
	OrdersNumber string                    `json:"orders_number" db:"orders_number"`
	Edipi        string                    `json:"edipi" db:"edipi"`
	Issuer       Issuer                    `json:"issuer" db:"issuer"`
	Revisions    ElectronicOrdersRevisions `has_many:"electronic_orders_revisions" fk_id:"electronic_order_id" order_by:"seq_num asc"`
}

ElectronicOrder contains the unchanging data of a set of orders across all amendments / revisions

func FetchElectronicOrderByID

func FetchElectronicOrderByID(db *pop.Connection, id uuid.UUID) (*ElectronicOrder, error)

FetchElectronicOrderByID gets all revisions of a set of Orders by their shared UUID, sorted in ascending order by their sequence number

func FetchElectronicOrderByIssuerAndOrdersNum

func FetchElectronicOrderByIssuerAndOrdersNum(db *pop.Connection, issuer string, ordersNum string) (*ElectronicOrder, error)

FetchElectronicOrderByIssuerAndOrdersNum gets all revisions of a set of Orders by the unique combination of the Orders number and the issuer.

func FetchElectronicOrdersByEdipiAndIssuers

func FetchElectronicOrdersByEdipiAndIssuers(db *pop.Connection, edipi string, issuers []string) ([]*ElectronicOrder, error)

FetchElectronicOrdersByEdipiAndIssuers gets all Orders issued to a member by EDIPI from the specified issuers

func (ElectronicOrder) String

func (e ElectronicOrder) String() string

String is not required by pop and may be deleted

func (*ElectronicOrder) Validate

func (e *ElectronicOrder) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*ElectronicOrder) ValidateCreate

func (e *ElectronicOrder) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*ElectronicOrder) ValidateUpdate

func (e *ElectronicOrder) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type ElectronicOrders

type ElectronicOrders []ElectronicOrder

ElectronicOrders is not required by pop and may be deleted

func (ElectronicOrders) String

func (e ElectronicOrders) String() string

String is not required by pop and may be deleted

type ElectronicOrdersAffiliation

type ElectronicOrdersAffiliation string

ElectronicOrdersAffiliation is a service member's military branch of service, or identifies a civilian

const (
	// ElectronicOrdersAffiliationAirForce captures enum value "air-force"
	ElectronicOrdersAffiliationAirForce ElectronicOrdersAffiliation = "air-force"
	// ElectronicOrdersAffiliationArmy captures enum value "army"
	ElectronicOrdersAffiliationArmy ElectronicOrdersAffiliation = "army"
	// ElectronicOrdersAffiliationCivilianAgency captures enum value "civilian-agency"
	ElectronicOrdersAffiliationCivilianAgency ElectronicOrdersAffiliation = "civilian-agency"
	// ElectronicOrdersAffiliationCoastGuard captures enum value "coast-guard"
	ElectronicOrdersAffiliationCoastGuard ElectronicOrdersAffiliation = "coast-guard"
	// ElectronicOrdersAffiliationMarineCorps captures enum value "marine-corps"
	ElectronicOrdersAffiliationMarineCorps ElectronicOrdersAffiliation = "marine-corps"
	// ElectronicOrdersAffiliationNavy captures enum value "navy"
	ElectronicOrdersAffiliationNavy ElectronicOrdersAffiliation = "navy"
)

type ElectronicOrdersRevision

type ElectronicOrdersRevision struct {
	ID                    uuid.UUID                   `json:"id" db:"id"`
	CreatedAt             time.Time                   `json:"created_at" db:"created_at"`
	UpdatedAt             time.Time                   `json:"updated_at" db:"updated_at"`
	ElectronicOrderID     uuid.UUID                   `json:"electronic_order_id" db:"electronic_order_id"`
	ElectronicOrder       ElectronicOrder             `belongs_to:"electronic_order" fk_id:"electronic_order_id"`
	SeqNum                int                         `json:"seq_num" db:"seq_num"`
	GivenName             string                      `json:"given_name" db:"given_name"`
	MiddleName            *string                     `json:"middle_name" db:"middle_name"`
	FamilyName            string                      `json:"family_name" db:"family_name"`
	NameSuffix            *string                     `json:"name_suffix" db:"name_suffix"`
	Affiliation           ElectronicOrdersAffiliation `json:"affiliation" db:"affiliation"`
	Paygrade              Paygrade                    `json:"paygrade" db:"paygrade"`
	Title                 *string                     `json:"title" db:"title"`
	Status                ElectronicOrdersStatus      `json:"status" db:"status"`
	DateIssued            time.Time                   `json:"date_issued" db:"date_issued"`
	NoCostMove            bool                        `json:"no_cost_move" db:"no_cost_move"`
	TdyEnRoute            bool                        `json:"tdy_en_route" db:"tdy_en_route"`
	TourType              TourType                    `json:"tour_type" db:"tour_type"`
	OrdersType            ElectronicOrdersType        `json:"orders_type" db:"orders_type"`
	HasDependents         bool                        `json:"has_dependents" db:"has_dependents"`
	LosingUIC             *string                     `json:"losing_uic" db:"losing_uic"`
	LosingUnitName        *string                     `json:"losing_unit_name" db:"losing_unit_name"`
	LosingUnitCity        *string                     `json:"losing_unit_city" db:"losing_unit_city"`
	LosingUnitLocality    *string                     `json:"losing_unit_locality" db:"losing_unit_locality"`
	LosingUnitCountry     *string                     `json:"losing_unit_country" db:"losing_unit_country"`
	LosingUnitPostalCode  *string                     `json:"losing_unit_postal_code" db:"losing_unit_postal_code"`
	GainingUIC            *string                     `json:"gaining_uic" db:"gaining_uic"`
	GainingUnitName       *string                     `json:"gaining_unit_name" db:"gaining_unit_name"`
	GainingUnitCity       *string                     `json:"gaining_unit_city" db:"gaining_unit_city"`
	GainingUnitLocality   *string                     `json:"gaining_unit_locality" db:"gaining_unit_locality"`
	GainingUnitCountry    *string                     `json:"gaining_unit_country" db:"gaining_unit_country"`
	GainingUnitPostalCode *string                     `json:"gaining_unit_postal_code" db:"gaining_unit_postal_code"`
	ReportNoEarlierThan   *time.Time                  `json:"report_no_earlier_than" db:"report_no_earlier_than"`
	ReportNoLaterThan     *time.Time                  `json:"report_no_later_than" db:"report_no_later_than"`
	HhgTAC                *string                     `json:"hhg_tac" db:"hhg_tac"`
	HhgSDN                *string                     `json:"hhg_sdn" db:"hhg_sdn"`
	HhgLOA                *string                     `json:"hhg_loa" db:"hhg_loa"`
	NtsTAC                *string                     `json:"nts_tac" db:"nts_tac"`
	NtsSDN                *string                     `json:"nts_sdn" db:"nts_sdn"`
	NtsLOA                *string                     `json:"nts_loa" db:"nts_loa"`
	PovShipmentTAC        *string                     `json:"pov_shipment_tac" db:"pov_shipment_tac"`
	PovShipmentSDN        *string                     `json:"pov_shipment_sdn" db:"pov_shipment_sdn"`
	PovShipmentLOA        *string                     `json:"pov_shipment_loa" db:"pov_shipment_loa"`
	PovStorageTAC         *string                     `json:"pov_storage_tac" db:"pov_storage_tac"`
	PovStorageSDN         *string                     `json:"pov_storage_sdn" db:"pov_storage_sdn"`
	PovStorageLOA         *string                     `json:"pov_storage_loa" db:"pov_storage_loa"`
	UbTAC                 *string                     `json:"ub_tac" db:"ub_tac"`
	UbSDN                 *string                     `json:"ub_sdn" db:"ub_sdn"`
	UbLOA                 *string                     `json:"ub_loa" db:"ub_loa"`
	Comments              *string                     `json:"comments" db:"comments"`
}

ElectronicOrdersRevision represents a complete amendment of one set of electronic orders

func (ElectronicOrdersRevision) String

func (e ElectronicOrdersRevision) String() string

String is not required by pop and may be deleted

func (*ElectronicOrdersRevision) Validate

func (e *ElectronicOrdersRevision) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*ElectronicOrdersRevision) ValidateCreate

func (e *ElectronicOrdersRevision) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*ElectronicOrdersRevision) ValidateUpdate

func (e *ElectronicOrdersRevision) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type ElectronicOrdersRevisions

type ElectronicOrdersRevisions []ElectronicOrdersRevision

ElectronicOrdersRevisions is not required by pop and may be deleted

func (ElectronicOrdersRevisions) String

func (e ElectronicOrdersRevisions) String() string

String is not required by pop and may be deleted

type ElectronicOrdersStatus

type ElectronicOrdersStatus string

ElectronicOrdersStatus indicates whether these Orders are authorized, RFO (Request For Orders), or canceled. An RFO is not sufficient to authorize moving expenses; only authorized Orders can do that.

const (
	// ElectronicOrdersStatusAuthorized captures enum value "authorized"
	ElectronicOrdersStatusAuthorized ElectronicOrdersStatus = "authorized"
	// ElectronicOrdersStatusRfo captures enum value "rfo"
	ElectronicOrdersStatusRfo ElectronicOrdersStatus = "rfo"
	// ElectronicOrdersStatusCanceled captures enum value "canceled"
	ElectronicOrdersStatusCanceled ElectronicOrdersStatus = "canceled"
)

type ElectronicOrdersType

type ElectronicOrdersType string

ElectronicOrdersType is the type of travel or move for a set of Orders

const (
	// ElectronicOrdersTypeAccession captures enum value "accession"
	ElectronicOrdersTypeAccession ElectronicOrdersType = "accession"
	// ElectronicOrdersTypeBetweenDutyStations captures enum value "between-duty-stations"
	ElectronicOrdersTypeBetweenDutyStations ElectronicOrdersType = "between-duty-stations"
	// ElectronicOrdersTypeBrac captures enum value "brac"
	ElectronicOrdersTypeBrac ElectronicOrdersType = "brac"
	// ElectronicOrdersTypeCot captures enum value "cot"
	ElectronicOrdersTypeCot ElectronicOrdersType = "cot"
	// ElectronicOrdersTypeEmergencyEvac captures enum value "emergency-evac"
	ElectronicOrdersTypeEmergencyEvac ElectronicOrdersType = "emergency-evac"
	// ElectronicOrdersTypeIpcot captures enum value "ipcot"
	ElectronicOrdersTypeIpcot ElectronicOrdersType = "ipcot"
	// ElectronicOrdersTypeLowCostTravel captures enum value "low-cost-travel"
	ElectronicOrdersTypeLowCostTravel ElectronicOrdersType = "low-cost-travel"
	// ElectronicOrdersTypeOperational captures enum value "operational"
	ElectronicOrdersTypeOperational ElectronicOrdersType = "operational"
	// ElectronicOrdersTypeOteip captures enum value "oteip"
	ElectronicOrdersTypeOteip ElectronicOrdersType = "oteip"
	// ElectronicOrdersTypeRotational captures enum value "rotational"
	ElectronicOrdersTypeRotational ElectronicOrdersType = "rotational"
	// ElectronicOrdersTypeSeparation captures enum value "separation"
	ElectronicOrdersTypeSeparation ElectronicOrdersType = "separation"
	// ElectronicOrdersTypeSpecialPurpose captures enum value "special-purpose"
	ElectronicOrdersTypeSpecialPurpose ElectronicOrdersType = "special-purpose"
	// ElectronicOrdersTypeTraining captures enum value "training"
	ElectronicOrdersTypeTraining ElectronicOrdersType = "training"
	// ElectronicOrdersTypeUnitMove captures enum value "unit-move"
	ElectronicOrdersTypeUnitMove ElectronicOrdersType = "unit-move"
)

type Entitlement

type Entitlement struct {
	ID                    uuid.UUID `db:"id"`
	DependentsAuthorized  *bool     `db:"dependents_authorized"`
	TotalDependents       *int      `db:"total_dependents"`
	NonTemporaryStorage   *bool     `db:"non_temporary_storage"`
	PrivatelyOwnedVehicle *bool     `db:"privately_owned_vehicle"`
	//DBAuthorizedWeight is AuthorizedWeight when not null
	DBAuthorizedWeight *int `db:"authorized_weight"`

	StorageInTransit                             *int      `db:"storage_in_transit"`
	RequiredMedicalEquipmentWeight               int       `db:"required_medical_equipment_weight"`
	OrganizationalClothingAndIndividualEquipment bool      `db:"organizational_clothing_and_individual_equipment"`
	ProGearWeight                                int       `db:"pro_gear_weight"`
	ProGearWeightSpouse                          int       `db:"pro_gear_weight_spouse"`
	CreatedAt                                    time.Time `db:"created_at"`
	UpdatedAt                                    time.Time `db:"updated_at"`
	// contains filtered or unexported fields
}

Entitlement is an object representing entitlements for orders

func (*Entitlement) AuthorizedWeight

func (e *Entitlement) AuthorizedWeight() *int

AuthorizedWeight returns authorized weight. If authorized weight has not been stored in DBAuthorizedWeight use either TotalWeightSelf with no dependents or TotalWeightSelfPlusDependents with dependents.

func (*Entitlement) SetWeightAllotment

func (e *Entitlement) SetWeightAllotment(grade string)

SetWeightAllotment sets the weight allotment TODO probably want to reconsider keeping grade a string rather than enum TODO and possibly consider creating ghc specific GetWeightAllotment should the two TODO diverge in the future

func (*Entitlement) Validate

func (e *Entitlement) Validate(*pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

func (*Entitlement) WeightAllotment

func (e *Entitlement) WeightAllotment() *WeightAllotment

WeightAllotment returns the weight allotment

func (*Entitlement) WeightAllowance

func (e *Entitlement) WeightAllowance() *int

WeightAllowance will return the service member's weight allotment based on their rank and if dependents are authorized

type EvaluationReport

type EvaluationReport struct {
	ID                            uuid.UUID                       `json:"id" db:"id"`
	OfficeUser                    OfficeUser                      `belongs_to:"office_users" fk_id:"office_user_id"`
	OfficeUserID                  uuid.UUID                       `db:"office_user_id"`
	Move                          Move                            `belongs_to:"moves" fk_id:"move_id"`
	MoveID                        uuid.UUID                       `db:"move_id"`
	Shipment                      *MTOShipment                    `belongs_to:"mto_shipments" fk_id:"shipment_id"`
	ShipmentID                    *uuid.UUID                      `json:"shipment_id" db:"shipment_id"`
	Type                          EvaluationReportType            `json:"type" db:"type"`
	InspectionDate                *time.Time                      `json:"inspection_date" db:"inspection_date"`
	InspectionType                *EvaluationReportInspectionType `json:"inspection_type" db:"inspection_type"`
	TravelTimeMinutes             *int                            `json:"travel_time_minutes" db:"travel_time_minutes"`
	Location                      *EvaluationReportLocationType   `json:"location" db:"location"`
	LocationDescription           *string                         `json:"location_description" db:"location_description"`
	ObservedDate                  *time.Time                      `json:"observed_date" db:"observed_date"`
	EvaluationLengthMinutes       *int                            `json:"evaluation_length_minutes" db:"evaluation_length_minutes"`
	ViolationsObserved            *bool                           `json:"violations_observed" db:"violations_observed"`
	Remarks                       *string                         `json:"remarks" db:"remarks"`
	SeriousIncident               *bool                           `json:"serious_incident" db:"serious_incident"`
	SeriousIncidentDesc           *string                         `json:"serious_incident_desc" db:"serious_incident_desc"`
	ObservedClaimsResponseDate    *time.Time                      `json:"observed_claims_response_date" db:"observed_claims_response_date"`
	ObservedPickupDate            *time.Time                      `json:"observed_pickup_date" db:"observed_pickup_date"`
	ObservedPickupSpreadStartDate *time.Time                      `json:"observed_pickup_spread_start_date" db:"observed_pickup_spread_start_date"`
	ObservedPickupSpreadEndDate   *time.Time                      `json:"observed_pickup_spread_end_date" db:"observed_pickup_spread_end_date"`
	ObservedDeliveryDate          *time.Time                      `json:"observed_delivery_date" db:"observed_delivery_date"`
	SubmittedAt                   *time.Time                      `json:"submitted_at" db:"submitted_at"`
	DeletedAt                     *time.Time                      `db:"deleted_at"`
	CreatedAt                     time.Time                       `json:"created_at" db:"created_at"`
	UpdatedAt                     time.Time                       `json:"updated_at" db:"updated_at"`
	ReportViolations              ReportViolations                `json:"report_violation,omitempty" fk_id:"report_id" has_many:"report_violation"`
}

func (*EvaluationReport) TableName

func (r *EvaluationReport) TableName() string

func (*EvaluationReport) Validate

func (r *EvaluationReport) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type EvaluationReportInspectionType

type EvaluationReportInspectionType string
const (
	EvaluationReportInspectionTypeDataReview EvaluationReportInspectionType = "DATA_REVIEW"
	EvaluationReportInspectionTypePhysical   EvaluationReportInspectionType = "PHYSICAL"
	EvaluationReportInspectionTypeVirtual    EvaluationReportInspectionType = "VIRTUAL"
)

type EvaluationReportLocationType

type EvaluationReportLocationType string
const (
	EvaluationReportLocationTypeOrigin      EvaluationReportLocationType = "ORIGIN"
	EvaluationReportLocationTypeDestination EvaluationReportLocationType = "DESTINATION"
	EvaluationReportLocationTypeOther       EvaluationReportLocationType = "OTHER"
)

type EvaluationReportType

type EvaluationReportType string
const (
	EvaluationReportTypeShipment   EvaluationReportType = "SHIPMENT"
	EvaluationReportTypeCounseling EvaluationReportType = "COUNSELING"
)

type EvaluationReports

type EvaluationReports []EvaluationReport

EvaluationReports is not required by pop and may be deleted

type Float64IsGreaterThan

type Float64IsGreaterThan struct {
	Name     string
	Field    float64
	Compared float64
	Message  string
}

Float64IsGreaterThan validates that a float64 is greater than a given value

func (*Float64IsGreaterThan) IsValid

func (v *Float64IsGreaterThan) IsValid(errors *validate.Errors)

IsValid adds an error if the field is not greater than the compared value.

type Float64IsPresent

type Float64IsPresent struct {
	Name    string
	Field   float64
	Message string
}

Float64IsPresent validates that a float64 is non-zero.

func (*Float64IsPresent) IsValid

func (v *Float64IsPresent) IsValid(errors *validate.Errors)

IsValid adds an error if the field equals 0.

type FormattedMovingExpenses

type FormattedMovingExpenses struct {
	ContractedExpenseMemberPaid Dollar
	ContractedExpenseGTCCPaid   Dollar
	RentalEquipmentMemberPaid   Dollar
	RentalEquipmentGTCCPaid     Dollar
	PackingMaterialsMemberPaid  Dollar
	PackingMaterialsGTCCPaid    Dollar
	WeighingFeesMemberPaid      Dollar
	WeighingFeesGTCCPaid        Dollar
	GasMemberPaid               Dollar
	GasGTCCPaid                 Dollar
	TollsMemberPaid             Dollar
	TollsGTCCPaid               Dollar
	OilMemberPaid               Dollar
	OilGTCCPaid                 Dollar
	OtherMemberPaid             Dollar
	OtherGTCCPaid               Dollar
	TotalMemberPaid             Dollar
	TotalGTCCPaid               Dollar
	TotalMemberPaidRepeated     Dollar
	TotalGTCCPaidRepeated       Dollar
	TotalPaidNonSIT             Dollar
	TotalMemberPaidSIT          Dollar
	TotalGTCCPaidSIT            Dollar
	TotalPaidSIT                Dollar
}

FormattedMovingExpenses is an object representing the service member's moving expenses formatted for the SSW

type FormattedOtherExpenses

type FormattedOtherExpenses struct {
	Descriptions string
	AmountsPaid  string
}

FormattedOtherExpenses is an object representing the other moving expenses formatted for the SSW

type FuelEIADieselPrice

type FuelEIADieselPrice struct {
	ID                          uuid.UUID       `json:"id" db:"id"`
	CreatedAt                   time.Time       `json:"created_at" db:"created_at"`
	UpdatedAt                   time.Time       `json:"updated_at" db:"updated_at"`
	PubDate                     time.Time       `json:"pub_date" db:"pub_date"`
	RateStartDate               time.Time       `json:"rate_start_date" db:"rate_start_date"`
	RateEndDate                 time.Time       `json:"rate_end_date" db:"rate_end_date"`
	EIAPricePerGallonMillicents unit.Millicents `json:"eia_price_per_gallon_millicents" db:"eia_price_per_gallon_millicents"`
	BaselineRate                int64           `json:"baseline_rate" db:"baseline_rate"`
}

FuelEIADieselPrice used to hold data from the SDDC Fuel Surcharge information found at https://etops.sddc.army.mil/pls/ppcig_camp/fsc.output to calculate a shipment's fuel surcharge

func FetchMostRecentFuelPrices

func FetchMostRecentFuelPrices(dbConnection *pop.Connection, clock clock.Clock, numMonths int) ([]FuelEIADieselPrice, error)

FetchMostRecentFuelPrices queries and fetches all fuel_eia_diesel_prices for past specified number of months, including this month

func (FuelEIADieselPrice) String

func (f FuelEIADieselPrice) String() string

String is not required by pop and may be deleted

func (*FuelEIADieselPrice) Validate

func (f *FuelEIADieselPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*FuelEIADieselPrice) ValidateCreate

func (f *FuelEIADieselPrice) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*FuelEIADieselPrice) ValidateUpdate

func (f *FuelEIADieselPrice) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type FuelEIADieselPrices

type FuelEIADieselPrices []FuelEIADieselPrice

FuelEIADieselPrices is not required by pop and may be deleted

func (FuelEIADieselPrices) String

func (f FuelEIADieselPrices) String() string

String is not required by pop and may be deleted

type GHCDieselFuelPrice

type GHCDieselFuelPrice struct {
	ID                    uuid.UUID       `json:"id" db:"id"`
	CreatedAt             time.Time       `json:"created_at" db:"created_at"`
	UpdatedAt             time.Time       `json:"updated_at" db:"updated_at"`
	FuelPriceInMillicents unit.Millicents `json:"fuel_price_in_millicents" db:"fuel_price_in_millicents"`
	PublicationDate       time.Time       `json:"publication_date" db:"publication_date"`
}

GHCDieselFuelPrice represents the weekly national average diesel fuel price

func (GHCDieselFuelPrice) TableName

func (g GHCDieselFuelPrice) TableName() string

TableName overrides the table name used by Pop.

func (*GHCDieselFuelPrice) Validate

func (g *GHCDieselFuelPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type GHCDomesticTransitTime

type GHCDomesticTransitTime struct {
	ID                 uuid.UUID `db:"id" csv:"id"`
	MaxDaysTransitTime int       `db:"max_days_transit_time" csv:"max_days_transit_time"`
	WeightLbsLower     int       `db:"weight_lbs_lower" csv:"weight_lbs_lower"`
	WeightLbsUpper     int       `db:"weight_lbs_upper" csv:"weight_lbs_upper"`
	DistanceMilesLower int       `db:"distance_miles_lower" csv:"distance_miles_lower"`
	DistanceMilesUpper int       `db:"distance_miles_upper" csv:"distance_miles_upper"`
}

GHCDomesticTransitTime Tab Domestic Transit Times

func (GHCDomesticTransitTime) TableName

func (m GHCDomesticTransitTime) TableName() string

TableName overrides the table name used by Pop.

type Int64IsPresent

type Int64IsPresent struct {
	Name  string
	Field int64
}

Int64IsPresent validates that an int64 is greater than 0.

func (*Int64IsPresent) IsValid

func (v *Int64IsPresent) IsValid(errors *validate.Errors)

IsValid adds an error if the value is equal to 0.

type Invoice

type Invoice struct {
	ID            uuid.UUID     `json:"id" db:"id"`
	ApproverID    uuid.UUID     `json:"approver_id" db:"approver_id"`
	Approver      OfficeUser    `belongs_to:"office_user" fk_id:"approver_id"`
	Status        InvoiceStatus `json:"status" db:"status"`
	InvoiceNumber string        `json:"invoice_number" db:"invoice_number"`
	InvoicedDate  time.Time     `json:"invoiced_date" db:"invoiced_date"`
	CreatedAt     time.Time     `json:"created_at" db:"created_at"`
	UpdatedAt     time.Time     `json:"updated_at" db:"updated_at"`
	UserUploadID  *uuid.UUID    `json:"user_upload_id" db:"user_upload_id"`
	UserUpload    *UserUpload   `belongs_to:"user_uploads" fk_id:"user_upload_id"`
}

Invoice is a collection of line item charges to be sent for payment

func FetchInvoice

func FetchInvoice(db *pop.Connection, session *auth.Session, id uuid.UUID) (*Invoice, error)

FetchInvoice fetches and validates an invoice model

func (*Invoice) Validate

func (i *Invoice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type InvoiceStatus

type InvoiceStatus string

InvoiceStatus represents the status of an invoice

const (
	// InvoiceStatusDRAFT captures enum value "DRAFT"
	InvoiceStatusDRAFT InvoiceStatus = "DRAFT"
	// InvoiceStatusINPROCESS captures enum value "IN_PROCESS"
	InvoiceStatusINPROCESS InvoiceStatus = "IN_PROCESS"
	// InvoiceStatusSUBMITTED captures enum value "SUBMITTED"
	InvoiceStatusSUBMITTED InvoiceStatus = "SUBMITTED"
	// InvoiceStatusSUBMISSIONFAILURE captures enum value "SUBMISSION_FAILURE"
	InvoiceStatusSUBMISSIONFAILURE InvoiceStatus = "SUBMISSION_FAILURE"
	// InvoiceStatusUPDATEFAILURE captures enum value "UPDATE_FAILURE"
	// This status indicates that the invoice was successfully submitted, but the updating of the invoice
	// and associated shipment line items failed.
	InvoiceStatusUPDATEFAILURE InvoiceStatus = "UPDATE_FAILURE"
)

type Invoices

type Invoices []Invoice

Invoices is an array of invoices

type Issuer

type Issuer string

Issuer is the organization that issues orders.

const (
	// IssuerArmy captures enum value "army"
	IssuerArmy Issuer = "army"
	// IssuerNavy captures enum value "navy"
	IssuerNavy Issuer = "navy"
	// IssuerAirForce captures enum value "air-force"
	IssuerAirForce Issuer = "air-force"
	// IssuerMarineCorps captures enum value "marine-corps"
	IssuerMarineCorps Issuer = "marine-corps"
	// IssuerCoastGuard captures enum value "coast-guard"
	IssuerCoastGuard Issuer = "coast-guard"
)

type ItemCanFitInsideCrate

type ItemCanFitInsideCrate struct {
	Name         string
	NameCompared string
	Item         *primemessages.MTOServiceItemDimension
	Crate        *primemessages.MTOServiceItemDimension
	Message      string
}

ItemCanFitInsideCrate is a structure for determining if an Item Dimension can fit inside a Crate Dimension

func (ItemCanFitInsideCrate) IsValid

func (v ItemCanFitInsideCrate) IsValid(errors *validate.Errors)

IsValid adds an error if the Item can not fit inside a Crate

type JSONMap

type JSONMap map[string]interface{}

AuditHistoryJSONData

func (*JSONMap) Scan

func (jm *JSONMap) Scan(value interface{}) error

Scan reads a data type and update the JSONMap to represent the value read from JSON

func (JSONMap) Value

func (jm JSONMap) Value() (driver.Value, error)

Value returns a JSON value (from JSONMap to JSON string)

type LOAType

type LOAType string

LOAType represents the possible TAC and SAC types for a mto shipment

const (
	// LOATypeHHG is the HHG TAC or SAC
	LOATypeHHG LOAType = "HHG"
	// LOATypeNTS is the NTS TAC or SAC
	LOATypeNTS LOAType = "NTS"
)

type MTOAgent

type MTOAgent struct {
	ID            uuid.UUID    `db:"id"`
	MTOShipment   MTOShipment  `belongs_to:"mto_shipments" fk_id:"mto_shipment_id"`
	MTOShipmentID uuid.UUID    `db:"mto_shipment_id"`
	FirstName     *string      `db:"first_name"`
	LastName      *string      `db:"last_name"`
	Email         *string      `db:"email"`
	Phone         *string      `db:"phone"`
	MTOAgentType  MTOAgentType `db:"agent_type"`
	CreatedAt     time.Time    `db:"created_at"`
	UpdatedAt     time.Time    `db:"updated_at"`
	DeletedAt     *time.Time   `db:"deleted_at"`
}

MTOAgent is a struct that represents the mto_agents table.

func (MTOAgent) TableName

func (m MTOAgent) TableName() string

TableName overrides the table name used by Pop.

func (*MTOAgent) Validate

func (m *MTOAgent) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type MTOAgentType

type MTOAgentType string

MTOAgentType represents the type label for move task order agent

const (
	MTOAgentReleasing MTOAgentType = "RELEASING_AGENT"
	MTOAgentReceiving MTOAgentType = "RECEIVING_AGENT"
)

Constants for the MTOAgentType

type MTOAgents

type MTOAgents []MTOAgent

MTOAgents is a collection of MTOAgent

type MTOServiceItem

type MTOServiceItem struct {
	ID                            uuid.UUID                      `db:"id"`
	MoveTaskOrder                 Move                           `belongs_to:"moves" fk_id:"move_id"`
	MoveTaskOrderID               uuid.UUID                      `db:"move_id"`
	MTOShipment                   MTOShipment                    `belongs_to:"mto_shipments" fk_id:"mto_shipment_id"`
	MTOShipmentID                 *uuid.UUID                     `db:"mto_shipment_id"`
	ReService                     ReService                      `belongs_to:"re_services" fk_id:"re_service_id"`
	ReServiceID                   uuid.UUID                      `db:"re_service_id"`
	Reason                        *string                        `db:"reason"`
	RejectionReason               *string                        `db:"rejection_reason"`
	Status                        MTOServiceItemStatus           `db:"status"`
	PickupPostalCode              *string                        `db:"pickup_postal_code"`
	SITPostalCode                 *string                        `db:"sit_postal_code"`
	SITEntryDate                  *time.Time                     `db:"sit_entry_date"`
	SITDepartureDate              *time.Time                     `db:"sit_departure_date"`
	SITOriginHHGOriginalAddress   *Address                       `belongs_to:"addresses" fk_id:"sit_origin_hhg_original_address_id"`
	SITOriginHHGOriginalAddressID *uuid.UUID                     `db:"sit_origin_hhg_original_address_id"`
	SITOriginHHGActualAddress     *Address                       `belongs_to:"addresses" fk_id:"sit_origin_hhg_actual_address_id"`
	SITOriginHHGActualAddressID   *uuid.UUID                     `db:"sit_origin_hhg_actual_address_id"`
	SITDestinationFinalAddress    *Address                       `belongs_to:"addresses" fk_id:"sit_destination_final_address_id"`
	SITDestinationFinalAddressID  *uuid.UUID                     `db:"sit_destination_final_address_id"`
	Description                   *string                        `db:"description"`
	EstimatedWeight               *unit.Pound                    `db:"estimated_weight"`
	ActualWeight                  *unit.Pound                    `db:"actual_weight"`
	Dimensions                    MTOServiceItemDimensions       `has_many:"mto_service_item_dimensions" fk_id:"mto_service_item_id"`
	CustomerContacts              MTOServiceItemCustomerContacts `has_many:"mto_service_item_customer_contacts" fk_id:"mto_service_item_id"`
	CreatedAt                     time.Time                      `db:"created_at"`
	UpdatedAt                     time.Time                      `db:"updated_at"`
	ApprovedAt                    *time.Time                     `db:"approved_at"`
	RejectedAt                    *time.Time                     `db:"rejected_at"`
}

MTOServiceItem is an object representing service items for a move task order.

func (MTOServiceItem) TableName

func (m MTOServiceItem) TableName() string

TableName overrides the table name used by Pop.

func (*MTOServiceItem) Validate

func (m *MTOServiceItem) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type MTOServiceItemCustomerContact

type MTOServiceItemCustomerContact struct {
	ID                         uuid.UUID           `db:"id"`
	MTOServiceItem             MTOServiceItem      `belongs_to:"mto_service_items" fk_id:"mto_service_item_id"`
	MTOServiceItemID           uuid.UUID           `db:"mto_service_item_id"`
	Type                       CustomerContactType `db:"type"`
	TimeMilitary               string              `db:"time_military"`
	FirstAvailableDeliveryDate time.Time           `db:"first_available_delivery_date"`
	CreatedAt                  time.Time           `db:"created_at"`
	UpdatedAt                  time.Time           `db:"updated_at"`
}

MTOServiceItemCustomerContact is an object representing customer contact for a service item.

func (MTOServiceItemCustomerContact) TableName

func (m MTOServiceItemCustomerContact) TableName() string

TableName overrides the table name used by Pop.

func (*MTOServiceItemCustomerContact) Validate

func (m *MTOServiceItemCustomerContact) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type MTOServiceItemCustomerContacts

type MTOServiceItemCustomerContacts []MTOServiceItemCustomerContact

MTOServiceItemCustomerContacts is a slice containing MTOServiceItemCustomerContact.

type MTOServiceItemDimension

type MTOServiceItemDimension struct {
	ID               uuid.UUID             `db:"id"`
	MTOServiceItem   MTOServiceItem        `belongs_to:"mto_service_items" fk_id:"mto_service_item_id"`
	MTOServiceItemID uuid.UUID             `db:"mto_service_item_id"`
	Type             DimensionType         `db:"type"`
	Length           unit.ThousandthInches `db:"length_thousandth_inches"`
	Height           unit.ThousandthInches `db:"height_thousandth_inches"`
	Width            unit.ThousandthInches `db:"width_thousandth_inches"`
	CreatedAt        time.Time             `db:"created_at"`
	UpdatedAt        time.Time             `db:"updated_at"`
}

MTOServiceItemDimension is an object representing dimensions for a service item.

func (MTOServiceItemDimension) TableName

func (m MTOServiceItemDimension) TableName() string

TableName overrides the table name used by Pop.

func (*MTOServiceItemDimension) Validate

func (m *MTOServiceItemDimension) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

func (*MTOServiceItemDimension) Volume

Volume calculates Length x Height x Width

type MTOServiceItemDimensions

type MTOServiceItemDimensions []MTOServiceItemDimension

MTOServiceItemDimensions is a slice containing MTOServiceItemDimension.

type MTOServiceItemStatus

type MTOServiceItemStatus string

MTOServiceItemStatus represents the possible statuses for a mto shipment

const (
	// MTOServiceItemStatusSubmitted is the submitted status type for MTO Service Items
	MTOServiceItemStatusSubmitted MTOServiceItemStatus = "SUBMITTED"
	// MTOServiceItemStatusApproved is the approved status type for MTO Service Items
	MTOServiceItemStatusApproved MTOServiceItemStatus = "APPROVED"
	// MTOServiceItemStatusRejected is the rejected status type for MTO Service Items
	MTOServiceItemStatusRejected MTOServiceItemStatus = "REJECTED"
)

type MTOServiceItems

type MTOServiceItems []MTOServiceItem

MTOServiceItems is a slice containing MTOServiceItems

type MTOShipment

type MTOShipment struct {
	ID                               uuid.UUID         `db:"id"`
	MoveTaskOrder                    Move              `belongs_to:"moves" fk_id:"move_id"`
	MoveTaskOrderID                  uuid.UUID         `db:"move_id"`
	ScheduledPickupDate              *time.Time        `db:"scheduled_pickup_date"`
	RequestedPickupDate              *time.Time        `db:"requested_pickup_date"`
	RequestedDeliveryDate            *time.Time        `db:"requested_delivery_date"`
	ApprovedDate                     *time.Time        `db:"approved_date"`
	FirstAvailableDeliveryDate       *time.Time        `db:"first_available_delivery_date"`
	ActualPickupDate                 *time.Time        `db:"actual_pickup_date"`
	RequiredDeliveryDate             *time.Time        `db:"required_delivery_date"`
	ScheduledDeliveryDate            *time.Time        `db:"scheduled_delivery_date"`
	ActualDeliveryDate               *time.Time        `db:"actual_delivery_date"`
	CustomerRemarks                  *string           `db:"customer_remarks"`
	CounselorRemarks                 *string           `db:"counselor_remarks"`
	PickupAddress                    *Address          `belongs_to:"addresses" fk_id:"pickup_address_id"`
	PickupAddressID                  *uuid.UUID        `db:"pickup_address_id"`
	DestinationAddress               *Address          `belongs_to:"addresses" fk_id:"destination_address_id"`
	DestinationAddressID             *uuid.UUID        `db:"destination_address_id"`
	DestinationType                  *DestinationType  `db:"destination_address_type"`
	MTOAgents                        MTOAgents         `has_many:"mto_agents" fk_id:"mto_shipment_id"`
	MTOServiceItems                  MTOServiceItems   `has_many:"mto_service_items" fk_id:"mto_shipment_id"`
	SecondaryPickupAddress           *Address          `belongs_to:"addresses" fk_id:"secondary_pickup_address_id"`
	SecondaryPickupAddressID         *uuid.UUID        `db:"secondary_pickup_address_id"`
	SecondaryDeliveryAddress         *Address          `belongs_to:"addresses" fk_id:"secondary_delivery_address_id"`
	SecondaryDeliveryAddressID       *uuid.UUID        `db:"secondary_delivery_address_id"`
	SITDaysAllowance                 *int              `db:"sit_days_allowance"`
	SITExtensions                    SITExtensions     `has_many:"sit_extensions" fk_id:"mto_shipment_id"`
	PrimeEstimatedWeight             *unit.Pound       `db:"prime_estimated_weight"`
	PrimeEstimatedWeightRecordedDate *time.Time        `db:"prime_estimated_weight_recorded_date"`
	PrimeActualWeight                *unit.Pound       `db:"prime_actual_weight"`
	BillableWeightCap                *unit.Pound       `db:"billable_weight_cap"`
	BillableWeightJustification      *string           `db:"billable_weight_justification"`
	NTSRecordedWeight                *unit.Pound       `db:"nts_recorded_weight"`
	ShipmentType                     MTOShipmentType   `db:"shipment_type"`
	Status                           MTOShipmentStatus `db:"status"`
	Diversion                        bool              `db:"diversion"`
	RejectionReason                  *string           `db:"rejection_reason"`
	Distance                         *unit.Miles       `db:"distance"`
	Reweigh                          *Reweigh          `has_one:"reweighs" fk_id:"shipment_id"`
	UsesExternalVendor               bool              `db:"uses_external_vendor"`
	StorageFacility                  *StorageFacility  `belongs_to:"storage_facilities" fk:"storage_facility_id"`
	StorageFacilityID                *uuid.UUID        `db:"storage_facility_id"`
	ServiceOrderNumber               *string           `db:"service_order_number"`
	TACType                          *LOAType          `db:"tac_type"`
	SACType                          *LOAType          `db:"sac_type"`
	PPMShipment                      *PPMShipment      `has_one:"ppm_shipment" fk_id:"shipment_id"`
	CreatedAt                        time.Time         `db:"created_at"`
	UpdatedAt                        time.Time         `db:"updated_at"`
	DeletedAt                        *time.Time        `db:"deleted_at"`
}

MTOShipment is an object representing data for a move task order shipment

func (MTOShipment) TableName

func (m MTOShipment) TableName() string

TableName overrides the table name used by Pop.

func (*MTOShipment) Validate

func (m *MTOShipment) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type MTOShipmentStatus

type MTOShipmentStatus string

MTOShipmentStatus represents the possible statuses for a mto shipment

const (
	// MTOShipmentStatusDraft is the draft status type for MTO Shipments
	MTOShipmentStatusDraft MTOShipmentStatus = "DRAFT"
	// MTOShipmentStatusSubmitted is the submitted status type for MTO Shipments
	MTOShipmentStatusSubmitted MTOShipmentStatus = "SUBMITTED"
	// MTOShipmentStatusApproved is the approved status type for MTO Shipments
	MTOShipmentStatusApproved MTOShipmentStatus = "APPROVED"
	// MTOShipmentStatusRejected is the rejected status type for MTO Shipments
	MTOShipmentStatusRejected MTOShipmentStatus = "REJECTED"
	// MTOShipmentStatusCancellationRequested indicates the TOO has requested that the Prime cancel the shipment
	MTOShipmentStatusCancellationRequested MTOShipmentStatus = "CANCELLATION_REQUESTED"
	// MTOShipmentStatusCanceled indicates that a shipment has been canceled by the Prime
	MTOShipmentStatusCanceled MTOShipmentStatus = "CANCELED"
	// MTOShipmentStatusDiversionRequested indicates that the TOO has requested that the Prime divert a shipment
	MTOShipmentStatusDiversionRequested MTOShipmentStatus = "DIVERSION_REQUESTED"
)

type MTOShipmentType

type MTOShipmentType string

MTOShipmentType represents the type of shipments the mto shipment is

const (
	// MTOShipmentTypeHHG is an HHG Shipment Type default
	MTOShipmentTypeHHG MTOShipmentType = "HHG"
	// MTOShipmentTypeInternationalHHG is a Shipment Type for International HHG
	MTOShipmentTypeInternationalHHG MTOShipmentType = "INTERNATIONAL_HHG"
	// MTOShipmentTypeInternationalUB is a Shipment Type for International UB
	MTOShipmentTypeInternationalUB MTOShipmentType = "INTERNATIONAL_UB"
	// MTOShipmentTypeHHGLongHaulDom is an HHG Shipment Type for Longhaul Domestic
	MTOShipmentTypeHHGLongHaulDom MTOShipmentType = "HHG_LONGHAUL_DOMESTIC"
	// MTOShipmentTypeHHGShortHaulDom is an HHG Shipment Type for Shothaul Domestic
	MTOShipmentTypeHHGShortHaulDom MTOShipmentType = "HHG_SHORTHAUL_DOMESTIC"
	// MTOShipmentTypeHHGIntoNTSDom is an HHG Shipment Type for going into NTS Domestic
	MTOShipmentTypeHHGIntoNTSDom MTOShipmentType = NTSRaw
	// MTOShipmentTypeHHGOutOfNTSDom is an HHG Shipment Type for going out of NTS Domestic
	MTOShipmentTypeHHGOutOfNTSDom MTOShipmentType = NTSrRaw
	// MTOShipmentTypeMotorhome is a Shipment Type for Motorhome
	MTOShipmentTypeMotorhome MTOShipmentType = "MOTORHOME"
	// MTOShipmentTypeBoatHaulAway is a Shipment Type for Boat Haul Away
	MTOShipmentTypeBoatHaulAway MTOShipmentType = "BOAT_HAUL_AWAY"
	// MTOShipmentTypeBoatTowAway is a Shipment Type for Boat Tow Away
	MTOShipmentTypeBoatTowAway MTOShipmentType = "BOAT_TOW_AWAY"
	// MTOShipmentTypePPM is a Shipment Type for Personally Procured Move shipments
	MTOShipmentTypePPM MTOShipmentType = "PPM"
)

type MTOShipments

type MTOShipments []MTOShipment

MTOShipments is a list of mto shipments

type Market

type Market string

Market represents the market for an international move

const (
	MarketConus  Market = "C"
	MarketOconus Market = "O"
)

This lists available markets for international accessorial pricing

func (Market) String

func (m Market) String() string

type MethodOfReceipt

type MethodOfReceipt string

MethodOfReceipt is how the SM will be paid

const (
	// MethodOfReceiptMILPAY captures enum value MIL_PAY
	MethodOfReceiptMILPAY MethodOfReceipt = "MIL_PAY"
	// MethodOfReceiptOTHERDD captures enum value OTHER_DD
	MethodOfReceiptOTHERDD MethodOfReceipt = "OTHER_DD"
	// MethodOfReceiptGTCC captures enum value GTCC
	MethodOfReceiptGTCC MethodOfReceipt = "GTCC"
)

type Move

type Move struct {
	ID                           uuid.UUID                 `json:"id" db:"id"`
	Locator                      string                    `json:"locator" db:"locator"`
	CreatedAt                    time.Time                 `json:"created_at" db:"created_at"`
	UpdatedAt                    time.Time                 `json:"updated_at" db:"updated_at"`
	SubmittedAt                  *time.Time                `json:"submitted_at" db:"submitted_at"`
	OrdersID                     uuid.UUID                 `json:"orders_id" db:"orders_id"`
	Orders                       Order                     `belongs_to:"orders" fk_id:"orders_id"`
	SelectedMoveType             *SelectedMoveType         `json:"selected_move_type" db:"selected_move_type"`
	PersonallyProcuredMoves      PersonallyProcuredMoves   `has_many:"personally_procured_moves" fk_id:"move_id" order_by:"created_at desc"`
	Status                       MoveStatus                `json:"status" db:"status"`
	SignedCertifications         SignedCertifications      `has_many:"signed_certifications" fk_id:"move_id" order_by:"created_at desc"`
	CancelReason                 *string                   `json:"cancel_reason" db:"cancel_reason"`
	Show                         *bool                     `json:"show" db:"show"`
	TIORemarks                   *string                   `db:"tio_remarks"`
	AvailableToPrimeAt           *time.Time                `db:"available_to_prime_at"`
	ContractorID                 *uuid.UUID                `db:"contractor_id"`
	Contractor                   *Contractor               `belongs_to:"contractors" fk_id:"contractor_id"`
	PPMEstimatedWeight           *unit.Pound               `db:"ppm_estimated_weight"`
	PPMType                      *string                   `db:"ppm_type"`
	MTOServiceItems              MTOServiceItems           `has_many:"mto_service_items" fk_id:"move_id"`
	PaymentRequests              PaymentRequests           `has_many:"payment_requests" fk_id:"move_id"`
	MTOShipments                 MTOShipments              `has_many:"mto_shipments" fk_id:"move_id"`
	ReferenceID                  *string                   `db:"reference_id"`
	ServiceCounselingCompletedAt *time.Time                `db:"service_counseling_completed_at"`
	PrimeCounselingCompletedAt   *time.Time                `db:"prime_counseling_completed_at"`
	ExcessWeightQualifiedAt      *time.Time                `db:"excess_weight_qualified_at"`
	ExcessWeightUploadID         *uuid.UUID                `db:"excess_weight_upload_id"`
	ExcessWeightUpload           *Upload                   `belongs_to:"uploads" fk_id:"excess_weight_upload_id"`
	ExcessWeightAcknowledgedAt   *time.Time                `db:"excess_weight_acknowledged_at"`
	BillableWeightsReviewedAt    *time.Time                `db:"billable_weights_reviewed_at"`
	FinancialReviewFlag          bool                      `db:"financial_review_flag"`
	FinancialReviewFlagSetAt     *time.Time                `db:"financial_review_flag_set_at"`
	FinancialReviewRemarks       *string                   `db:"financial_review_remarks"`
	ShipmentGBLOC                MoveToGBLOCs              `has_many:"move_to_gbloc" fk_id:"move_id"`
	OriginDutyLocationGBLOC      OriginDutyLocationToGBLOC `has_one:"origin_duty_location_to_gbloc" fk_id:"move_id"`
}

Move is an object representing a move

func FetchMove

func FetchMove(db *pop.Connection, session *auth.Session, id uuid.UUID) (*Move, error)

FetchMove fetches and validates a Move for this User

func FetchMoveByMoveID

func FetchMoveByMoveID(db *pop.Connection, moveID uuid.UUID) (Move, error)

FetchMoveByMoveID returns a Move for a given id

func FetchMoveByOrderID

func FetchMoveByOrderID(db *pop.Connection, orderID uuid.UUID) (Move, error)

FetchMoveByOrderID returns a Move for a given id

func FetchMoveForMoveDates

func FetchMoveForMoveDates(db *pop.Connection, moveID uuid.UUID) (Move, error)

FetchMoveForMoveDates returns a Move along with all the associations needed to determine the move dates summary information.

func (Move) CreatePPM

func (m Move) CreatePPM(db *pop.Connection,
	weightEstimate *unit.Pound,
	originalMoveDate *time.Time,
	pickupPostalCode *string,
	hasAdditionalPostalCode *bool,
	additionalPickupPostalCode *string,
	destinationPostalCode *string,
	hasSit *bool,
	daysInStorage *int64,
	estimatedStorageReimbursement *string,
	hasRequestedAdvance bool,
	advance *Reimbursement) (*PersonallyProcuredMove, *validate.Errors, error)

CreatePPM creates a new PPM associated with this move

func (Move) CreateSignedCertification

func (m Move) CreateSignedCertification(db *pop.Connection,
	submittingUserID uuid.UUID,
	certificationText string,
	signature string,
	date time.Time,
	ppmID *uuid.UUID,
	certificationType *SignedCertificationType) (*SignedCertification, *validate.Errors, error)

CreateSignedCertification creates a new SignedCertification associated with this move

func (Move) IsCanceled

func (m Move) IsCanceled() *bool

IsCanceled returns true if the Move's status is `CANCELED`, false otherwise

func (*Move) Validate

func (m *Move) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Move) ValidateCreate

func (m *Move) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Move) ValidateUpdate

func (m *Move) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type MoveHistory

type MoveHistory struct {
	ID             uuid.UUID
	Locator        string
	ReferenceID    *string
	AuditHistories AuditHistories
}

MoveHistory captures a move's audit history. This struct doesn't have a database table it is used for the ghc.yaml/GHC API. NO DATABASE TABLE

type MoveOptions

type MoveOptions struct {
	SelectedType *SelectedMoveType
	Show         *bool
}

MoveOptions is used when creating new moves based on parameters

type MoveQueueItem

type MoveQueueItem struct {
	ID                          uuid.UUID          `json:"id" db:"id"`
	CreatedAt                   time.Time          `json:"created_at" db:"created_at"`
	Edipi                       string             `json:"edipi" db:"edipi"`
	Rank                        *ServiceMemberRank `json:"rank" db:"rank"`
	CustomerName                string             `json:"customer_name" db:"customer_name"`
	Locator                     string             `json:"locator" db:"locator"`
	Status                      string             `json:"status" db:"status"`
	PpmStatus                   *string            `json:"ppm_status" db:"ppm_status"`
	OrdersType                  string             `json:"orders_type" db:"orders_type"`
	MoveDate                    *time.Time         `json:"move_date" db:"move_date"`
	SubmittedDate               *time.Time         `json:"submitted_date" db:"submitted_date"`
	LastModifiedDate            time.Time          `json:"last_modified_date" db:"last_modified_date"`
	OriginDutyLocationName      string             `json:"origin_duty_location_name" db:"origin_duty_location_name"`
	DestinationDutyLocationName string             `json:"destination_duty_location_name" db:"destination_duty_location_name"`
	PmSurveyConductedDate       *time.Time         `json:"pm_survey_conducted_date" db:"pm_survey_conducted_date"`
	OriginGBLOC                 *string            `json:"origin_gbloc" db:"origin_gbloc"`
	DestinationGBLOC            *string            `json:"destination_gbloc" db:"destination_gbloc"`
	DeliveredDate               *time.Time         `json:"delivered_date" db:"delivered_date"`
	InvoiceApprovedDate         *time.Time         `json:"invoice_approved_date" db:"invoice_approved_date"`
	BranchOfService             string             `json:"branch_of_service" db:"branch_of_service"`
	ActualMoveDate              *time.Time         `json:"actual_move_date" db:"actual_move_date"`
	OriginalMoveDate            *time.Time         `json:"original_move_date" db:"original_move_date"`
}

MoveQueueItem represents a single move queue item within a queue.

func GetMoveQueueItems

func GetMoveQueueItems(db *pop.Connection, lifecycleState string) ([]MoveQueueItem, error)

GetMoveQueueItems gets all moveQueueItems for a specific lifecycleState

type MoveStatus

type MoveStatus string

MoveStatus represents the status of an order record's lifecycle

const (
	// MoveStatusDRAFT captures enum value "DRAFT"
	MoveStatusDRAFT MoveStatus = "DRAFT"
	// MoveStatusSUBMITTED captures enum value "SUBMITTED"
	MoveStatusSUBMITTED MoveStatus = "SUBMITTED"
	// MoveStatusAPPROVED captures enum value "APPROVED"
	MoveStatusAPPROVED MoveStatus = "APPROVED"
	// MoveStatusCANCELED captures enum value "CANCELED"
	MoveStatusCANCELED MoveStatus = "CANCELED"
	// MoveStatusAPPROVALSREQUESTED captures enum value "APPROVALS REQUESTED"
	MoveStatusAPPROVALSREQUESTED MoveStatus = "APPROVALS REQUESTED"
	// MoveStatusNeedsServiceCounseling captures enum value "NEEDS SERVICE COUNSELING"
	MoveStatusNeedsServiceCounseling MoveStatus = "NEEDS SERVICE COUNSELING"
	// MoveStatusServiceCounselingCompleted captures enum value "SERVICE COUNSELING COMPLETED"
	MoveStatusServiceCounselingCompleted MoveStatus = "SERVICE COUNSELING COMPLETED"
)

type MoveToGBLOC

type MoveToGBLOC struct {
	MoveID uuid.UUID `db:"move_id"`
	Move   Move      `belongs_to:"moves" fk_id:"move_id"`
	GBLOC  *string   `db:"gbloc"`
}

MoveToGBLOC represents the view that associates each move ID with a GBLOC based on the postal code of its first shipment. This view is used to encapsulate query logic that was impossible to express with Pop. It will be used for the TOO and TIO queues, but not for Services Counseling.

func (MoveToGBLOC) TableName

func (m MoveToGBLOC) TableName() string

TableName overrides the table name used by Pop.

type MoveToGBLOCs

type MoveToGBLOCs []MoveToGBLOC

MoveToGBLOCs is not required by pop and may be deleted

type Moves

type Moves []Move

Moves is not required by pop and may be deleted

func GetMovesForUserID

func GetMovesForUserID(db *pop.Connection, userID uuid.UUID) (Moves, error)

GetMovesForUserID gets all move models for a given user ID

type MovingExpense

type MovingExpense struct {
	ID                uuid.UUID                 `json:"id" db:"id"`
	PPMShipmentID     uuid.UUID                 `json:"ppm_shipment_id" db:"ppm_shipment_id"`
	PPMShipment       PPMShipment               `belongs_to:"ppm_shipments" fk_id:"ppm_shipment_id"`
	DocumentID        uuid.UUID                 `json:"document_id" db:"document_id"`
	Document          Document                  `belongs_to:"documents" fk_id:"document_id"`
	CreatedAt         time.Time                 `json:"created_at" db:"created_at"`
	UpdatedAt         time.Time                 `json:"updated_at" db:"updated_at"`
	DeletedAt         *time.Time                `json:"deleted_at" db:"deleted_at"`
	MovingExpenseType *MovingExpenseReceiptType `json:"moving_expense_type" db:"moving_expense_type"`
	Description       *string                   `json:"description" db:"description"`
	PaidWithGTCC      *bool                     `json:"paid_with_gtcc" db:"paid_with_gtcc"`
	Amount            *unit.Cents               `json:"amount" db:"amount"`
	MissingReceipt    *bool                     `json:"missing_receipt" db:"missing_receipt"`
	Status            *PPMDocumentStatus        `json:"status" db:"status"`
	Reason            *string                   `json:"reason" db:"reason"`
	SITStartDate      *time.Time                `json:"sit_start_date" db:"sit_start_date"`
	SITEndDate        *time.Time                `json:"sit_end_date" db:"sit_end_date"`
}

func FetchMovingExpensesShipmentSummaryWorksheet

func FetchMovingExpensesShipmentSummaryWorksheet(move Move, db *pop.Connection, session *auth.Session) ([]MovingExpense, error)

FetchMovingExpensesShipmentSummaryWorksheet fetches moving expenses for the Shipment Summary Worksheet TODO: update to create moving expense summary with the new moving expense model

func (*MovingExpense) Validate

func (m *MovingExpense) Validate(_ *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This should contain validation that is for data integrity. Business validation should occur in service objects.

type MovingExpenseReceiptType

type MovingExpenseReceiptType string

MovingExpenseReceiptType represents types of different moving expenses

const (
	// MovingExpenseReceiptTypeContractedExpense captures enum value "CONTRACTED_EXPENSE"
	MovingExpenseReceiptTypeContractedExpense MovingExpenseReceiptType = "CONTRACTED_EXPENSE"
	// MovingExpenseReceiptTypeOil captures enum value "OIL"
	MovingExpenseReceiptTypeOil MovingExpenseReceiptType = "OIL"
	// MovingExpenseReceiptTypePackingMaterials captures enum value "PACKING_MATERIALS"
	MovingExpenseReceiptTypePackingMaterials MovingExpenseReceiptType = "PACKING_MATERIALS"
	// MovingExpenseReceiptTypeRentalEquipment captures enum value "RENTAL_EQUIPMENT"
	MovingExpenseReceiptTypeRentalEquipment MovingExpenseReceiptType = "RENTAL_EQUIPMENT"
	// MovingExpenseReceiptTypeStorage captures enum value "STORAGE"
	MovingExpenseReceiptTypeStorage MovingExpenseReceiptType = "STORAGE"
	// MovingExpenseReceiptTypeTolls captures enum value "TOLLS"
	MovingExpenseReceiptTypeTolls MovingExpenseReceiptType = "TOLLS"
	// MovingExpenseReceiptTypeWeighingFee captures enum value "WEIGHING_FEE"
	MovingExpenseReceiptTypeWeighingFee MovingExpenseReceiptType = "WEIGHING_FEE"
	// MovingExpenseReceiptTypeOther captures enum value "OTHER"
	MovingExpenseReceiptTypeOther MovingExpenseReceiptType = "OTHER"
)

type MovingExpenses

type MovingExpenses []MovingExpense

type MustBeBothNilOrBothHaveValue

type MustBeBothNilOrBothHaveValue struct {
	FieldName1  string
	FieldValue1 *string
	FieldName2  string
	FieldValue2 *string
}

MustBeBothNilOrBothHaveValue validates that two fields are either both nil or both have values

func (*MustBeBothNilOrBothHaveValue) IsValid

func (v *MustBeBothNilOrBothHaveValue) IsValid(errors *validate.Errors)

IsValid adds an error if fieldValue1 or fieldValue2 are neither both empty nor both non-empty

type NotImplementedCountryCode

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

NotImplementedCountryCode is the default for unimplemented country code lookup

func (NotImplementedCountryCode) Error

type Notification

type Notification struct {
	ID               uuid.UUID         `db:"id"`
	ServiceMemberID  uuid.UUID         `db:"service_member_id"`
	ServiceMember    ServiceMember     `belongs_to:"service_member" fk_id:"service_member_id"`
	SESMessageID     string            `db:"ses_message_id"`
	NotificationType NotificationTypes `db:"notification_type"`
	CreatedAt        time.Time         `db:"created_at"`
}

Notification represents an email sent to a service member

func (*Notification) Validate

func (n *Notification) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type NotificationTypes

type NotificationTypes string

NotificationTypes represents types of notifications

const (
	// MoveReviewedEmail captures enum value "MOVE_REVIEWED_EMAIL"
	MoveReviewedEmail NotificationTypes = "MOVE_REVIEWED_EMAIL"
	// MovePaymentReminderEmail captures enum value "MOVE_PAYMENT_REMINDER_EMAIL"
	MovePaymentReminderEmail NotificationTypes = "MOVE_PAYMENT_REMINDER_EMAIL"
)

type Notifications

type Notifications []Notification

Notifications is a slice of notification structs

type Obligation

type Obligation struct {
	Gcc   unit.Cents
	SIT   unit.Cents
	Miles unit.Miles
}

Obligation an object representing the obligations section on the shipment summary worksheet

func (Obligation) FormatSIT

func (obligation Obligation) FormatSIT() float64

FormatSIT formats the SIT Cost into a dollar float for the shipment summary worksheet

func (Obligation) GCC100

func (obligation Obligation) GCC100() float64

GCC100 calculates the 100% GCC on shipment summary worksheet

func (Obligation) GCC95

func (obligation Obligation) GCC95() float64

GCC95 calculates the 95% GCC on shipment summary worksheet

func (Obligation) MaxAdvance

func (obligation Obligation) MaxAdvance() float64

MaxAdvance calculates the Max Advance on the shipment summary worksheet

type Obligations

type Obligations struct {
	MaxObligation              Obligation
	ActualObligation           Obligation
	NonWinningMaxObligation    Obligation
	NonWinningActualObligation Obligation
}

Obligations is an object representing the winning and non-winning Max Obligation and Actual Obligation sections of the shipment summary worksheet

type OfficeEmail

type OfficeEmail struct {
	ID                     uuid.UUID            `json:"id" db:"id"`
	TransportationOfficeID uuid.UUID            `json:"transportation_office_id" db:"transportation_office_id"`
	TransportationOffice   TransportationOffice `belongs_to:"transportation_office" fk_id:"transportation_office_id"`
	Email                  string               `json:"email" db:"email"`
	Label                  *string              `json:"label" db:"label"`
	CreatedAt              time.Time            `json:"created_at" db:"created_at"`
	UpdatedAt              time.Time            `json:"updated_at" db:"updated_at"`
}

OfficeEmail is used to store Email addresses for the TransportationOffices

func (*OfficeEmail) Validate

func (o *OfficeEmail) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*OfficeEmail) ValidateCreate

func (o *OfficeEmail) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*OfficeEmail) ValidateUpdate

func (o *OfficeEmail) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type OfficeEmails

type OfficeEmails []OfficeEmail

OfficeEmails is not required by pop and may be deleted

type OfficePhoneLine

type OfficePhoneLine struct {
	ID                     uuid.UUID            `json:"id" db:"id"`
	TransportationOfficeID uuid.UUID            `json:"transportation_office_id" db:"transportation_office_id"`
	TransportationOffice   TransportationOffice `belongs_to:"transportation_office" fk_id:"transportation_office_id"`
	Number                 string               `json:"number" db:"number"`
	Label                  *string              `json:"label" db:"label"`
	IsDsnNumber            bool                 `json:"is_dsn_number" db:"is_dsn_number"`
	Type                   string               `json:"type" db:"type"`
	CreatedAt              time.Time            `json:"created_at" db:"created_at"`
	UpdatedAt              time.Time            `json:"updated_at" db:"updated_at"`
}

OfficePhoneLine is used to store Phone lines (voice or fax) for the TransportationOffices

func (*OfficePhoneLine) Validate

func (o *OfficePhoneLine) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*OfficePhoneLine) ValidateCreate

func (o *OfficePhoneLine) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*OfficePhoneLine) ValidateUpdate

func (o *OfficePhoneLine) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type OfficePhoneLines

type OfficePhoneLines []OfficePhoneLine

OfficePhoneLines is not required by pop and may be deleted

type OfficeUser

type OfficeUser struct {
	ID                     uuid.UUID            `json:"id" db:"id"`
	UserID                 *uuid.UUID           `json:"user_id" db:"user_id"`
	User                   User                 `belongs_to:"user" fk_id:"user_id"`
	LastName               string               `json:"last_name" db:"last_name"`
	FirstName              string               `json:"first_name" db:"first_name"`
	MiddleInitials         *string              `json:"middle_initials" db:"middle_initials"`
	Email                  string               `json:"email" db:"email"`
	Telephone              string               `json:"telephone" db:"telephone"`
	TransportationOfficeID uuid.UUID            `json:"transportation_office_id" db:"transportation_office_id"`
	TransportationOffice   TransportationOffice `belongs_to:"transportation_office" fk_id:"transportation_office_id"`
	CreatedAt              time.Time            `json:"created_at" db:"created_at"`
	UpdatedAt              time.Time            `json:"updated_at" db:"updated_at"`
	Active                 bool                 `json:"active" db:"active"`
}

OfficeUser is someone who works in one of the TransportationOffices

func FetchOfficeUserByEmail

func FetchOfficeUserByEmail(tx *pop.Connection, email string) (*OfficeUser, error)

FetchOfficeUserByEmail looks for an office user with a specific email

func FetchOfficeUserByID

func FetchOfficeUserByID(tx *pop.Connection, id uuid.UUID) (*OfficeUser, error)

FetchOfficeUserByID fetches an office user by ID

func (*OfficeUser) Validate

func (o *OfficeUser) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*OfficeUser) ValidateCreate

func (o *OfficeUser) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*OfficeUser) ValidateUpdate

func (o *OfficeUser) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type OfficeUsers

type OfficeUsers []OfficeUser

OfficeUsers is not required by pop and may be deleted

type OptionalDateIsWorkday

type OptionalDateIsWorkday struct {
	Name     string
	Field    *time.Time
	Calendar *cal.BusinessCalendar
}

OptionalDateIsWorkday validates that a field is on a workday if it exists

func (*OptionalDateIsWorkday) IsValid

func (v *OptionalDateIsWorkday) IsValid(errors *validate.Errors)

IsValid adds error if field is not on valid workday ignores nil field

type OptionalDateNotBefore

type OptionalDateNotBefore struct {
	Name    string
	Field   *time.Time
	MinDate *time.Time
}

OptionalDateNotBefore validates that a date is not before the earliest allowable date

func (*OptionalDateNotBefore) IsValid

func (v *OptionalDateNotBefore) IsValid(errors *validate.Errors)

IsValid adds an error if the field has a value and there is not a not-before date or the date is before the not-before date

type OptionalInt64IsPositive

type OptionalInt64IsPositive struct {
	Name  string
	Field *int64
}

OptionalInt64IsPositive adds an error if the Field is less than or equal to zero

func (*OptionalInt64IsPositive) IsValid

func (v *OptionalInt64IsPositive) IsValid(errors *validate.Errors)

IsValid adds an error if the Field is less than or equal to zero

type OptionalIntIsPositive

type OptionalIntIsPositive struct {
	Name  string
	Field *int
}

OptionalIntIsPositive adds an error if the Field is less than or equal to zero

func (*OptionalIntIsPositive) IsValid

func (v *OptionalIntIsPositive) IsValid(errors *validate.Errors)

IsValid adds an error if the Field is less than or equal to zero

type OptionalPoundIsNonNegative

type OptionalPoundIsNonNegative struct {
	Name  string
	Field *unit.Pound
}

OptionalPoundIsNonNegative adds an error if the Field is less than zero

func (*OptionalPoundIsNonNegative) IsValid

func (v *OptionalPoundIsNonNegative) IsValid(errors *validate.Errors)

IsValid adds an error if the Field is less than zero

type OptionalPoundIsPositive

type OptionalPoundIsPositive struct {
	Name  string
	Field *unit.Pound
}

OptionalPoundIsPositive adds an error if the Field is less than or equal to zero

func (*OptionalPoundIsPositive) IsValid

func (v *OptionalPoundIsPositive) IsValid(errors *validate.Errors)

IsValid adds an error if the Field is less than zero

type OptionalRegexMatch

type OptionalRegexMatch struct {
	Name    string
	Field   *string
	Expr    string
	Message string
}

OptionalRegexMatch validates that a field matches the regexp match

func (*OptionalRegexMatch) IsValid

func (v *OptionalRegexMatch) IsValid(errors *validate.Errors)

IsValid performs the validation based on the regexp match

type OptionalStringInclusion

type OptionalStringInclusion struct {
	Name    string
	Field   *string
	List    []string
	Message string
}

OptionalStringInclusion validates that a field is in a list of strings if the field exists

func (*OptionalStringInclusion) IsValid

func (v *OptionalStringInclusion) IsValid(errors *validate.Errors)

IsValid adds error if field is non-nil and not in the list of strings

type OptionalTimeIsPresent

type OptionalTimeIsPresent struct {
	Name    string
	Field   *time.Time
	Message string
}

OptionalTimeIsPresent adds an error if the Field is not nil and also not a valid time

func (*OptionalTimeIsPresent) IsValid

func (v *OptionalTimeIsPresent) IsValid(errors *validate.Errors)

IsValid adds an error if the Field is not nil and also not a valid time

type OptionalUUIDIsPresent

type OptionalUUIDIsPresent struct {
	Name    string
	Field   *uuid.UUID
	Message string
}

OptionalUUIDIsPresent is a structure for determining if an Optional UUID is valid If it is a nil pointer, it passes validation. If it is a pointer to a valid UUID, it passes validation. If it is a pointer to a non-valid UUID, it fails validation.

func (*OptionalUUIDIsPresent) IsValid

func (v *OptionalUUIDIsPresent) IsValid(errors *validate.Errors)

IsValid adds an error if an optional UUID is valid. If it is a nil pointer, it passes validation. If it is a pointer to a valid UUID, it passes validation. If it is a pointer to a non-valid UUID, it fails validation.

type Order

type Order struct {
	ID                          uuid.UUID                          `json:"id" db:"id"`
	CreatedAt                   time.Time                          `json:"created_at" db:"created_at"`
	UpdatedAt                   time.Time                          `json:"updated_at" db:"updated_at"`
	ServiceMemberID             uuid.UUID                          `json:"service_member_id" db:"service_member_id"`
	ServiceMember               ServiceMember                      `belongs_to:"service_members" fk_id:"service_member_id"`
	IssueDate                   time.Time                          `json:"issue_date" db:"issue_date"`
	ReportByDate                time.Time                          `json:"report_by_date" db:"report_by_date"`
	OrdersType                  internalmessages.OrdersType        `json:"orders_type" db:"orders_type"`
	OrdersTypeDetail            *internalmessages.OrdersTypeDetail `json:"orders_type_detail" db:"orders_type_detail"`
	HasDependents               bool                               `json:"has_dependents" db:"has_dependents"`
	SpouseHasProGear            bool                               `json:"spouse_has_pro_gear" db:"spouse_has_pro_gear"`
	OriginDutyLocation          *DutyLocation                      `belongs_to:"duty_locations" fk_id:"origin_duty_location_id"`
	OriginDutyLocationID        *uuid.UUID                         `json:"origin_duty_location_id" db:"origin_duty_location_id"`
	NewDutyLocationID           uuid.UUID                          `json:"new_duty_location_id" db:"new_duty_location_id"`
	NewDutyLocation             DutyLocation                       `belongs_to:"duty_locations" fk_id:"new_duty_location_id"`
	UploadedOrders              Document                           `belongs_to:"documents" fk_id:"uploaded_orders_id"`
	UploadedOrdersID            uuid.UUID                          `json:"uploaded_orders_id" db:"uploaded_orders_id"`
	OrdersNumber                *string                            `json:"orders_number" db:"orders_number"`
	Moves                       Moves                              `has_many:"moves" fk_id:"orders_id" order_by:"created_at desc"`
	Status                      OrderStatus                        `json:"status" db:"status"`
	TAC                         *string                            `json:"tac" db:"tac"`
	SAC                         *string                            `json:"sac" db:"sac"`
	NtsTAC                      *string                            `json:"nts_tac" db:"nts_tac"`
	NtsSAC                      *string                            `json:"nts_sac" db:"nts_sac"`
	DepartmentIndicator         *string                            `json:"department_indicator" db:"department_indicator"`
	Grade                       *string                            `json:"grade" db:"grade"`
	Entitlement                 *Entitlement                       `belongs_to:"entitlements" fk_id:"entitlement_id"`
	EntitlementID               *uuid.UUID                         `json:"entitlement_id" db:"entitlement_id"`
	UploadedAmendedOrders       *Document                          `belongs_to:"documents" fk_id:"uploaded_amended_orders_id"`
	UploadedAmendedOrdersID     *uuid.UUID                         `json:"uploaded_amended_orders_id" db:"uploaded_amended_orders_id"`
	AmendedOrdersAcknowledgedAt *time.Time                         `json:"amended_orders_acknowledged_at" db:"amended_orders_acknowledged_at"`
}

Order is a set of orders received by a service member

func FetchLatestOrder

func FetchLatestOrder(session *auth.Session, db *pop.Connection) (Order, error)

FetchLatestOrder gets the latest order for a service member

func FetchOrder

func FetchOrder(db *pop.Connection, id uuid.UUID) (Order, error)

FetchOrder returns orders without REGARDLESS OF USER. DO NOT USE IF YOU NEED USER AUTH

func FetchOrderForPDFConversion

func FetchOrderForPDFConversion(db *pop.Connection, id uuid.UUID) (Order, error)

FetchOrderForPDFConversion returns orders and any attached uploads

func FetchOrderForUser

func FetchOrderForUser(db *pop.Connection, session *auth.Session, id uuid.UUID) (Order, error)

FetchOrderForUser returns orders only if it is allowed for the given user to access those orders.

func (*Order) Cancel

func (o *Order) Cancel() error

Cancel cancels the Order

func (*Order) CreateNewMove

func (o *Order) CreateNewMove(db *pop.Connection, moveOptions MoveOptions) (*Move, *validate.Errors, error)

CreateNewMove creates a move associated with these Orders

func (*Order) IsComplete

func (o *Order) IsComplete() bool

IsComplete checks if orders have all fields necessary to approve a move

func (*Order) IsCompleteForGBL

func (o *Order) IsCompleteForGBL() bool

IsCompleteForGBL checks if orders have all fields necessary to generate a GBL

func (*Order) Submit

func (o *Order) Submit() error

Submit submits the Order

func (*Order) Validate

func (o *Order) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type OrderStatus

type OrderStatus string

OrderStatus represents the state of an order record in the UX manual orders flow

const (
	// OrderStatusDRAFT captures enum value "DRAFT"
	OrderStatusDRAFT OrderStatus = "DRAFT"
	// OrderStatusSUBMITTED captures enum value "SUBMITTED"
	OrderStatusSUBMITTED OrderStatus = "SUBMITTED"
	// OrderStatusAPPROVED captures enum value "APPROVED"
	OrderStatusAPPROVED OrderStatus = "APPROVED"
	// OrderStatusCANCELED captures enum value "CANCELED"
	OrderStatusCANCELED OrderStatus = "CANCELED"
)

type Orders

type Orders []Order

Orders is not required by pop and may be deleted

type OrdersTypeIsPresent

type OrdersTypeIsPresent struct {
	Name  string
	Field internalmessages.OrdersType
}

OrdersTypeIsPresent validates that orders type field is present

func (*OrdersTypeIsPresent) IsValid

func (v *OrdersTypeIsPresent) IsValid(errors *validate.Errors)

IsValid adds an error if the string value is blank.

type Organization

type Organization struct {
	ID        uuid.UUID `json:"id" db:"id"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	Name      string    `json:"name" db:"name"`
	PocEmail  *string   `json:"poc_email" db:"poc_email"`
	PocPhone  *string   `json:"poc_phone" db:"poc_phone"`
}

Organization represents an organization and their contact information

func (Organization) String

func (o Organization) String() string

String is not required by pop and may be deleted

func (*Organization) Validate

func (o *Organization) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Organization) ValidateCreate

func (o *Organization) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Organization) ValidateUpdate

func (o *Organization) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Organizations

type Organizations []Organization

Organizations is not required by pop and may be deleted

func (Organizations) String

func (o Organizations) String() string

String is not required by pop and may be deleted

type OriginDutyLocationToGBLOC

type OriginDutyLocationToGBLOC struct {
	ID     uuid.UUID `db:"id"`
	MoveID uuid.UUID `db:"move_id"`
	GBLOC  string    `db:"gbloc"`
}

OriginDutyLocationToGBLOC represents the view that associates each move ID with a GBLOC based on the postal code of its origin duty location. This view is used to encapsulate query logic that was impossible to express with Pop. It will be used for the for Services Counseling queue.

func (OriginDutyLocationToGBLOC) TableName

func (m OriginDutyLocationToGBLOC) TableName() string

TableName overrides the table name used by Pop.

type PPMAdvanceStatus

type PPMAdvanceStatus string

PPMAdvanceStatus represents the status of an advance that can be approved, edited or rejected by a SC

const (
	// PPMAdvanceStatusApproved captures enum value "APPROVED"
	PPMAdvanceStatusApproved PPMAdvanceStatus = "APPROVED"
	// PPMAdvanceStatusEdited captures enum value "EDITED"
	PPMAdvanceStatusEdited PPMAdvanceStatus = "EDITED"
	// PPMAdvanceStatusRejected captures enum value "REJECTED"
	PPMAdvanceStatusRejected PPMAdvanceStatus = "REJECTED"
)

type PPMDocumentStatus

type PPMDocumentStatus string

PPMDocumentStatus represents the status of a PPMShipment's documents. Lives here since we have multiple PPM document models.

const (
	// PPMDocumentStatusApproved captures enum value "APPROVED"
	PPMDocumentStatusApproved PPMDocumentStatus = "APPROVED"
	// PPMDocumentStatusExcluded captures enum value "EXCLUDED"
	PPMDocumentStatusExcluded PPMDocumentStatus = "EXCLUDED"
	// PPMDocumentStatusRejected captures enum value "REJECTED"
	PPMDocumentStatusRejected PPMDocumentStatus = "REJECTED"
)

type PPMShipment

type PPMShipment struct {
	ID                             uuid.UUID            `json:"id" db:"id"`
	ShipmentID                     uuid.UUID            `json:"shipment_id" db:"shipment_id"`
	Shipment                       MTOShipment          `belongs_to:"mto_shipments" fk_id:"shipment_id"`
	CreatedAt                      time.Time            `json:"created_at" db:"created_at"`
	UpdatedAt                      time.Time            `json:"updated_at" db:"updated_at"`
	DeletedAt                      *time.Time           `json:"deleted_at" db:"deleted_at"`
	Status                         PPMShipmentStatus    `json:"status" db:"status"`
	ExpectedDepartureDate          time.Time            `json:"expected_departure_date" db:"expected_departure_date"`
	ActualMoveDate                 *time.Time           `json:"actual_move_date" db:"actual_move_date"`
	SubmittedAt                    *time.Time           `json:"submitted_at" db:"submitted_at"`
	ReviewedAt                     *time.Time           `json:"reviewed_at" db:"reviewed_at"`
	ApprovedAt                     *time.Time           `json:"approved_at" db:"approved_at"`
	W2Address                      *Address             `belongs_to:"addresses" fk_id:"w2_address_id"`
	W2AddressID                    *uuid.UUID           `db:"w2_address_id"`
	PickupPostalCode               string               `json:"pickup_postal_code" db:"pickup_postal_code"`
	SecondaryPickupPostalCode      *string              `json:"secondary_pickup_postal_code" db:"secondary_pickup_postal_code"`
	ActualPickupPostalCode         *string              `json:"actual_pickup_postal_code" db:"actual_pickup_postal_code"`
	DestinationPostalCode          string               `json:"destination_postal_code" db:"destination_postal_code"`
	SecondaryDestinationPostalCode *string              `json:"secondary_destination_postal_code" db:"secondary_destination_postal_code"`
	ActualDestinationPostalCode    *string              `json:"actual_destination_postal_code" db:"actual_destination_postal_code"`
	EstimatedWeight                *unit.Pound          `json:"estimated_weight" db:"estimated_weight"`
	NetWeight                      *unit.Pound          `json:"net_weight" db:"net_weight"`
	HasProGear                     *bool                `json:"has_pro_gear" db:"has_pro_gear"`
	ProGearWeight                  *unit.Pound          `json:"pro_gear_weight" db:"pro_gear_weight"`
	SpouseProGearWeight            *unit.Pound          `json:"spouse_pro_gear_weight" db:"spouse_pro_gear_weight"`
	EstimatedIncentive             *unit.Cents          `json:"estimated_incentive" db:"estimated_incentive"`
	FinalIncentive                 *unit.Cents          `json:"final_incentive" db:"final_incentive"`
	HasRequestedAdvance            *bool                `json:"has_requested_advance" db:"has_requested_advance"`
	AdvanceAmountRequested         *unit.Cents          `json:"advance_amount_requested" db:"advance_amount_requested"`
	HasReceivedAdvance             *bool                `json:"has_received_advance" db:"has_received_advance"`
	AdvanceStatus                  *PPMAdvanceStatus    `json:"advance_status" db:"advance_status"`
	AdvanceAmountReceived          *unit.Cents          `json:"advance_amount_received" db:"advance_amount_received"`
	SITExpected                    *bool                `json:"sit_expected" db:"sit_expected"`
	SITLocation                    *SITLocationType     `json:"sit_location" db:"sit_location"`
	SITEstimatedWeight             *unit.Pound          `json:"sit_estimated_weight" db:"sit_estimated_weight"`
	SITEstimatedEntryDate          *time.Time           `json:"sit_estimated_entry_date" db:"sit_estimated_entry_date"`
	SITEstimatedDepartureDate      *time.Time           `json:"sit_estimated_departure_date" db:"sit_estimated_departure_date"`
	SITEstimatedCost               *unit.Cents          `json:"sit_estimated_cost" db:"sit_estimated_cost"`
	WeightTickets                  WeightTickets        `has_many:"weight_tickets" fk_id:"ppm_shipment_id" order_by:"created_at asc"`
	MovingExpenses                 MovingExpenses       `has_many:"moving_expenses" fk_id:"ppm_shipment_id" order_by:"created_at asc"`
	ProgearExpenses                ProgearWeightTickets `has_many:"progear_weight_tickets" fk_id:"ppm_shipment_id" order_by:"created_at asc"`
	SignedCertifications           SignedCertifications `has_many:"signed_certifications" fk_id:"ppm_id" order_by:"created_at desc"`
}

PPMShipment is the portion of a move that a service member performs themselves

func FetchPPMShipmentFromMTOShipmentID

func FetchPPMShipmentFromMTOShipmentID(db *pop.Connection, mtoShipmentID uuid.UUID) (*PPMShipment, error)

func (PPMShipment) TableName

func (p PPMShipment) TableName() string

TableName overrides the table name used by Pop. By default it tries using the name `ppmshipments`.

type PPMShipmentStatus

type PPMShipmentStatus string

PPMShipmentStatus represents the status of an order record's lifecycle

const (
	// PPMShipmentStatusDraft captures enum value "DRAFT"
	PPMShipmentStatusDraft PPMShipmentStatus = "DRAFT"
	// PPMShipmentStatusSubmitted captures enum value "SUBMITTED"
	PPMShipmentStatusSubmitted PPMShipmentStatus = "SUBMITTED"
	// PPMShipmentStatusWaitingOnCustomer captures enum value "WAITING_ON_CUSTOMER"
	PPMShipmentStatusWaitingOnCustomer PPMShipmentStatus = "WAITING_ON_CUSTOMER"
	// PPMShipmentStatusNeedsAdvanceApproval captures enum value "NEEDS_ADVANCE_APPROVAL"
	PPMShipmentStatusNeedsAdvanceApproval PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL"
	// PPMShipmentStatusNeedsPaymentApproval captures enum value "NEEDS_PAYMENT_APPROVAL"
	PPMShipmentStatusNeedsPaymentApproval PPMShipmentStatus = "NEEDS_PAYMENT_APPROVAL"
	// PPMShipmentStatusPaymentApproved captures enum value "PAYMENT_APPROVED"
	PPMShipmentStatusPaymentApproved PPMShipmentStatus = "PAYMENT_APPROVED"
	// PPMShipmentStatusNeedsCloseOut captures enum value "NEEDS_CLOSE_OUT"
	PPMShipmentStatusNeedsCloseOut PPMShipmentStatus = "NEEDS_CLOSE_OUT"
)

type PPMShipments

type PPMShipments []PPMShipment

PPMShipments is a list of PPMs

type PPMStatus

type PPMStatus string

PPMStatus represents the status of an order record's lifecycle

const (
	// PPMStatusDRAFT captures enum value "DRAFT"
	PPMStatusDRAFT PPMStatus = "DRAFT"
	// PPMStatusSUBMITTED captures enum value "SUBMITTED"
	PPMStatusSUBMITTED PPMStatus = "SUBMITTED"
	// PPMStatusAPPROVED captures enum value "APPROVED"
	PPMStatusAPPROVED PPMStatus = "APPROVED"
	// PPMStatusPAYMENTREQUESTED captures enum value "PAYMENT_REQUESTED"
	PPMStatusPAYMENTREQUESTED PPMStatus = "PAYMENT_REQUESTED"
	// PPMStatusCOMPLETED captures enum value "COMPLETED"
	PPMStatusCOMPLETED PPMStatus = "COMPLETED"
	// PPMStatusCANCELED captures enum value "CANCELED"
	PPMStatusCANCELED PPMStatus = "CANCELED"
)

type PWSViolation

type PWSViolation struct {
	ID                   uuid.UUID            `json:"id" db:"id"`
	DisplayOrder         int                  `json:"display_order" db:"display_order"`
	ParagraphNumber      string               `db:"paragraph_number"`
	Title                string               `db:"title"`
	Category             PWSViolationCategory `db:"category"`
	SubCategory          string               `db:"sub_category"`
	RequirementSummary   string               `db:"requirement_summary"`
	RequirementStatement string               `db:"requirement_statement"`
	IsKpi                bool                 `db:"is_kpi"`
	AdditionalDataElem   string               `db:"additional_data_elem"`
}

func (PWSViolation) TableName

func (p PWSViolation) TableName() string

type PWSViolationCategory

type PWSViolationCategory string
const (
	PWSViolationCategoryPreMoveServices      PWSViolationCategory = "Pre-Move Services"
	PWSViolationCategoryPhysicalMoveServices PWSViolationCategory = "Physical Move Services"
	PWSViolationCategoryLiability            PWSViolationCategory = "Liability"
)

type PWSViolations

type PWSViolations []PWSViolation

type Paygrade

type Paygrade string

Paygrade is the "rank" of a member. Some of these paygrades will have identical entitlements.

const (
	// PaygradeAviationCadet captures enum value "aviation-cadet"
	PaygradeAviationCadet Paygrade = "aviation-cadet"
	// PaygradeCadet captures enum value "cadet"
	PaygradeCadet Paygrade = "cadet"
	// PaygradeCivilian captures enum value "civilian"
	PaygradeCivilian Paygrade = "civilian"
	// PaygradeE1 captures enum value "e-1"
	PaygradeE1 Paygrade = "e-1"
	// PaygradeE2 captures enum value "e-2"
	PaygradeE2 Paygrade = "e-2"
	// PaygradeE3 captures enum value "e-3"
	PaygradeE3 Paygrade = "e-3"
	// PaygradeE4 captures enum value "e-4"
	PaygradeE4 Paygrade = "e-4"
	// PaygradeE5 captures enum value "e-5"
	PaygradeE5 Paygrade = "e-5"
	// PaygradeE6 captures enum value "e-6"
	PaygradeE6 Paygrade = "e-6"
	// PaygradeE7 captures enum value "e-7"
	PaygradeE7 Paygrade = "e-7"
	// PaygradeE8 captures enum value "e-8"
	PaygradeE8 Paygrade = "e-8"
	// PaygradeE9 captures enum value "e-9"
	PaygradeE9 Paygrade = "e-9"
	// PaygradeMidshipman captures enum value "midshipman"
	PaygradeMidshipman Paygrade = "midshipman"
	// PaygradeO1 captures enum value "o-1"
	PaygradeO1 Paygrade = "o-1"
	// PaygradeO2 captures enum value "o-2"
	PaygradeO2 Paygrade = "o-2"
	// PaygradeO3 captures enum value "o-3"
	PaygradeO3 Paygrade = "o-3"
	// PaygradeO4 captures enum value "o-4"
	PaygradeO4 Paygrade = "o-4"
	// PaygradeO5 captures enum value "o-5"
	PaygradeO5 Paygrade = "o-5"
	// PaygradeO6 captures enum value "o-6"
	PaygradeO6 Paygrade = "o-6"
	// PaygradeO7 captures enum value "o-7"
	PaygradeO7 Paygrade = "o-7"
	// PaygradeO8 captures enum value "o-8"
	PaygradeO8 Paygrade = "o-8"
	// PaygradeO9 captures enum value "o-9"
	PaygradeO9 Paygrade = "o-9"
	// PaygradeO10 captures enum value "o-10"
	PaygradeO10 Paygrade = "o-10"
	// PaygradeW1 captures enum value "w-1"
	PaygradeW1 Paygrade = "w-1"
	// PaygradeW2 captures enum value "w-2"
	PaygradeW2 Paygrade = "w-2"
	// PaygradeW3 captures enum value "w-3"
	PaygradeW3 Paygrade = "w-3"
	// PaygradeW4 captures enum value "w-4"
	PaygradeW4 Paygrade = "w-4"
	// PaygradeW5 captures enum value "w-5"
	PaygradeW5 Paygrade = "w-5"
)

type PaymentRequest

type PaymentRequest struct {
	ID                              uuid.UUID            `json:"id" db:"id"`
	MoveTaskOrderID                 uuid.UUID            `db:"move_id"`
	IsFinal                         bool                 `json:"is_final" db:"is_final"`
	Status                          PaymentRequestStatus `json:"status" db:"status"`
	RejectionReason                 *string              `json:"rejection_reason" db:"rejection_reason"`
	PaymentRequestNumber            string               `json:"payment_request_number" db:"payment_request_number"`
	SequenceNumber                  int                  `json:"sequence_number" db:"sequence_number"`
	RequestedAt                     time.Time            `json:"requested_at" db:"requested_at"`
	ReviewedAt                      *time.Time           `json:"reviewed_at" db:"reviewed_at"`
	SentToGexAt                     *time.Time           `json:"sent_to_gex_at" db:"sent_to_gex_at"`
	ReceivedByGexAt                 *time.Time           `json:"received_by_gex_at" db:"received_by_gex_at"`
	PaidAt                          *time.Time           `json:"paid_at" db:"paid_at"`
	CreatedAt                       time.Time            `db:"created_at"`
	UpdatedAt                       time.Time            `db:"updated_at"`
	RecalculationOfPaymentRequestID *uuid.UUID           `json:"recalculation_of_payment_request_id" db:"recalculation_of_payment_request_id"`

	// Associations
	MoveTaskOrder                 Move                `belongs_to:"moves" fk_id:"move_id"`
	PaymentServiceItems           PaymentServiceItems `has_many:"payment_service_items" fk_id:"payment_request_id"`
	ProofOfServiceDocs            ProofOfServiceDocs  `has_many:"proof_of_service_docs" fk_id:"payment_request_id"`
	EdiErrors                     EdiErrors           `has_many:"edi_errors" fk_id:"payment_request_id"`
	RecalculationOfPaymentRequest *PaymentRequest     `belongs_to:"payment_requests" fk_id:"recalculation_of_payment_request_id"`
}

PaymentRequest is an object representing a payment request on a move task order

func (*PaymentRequest) Validate

func (p *PaymentRequest) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type PaymentRequestStatus

type PaymentRequestStatus string

PaymentRequestStatus is a type of Payment Request Status

const (
	// PaymentRequestStatusPending is pending
	PaymentRequestStatusPending PaymentRequestStatus = "PENDING"
	// PaymentRequestStatusReviewed is reviewed
	PaymentRequestStatusReviewed PaymentRequestStatus = "REVIEWED"
	// PaymentRequestStatusReviewedAllRejected is reviewed
	PaymentRequestStatusReviewedAllRejected PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED"
	// PaymentRequestStatusSentToGex is sent to gex
	PaymentRequestStatusSentToGex PaymentRequestStatus = "SENT_TO_GEX"
	// PaymentRequestStatusReceivedByGex is received by gex
	PaymentRequestStatusReceivedByGex PaymentRequestStatus = "RECEIVED_BY_GEX"
	// PaymentRequestStatusPaid is paid
	PaymentRequestStatusPaid PaymentRequestStatus = "PAID"
	// PaymentRequestStatusEDIError an error has occurred
	PaymentRequestStatusEDIError PaymentRequestStatus = "EDI_ERROR"
	// PaymentRequestStatusDeprecated is deprecated
	PaymentRequestStatusDeprecated PaymentRequestStatus = "DEPRECATED"
)

func (PaymentRequestStatus) String

func (p PaymentRequestStatus) String() string

String is a string representation of a Payment Request Status

type PaymentRequestToInterchangeControlNumber

type PaymentRequestToInterchangeControlNumber struct {
	ID                       uuid.UUID `db:"id"`
	PaymentRequestID         uuid.UUID `db:"payment_request_id"`
	InterchangeControlNumber int       `db:"interchange_control_number"`
	EDIType                  EDIType   `db:"edi_type"`

	// Associations
	PaymentRequest PaymentRequest `belongs_to:"payment_requests" fk_id:"payment_request_id"`
}

PaymentRequestToInterchangeControlNumber is an object that links payment requests to an Interchange Control Number used in the EDI 858 invoice

func (*PaymentRequestToInterchangeControlNumber) Validate

func (p *PaymentRequestToInterchangeControlNumber) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type PaymentRequests

type PaymentRequests []PaymentRequest

PaymentRequests is a slice of PaymentRequest

type PaymentServiceItem

type PaymentServiceItem struct {
	ID               uuid.UUID                `json:"id" db:"id"`
	PaymentRequestID uuid.UUID                `json:"payment_request_id" db:"payment_request_id"`
	MTOServiceItemID uuid.UUID                `json:"mto_service_item_id" db:"mto_service_item_id"`
	Status           PaymentServiceItemStatus `json:"status" db:"status"`
	PriceCents       *unit.Cents              `json:"price_cents" db:"price_cents"`
	RejectionReason  *string                  `json:"rejection_reason" db:"rejection_reason"`
	RequestedAt      time.Time                `json:"requested_at" db:"requested_at"`
	ApprovedAt       *time.Time               `json:"approved_at" db:"approved_at"`
	DeniedAt         *time.Time               `json:"denied_at" db:"denied_at"`
	SentToGexAt      *time.Time               `json:"sent_to_gex_at" db:"sent_to_gex_at"`
	PaidAt           *time.Time               `json:"paid_at" db:"paid_at"`
	ReferenceID      string                   `json:"reference_id" db:"reference_id"`
	CreatedAt        time.Time                `db:"created_at"`
	UpdatedAt        time.Time                `db:"updated_at"`

	//Associations
	PaymentRequest           PaymentRequest           `belongs_to:"payment_request" fk_id:"payment_request_id"`
	MTOServiceItem           MTOServiceItem           `belongs_to:"mto_service_item" fk_id:"mto_service_item_id"`
	PaymentServiceItemParams PaymentServiceItemParams `has_many:"payment_service_item_params" fk_id:"payment_service_item_id"`
}

PaymentServiceItem represents a payment service item

func (*PaymentServiceItem) BeforeCreate

func (p *PaymentServiceItem) BeforeCreate(db *pop.Connection) error

BeforeCreate is a Pop callback that is called before a PaymentServiceItem is created.

func (*PaymentServiceItem) GeneratePSIReferenceID

func (p *PaymentServiceItem) GeneratePSIReferenceID(db *pop.Connection) (string, error)

GeneratePSIReferenceID returns a reference ID for the PaymentServiceItem it is being called on. The format should be <MTO reference ID>-<part of PSI ID to make it unique>

func (*PaymentServiceItem) Validate

func (p *PaymentServiceItem) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type PaymentServiceItemParam

type PaymentServiceItemParam struct {
	ID                    uuid.UUID `json:"id" db:"id"`
	PaymentServiceItemID  uuid.UUID `json:"payment_service_item_id" db:"payment_service_item_id"`
	ServiceItemParamKeyID uuid.UUID `json:"service_item_param_key_id" db:"service_item_param_key_id"`
	Value                 string    `json:"value" db:"value"`
	CreatedAt             time.Time `db:"created_at"`
	UpdatedAt             time.Time `db:"updated_at"`

	// Associations
	PaymentServiceItem  PaymentServiceItem  `belongs_to:"payment_service_item" fk_id:"payment_service_item_id"`
	ServiceItemParamKey ServiceItemParamKey `belongs_to:"service_item_param_key" fk_id:"service_item_param_key_id"`

	// Used to lookup the appropriate ServiceItemParamKeyID when creating a PaymentServiceItemParam
	IncomingKey string `db:"-"`
}

PaymentServiceItemParam represents a parameter of the Payment Service Item

func (*PaymentServiceItemParam) Validate

func (p *PaymentServiceItemParam) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type PaymentServiceItemParams

type PaymentServiceItemParams []PaymentServiceItemParam

PaymentServiceItemParams is not required by pop and may be deleted

type PaymentServiceItemStatus

type PaymentServiceItemStatus string

PaymentServiceItemStatus is a type of Payment Service Item Status

const (
	// PaymentServiceItemStatusRequested is the requested status
	PaymentServiceItemStatusRequested PaymentServiceItemStatus = "REQUESTED"
	// PaymentServiceItemStatusApproved is the approved status
	PaymentServiceItemStatusApproved PaymentServiceItemStatus = "APPROVED"
	// PaymentServiceItemStatusDenied is the denied status
	PaymentServiceItemStatusDenied PaymentServiceItemStatus = "DENIED"
	// PaymentServiceItemStatusSentToGex is the sent-to-gex status
	PaymentServiceItemStatusSentToGex PaymentServiceItemStatus = "SENT_TO_GEX"
	// PaymentServiceItemStatusPaid is the paid status
	PaymentServiceItemStatusPaid PaymentServiceItemStatus = "PAID"
	// PaymentServiceItemStatusEDIError is an error status
	PaymentServiceItemStatusEDIError PaymentServiceItemStatus = "EDI_ERROR"

	// PaymentServiceItemMaxReferenceIDLength is the maximum overall length allowed for a reference ID
	// (given the EDI field's max length)
	PaymentServiceItemMaxReferenceIDLength = 30
	// PaymentServiceItemMinReferenceIDSuffixLength is the minimum suffix length for the PSI's reference ID
	PaymentServiceItemMinReferenceIDSuffixLength = 8
)

func (PaymentServiceItemStatus) String

func (p PaymentServiceItemStatus) String() string

PaymentServiceItemStatus is a string representation of a Payment Service Item Status

type PaymentServiceItems

type PaymentServiceItems []PaymentServiceItem

PaymentServiceItems is not required by pop and may be deleted

type PersonallyProcuredMove

type PersonallyProcuredMove struct {
	ID                            uuid.UUID      `json:"id" db:"id"`
	MoveID                        uuid.UUID      `json:"move_id" db:"move_id"`
	Move                          Move           `belongs_to:"move" fk_id:"move_id"`
	CreatedAt                     time.Time      `json:"created_at" db:"created_at"`
	UpdatedAt                     time.Time      `json:"updated_at" db:"updated_at"`
	WeightEstimate                *unit.Pound    `json:"weight_estimate" db:"weight_estimate"`
	OriginalMoveDate              *time.Time     `json:"original_move_date" db:"original_move_date"`
	ActualMoveDate                *time.Time     `json:"actual_move_date" db:"actual_move_date"`
	SubmitDate                    *time.Time     `json:"submit_date" db:"submit_date"`
	ApproveDate                   *time.Time     `json:"approve_date" db:"approve_date"`
	ReviewedDate                  *time.Time     `json:"reviewed_date" db:"reviewed_date"`
	NetWeight                     *unit.Pound    `json:"net_weight" db:"net_weight"`
	PickupPostalCode              *string        `json:"pickup_postal_code" db:"pickup_postal_code"`
	HasAdditionalPostalCode       *bool          `json:"has_additional_postal_code" db:"has_additional_postal_code"`
	AdditionalPickupPostalCode    *string        `json:"additional_pickup_postal_code" db:"additional_pickup_postal_code"`
	DestinationPostalCode         *string        `json:"destination_postal_code" db:"destination_postal_code"`
	HasSit                        *bool          `json:"has_sit" db:"has_sit"`
	DaysInStorage                 *int64         `json:"days_in_storage" db:"days_in_storage"`
	EstimatedStorageReimbursement *string        `json:"estimated_storage_reimbursement" db:"estimated_storage_reimbursement"`
	Mileage                       *int64         `json:"mileage" db:"mileage"`
	PlannedSITMax                 *unit.Cents    `json:"planned_sit_max" db:"planned_sit_max"`
	SITMax                        *unit.Cents    `json:"sit_max" db:"sit_max"`
	IncentiveEstimateMin          *unit.Cents    `json:"incentive_estimate_min" db:"incentive_estimate_min"`
	IncentiveEstimateMax          *unit.Cents    `json:"incentive_estimate_max" db:"incentive_estimate_max"`
	Status                        PPMStatus      `json:"status" db:"status"`
	HasRequestedAdvance           bool           `json:"has_requested_advance" db:"has_requested_advance"`
	AdvanceID                     *uuid.UUID     `json:"advance_id" db:"advance_id"`
	Advance                       *Reimbursement `belongs_to:"reimbursements" fk_id:"advance_id"`
	AdvanceWorksheet              Document       `belongs_to:"documents" fk_id:"advance_worksheet_id"`
	AdvanceWorksheetID            *uuid.UUID     `json:"advance_worksheet_id" db:"advance_worksheet_id"`
	TotalSITCost                  *unit.Cents    `json:"total_sit_cost" db:"total_sit_cost"`
	HasProGear                    *ProGearStatus `json:"has_pro_gear" db:"has_pro_gear"`
	HasProGearOverThousand        *ProGearStatus `json:"has_pro_gear_over_thousand" db:"has_pro_gear_over_thousand"`
}

PersonallyProcuredMove is the portion of a move that a service member performs themselves

func FetchPersonallyProcuredMove

func FetchPersonallyProcuredMove(db *pop.Connection, session *auth.Session, id uuid.UUID) (*PersonallyProcuredMove, error)

FetchPersonallyProcuredMove Fetches and Validates a PPM model

func FetchPersonallyProcuredMoveByOrderID

func FetchPersonallyProcuredMoveByOrderID(db *pop.Connection, orderID uuid.UUID) (*PersonallyProcuredMove, error)

FetchPersonallyProcuredMoveByOrderID Fetches and Validates a PPM model

func (*PersonallyProcuredMove) Approve

func (p *PersonallyProcuredMove) Approve(approveDate time.Time) error

Approve approves the PPM to go forward.

func (*PersonallyProcuredMove) Cancel

func (p *PersonallyProcuredMove) Cancel() error

Cancel marks the PPM as Canceled

func (*PersonallyProcuredMove) Complete

func (p *PersonallyProcuredMove) Complete(reviewedDate time.Time) error

Complete marks the PPM as completed

func (*PersonallyProcuredMove) RequestPayment

func (p *PersonallyProcuredMove) RequestPayment() error

RequestPayment requests payment for the PPM

func (*PersonallyProcuredMove) Submit

func (p *PersonallyProcuredMove) Submit(submitDate time.Time) error

Submit marks the PPM request for review

func (*PersonallyProcuredMove) Validate

func (p *PersonallyProcuredMove) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*PersonallyProcuredMove) ValidateCreate

func (p *PersonallyProcuredMove) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*PersonallyProcuredMove) ValidateUpdate

func (p *PersonallyProcuredMove) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type PersonallyProcuredMoves

type PersonallyProcuredMoves []PersonallyProcuredMove

PersonallyProcuredMoves is a list of PPMs

type PostalCodeToGBLOC

type PostalCodeToGBLOC struct {
	ID         uuid.UUID `db:"id"`
	PostalCode string    `db:"postal_code"`
	GBLOC      string    `db:"gbloc"`
	CreatedAt  time.Time `db:"created_at"`
	UpdatedAt  time.Time `db:"updated_at"`
}

PostalCodeToGBLOC is a mapping from Postal Codes to GBLOCs

type PostalCodeToGBLOCs

type PostalCodeToGBLOCs []PostalCodeToGBLOC

PostalCodeToGBLOCs is not required by pop and may be deleted

type PrimeUpload

type PrimeUpload struct {
	ID                  uuid.UUID         `db:"id"`
	ProofOfServiceDocID uuid.UUID         `db:"proof_of_service_docs_id"`
	ProofOfServiceDoc   ProofOfServiceDoc `belongs_to:"proof_of_service_docs" fk_id:"proof_of_service_docs_id"`
	ContractorID        uuid.UUID         `db:"contractor_id"`
	Contractor          Contractor        `belongs_to:"contractors" fk_id:"contractor_id"`
	UploadID            uuid.UUID         `db:"upload_id"`
	Upload              Upload            `belongs_to:"uploads" fk_id:"upload_id"`
	CreatedAt           time.Time         `db:"created_at"`
	UpdatedAt           time.Time         `db:"updated_at"`
	DeletedAt           *time.Time        `db:"deleted_at"`
}

An PrimeUpload represents an user uploaded file, such as an image or PDF.

func FetchPrimeUpload

func FetchPrimeUpload(db *pop.Connection, contractorID uuid.UUID, id uuid.UUID) (PrimeUpload, error)

FetchPrimeUpload returns an PrimeUpload if the contractor has access to that upload

func (*PrimeUpload) Validate

func (u *PrimeUpload) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type PrimeUploads

type PrimeUploads []PrimeUpload

PrimeUploads is not required by pop and may be deleted

type ProGearStatus

type ProGearStatus string

ProGearStatus represents the status of a pro-gear question

const (
	// ProGearStatusYes captures enum value "YES"
	ProGearStatusYes ProGearStatus = "YES"
	// ProGearStatusNo captures enum value "NO"
	ProGearStatusNo ProGearStatus = "NO"
	// ProGearStatusNotSure captures enum value "YES"
	ProGearStatusNotSure ProGearStatus = "NOT SURE"
)

type ProgearWeightTicket

type ProgearWeightTicket struct {
	ID               uuid.UUID          `json:"id" db:"id"`
	PPMShipmentID    uuid.UUID          `json:"ppm_shipment_id" db:"ppm_shipment_id"`
	PPMShipment      PPMShipment        `belongs_to:"ppm_shipments" fk_id:"ppm_shipment_id"`
	BelongsToSelf    *bool              `json:"belongs_to_self" db:"belongs_to_self"`
	Description      *string            `json:"description" db:"description"`
	HasWeightTickets *bool              `json:"has_weight_tickets" db:"has_weight_tickets"`
	Weight           *unit.Pound        `json:"weight" db:"weight"`
	DocumentID       uuid.UUID          `json:"document_id" db:"document_id"`
	Document         Document           `belongs_to:"documents" fk_id:"document_id"`
	Status           *PPMDocumentStatus `json:"status" db:"status"`
	Reason           *string            `json:"reason" db:"reason"`
	CreatedAt        time.Time          `json:"created_at" db:"created_at"`
	UpdatedAt        time.Time          `json:"updated_at" db:"updated_at"`
	DeletedAt        *time.Time         `json:"deleted_at" db:"deleted_at"`
}

func (*ProgearWeightTicket) Validate

func (p *ProgearWeightTicket) Validate(_ *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This should contain validation that is for data integrity. Business validation should occur in service objects.

type ProgearWeightTickets

type ProgearWeightTickets []ProgearWeightTicket

type ProofOfServiceDoc

type ProofOfServiceDoc struct {
	ID               uuid.UUID `json:"id" db:"id"`
	PaymentRequestID uuid.UUID `json:"payment_request_id" db:"payment_request_id"`
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`

	//Associations
	PaymentRequest PaymentRequest `belongs_to:"payment_request" fk_id:"payment_request_id"`
	PrimeUploads   PrimeUploads   `has_many:"prime_uploads" fk_id:"proof_of_service_docs_id" order_by:"created_at asc"`
}

ProofOfServiceDoc represents a document for proof of service

func (*ProofOfServiceDoc) Validate

func (p *ProofOfServiceDoc) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type ProofOfServiceDocs

type ProofOfServiceDocs []ProofOfServiceDoc

ProofOfServiceDocs is not required by pop and may be deleted

type ReContract

type ReContract struct {
	ID        uuid.UUID `json:"id" db:"id"`
	Code      string    `json:"code" db:"code"`
	Name      string    `json:"name" db:"name"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}

ReContract represents a contract with pricing information

func (*ReContract) Validate

func (r *ReContract) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReContractYear

type ReContractYear struct {
	ID                   uuid.UUID `json:"id" db:"id"`
	ContractID           uuid.UUID `json:"contract_id" db:"contract_id"`
	Name                 string    `json:"name" db:"name"`
	StartDate            time.Time `json:"start_date" db:"start_date"`
	EndDate              time.Time `json:"end_date" db:"end_date"`
	Escalation           float64   `json:"escalation" db:"escalation"`
	EscalationCompounded float64   `json:"escalation_compounded" db:"escalation_compounded"`
	CreatedAt            time.Time `json:"created_at" db:"created_at"`
	UpdatedAt            time.Time `json:"updated_at" db:"updated_at"`

	// Associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
}

ReContractYear represents a single "year" of a contract

func (*ReContractYear) Validate

func (r *ReContractYear) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReContractYears

type ReContractYears []ReContractYear

ReContractYears is not required by pop and may be deleted

type ReContracts

type ReContracts []ReContract

ReContracts is not required by pop and may be deleted

type ReDomesticAccessorialPrice

type ReDomesticAccessorialPrice struct {
	ID               uuid.UUID  `json:"id" db:"id"`
	ContractID       uuid.UUID  `json:"contract_id" db:"contract_id"`
	ServiceID        uuid.UUID  `json:"service_id" db:"service_id"`
	ServicesSchedule int        `json:"services_schedule" db:"services_schedule"`
	PerUnitCents     unit.Cents `json:"per_unit_cents" db:"per_unit_cents"`
	CreatedAt        time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at" db:"updated_at"`

	//associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
	Service  ReService  `belongs_to:"re_service" fk_id:"service_id"`
}

ReDomesticAccessorialPrice model struct

func (*ReDomesticAccessorialPrice) Validate

func (r *ReDomesticAccessorialPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReDomesticAccessorialPrices

type ReDomesticAccessorialPrices []ReDomesticAccessorialPrice

ReDomesticAccessorialPrices is not required by pop and may be deleted

type ReDomesticLinehaulPrice

type ReDomesticLinehaulPrice struct {
	ID                    uuid.UUID       `json:"id" db:"id"`
	ContractID            uuid.UUID       `json:"contract_id" db:"contract_id"`
	WeightLower           unit.Pound      `json:"weight_lower" db:"weight_lower"`
	WeightUpper           unit.Pound      `json:"weight_upper" db:"weight_upper"`
	MilesLower            int             `json:"miles_lower" db:"miles_lower"`
	MilesUpper            int             `json:"miles_upper" db:"miles_upper"`
	IsPeakPeriod          bool            `json:"is_peak_period" db:"is_peak_period"`
	DomesticServiceAreaID uuid.UUID       `json:"domestic_service_area_id" db:"domestic_service_area_id"`
	PriceMillicents       unit.Millicents `json:"price_millicents" db:"price_millicents"`
	CreatedAt             time.Time       `json:"created_at" db:"created_at"`
	UpdatedAt             time.Time       `json:"updated_at" db:"updated_at"`

	// Associations
	Contract            ReContract            `belongs_to:"re_contract" fk_id:"contract_id"`
	DomesticServiceArea ReDomesticServiceArea `belongs_to:"re_domestic_service_area" fk_id:"domestic_service_area_id"`
}

ReDomesticLinehaulPrice represents a domestic linehaul price based on weight, mileage, etc.

func (*ReDomesticLinehaulPrice) Validate

func (r *ReDomesticLinehaulPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReDomesticLinehaulPrices

type ReDomesticLinehaulPrices []ReDomesticLinehaulPrice

ReDomesticLinehaulPrices is not required by pop and may be deleted

type ReDomesticOtherPrice

type ReDomesticOtherPrice struct {
	ID           uuid.UUID  `json:"id" db:"id"`
	ContractID   uuid.UUID  `json:"contract_id" db:"contract_id"`
	ServiceID    uuid.UUID  `json:"service_id" db:"service_id"`
	IsPeakPeriod bool       `json:"is_peak_period" db:"is_peak_period"`
	Schedule     int        `json:"schedule" db:"schedule"`
	PriceCents   unit.Cents `json:"price_cents" db:"price_cents"`
	CreatedAt    time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at" db:"updated_at"`

	// Associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
	Service  ReService  `belongs_to:"re_service" fk_id:"service_id"`
}

ReDomesticOtherPrice represents a domestic service area price based on date, service area, etc.

func (*ReDomesticOtherPrice) Validate

func (r *ReDomesticOtherPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReDomesticOtherPrices

type ReDomesticOtherPrices []ReDomesticOtherPrice

ReDomesticOtherPrices is not required by pop and may be deleted

type ReDomesticServiceArea

type ReDomesticServiceArea struct {
	ID               uuid.UUID `json:"id" db:"id"`
	ContractID       uuid.UUID `json:"contract_id" db:"contract_id"`
	ServiceArea      string    `json:"service_area" db:"service_area"`
	ServicesSchedule int       `json:"services_schedule" db:"services_schedule"`
	SITPDSchedule    int       `json:"sit_pd_schedule" db:"sit_pd_schedule"`
	CreatedAt        time.Time `json:"created_at" db:"created_at"`
	UpdatedAt        time.Time `json:"updated_at" db:"updated_at"`

	// Associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
}

ReDomesticServiceArea model struct

func (*ReDomesticServiceArea) Validate

func (r *ReDomesticServiceArea) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReDomesticServiceAreaPrice

type ReDomesticServiceAreaPrice struct {
	ID                    uuid.UUID  `json:"id" db:"id"`
	ContractID            uuid.UUID  `json:"contract_id" db:"contract_id"`
	ServiceID             uuid.UUID  `json:"service_id" db:"service_id"`
	IsPeakPeriod          bool       `json:"is_peak_period" db:"is_peak_period"`
	DomesticServiceAreaID uuid.UUID  `json:"domestic_service_area_id" db:"domestic_service_area_id"`
	PriceCents            unit.Cents `json:"price_cents" db:"price_cents"`
	CreatedAt             time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt             time.Time  `json:"updated_at" db:"updated_at"`

	// Associations
	Contract            ReContract            `belongs_to:"re_contract" fk_id:"contract_id"`
	Service             ReService             `belongs_to:"re_service" fk_id:"service_id"`
	DomesticServiceArea ReDomesticServiceArea `belongs_to:"re_domestic_service_area" fk_id:"domestic_service_area_id"`
}

ReDomesticServiceAreaPrice represents a domestic service area price based on date, service area, etc.

func (*ReDomesticServiceAreaPrice) Validate

func (r *ReDomesticServiceAreaPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReDomesticServiceAreaPrices

type ReDomesticServiceAreaPrices []ReDomesticServiceAreaPrice

ReDomesticServiceAreaPrices is not required by pop and may be deleted

type ReDomesticServiceAreas

type ReDomesticServiceAreas []ReDomesticServiceArea

ReDomesticServiceAreas is not required by pop and may be deleted

type ReIntlAccessorialPrice

type ReIntlAccessorialPrice struct {
	ID           uuid.UUID  `json:"id" db:"id"`
	ContractID   uuid.UUID  `json:"contract_id" db:"contract_id"`
	ServiceID    uuid.UUID  `json:"service_id" db:"service_id"`
	Market       Market     `json:"market" db:"market"`
	PerUnitCents unit.Cents `json:"per_unit_cents" db:"per_unit_cents"`
	CreatedAt    time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at" db:"updated_at"`

	//associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
	Service  ReService  `belongs_to:"re_service" fk_id:"service_id"`
}

ReIntlAccessorialPrice model struct

func (*ReIntlAccessorialPrice) Validate

func (r *ReIntlAccessorialPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReIntlAccessorialPrices

type ReIntlAccessorialPrices []ReIntlAccessorialPrice

ReIntlAccessorialPrices is not required by pop and may be deleted

type ReIntlOtherPrice

type ReIntlOtherPrice struct {
	ID           uuid.UUID  `json:"id" db:"id"`
	ContractID   uuid.UUID  `json:"contract_id" db:"contract_id"`
	ServiceID    uuid.UUID  `json:"service_id" db:"service_id"`
	RateAreaID   uuid.UUID  `json:"rate_area_id" db:"rate_area_id"`
	IsPeakPeriod bool       `json:"is_peak_period" db:"is_peak_period"`
	PerUnitCents unit.Cents `json:"per_unit_cents" db:"per_unit_cents"`
	CreatedAt    time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at" db:"updated_at"`

	// Associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
	Service  ReService  `belongs_to:"re_service" fk_id:"service_id"`
	RateArea ReRateArea `belongs_to:"re_rate_area" fk_id:"rate_area_id"`
}

ReIntlOtherPrice is the ghc rate engine international price

func (*ReIntlOtherPrice) Validate

func (p *ReIntlOtherPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type ReIntlOtherPrices

type ReIntlOtherPrices []ReIntlOtherPrice

ReIntlOtherPrices is a slice of ReIntlOtherPrice

type ReIntlPrice

type ReIntlPrice struct {
	ID                    uuid.UUID  `json:"id" db:"id"`
	ContractID            uuid.UUID  `json:"contract_id" db:"contract_id"`
	ServiceID             uuid.UUID  `json:"service_id" db:"service_id"`
	OriginRateAreaID      uuid.UUID  `json:"origin_rate_area_id" db:"origin_rate_area_id"`
	DestinationRateAreaID uuid.UUID  `json:"destination_rate_area_id" db:"destination_rate_area_id"`
	IsPeakPeriod          bool       `json:"is_peak_period" db:"is_peak_period"`
	PerUnitCents          unit.Cents `json:"per_unit_cents" db:"per_unit_cents"`
	CreatedAt             time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt             time.Time  `json:"updated_at" db:"updated_at"`

	// Associations
	Contract            ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
	Service             ReService  `belongs_to:"re_service" fk_id:"service_id"`
	OriginRateArea      ReRateArea `belongs_to:"re_rate_area" fk_id:"origin_rate_area_id"`
	DestinationRateArea ReRateArea `belongs_to:"re_rate_area" fk_id:"destination_rate_area_id"`
}

ReIntlPrice is the ghc rate engine international price

func (*ReIntlPrice) Validate

func (p *ReIntlPrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type ReIntlPrices

type ReIntlPrices []ReIntlPrice

ReIntlPrices is a slice of ReIntlPrice objects

type ReRateArea

type ReRateArea struct {
	ID         uuid.UUID `json:"id" db:"id"`
	ContractID uuid.UUID `json:"contract_id" db:"contract_id"`
	IsOconus   bool      `json:"is_oconus" db:"is_oconus"`
	Code       string    `json:"code" db:"code"`
	Name       string    `json:"name" db:"name"`
	CreatedAt  time.Time `json:"created_at" db:"created_at"`
	UpdatedAt  time.Time `json:"updated_at" db:"updated_at"`

	// Associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
}

ReRateArea model struct

func FetchReRateAreaItem

func FetchReRateAreaItem(tx *pop.Connection, contractID uuid.UUID, code string) (*ReRateArea, error)

FetchReRateAreaItem returns an area for a matching code

func (*ReRateArea) Validate

func (r *ReRateArea) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReRateAreas

type ReRateAreas []ReRateArea

ReRateAreas is not required by pop and may be deleted

type ReService

type ReService struct {
	ID        uuid.UUID     `json:"id" db:"id"`
	Code      ReServiceCode `json:"code" db:"code"`
	Priority  int           `db:"priority"`
	Name      string        `json:"name" db:"name"`
	CreatedAt time.Time     `json:"created_at" db:"created_at"`
	UpdatedAt time.Time     `json:"updated_at" db:"updated_at"`
}

ReService model struct

func (*ReService) Validate

func (r *ReService) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReServiceCode

type ReServiceCode string

ReServiceCode is the code of service

const (
	// ReServiceCodeCS Counseling
	ReServiceCodeCS ReServiceCode = "CS"
	// ReServiceCodeDBHF Domestic haul away boat factor
	ReServiceCodeDBHF ReServiceCode = "DBHF"
	// ReServiceCodeDBTF Domestic tow away boat factor
	ReServiceCodeDBTF ReServiceCode = "DBTF"
	// ReServiceCodeDCRT Domestic crating
	ReServiceCodeDCRT ReServiceCode = "DCRT"
	// ReServiceCodeDCRTSA Domestic crating - standalone
	ReServiceCodeDCRTSA ReServiceCode = "DCRTSA"
	// ReServiceCodeDDASIT Domestic destination add'l SIT
	ReServiceCodeDDASIT ReServiceCode = "DDASIT"
	// ReServiceCodeDDDSIT Domestic destination SIT delivery
	ReServiceCodeDDDSIT ReServiceCode = "DDDSIT"
	// ReServiceCodeDDFSIT Domestic destination 1st day SIT
	ReServiceCodeDDFSIT ReServiceCode = "DDFSIT"
	// ReServiceCodeDDP Domestic destination price
	ReServiceCodeDDP ReServiceCode = "DDP"
	// ReServiceCodeDDSHUT Domestic destination shuttle service
	ReServiceCodeDDSHUT ReServiceCode = "DDSHUT"
	// ReServiceCodeDLH Domestic linehaul
	ReServiceCodeDLH ReServiceCode = "DLH"
	// ReServiceCodeDMHF Domestic mobile home factor
	ReServiceCodeDMHF ReServiceCode = "DMHF"
	// ReServiceCodeDNPK Domestic NTS packing
	ReServiceCodeDNPK ReServiceCode = "DNPK"
	// ReServiceCodeDOASIT Domestic origin add'l SIT
	ReServiceCodeDOASIT ReServiceCode = "DOASIT"
	// ReServiceCodeDOFSIT Domestic origin 1st day SIT
	ReServiceCodeDOFSIT ReServiceCode = "DOFSIT"
	// ReServiceCodeDOP Domestic origin price
	ReServiceCodeDOP ReServiceCode = "DOP"
	// ReServiceCodeDOPSIT Domestic origin SIT pickup
	ReServiceCodeDOPSIT ReServiceCode = "DOPSIT"
	// ReServiceCodeDOSHUT Domestic origin shuttle service
	ReServiceCodeDOSHUT ReServiceCode = "DOSHUT"
	// ReServiceCodeDPK Domestic packing
	ReServiceCodeDPK ReServiceCode = "DPK"
	// ReServiceCodeDSH Domestic shorthaul
	ReServiceCodeDSH ReServiceCode = "DSH"
	// ReServiceCodeDUCRT Domestic uncrating
	ReServiceCodeDUCRT ReServiceCode = "DUCRT"
	// ReServiceCodeDUPK Domestic unpacking
	ReServiceCodeDUPK ReServiceCode = "DUPK"
	// ReServiceCodeFSC Fuel Surcharge
	ReServiceCodeFSC ReServiceCode = "FSC"
	// ReServiceCodeIBHF International haul away boat factor
	ReServiceCodeIBHF ReServiceCode = "IBHF"
	// ReServiceCodeIBTF International tow away boat factor
	ReServiceCodeIBTF ReServiceCode = "IBTF"
	// ReServiceCodeICOLH International C->O shipping & LH
	ReServiceCodeICOLH ReServiceCode = "ICOLH"
	// ReServiceCodeICOUB International C->O UB
	ReServiceCodeICOUB ReServiceCode = "ICOUB"
	// ReServiceCodeICRT International crating
	ReServiceCodeICRT ReServiceCode = "ICRT"
	// ReServiceCodeICRTSA International crating - standalone
	ReServiceCodeICRTSA ReServiceCode = "ICRTSA"
	// ReServiceCodeIDASIT International destination add'l day SIT
	ReServiceCodeIDASIT ReServiceCode = "IDASIT"
	// ReServiceCodeIDDSIT International destination SIT delivery
	ReServiceCodeIDDSIT ReServiceCode = "IDDSIT"
	// ReServiceCodeIDFSIT International destination 1st day SIT
	ReServiceCodeIDFSIT ReServiceCode = "IDFSIT"
	// ReServiceCodeIDSHUT International destination shuttle service
	ReServiceCodeIDSHUT ReServiceCode = "IDSHUT"
	// ReServiceCodeIHPK International HHG pack
	ReServiceCodeIHPK ReServiceCode = "IHPK"
	// ReServiceCodeIHUPK International HHG unpack
	ReServiceCodeIHUPK ReServiceCode = "IHUPK"
	// ReServiceCodeINPK International NTS packing
	ReServiceCodeINPK ReServiceCode = "INPK"
	// ReServiceCodeIOASIT International origin add'l day SIT
	ReServiceCodeIOASIT ReServiceCode = "IOASIT"
	// ReServiceCodeIOCLH International O->C shipping & LH
	ReServiceCodeIOCLH ReServiceCode = "IOCLH"
	// ReServiceCodeIOCUB International O->C UB
	ReServiceCodeIOCUB ReServiceCode = "IOCUB"
	// ReServiceCodeIOFSIT International origin 1st day SIT
	ReServiceCodeIOFSIT ReServiceCode = "IOFSIT"
	// ReServiceCodeIOOLH International O->O shipping & LH
	ReServiceCodeIOOLH ReServiceCode = "IOOLH"
	// ReServiceCodeIOOUB International O->O UB
	ReServiceCodeIOOUB ReServiceCode = "IOOUB"
	// ReServiceCodeIOPSIT International origin SIT pickup
	ReServiceCodeIOPSIT ReServiceCode = "IOPSIT"
	// ReServiceCodeIOSHUT International origin shuttle service
	ReServiceCodeIOSHUT ReServiceCode = "IOSHUT"
	// ReServiceCodeIUBPK International UB pack
	ReServiceCodeIUBPK ReServiceCode = "IUBPK"
	// ReServiceCodeIUBUPK International UB unpack
	ReServiceCodeIUBUPK ReServiceCode = "IUBUPK"
	// ReServiceCodeIUCRT International uncrating
	ReServiceCodeIUCRT ReServiceCode = "IUCRT"
	// ReServiceCodeMS Move management
	ReServiceCodeMS ReServiceCode = "MS"
	// ReServiceCodeNSTH Nonstandard HHG
	ReServiceCodeNSTH ReServiceCode = "NSTH"
	// ReServiceCodeNSTUB Nonstandard UB
	ReServiceCodeNSTUB ReServiceCode = "NSTUB"
)

func (ReServiceCode) String

func (r ReServiceCode) String() string

type ReServices

type ReServices []ReService

ReServices is not required by pop and may be deleted

type ReShipmentTypePrice

type ReShipmentTypePrice struct {
	ID         uuid.UUID `json:"id" db:"id"`
	ContractID uuid.UUID `json:"contract_id" db:"contract_id"`
	ServiceID  uuid.UUID `json:"service_id" db:"service_id"`
	Market     Market    `json:"market" db:"market"`
	Factor     float64   `json:"factor" db:"factor"`
	CreatedAt  time.Time `json:"created_at" db:"created_at"`
	UpdatedAt  time.Time `json:"updated_at" db:"updated_at"`

	//Associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
	Service  ReService  `belongs_to:"re_service" fk_id:"service_id"`
}

ReShipmentTypePrice model struct

func (*ReShipmentTypePrice) Validate

func (r *ReShipmentTypePrice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReShipmentTypePrices

type ReShipmentTypePrices []ReShipmentTypePrice

ReShipmentTypePrices is not required by pop and may be deleted

type ReTaskOrderFee

type ReTaskOrderFee struct {
	ID             uuid.UUID  `json:"id" db:"id"`
	ContractYearID uuid.UUID  `json:"contract_year_id" db:"contract_year_id"`
	ServiceID      uuid.UUID  `json:"service_id" db:"service_id"`
	PriceCents     unit.Cents `json:"price_cents" db:"price_cents"`
	CreatedAt      time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at" db:"updated_at"`

	//Associations
	ContractYear ReContractYear `belongs_to:"re_contract_year" fk_id:"contract_year_id"`
	Service      ReService      `belongs_to:"re_service" fk_id:"service_id"`
}

ReTaskOrderFee model struct

func (*ReTaskOrderFee) Validate

func (r *ReTaskOrderFee) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReTaskOrderFees

type ReTaskOrderFees []ReTaskOrderFee

ReTaskOrderFees is not required by pop and may be deleted

type ReZip3

type ReZip3 struct {
	ID                    uuid.UUID  `json:"id" db:"id"`
	ContractID            uuid.UUID  `json:"contract_id" db:"contract_id"`
	Zip3                  string     `json:"zip3" db:"zip3"`
	BasePointCity         string     `json:"base_point_city" db:"base_point_city"`
	State                 string     `json:"state" db:"state"`
	DomesticServiceAreaID uuid.UUID  `json:"domestic_service_area_id" db:"domestic_service_area_id"`
	RateAreaID            *uuid.UUID `json:"rate_area_id" db:"rate_area_id"`
	HasMultipleRateAreas  bool       `json:"has_multiple_rate_areas" db:"has_multiple_rate_areas"`
	CreatedAt             time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt             time.Time  `json:"updated_at" db:"updated_at"`

	// Associations
	Contract            ReContract            `belongs_to:"re_contract" fk_id:"contract_id"`
	DomesticServiceArea ReDomesticServiceArea `belongs_to:"re_domestic_service_areas" fk_id:"domestic_service_area_id"`
	RateArea            *ReRateArea           `belongs_to:"re_rate_areas" fk_id:"rate_area_id"`
}

ReZip3 model struct

func (*ReZip3) Validate

func (r *ReZip3) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReZip3s

type ReZip3s []ReZip3

ReZip3s is not required by pop and may be deleted

type ReZip5RateArea

type ReZip5RateArea struct {
	ID         uuid.UUID `json:"id" db:"id"`
	ContractID uuid.UUID `json:"contract_id" db:"contract_id"`
	Zip5       string    `json:"zip5" db:"zip5"`
	RateAreaID uuid.UUID `json:"rate_area_id" db:"rate_area_id"`
	CreatedAt  time.Time `json:"created_at" db:"created_at"`
	UpdatedAt  time.Time `json:"updated_at" db:"updated_at"`

	// Associations
	Contract ReContract `belongs_to:"re_contract" fk_id:"contract_id"`
	RateArea ReRateArea `belongs_to:"re_rate_areas" fk_id:"rate_area_id"`
}

ReZip5RateArea model struct

func (*ReZip5RateArea) Validate

func (r *ReZip5RateArea) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type ReZip5RateAreas

type ReZip5RateAreas []ReZip5RateArea

ReZip5RateAreas is not required by pop and may be deleted

type Reimbursement

type Reimbursement struct {
	ID              uuid.UUID           `json:"id" db:"id"`
	CreatedAt       time.Time           `json:"created_at" db:"created_at"`
	UpdatedAt       time.Time           `json:"updated_at" db:"updated_at"`
	RequestedAmount unit.Cents          `json:"requested_amount" db:"requested_amount"`
	MethodOfReceipt MethodOfReceipt     `json:"method_of_receipt" db:"method_of_receipt"`
	Status          ReimbursementStatus `json:"status" db:"status"`
	RequestedDate   *time.Time          `json:"requested_date" db:"requested_date"`
}

Reimbursement is money that is intended to be paid to the servicemember

func BuildDraftReimbursement

func BuildDraftReimbursement(requestedAmount unit.Cents, methodOfReceipt MethodOfReceipt) Reimbursement

BuildDraftReimbursement makes a Reimbursement in the DRAFT state, but does not save it

func BuildRequestedReimbursement

func BuildRequestedReimbursement(requestedAmount unit.Cents, methodOfReceipt MethodOfReceipt) Reimbursement

BuildRequestedReimbursement makes a Reimbursement in the REQUEST state, but does not save it This will be useful for reimbursements that are filed after the initial move is created

func FetchReimbursement

func FetchReimbursement(db *pop.Connection, session *auth.Session, id uuid.UUID) (*Reimbursement, error)

FetchReimbursement Fetches and Validates a Reimbursement model

func (*Reimbursement) Approve

func (r *Reimbursement) Approve() error

Approve approves the Reimbursement

func (*Reimbursement) Pay

func (r *Reimbursement) Pay() error

Pay pays the Reimbursement

func (*Reimbursement) Reject

func (r *Reimbursement) Reject() error

Reject rejects the Reimbursement

func (*Reimbursement) Request

func (r *Reimbursement) Request() error

Request officially requests the reimbursement.

func (Reimbursement) TableName

func (r Reimbursement) TableName() string

func (*Reimbursement) Validate

func (r *Reimbursement) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Reimbursement) ValidateCreate

func (r *Reimbursement) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Reimbursement) ValidateUpdate

func (r *Reimbursement) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type ReimbursementStatus

type ReimbursementStatus string

ReimbursementStatus is the status of the Reimbursement

const (
	// ReimbursementStatusDRAFT captures enum value "DRAFT"
	ReimbursementStatusDRAFT ReimbursementStatus = "DRAFT"
	// ReimbursementStatusREQUESTED captures enum value "REQUESTED"
	ReimbursementStatusREQUESTED ReimbursementStatus = "REQUESTED"
	// ReimbursementStatusAPPROVED captures enum value "APPROVED"
	ReimbursementStatusAPPROVED ReimbursementStatus = "APPROVED"
	// ReimbursementStatusREJECTED captures enum value "REJECTED"
	ReimbursementStatusREJECTED ReimbursementStatus = "REJECTED"
	// ReimbursementStatusPAID captures enum value "PAID"
	ReimbursementStatusPAID ReimbursementStatus = "PAID"
)

type Reimbursements

type Reimbursements []Reimbursement

Reimbursements is not required by pop and may be deleted

type ReportViolation

type ReportViolation struct {
	ID          uuid.UUID        `json:"id" db:"id"`
	ReportID    uuid.UUID        `json:"report_id" db:"report_id"`
	Report      EvaluationReport `belongs_to:"evaluation_report" fk_id:"report_id"`
	Violation   PWSViolation     `belongs_to:"pws_violations" fk_id:"violation_id"`
	ViolationID uuid.UUID        `json:"violation_id" db:"violation_id"`
}

func (*ReportViolation) TableName

func (r *ReportViolation) TableName() string

func (*ReportViolation) Validate

func (r *ReportViolation) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type ReportViolations

type ReportViolations []ReportViolation

EvaluationReports is not required by pop and may be deleted

type Reweigh

type Reweigh struct {
	ID                     uuid.UUID        `db:"id"`
	RequestedAt            time.Time        `db:"requested_at"`
	RequestedBy            ReweighRequester `db:"requested_by"`
	Shipment               MTOShipment      `belongs_to:"mto_shipments" fk_id:"shipment_id"`
	ShipmentID             uuid.UUID        `db:"shipment_id"`
	VerificationProvidedAt *time.Time       `db:"verification_provided_at"`
	VerificationReason     *string          `db:"verification_reason"`
	Weight                 *unit.Pound      `db:"weight"`
	CreatedAt              time.Time        `db:"created_at"`
	UpdatedAt              time.Time        `db:"updated_at"`
}

Reweigh represents a request for the prime mover to reweigh a shipment or provide verification why they could not

func (*Reweigh) Validate

func (r *Reweigh) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate ensures the reweigh fields have the required and optional valid values prior to saving

type ReweighRequester

type ReweighRequester string

ReweighRequester is the actor who initiated the reweigh request for the shipment

const (
	// ReweighRequesterCustomer represents the customer requesting a reweigh
	ReweighRequesterCustomer ReweighRequester = "CUSTOMER"
	// ReweighRequesterPrime represents the prime mover requesting a reweigh
	ReweighRequesterPrime ReweighRequester = "PRIME"
	// ReweighRequesterSystem represents the milmove system triggering a reweigh
	ReweighRequesterSystem ReweighRequester = "SYSTEM"
	// ReweighRequesterTOO represents the TOO office user requesting a reweigh
	ReweighRequesterTOO ReweighRequester = "TOO"
)

type RoleInclusion

type RoleInclusion struct {
	Name    string
	Field   AdminRole
	List    []AdminRole
	Message string
}

RoleInclusion is used to validate if a role is valid for inclusion

func (*RoleInclusion) IsValid

func (v *RoleInclusion) IsValid(errors *validate.Errors)

IsValid validates if RoleInclusion is valid

type SITExtension

type SITExtension struct {
	ID                uuid.UUID                 `db:"id"`
	MTOShipment       MTOShipment               `belongs_to:"mto_shipments" fk_id:"mto_shipment_id"`
	MTOShipmentID     uuid.UUID                 `db:"mto_shipment_id"`
	RequestReason     SITExtensionRequestReason `db:"request_reason"`
	ContractorRemarks *string                   `db:"contractor_remarks"`
	RequestedDays     int                       `db:"requested_days"`
	Status            SITExtensionStatus        `db:"status"`
	ApprovedDays      *int                      `db:"approved_days"`
	DecisionDate      *time.Time                `db:"decision_date"`
	OfficeRemarks     *string                   `db:"office_remarks"`
	CreatedAt         time.Time                 `db:"created_at"`
	UpdatedAt         time.Time                 `db:"updated_at"`
}

SITExtension struct representing one SIT extension request

func (SITExtension) TableName

func (m SITExtension) TableName() string

TableName overrides the table name used by Pop.

func (*SITExtension) Validate

func (m *SITExtension) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type SITExtensionRequestReason

type SITExtensionRequestReason string

SITExtensionRequestReason type for SIT Extension Request Reason

const (
	// SITExtensionRequestReasonSeriousIllnessMember is the sit extension request reason type for SIT extensions
	SITExtensionRequestReasonSeriousIllnessMember SITExtensionRequestReason = "SERIOUS_ILLNESS_MEMBER"
	// SITExtensionRequestReasonSeriousIllnessDependent is the sit extension request reason type for SIT extensions
	SITExtensionRequestReasonSeriousIllnessDependent SITExtensionRequestReason = "SERIOUS_ILLNESS_DEPENDENT"
	// SITExtensionRequestReasonImpendingAssignment is the sit extension request reason type for SIT extensions
	SITExtensionRequestReasonImpendingAssignment SITExtensionRequestReason = "IMPENDING_ASSIGNEMENT"
	// SITExtensionRequestReasonDirectedTemporaryDuty is the sit extension request reason type for SIT extensions
	SITExtensionRequestReasonDirectedTemporaryDuty SITExtensionRequestReason = "DIRECTED_TEMPORARY_DUTY"
	// SITExtensionRequestReasonNonavailabilityOfCivilianHousing is the sit extension request reason type for SIT extensions
	SITExtensionRequestReasonNonavailabilityOfCivilianHousing SITExtensionRequestReason = "NONAVAILABILITY_OF_CIVILIAN_HOUSING"
	// SITExtensionRequestReasonAwaitingCompletionOfResidence is the sit extension request reason type for SIT extensions
	SITExtensionRequestReasonAwaitingCompletionOfResidence SITExtensionRequestReason = "AWAITING_COMPLETION_OF_RESIDENCE"
	// SITExtensionRequestReasonOther is the sit extension request reason type for SIT extensions
	SITExtensionRequestReasonOther SITExtensionRequestReason = "OTHER"
)

type SITExtensionStatus

type SITExtensionStatus string

SITExtensionStatus type for SIT Extension status

const (
	// SITExtensionStatusPending is a SIT extension status
	SITExtensionStatusPending SITExtensionStatus = "PENDING"
	// SITExtensionStatusApproved is a SIT extension status
	SITExtensionStatusApproved SITExtensionStatus = "APPROVED"
	// SITExtensionStatusDenied is a SIT extension status
	SITExtensionStatusDenied SITExtensionStatus = "DENIED"
)

type SITExtensions

type SITExtensions []SITExtension

SITExtensions is a slice containing SITExtension

type SITLocationType

type SITLocationType string

SITLocationType represents whether the SIT at the origin or destination

const (
	// SITLocationTypeOrigin captures enum value "ORIGIN"
	SITLocationTypeOrigin SITLocationType = "ORIGIN"
	// SITLocationTypeDestination captures enum value "DESTINATION"
	SITLocationTypeDestination SITLocationType = "DESTINATION"
)

type SSWMaxWeightEntitlement

type SSWMaxWeightEntitlement struct {
	Entitlement   unit.Pound
	ProGear       unit.Pound
	SpouseProGear unit.Pound
	TotalWeight   unit.Pound
}

SSWMaxWeightEntitlement weight allotment for the shipment summary worksheet.

func SSWGetEntitlement

func SSWGetEntitlement(rank ServiceMemberRank, hasDependents bool, spouseHasProGear bool) SSWMaxWeightEntitlement

SSWGetEntitlement calculates the entitlement for the shipment summary worksheet based on the parameters of a move (hasDependents, spouseHasProGear)

type SelectedMoveType

type SelectedMoveType string

SelectedMoveType represents the type of move being represented

const (
	// MoveStatusHHG captures enum value "HHG" for House Hold Goods
	SelectedMoveTypeHHG SelectedMoveType = "HHG"
	// MoveStatusPPM captures enum value "PPM" for Personally Procured Move
	SelectedMoveTypePPM SelectedMoveType = "PPM"
	// MoveStatusUB captures enum value "UB" for Unaccompanied Baggage
	SelectedMoveTypeUB SelectedMoveType = "UB"
	// MoveStatusPOV captures enum value "POV" for Privately-Owned Vehicle
	SelectedMoveTypePOV SelectedMoveType = "POV"
	// MoveStatusNTS captures enum value "NTS" for Non-Temporary Storage
	SelectedMoveTypeNTS SelectedMoveType = NTSRaw
	// MoveStatusNTS captures enum value "NTS" for Non-Temporary Storage Release
	SelectedMoveTypeNTSR SelectedMoveType = NTSrRaw
	// MoveStatusHHGPPM captures enum value "HHG_PPM" for combination move HHG + PPM
	SelectedMoveTypeHHGPPM SelectedMoveType = "HHG_PPM"
)

This lists available move types in the system Combination move types like HHG+PPM should be added as an underscore separated list The list should be lexigraphically sorted. Ex: UB + PPM will always be 'PPM_UB'

func (SelectedMoveType) String

func (s SelectedMoveType) String() string

type ServiceItemParamKey

type ServiceItemParamKey struct {
	ID          uuid.UUID              `json:"id" db:"id"`
	Key         ServiceItemParamName   `json:"key" db:"key"`
	Description string                 `json:"description" db:"description"`
	Type        ServiceItemParamType   `json:"type" db:"type"`
	Origin      ServiceItemParamOrigin `json:"origin" db:"origin"`
	CreatedAt   time.Time              `db:"created_at"`
	UpdatedAt   time.Time              `db:"updated_at"`
}

ServiceItemParamKey is a key for a Service Item Param

func (*ServiceItemParamKey) Validate

func (s *ServiceItemParamKey) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate validates a ServiceItemParamKey

type ServiceItemParamKeys

type ServiceItemParamKeys []ServiceItemParamKey

ServiceItemParamKeys is not required by pop and may be deleted

type ServiceItemParamName

type ServiceItemParamName string

ServiceItemParamName is the name of service item parameter

const (
	// ServiceItemParamNameActualPickupDate is the param key name ActualPickupDate
	ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate"
	// ServiceItemParamNameContractCode is the param key name ContractCode
	ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode"
	// ServiceItemParamNameContractYearName is the param key name ContractYearName
	ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName"
	// ServiceItemParamNameCubicFeetBilled is the param key name CubicFeetBilled
	ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled"
	// ServiceItemParamNameCubicFeetCrating is the param key name CubicFeetCrating
	ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating"
	// ServiceItemParamNameDimensionHeight is the param key name DimensionHeight
	ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight"
	// ServiceItemParamNameDimensionLength is the param key name DimensionLength
	ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength"
	// ServiceItemParamNameDimensionWidth is the param key name DimensionWidth
	ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth"
	// ServiceItemParamNameDistanceZip is the param key name DistanceZip
	ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip"
	// ServiceItemParamNameDistanceZipSITDest is the param key name DistanceZipSITDest
	ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest"
	// ServiceItemParamNameDistanceZipSITOrigin is the param key name DistanceZipSITOrigin
	ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin"
	// ServiceItemParamNameEIAFuelPrice is the param key name EIAFuelPrice
	ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice"
	// ServiceItemParamNameEscalationCompounded is the param key name EscalationCompounded
	ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded"
	// ServiceItemParamNameFSCMultiplier is the param key name FSCMultiplier
	ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier"
	// ServiceItemParamNameFSCPriceDifferenceInCents is the param key name FSCPriceDifferenceInCents
	ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents"
	// ServiceItemParamNameFSCWeightBasedDistanceMultiplier is the param key name FSCWeightBasedDistanceMultiplier
	ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier"
	// ServiceItemParamNameIsPeak is the param key name IsPeak
	ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak"
	// ServiceItemParamNameMarketDest is the param key name MarketDest
	ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest"
	// ServiceItemParamNameMarketOrigin is the param key name MarketOrigin
	ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin"
	// ServiceItemParamNameMTOAvailableToPrimeAt is the param key name MTOAvailableToPrimeAt
	ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt"
	// ServiceItemParamNameNTSPackingFactor is the param key name NTSPackingFactor
	ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor"
	// ServiceItemParamNameNumberDaysSIT is the param key name NumberDaysSIT
	ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT"
	// ServiceItemParamNamePriceAreaDest is the param key name PriceAreaDest
	ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest"
	// ServiceItemParamNamePriceAreaIntlDest is the param key name PriceAreaIntlDest
	ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest"
	// ServiceItemParamNamePriceAreaIntlOrigin is the param key name PriceAreaIntlOrigin
	ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin"
	// ServiceItemParamNamePriceAreaOrigin is the param key name PriceAreaOrigin
	ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin"
	// ServiceItemParamNamePriceRateOrFactor is the param key name PriceRateOrFactor
	ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor"
	// ServiceItemParamNamePSILinehaulDom is the param key name PSI_LinehaulDom
	ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom"
	// ServiceItemParamNamePSILinehaulDomPrice is the param key name PSI_LinehaulDomPrice
	ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice"
	// ServiceItemParamNamePSILinehaulShort is the param key name PSI_LinehaulShort
	ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort"
	// ServiceItemParamNamePSILinehaulShortPrice is the param key name PSI_LinehaulShortPrice
	ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice"
	// ServiceItemParamNamePSIPriceDomDest is the param key name PSI_PriceDomDest
	ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest"
	// ServiceItemParamNamePSIPriceDomDestPrice is the param key name PSI_PriceDomDestPrice
	ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice"
	// ServiceItemParamNamePSIPriceDomOrigin is the param key name PSI_PriceDomOrigin
	ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin"
	// ServiceItemParamNamePSIPriceDomOriginPrice is the param key name PSI_PriceDomOriginPrice
	ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice"
	// ServiceItemParamNamePSIShippingLinehaulIntlCO is the param key name PSI_ShippingLinehaulIntlCO
	ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO"
	// ServiceItemParamNamePSIShippingLinehaulIntlCOPrice is the param key name PSI_ShippingLinehaulIntlCOPrice
	ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice"
	// ServiceItemParamNamePSIShippingLinehaulIntlOC is the param key name PSI_ShippingLinehaulIntlOC
	ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC"
	// ServiceItemParamNamePSIShippingLinehaulIntlOCPrice is the param key name PSI_ShippingLinehaulIntlOCPrice
	ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice"
	// ServiceItemParamNamePSIShippingLinehaulIntlOO is the param key name PSI_ShippingLinehaulIntlOO
	ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO"
	// ServiceItemParamNamePSIShippingLinehaulIntlOOPrice is the param key name PSI_ShippingLinehaulIntlOOPrice
	ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice"
	// ServiceItemParamNameRateAreaNonStdDest is the param key name RateAreaNonStdDest
	ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest"
	// ServiceItemParamNameRateAreaNonStdOrigin is the param key name RateAreaNonStdOrigin
	ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin"
	// ServiceItemParamNameReferenceDate is the param key name ReferenceDate
	ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate"
	// ServiceItemParamNameRequestedPickupDate is the param key name RequestedPickupDate
	ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate"
	// ServiceItemParamNameServiceAreaDest is the param key name ServiceAreaDest
	ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest"
	// ServiceItemParamNameServiceAreaOrigin is the param key name ServiceAreaOrigin
	ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin"
	// ServiceItemParamNameServicesScheduleDest is the param key name ServicesScheduleDest
	ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest"
	// ServiceItemParamNameServicesScheduleOrigin is the param key name ServicesScheduleOrigin
	ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin"
	// ServiceItemParamNameSITPaymentRequestEnd is the param key name SITPaymentRequestEnd
	ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd"
	// ServiceItemParamNameSITPaymentRequestStart is the param key name SITPaymentRequestStart
	ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart"
	// ServiceItemParamNameSITScheduleDest is the param key name SITScheduleDest
	ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest"
	// ServiceItemParamNameSITScheduleOrigin is the param key name SITScheduleOrigin
	ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin"
	// ServiceItemParamNameWeightAdjusted is the param key name WeightAdjusted
	ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted"
	// ServiceItemParamNameWeightBilled is the param key name WeightBilled
	ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled"
	// ServiceItemParamNameWeightEstimated is the param key name WeightEstimated
	ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated"
	// ServiceItemParamNameWeightOriginal is the param key name WeightOriginal
	ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal"
	// ServiceItemParamNameWeightReweigh is the param key name WeightReweigh
	ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh"
	// ServiceItemParamNameZipDestAddress is the param key name ZipDestAddress
	ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress"
	// ServiceItemParamNameZipPickupAddress is the param key name ZipPickupAddress
	ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress"
	// ServiceItemParamNameZipSITDestHHGFinalAddress is the param key name ZipSITDestHHGFinalAddress
	ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress"
	// ServiceItemParamNameZipSITOriginHHGActualAddress is the param key name ZipSITOriginHHGActualAddress
	ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress"
	// ServiceItemParamNameZipSITOriginHHGOriginalAddress is the param key name ZipSITOriginHHGOriginalAddress
	ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress"
)

func (ServiceItemParamName) String

func (s ServiceItemParamName) String() string

type ServiceItemParamOrigin

type ServiceItemParamOrigin string

ServiceItemParamOrigin is a type of service item parameter origin

const (
	// ServiceItemParamOriginPrime is the Prime origin
	ServiceItemParamOriginPrime ServiceItemParamOrigin = "PRIME"
	// ServiceItemParamOriginSystem is the System origin
	ServiceItemParamOriginSystem ServiceItemParamOrigin = "SYSTEM"
	// ServiceItemParamOriginPricer is the Pricer origin
	ServiceItemParamOriginPricer ServiceItemParamOrigin = "PRICER"
	// ServiceItemParamOriginPaymentRequest is the PaymentRequest origin
	ServiceItemParamOriginPaymentRequest ServiceItemParamOrigin = "PAYMENT_REQUEST"
)

func (ServiceItemParamOrigin) String

func (s ServiceItemParamOrigin) String() string

String is a string representation of a ServiceItemParamOrigin

type ServiceItemParamType

type ServiceItemParamType string

ServiceItemParamType is a type of service item parameter

const (
	// ServiceItemParamTypeString is a string
	ServiceItemParamTypeString ServiceItemParamType = "STRING"
	// ServiceItemParamTypeDate is a date
	ServiceItemParamTypeDate ServiceItemParamType = "DATE"
	// ServiceItemParamTypeInteger is an integer
	ServiceItemParamTypeInteger ServiceItemParamType = "INTEGER"
	// ServiceItemParamTypeDecimal is a decimal
	ServiceItemParamTypeDecimal ServiceItemParamType = "DECIMAL"
	// ServiceItemParamTypeTimestamp is a timestamp
	ServiceItemParamTypeTimestamp ServiceItemParamType = "TIMESTAMP"
	// ServiceItemParamTypePaymentServiceItemUUID is a UUID
	ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID"
	// ServiceItemParamTypeBoolean is a boolean
	ServiceItemParamTypeBoolean ServiceItemParamType = "BOOLEAN"
)

func (ServiceItemParamType) String

func (s ServiceItemParamType) String() string

String is a string representation of a ServiceItemParamType

type ServiceMember

type ServiceMember struct {
	ID                     uuid.UUID                 `json:"id" db:"id"`
	CreatedAt              time.Time                 `json:"created_at" db:"created_at"`
	UpdatedAt              time.Time                 `json:"updated_at" db:"updated_at"`
	UserID                 uuid.UUID                 `json:"user_id" db:"user_id"`
	User                   User                      `belongs_to:"user" fk_id:"user_id"`
	Edipi                  *string                   `json:"edipi" db:"edipi"`
	Affiliation            *ServiceMemberAffiliation `json:"affiliation" db:"affiliation"`
	Rank                   *ServiceMemberRank        `json:"rank" db:"rank"`
	FirstName              *string                   `json:"first_name" db:"first_name"`
	MiddleName             *string                   `json:"middle_name" db:"middle_name"`
	LastName               *string                   `json:"last_name" db:"last_name"`
	Suffix                 *string                   `json:"suffix" db:"suffix"`
	Telephone              *string                   `json:"telephone" db:"telephone"`
	SecondaryTelephone     *string                   `json:"secondary_telephone" db:"secondary_telephone"`
	PersonalEmail          *string                   `json:"personal_email" db:"personal_email"`
	PhoneIsPreferred       *bool                     `json:"phone_is_preferred" db:"phone_is_preferred"`
	EmailIsPreferred       *bool                     `json:"email_is_preferred" db:"email_is_preferred"`
	ResidentialAddressID   *uuid.UUID                `json:"residential_address_id" db:"residential_address_id"`
	ResidentialAddress     *Address                  `belongs_to:"address" fk_id:"residential_address_id"`
	BackupMailingAddressID *uuid.UUID                `json:"backup_mailing_address_id" db:"backup_mailing_address_id"`
	BackupMailingAddress   *Address                  `belongs_to:"address" fk_id:"backup_mailing_address_id"`
	Orders                 Orders                    `has_many:"orders" fk_id:"service_member_id" order_by:"created_at desc" `
	BackupContacts         BackupContacts            `has_many:"backup_contacts" fk_id:"service_member_id"`
	DutyLocationID         *uuid.UUID                `json:"duty_location_id" db:"duty_location_id"`
	DutyLocation           DutyLocation              `belongs_to:"duty_locations" fk_id:"duty_location_id"`
}

ServiceMember is a user of type service member

func FetchServiceMember

func FetchServiceMember(db *pop.Connection, id uuid.UUID) (ServiceMember, error)

FetchServiceMember returns a service member by id REGARDLESS OF USER. Does not fetch nested models. DO NOT USE IF YOU NEED USER AUTH

func FetchServiceMemberForUser

func FetchServiceMemberForUser(db *pop.Connection, session *auth.Session, id uuid.UUID) (ServiceMember, error)

FetchServiceMemberForUser returns a service member only if it is allowed for the given user to access that service member. This method is thereby a useful way of performing access control checks.

func GetCustomerFromShipment

func GetCustomerFromShipment(db *pop.Connection, shipmentID uuid.UUID) (*ServiceMember, error)

GetCustomerFromShipment gets the service member given a shipment id

func (ServiceMember) CreateBackupContact

func (s ServiceMember) CreateBackupContact(db *pop.Connection, name string, email string, phone *string, permission BackupContactPermission) (BackupContact, *validate.Errors, error)

CreateBackupContact creates a backup contact model tied to the service member

func (ServiceMember) CreateOrder

func (s ServiceMember) CreateOrder(appCtx appcontext.AppContext,
	issueDate time.Time,
	reportByDate time.Time,
	ordersType internalmessages.OrdersType,
	hasDependents bool,
	spouseHasProGear bool,
	newDutyLocation DutyLocation,
	ordersNumber *string,
	tac *string,
	sac *string,
	departmentIndicator *string,
	originDutyLocation *DutyLocation,
	grade *string,
	entitlement *Entitlement) (Order, *validate.Errors, error)

CreateOrder creates an order model tied to the service member

func (*ServiceMember) IsProfileComplete

func (s *ServiceMember) IsProfileComplete() bool

IsProfileComplete checks if the profile has been completely filled out

func (*ServiceMember) ReverseNameLineFormat

func (s *ServiceMember) ReverseNameLineFormat() string

ReverseNameLineFormat returns the service member's name as a string in Last, First, M format.

func (*ServiceMember) Validate

func (s *ServiceMember) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*ServiceMember) ValidateCreate

func (s *ServiceMember) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*ServiceMember) ValidateUpdate

func (s *ServiceMember) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type ServiceMemberAffiliation

type ServiceMemberAffiliation string

ServiceMemberAffiliation represents a service member's branch

const (
	// AffiliationARMY captures enum value "ARMY"
	AffiliationARMY ServiceMemberAffiliation = "ARMY"
	// AffiliationNAVY captures enum value "NAVY"
	AffiliationNAVY ServiceMemberAffiliation = "NAVY"
	// AffiliationMARINES captures enum value "MARINES"
	AffiliationMARINES ServiceMemberAffiliation = "MARINES"
	// AffiliationAIRFORCE captures enum value "AIR_FORCE"
	AffiliationAIRFORCE ServiceMemberAffiliation = "AIR_FORCE"
	// AffiliationCOASTGUARD captures enum value "COAST_GUARD"
	AffiliationCOASTGUARD ServiceMemberAffiliation = "COAST_GUARD"
)

func (ServiceMemberAffiliation) String

func (s ServiceMemberAffiliation) String() string

String is a string representation of a ServiceMemberAffiliation

type ServiceMemberRank

type ServiceMemberRank string

ServiceMemberRank represents a service member's rank

const (
	// ServiceMemberRankE1 captures enum value "E_1"
	ServiceMemberRankE1 ServiceMemberRank = "E_1"
	// ServiceMemberRankE2 captures enum value "E_2"
	ServiceMemberRankE2 ServiceMemberRank = "E_2"
	// ServiceMemberRankE3 captures enum value "E_3"
	ServiceMemberRankE3 ServiceMemberRank = "E_3"
	// ServiceMemberRankE4 captures enum value "E_4"
	ServiceMemberRankE4 ServiceMemberRank = "E_4"
	// ServiceMemberRankE5 captures enum value "E_5"
	ServiceMemberRankE5 ServiceMemberRank = "E_5"
	// ServiceMemberRankE6 captures enum value "E_6"
	ServiceMemberRankE6 ServiceMemberRank = "E_6"
	// ServiceMemberRankE7 captures enum value "E_7"
	ServiceMemberRankE7 ServiceMemberRank = "E_7"
	// ServiceMemberRankE8 captures enum value "E_8"
	ServiceMemberRankE8 ServiceMemberRank = "E_8"
	// ServiceMemberRankE9 captures enum value "E_9"
	ServiceMemberRankE9 ServiceMemberRank = "E_9"
	// ServiceMemberRankE9SPECIALSENIORENLISTED captures enum value "E_9_SPECIAL_SENIOR_ENLISTED"
	ServiceMemberRankE9SPECIALSENIORENLISTED ServiceMemberRank = "E_9_SPECIAL_SENIOR_ENLISTED"
	// ServiceMemberRankO1ACADEMYGRADUATE captures enum value "O_1_ACADEMY_GRADUATE"
	ServiceMemberRankO1ACADEMYGRADUATE ServiceMemberRank = "O_1_ACADEMY_GRADUATE"
	// ServiceMemberRankO2 captures enum value "O_2"
	ServiceMemberRankO2 ServiceMemberRank = "O_2"
	// ServiceMemberRankO3 captures enum value "O_3"
	ServiceMemberRankO3 ServiceMemberRank = "O_3"
	// ServiceMemberRankO4 captures enum value "O_4"
	ServiceMemberRankO4 ServiceMemberRank = "O_4"
	// ServiceMemberRankO5 captures enum value "O_5"
	ServiceMemberRankO5 ServiceMemberRank = "O_5"
	// ServiceMemberRankO6 captures enum value "O_6"
	ServiceMemberRankO6 ServiceMemberRank = "O_6"
	// ServiceMemberRankO7 captures enum value "O_7"
	ServiceMemberRankO7 ServiceMemberRank = "O_7"
	// ServiceMemberRankO8 captures enum value "O_8"
	ServiceMemberRankO8 ServiceMemberRank = "O_8"
	// ServiceMemberRankO9 captures enum value "O_9"
	ServiceMemberRankO9 ServiceMemberRank = "O_9"
	// ServiceMemberRankO10 captures enum value "O_10"
	ServiceMemberRankO10 ServiceMemberRank = "O_10"
	// ServiceMemberRankW1 captures enum value "W_1"
	ServiceMemberRankW1 ServiceMemberRank = "W_1"
	// ServiceMemberRankW2 captures enum value "W_2"
	ServiceMemberRankW2 ServiceMemberRank = "W_2"
	// ServiceMemberRankW3 captures enum value "W_3"
	ServiceMemberRankW3 ServiceMemberRank = "W_3"
	// ServiceMemberRankW4 captures enum value "W_4"
	ServiceMemberRankW4 ServiceMemberRank = "W_4"
	// ServiceMemberRankW5 captures enum value "W_5"
	ServiceMemberRankW5 ServiceMemberRank = "W_5"
	// ServiceMemberRankAVIATIONCADET captures enum value "AVIATION_CADET"
	ServiceMemberRankAVIATIONCADET ServiceMemberRank = "AVIATION_CADET"
	// ServiceMemberRankCIVILIANEMPLOYEE captures enum value "CIVILIAN_EMPLOYEE"
	ServiceMemberRankCIVILIANEMPLOYEE ServiceMemberRank = "CIVILIAN_EMPLOYEE"
	// ServiceMemberRankACADEMYCADET captures enum value "ACADEMY_CADET"
	ServiceMemberRankACADEMYCADET ServiceMemberRank = "ACADEMY_CADET"
	// ServiceMemberRankMIDSHIPMAN captures enum value "MIDSHIPMAN"
	ServiceMemberRankMIDSHIPMAN ServiceMemberRank = "MIDSHIPMAN"
)

type ServiceMembers

type ServiceMembers []ServiceMember

ServiceMembers is not required by pop and may be deleted

type ServiceParam

type ServiceParam struct {
	ID                    uuid.UUID `json:"id" db:"id"`
	ServiceID             uuid.UUID `json:"service_id" db:"service_id"`
	ServiceItemParamKeyID uuid.UUID `json:"service_item_param_key_id" db:"service_item_param_key_id"`
	IsOptional            bool      `json:"is_optional" db:"is_optional"`
	CreatedAt             time.Time `db:"created_at"`
	UpdatedAt             time.Time `db:"updated_at"`

	// Associations
	Service             ReService           `belongs_to:"re_service" fk_id:"service_id"`
	ServiceItemParamKey ServiceItemParamKey `belongs_to:"service_item_param_key" fk_id:"service_item_param_key_id"`
}

ServiceParam is a Service Parameter

func (*ServiceParam) Validate

func (p *ServiceParam) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type ServiceParams

type ServiceParams []ServiceParam

ServiceParams is not required by pop and may be deleted

type ShipmentSummaryFormData

type ShipmentSummaryFormData struct {
	ServiceMember           ServiceMember
	Order                   Order
	CurrentDutyLocation     DutyLocation
	NewDutyLocation         DutyLocation
	WeightAllotment         SSWMaxWeightEntitlement
	PersonallyProcuredMoves PersonallyProcuredMoves
	PreparationDate         time.Time
	Obligations             Obligations
	MovingExpenses          []MovingExpense
	PPMRemainingEntitlement unit.Pound
	SignedCertification     SignedCertification
}

ShipmentSummaryFormData is a container for the various objects required for the a Shipment Summary Worksheet

func FetchDataShipmentSummaryWorksheetFormData

func FetchDataShipmentSummaryWorksheetFormData(db *pop.Connection, session *auth.Session, moveID uuid.UUID) (ShipmentSummaryFormData, error)

FetchDataShipmentSummaryWorksheetFormData fetches the pages for the Shipment Summary Worksheet for a given Move ID

type ShipmentSummaryWorkSheetSIT

type ShipmentSummaryWorkSheetSIT struct {
	NumberAndTypes string
	EntryDates     string
	EndDates       string
	DaysInStorage  string
}

ShipmentSummaryWorkSheetSIT is an object representing SIT on the Shipment Summary Worksheet

type ShipmentSummaryWorkSheetShipments

type ShipmentSummaryWorkSheetShipments struct {
	ShipmentNumberAndTypes  string
	PickUpDates             string
	ShipmentWeights         string
	CurrentShipmentStatuses string
}

ShipmentSummaryWorkSheetShipments is an object representing shipment line items on Shipment Summary Worksheet

func FormatAllShipments

FormatAllShipments formats Shipment line items for the Shipment Summary Worksheet

type ShipmentSummaryWorksheetPage1Values

type ShipmentSummaryWorksheetPage1Values struct {
	CUIBanner                       string
	ServiceMemberName               string
	MaxSITStorageEntitlement        string
	PreferredPhoneNumber            string
	PreferredEmail                  string
	DODId                           string
	ServiceBranch                   string
	RankGrade                       string
	IssuingBranchOrAgency           string
	OrdersIssueDate                 string
	OrdersTypeAndOrdersNumber       string
	AuthorizedOrigin                string
	AuthorizedDestination           string
	NewDutyAssignment               string
	WeightAllotment                 string
	WeightAllotmentProgear          string
	WeightAllotmentProgearSpouse    string
	TotalWeightAllotment            string
	POVAuthorized                   string
	ShipmentNumberAndTypes          string
	ShipmentPickUpDates             string
	ShipmentWeights                 string
	ShipmentCurrentShipmentStatuses string
	SITNumberAndTypes               string
	SITEntryDates                   string
	SITEndDates                     string
	SITDaysInStorage                string
	PreparationDate                 string
	MaxObligationGCC100             string
	TotalWeightAllotmentRepeat      string
	MaxObligationGCC95              string
	MaxObligationSIT                string
	MaxObligationGCCMaxAdvance      string
	PPMRemainingEntitlement         string
	ActualObligationGCC100          string
	ActualObligationGCC95           string
	ActualObligationAdvance         string
	ActualObligationSIT             string
	MileageTotal                    string
}

ShipmentSummaryWorksheetPage1Values is an object representing a Shipment Summary Worksheet

func FormatValuesShipmentSummaryWorksheetFormPage1

func FormatValuesShipmentSummaryWorksheetFormPage1(data ShipmentSummaryFormData) ShipmentSummaryWorksheetPage1Values

FormatValuesShipmentSummaryWorksheetFormPage1 formats the data for page 1 of the Shipment Summary Worksheet

type ShipmentSummaryWorksheetPage2Values

type ShipmentSummaryWorksheetPage2Values struct {
	CUIBanner       string
	PreparationDate string
	TAC             string
	SAC             string
	FormattedMovingExpenses
}

ShipmentSummaryWorksheetPage2Values is an object representing a Shipment Summary Worksheet

func FormatValuesShipmentSummaryWorksheetFormPage2

func FormatValuesShipmentSummaryWorksheetFormPage2(data ShipmentSummaryFormData) ShipmentSummaryWorksheetPage2Values

FormatValuesShipmentSummaryWorksheetFormPage2 formats the data for page 2 of the Shipment Summary Worksheet

type ShipmentSummaryWorksheetPage3Values

type ShipmentSummaryWorksheetPage3Values struct {
	CUIBanner              string
	PreparationDate        string
	ServiceMemberSignature string
	SignatureDate          string
	FormattedOtherExpenses
}

ShipmentSummaryWorksheetPage3Values is an object representing a Shipment Summary Worksheet

func FormatValuesShipmentSummaryWorksheetFormPage3

func FormatValuesShipmentSummaryWorksheetFormPage3(data ShipmentSummaryFormData) ShipmentSummaryWorksheetPage3Values

FormatValuesShipmentSummaryWorksheetFormPage3 formats the data for page 2 of the Shipment Summary Worksheet

type SignedCertification

type SignedCertification struct {
	ID                       uuid.UUID                `json:"id" db:"id"`
	SubmittingUserID         uuid.UUID                `json:"submitting_user_id" db:"submitting_user_id"`
	MoveID                   uuid.UUID                `json:"move_id" db:"move_id"`
	PersonallyProcuredMoveID *uuid.UUID               `json:"personally_procured_move_id" db:"personally_procured_move_id"`
	PpmID                    *uuid.UUID               `json:"ppm_id" db:"ppm_id"`
	CertificationType        *SignedCertificationType `json:"certification_type" db:"certification_type"`
	CreatedAt                time.Time                `json:"created_at" db:"created_at"`
	UpdatedAt                time.Time                `json:"updated_at" db:"updated_at"`
	CertificationText        string                   `json:"certification_text" db:"certification_text"`
	Signature                string                   `json:"signature" db:"signature"`
	Date                     time.Time                `json:"date" db:"date"`
}

SignedCertification represents users acceptance

func FetchSignedCertifications

func FetchSignedCertifications(db *pop.Connection, session *auth.Session, id uuid.UUID) ([]*SignedCertification, error)

FetchSignedCertifications Fetches and Validates a all signed certifications associated with a move

func FetchSignedCertificationsPPMPayment

func FetchSignedCertificationsPPMPayment(db *pop.Connection, session *auth.Session, id uuid.UUID) (*SignedCertification, error)

DEPRECATED - This can be removed when the PPM Shipment Summary Worksheet is updated to use the new PPM shipment table FetchSignedCertificationsPPMPayment Fetches and Validates a PPM Payment Signature

func (*SignedCertification) Validate

func (s *SignedCertification) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*SignedCertification) ValidateCreate

func (s *SignedCertification) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*SignedCertification) ValidateUpdate

func (s *SignedCertification) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type SignedCertificationType

type SignedCertificationType string

SignedCertificationType represents the types of certificates

const (
	// SignedCertificationTypePPM captures enum value "PPM" - deprecated 10/2020
	SignedCertificationTypePPM SignedCertificationType = "PPM"

	// SignedCertificationTypePPMPAYMENT captures enum value "PPM_PAYMENT"
	SignedCertificationTypePPMPAYMENT SignedCertificationType = "PPM_PAYMENT"

	// SignedCertificationTypeHHG captures enum value "HHG" - deprecated 10/2020
	SignedCertificationTypeHHG SignedCertificationType = "HHG"

	// SignedCertificationTypeSHIPMENT captures enum value "SHIPMENT" for all shipment types from 10/2020
	SignedCertificationTypeSHIPMENT SignedCertificationType = "SHIPMENT"
)

type SignedCertifications

type SignedCertifications []SignedCertification

SignedCertifications is not required by pop and may be deleted

type StageConusToOconusPrice

type StageConusToOconusPrice struct {
	OriginDomesticPriceAreaCode string `db:"origin_domestic_price_area_code" csv:"origin_domestic_price_area_code"`
	OriginDomesticPriceArea     string `db:"origin_domestic_price_area" csv:"origin_domestic_price_area"`
	DestinationIntlPriceAreaID  string `db:"destination_intl_price_area_id" csv:"destination_intl_price_area_id"`
	DestinationIntlPriceArea    string `db:"destination_intl_price_area" csv:"destination_intl_price_area"`
	Season                      string `db:"season" csv:"season"`
	HHGShippingLinehaulPrice    string `db:"hhg_shipping_linehaul_price" csv:"hhg_shipping_linehaul_price"`
	UBPrice                     string `db:"ub_price" csv:"ub_price"`
}

StageConusToOconusPrice is the stage CONUS To OCONUS price

type StageCounselingServicesPrice

type StageCounselingServicesPrice struct {
	ContractYear      string `db:"contract_year" csv:"contract_year"`
	PricePerTaskOrder string `db:"price_per_task_order" csv:"price_per_task_order"`
}

StageCounselingServicesPrice is the stage counseling service price

type StageDomesticInternationalAdditionalPrice

type StageDomesticInternationalAdditionalPrice struct {
	Market       string `db:"market" csv:"market"`
	ShipmentType string `db:"shipment_type" csv:"shipment_type"`
	Factor       string `db:"factor" csv:"factor"`
}

StageDomesticInternationalAdditionalPrice is the stage domestic international additional price

type StageDomesticLinehaulPrice

type StageDomesticLinehaulPrice struct {
	ServiceAreaNumber string `db:"service_area_number" csv:"service_area_number"`
	OriginServiceArea string `db:"origin_service_area" csv:"origin_service_area"`
	ServicesSchedule  string `db:"services_schedule" csv:"services_schedule"`
	Season            string `db:"season" csv:"season"`
	WeightLower       string `db:"weight_lower" csv:"weight_lower"`
	WeightUpper       string `db:"weight_upper" csv:"weight_upper"`
	MilesLower        string `db:"miles_lower" csv:"miles_lower"`
	MilesUpper        string `db:"miles_upper" csv:"miles_upper"`
	EscalationNumber  string `db:"escalation_number" csv:"escalation_number"`
	Rate              string `db:"rate" csv:"rate"`
}

StageDomesticLinehaulPrice is the stage domestic linehaul price

type StageDomesticMoveAccessorialPrice

type StageDomesticMoveAccessorialPrice struct {
	ServicesSchedule string `db:"services_schedule" csv:"services_schedule"`
	ServiceProvided  string `db:"service_provided" csv:"service_provided"`
	PricePerUnit     string `db:"price_per_unit" csv:"price_per_unit"`
}

StageDomesticMoveAccessorialPrice is the stage domestic move accessorial price

type StageDomesticOtherPackPrice

type StageDomesticOtherPackPrice struct {
	ServicesSchedule   string `db:"services_schedule" csv:"services_schedule"`
	ServiceProvided    string `db:"service_provided" csv:"service_provided"`
	NonPeakPricePerCwt string `db:"non_peak_price_per_cwt" csv:"non_peak_price_per_cwt"`
	PeakPricePerCwt    string `db:"peak_price_per_cwt" csv:"peak_price_per_cwt"`
}

StageDomesticOtherPackPrice is the stage domestic other pack price

type StageDomesticOtherSitPrice

type StageDomesticOtherSitPrice struct {
	SITPickupDeliverySchedule string `db:"sit_pickup_delivery_schedule" csv:"sit_pickup_delivery_schedule"`
	ServiceProvided           string `db:"service_provided" csv:"service_provided"`
	NonPeakPricePerCwt        string `db:"non_peak_price_per_cwt" csv:"non_peak_price_per_cwt"`
	PeakPricePerCwt           string `db:"peak_price_per_cwt" csv:"peak_price_per_cwt"`
}

StageDomesticOtherSitPrice is the stage domestic other SIT price

type StageDomesticServiceArea

type StageDomesticServiceArea struct {
	BasePointCity     string `db:"base_point_city" csv:"base_point_city"`
	State             string `db:"state" csv:"state"`
	ServiceAreaNumber string `db:"service_area_number" csv:"service_area_number"`
	Zip3s             string `db:"zip3s" csv:"zip3s"`
}

StageDomesticServiceArea is the stage domestic service area

type StageDomesticServiceAreaPrice

type StageDomesticServiceAreaPrice struct {
	ServiceAreaNumber                     string `db:"service_area_number" csv:"service_area_number"`
	ServiceAreaName                       string `db:"service_area_name" csv:"service_area_name"`
	ServicesSchedule                      string `db:"services_schedule" csv:"services_schedule"`
	SITPickupDeliverySchedule             string `db:"sit_pickup_delivery_schedule" csv:"sit_pickup_delivery_schedule"`
	Season                                string `db:"season" csv:"season"`
	ShorthaulPrice                        string `db:"shorthaul_price" csv:"shorthaul_price"`
	OriginDestinationPrice                string `db:"origin_destination_price" csv:"origin_destination_price"`
	OriginDestinationSITFirstDayWarehouse string `db:"origin_destination_sit_first_day_warehouse" csv:"origin_destination_sit_first_day_warehouse"`
	OriginDestinationSITAddlDays          string `db:"origin_destination_sit_addl_days" csv:"origin_destination_sit_addl_days"`
}

StageDomesticServiceAreaPrice is the stage domestic service area price

type StageInternationalMoveAccessorialPrice

type StageInternationalMoveAccessorialPrice struct {
	Market          string `db:"market" csv:"market"`
	ServiceProvided string `db:"service_provided" csv:"service_provided"`
	PricePerUnit    string `db:"price_per_unit" csv:"price_per_unit"`
}

StageInternationalMoveAccessorialPrice is the stage international move accessorial price

type StageInternationalServiceArea

type StageInternationalServiceArea struct {
	RateArea   string `db:"rate_area" csv:"rate_area"`
	RateAreaID string `db:"rate_area_id" csv:"rate_area_id"`
}

StageInternationalServiceArea is the stage international service area

type StageNonStandardLocnPrice

type StageNonStandardLocnPrice struct {
	OriginID        string `db:"origin_id" csv:"origin_id"`
	OriginArea      string `db:"origin_area" csv:"origin_area"`
	DestinationID   string `db:"destination_id" csv:"destination_id"`
	DestinationArea string `db:"destination_area" csv:"destination_area"`
	MoveType        string `db:"move_type" csv:"move_type"`
	Season          string `db:"season" csv:"season"`
	HHGPrice        string `db:"hhg_price" csv:"hhg_price"`
	UBPrice         string `db:"ub_price" csv:"ub_price"`
}

StageNonStandardLocnPrice is the stage non-standard location price

type StageOconusToConusPrice

type StageOconusToConusPrice struct {
	OriginIntlPriceAreaID            string `db:"origin_intl_price_area_id" csv:"origin_intl_price_area_id"`
	OriginIntlPriceArea              string `db:"origin_intl_price_area" csv:"origin_intl_price_area"`
	DestinationDomesticPriceAreaCode string `db:"destination_domestic_price_area_area" csv:"destination_domestic_price_area_area"`
	DestinationDomesticPriceArea     string `db:"destination_domestic_price_area" csv:"destination_domestic_price_area"`
	Season                           string `db:"season" csv:"season"`
	HHGShippingLinehaulPrice         string `db:"hhg_shipping_linehaul_price" csv:"hhg_shipping_linehaul_price"`
	UBPrice                          string `db:"ub_price" csv:"ub_price"`
}

StageOconusToConusPrice is the stage OCONUS To CONUS price

type StageOconusToOconusPrice

type StageOconusToOconusPrice struct {
	OriginIntlPriceAreaID      string `db:"origin_intl_price_area_id" csv:"origin_intl_price_area_id"`
	OriginIntlPriceArea        string `db:"origin_intl_price_area" csv:"origin_intl_price_area"`
	DestinationIntlPriceAreaID string `db:"destination_intl_price_area_id" csv:"destination_intl_price_area_id"`
	DestinationIntlPriceArea   string `db:"destination_intl_price_area" csv:"destination_intl_price_area"`
	Season                     string `db:"season" csv:"season"`
	HHGShippingLinehaulPrice   string `db:"hhg_shipping_linehaul_price" csv:"hhg_shipping_linehaul_price"`
	UBPrice                    string `db:"ub_price" csv:"ub_price"`
}

StageOconusToOconusPrice is the stage OCONUS To OCONUS price

type StageOtherIntlPrice

type StageOtherIntlPrice struct {
	RateAreaCode                          string `db:"rate_area_code" csv:"rate_area_code"`
	RateAreaName                          string `db:"rate_area_name" csv:"rate_area_name"`
	HHGOriginPackPrice                    string `db:"hhg_origin_pack_price" csv:"hhg_origin_pack_price"`
	HHGDestinationUnPackPrice             string `db:"hhg_destination_unpack_price" csv:"hhg_destination_unpack_price"`
	UBOriginPackPrice                     string `db:"ub_origin_pack_price" csv:"ub_origin_pack_price"`
	UBDestinationUnPackPrice              string `db:"ub_destination_unpack_price" csv:"ub_destination_unpack_price"`
	OriginDestinationSITFirstDayWarehouse string `db:"origin_destination_sit_first_day_warehouse" csv:"origin_destination_sit_first_day_warehouse"`
	OriginDestinationSITAddlDays          string `db:"origin_destination_sit_addl_days" csv:"origin_destination_sit_addl_days"`
	SITLte50Miles                         string `db:"sit_lte_50_miles" csv:"sit_lte_50_miles"`
	SITGt50Miles                          string `db:"sit_gt_50_miles" csv:"sit_gt_50_miles"`
	Season                                string `db:"season" csv:"season"`
}

StageOtherIntlPrice is the stage other international price

type StagePriceEscalationDiscount

type StagePriceEscalationDiscount struct {
	ContractYear          string `db:"contract_year" csv:"contract_year"`
	ForecastingAdjustment string `db:"forecasting_adjustment" csv:"forecasting_adjustment"`
	Discount              string `db:"discount" csv:"discount"`
	PriceEscalation       string `db:"price_escalation" csv:"price_escalation"`
}

StagePriceEscalationDiscount is the stage price escalation discount

type StageShipmentManagementServicesPrice

type StageShipmentManagementServicesPrice struct {
	ContractYear      string `db:"contract_year" csv:"contract_year"`
	PricePerTaskOrder string `db:"price_per_task_order" csv:"price_per_task_order"`
}

StageShipmentManagementServicesPrice is the stage shipment management service price

type StageTransitionPrice

type StageTransitionPrice struct {
	ContractYear      string `db:"contract_year" csv:"contract_year"`
	PricePerTaskOrder string `db:"price_total_cost" csv:"price_total_cost"`
}

StageTransitionPrice is the stage transition price

type StorageFacilities

type StorageFacilities []StorageFacility

type StorageFacility

type StorageFacility struct {
	ID           uuid.UUID  `json:"id" db:"id"`
	FacilityName string     `json:"facility_name" db:"facility_name"`
	Address      Address    `belongs_to:"addresses" fk_id:"address_id"`
	AddressID    uuid.UUID  `json:"address_id" db:"address_id"`
	LotNumber    *string    `json:"lot_number" db:"lot_number"`
	Phone        *string    `json:"phone" db:"phone"`
	Email        *string    `json:"email" db:"email"`
	CreatedAt    time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at" db:"updated_at"`
	DeletedAt    *time.Time `json:"deleted_at" db:"deleted_at"`
}

func (*StorageFacility) Validate

func (f *StorageFacility) Validate(tx *pop.Connection) (*validate.Errors, error)

type StringInList

type StringInList struct {
	Value     string
	FieldName string
	List      container
}

StringInList is an improved validators.StringInclusion validator with better error messages.

func NewStringInList

func NewStringInList(value string, fieldName string, list container) *StringInList

NewStringInList returns a new StringInList validator.

func (*StringInList) IsValid

func (v *StringInList) IsValid(errors *validate.Errors)

IsValid adds an error if the string value is blank.

type StringIsNilOrNotBlank

type StringIsNilOrNotBlank struct {
	Name  string
	Field *string
}

StringIsNilOrNotBlank validates OptionalString fields, which we represent as *string.

func (*StringIsNilOrNotBlank) IsValid

func (v *StringIsNilOrNotBlank) IsValid(errors *validate.Errors)

IsValid adds an error if the pointer is not nil and also an empty string.

type TSPPerformanceGroup

type TSPPerformanceGroup struct {
	TrafficDistributionListID uuid.UUID
	PerformancePeriodStart    time.Time
	PerformancePeriodEnd      time.Time
	RateCycleStart            time.Time
	RateCycleEnd              time.Time
}

TSPPerformanceGroup contains the fields required to uniquely identify a TransportationServiceProviderPerformances grouping for quality band assignment (currently done in the award queue).

type TSPPerformanceGroups

type TSPPerformanceGroups []TSPPerformanceGroup

TSPPerformanceGroups is a handy type for multiple TSPPerformanceGroup structs

func FetchUnbandedTSPPerformanceGroups

func FetchUnbandedTSPPerformanceGroups(db *pop.Connection) (TSPPerformanceGroups, error)

FetchUnbandedTSPPerformanceGroups gets all groupings of TSPPs that have at least one entry with an unassigned quality band.

type Tariff400ngFullPackRate

type Tariff400ngFullPackRate struct {
	ID                 uuid.UUID  `json:"id" db:"id"`
	CreatedAt          time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at" db:"updated_at"`
	Schedule           int        `json:"schedule" db:"schedule"`
	WeightLbsLower     unit.Pound `json:"weight_lbs_lower" db:"weight_lbs_lower"`
	WeightLbsUpper     unit.Pound `json:"weight_lbs_upper" db:"weight_lbs_upper"`
	RateCents          unit.Cents `json:"rate_cents" db:"rate_cents"`
	EffectiveDateLower time.Time  `json:"effective_date_lower" db:"effective_date_lower"`
	EffectiveDateUpper time.Time  `json:"effective_date_upper" db:"effective_date_upper"`
}

Tariff400ngFullPackRate describes the rates paid to pack various weights of goods

func (*Tariff400ngFullPackRate) Validate

func (t *Tariff400ngFullPackRate) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type Tariff400ngFullPackRates

type Tariff400ngFullPackRates []Tariff400ngFullPackRate

Tariff400ngFullPackRates is not required by pop and may be deleted

type Tariff400ngFullUnpackRate

type Tariff400ngFullUnpackRate struct {
	ID                 uuid.UUID `json:"id" db:"id"`
	CreatedAt          time.Time `json:"created_at" db:"created_at"`
	UpdatedAt          time.Time `json:"updated_at" db:"updated_at"`
	Schedule           int       `json:"schedule" db:"schedule"`
	RateMillicents     int       `json:"rate_millicents" db:"rate_millicents"`
	EffectiveDateLower time.Time `json:"effective_date_lower" db:"effective_date_lower"`
	EffectiveDateUpper time.Time `json:"effective_date_upper" db:"effective_date_upper"`
}

Tariff400ngFullUnpackRate describes the rates paid to unpack various weights of goods

func (*Tariff400ngFullUnpackRate) Validate

func (t *Tariff400ngFullUnpackRate) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type Tariff400ngFullUnpackRates

type Tariff400ngFullUnpackRates []Tariff400ngFullUnpackRate

Tariff400ngFullUnpackRates is not required by pop and may be deleted

type Tariff400ngItem

type Tariff400ngItem struct {
	ID                  uuid.UUID                      `json:"id" db:"id"`
	Code                string                         `json:"code" db:"code"`
	Item                string                         `json:"item" db:"item"`
	DiscountType        Tariff400ngItemDiscountType    `json:"discount_type" db:"discount_type"`
	AllowedLocation     Tariff400ngItemAllowedLocation `json:"allowed_location" db:"allowed_location"`
	MeasurementUnit1    Tariff400ngItemMeasurementUnit `json:"measurement_unit_1" db:"measurement_unit_1"`
	MeasurementUnit2    Tariff400ngItemMeasurementUnit `json:"measurement_unit_2" db:"measurement_unit_2"`
	RateRefCode         Tariff400ngItemRateRefCode     `json:"rate_ref_code" db:"rate_ref_code"`
	RequiresPreApproval bool                           `json:"requires_pre_approval" db:"requires_pre_approval"`
	CreatedAt           time.Time                      `json:"created_at" db:"created_at"`
	UpdatedAt           time.Time                      `json:"updated_at" db:"updated_at"`
}

Tariff400ngItem is an object representing a possible 400ng item

func FetchTariff400ngItem

func FetchTariff400ngItem(dbConnection *pop.Connection, id uuid.UUID) (Tariff400ngItem, error)

FetchTariff400ngItem returns a Tariff400ngItem for the given ID

func FetchTariff400ngItemByCode

func FetchTariff400ngItemByCode(dbConnection *pop.Connection, code string) (Tariff400ngItem, error)

FetchTariff400ngItemByCode returns a Tariff400ngItem for the given code

func FetchTariff400ngItems

func FetchTariff400ngItems(dbConnection *pop.Connection, onlyRequiresPreApproval bool) ([]Tariff400ngItem, error)

FetchTariff400ngItems returns a list of 400ng items

type Tariff400ngItemAllowedLocation

type Tariff400ngItemAllowedLocation string

Tariff400ngItemAllowedLocation represents the location of the item

type Tariff400ngItemDiscountType

type Tariff400ngItemDiscountType string

Tariff400ngItemDiscountType represents

type Tariff400ngItemMeasurementUnit

type Tariff400ngItemMeasurementUnit string

Tariff400ngItemMeasurementUnit represents

type Tariff400ngItemRate

type Tariff400ngItemRate struct {
	ID                 uuid.UUID  `json:"id" db:"id"`
	Code               string     `json:"code" db:"code"`
	Schedule           *int       `json:"schedule" db:"schedule"`
	WeightLbsLower     unit.Pound `json:"weight_lbs_lower" db:"weight_lbs_lower"`
	WeightLbsUpper     unit.Pound `json:"weight_lbs_upper" db:"weight_lbs_upper"`
	RateCents          unit.Cents `json:"rate_cents" db:"rate_cents"`
	EffectiveDateLower time.Time  `json:"effective_date_lower" db:"effective_date_lower"`
	EffectiveDateUpper time.Time  `json:"effective_date_upper" db:"effective_date_upper"`
	CreatedAt          time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at" db:"updated_at"`
}

Tariff400ngItemRate contains pricing data for a Tariff400ngItem

func FetchTariff400ngItemRate

func FetchTariff400ngItemRate(tx *pop.Connection, code string, schedule int, weight unit.Pound, shipDate time.Time) (Tariff400ngItemRate, error)

FetchTariff400ngItemRate returns a rate for a matching code, schedule, weight, and ship date

func (*Tariff400ngItemRate) Validate

func (t *Tariff400ngItemRate) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type Tariff400ngItemRateRefCode

type Tariff400ngItemRateRefCode string

Tariff400ngItemRateRefCode represents

type Tariff400ngLinehaulRate

type Tariff400ngLinehaulRate struct {
	ID                 uuid.UUID  `json:"id" db:"id"`
	CreatedAt          time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at" db:"updated_at"`
	DistanceMilesLower int        `json:"distance_miles_lower" db:"distance_miles_lower"`
	DistanceMilesUpper int        `json:"distance_miles_upper" db:"distance_miles_upper"`
	Type               string     `json:"type" db:"type"`
	WeightLbsLower     unit.Pound `json:"weight_lbs_lower" db:"weight_lbs_lower"`
	WeightLbsUpper     unit.Pound `json:"weight_lbs_upper" db:"weight_lbs_upper"`
	RateCents          unit.Cents `json:"rate_cents" db:"rate_cents"`
	EffectiveDateLower time.Time  `json:"effective_date_lower" db:"effective_date_lower"`
	EffectiveDateUpper time.Time  `json:"effective_date_upper" db:"effective_date_upper"`
}

Tariff400ngLinehaulRate describes the rate paids paid to transport various weights of goods various distances.

func (*Tariff400ngLinehaulRate) Validate

func (t *Tariff400ngLinehaulRate) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type Tariff400ngLinehaulRates

type Tariff400ngLinehaulRates []Tariff400ngLinehaulRate

Tariff400ngLinehaulRates is not required by pop and may be deleted

type Tariff400ngServiceArea

type Tariff400ngServiceArea struct {
	ID                 uuid.UUID  `json:"id" db:"id"`
	CreatedAt          time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at" db:"updated_at"`
	Name               string     `json:"name" db:"name"`
	ServiceArea        string     `json:"service_area" db:"service_area"`
	ServicesSchedule   int        `json:"services_schedule" db:"services_schedule"`
	LinehaulFactor     unit.Cents `json:"linehaul_factor" db:"linehaul_factor"`
	ServiceChargeCents unit.Cents `json:"service_charge_cents" db:"service_charge_cents"`
	EffectiveDateLower time.Time  `json:"effective_date_lower" db:"effective_date_lower"`
	EffectiveDateUpper time.Time  `json:"effective_date_upper" db:"effective_date_upper"`
	// Note that the following SIT fields are nullable in the DB because some old 2017-2018 records
	// store nulls in them (those records existed before these fields).  But going forward, we want
	// to assume these fields are always there.  The model-vet utility will flag this, so just noting
	// this for now until we either do something with the old records or suppress the model-vet error.
	SIT185ARateCents unit.Cents `json:"sit_185a_rate_cents" db:"sit_185a_rate_cents"`
	SIT185BRateCents unit.Cents `json:"sit_185b_rate_cents" db:"sit_185b_rate_cents"`
	SITPDSchedule    int        `json:"sit_pd_schedule" db:"sit_pd_schedule"`
}

Tariff400ngServiceArea describes the service charges for various service areas

func FetchTariff400ngServiceAreaForZip3

func FetchTariff400ngServiceAreaForZip3(tx *pop.Connection, zip3 string, date time.Time) (Tariff400ngServiceArea, error)

FetchTariff400ngServiceAreaForZip3 returns the service area for a specified Zip3.

func (*Tariff400ngServiceArea) Validate

func (t *Tariff400ngServiceArea) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type Tariff400ngServiceAreas

type Tariff400ngServiceAreas []Tariff400ngServiceArea

Tariff400ngServiceAreas is not required by pop and may be deleted

type Tariff400ngShorthaulRate

type Tariff400ngShorthaulRate struct {
	ID                 uuid.UUID  `json:"id" db:"id"`
	CreatedAt          time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at" db:"updated_at"`
	CwtMilesLower      int        `json:"cwt_miles_lower" db:"cwt_miles_lower"`
	CwtMilesUpper      int        `json:"cwt_miles_upper" db:"cwt_miles_upper"`
	RateCents          unit.Cents `json:"rate_cents" db:"rate_cents"`
	EffectiveDateLower time.Time  `json:"effective_date_lower" db:"effective_date_lower"`
	EffectiveDateUpper time.Time  `json:"effective_date_upper" db:"effective_date_upper"`
}

Tariff400ngShorthaulRate describes the rates paid for shorthaul shipments

func (*Tariff400ngShorthaulRate) Validate

func (t *Tariff400ngShorthaulRate) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Tariff400ngShorthaulRate) ValidateCreate

func (t *Tariff400ngShorthaulRate) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Tariff400ngShorthaulRate) ValidateUpdate

func (t *Tariff400ngShorthaulRate) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Tariff400ngShorthaulRates

type Tariff400ngShorthaulRates []Tariff400ngShorthaulRate

Tariff400ngShorthaulRates is not required by pop and may be deleted

type Tariff400ngZip3

type Tariff400ngZip3 struct {
	ID            uuid.UUID `json:"id" db:"id"`
	CreatedAt     time.Time `json:"created_at" db:"created_at"`
	UpdatedAt     time.Time `json:"updated_at" db:"updated_at"`
	Zip3          string    `json:"zip3" db:"zip3"`
	BasepointCity string    `json:"basepoint_city" db:"basepoint_city"`
	State         string    `json:"state" db:"state"`
	ServiceArea   string    `json:"service_area" db:"service_area"`
	RateArea      string    `json:"rate_area" db:"rate_area"`
	Region        string    `json:"region" db:"region"`
}

Tariff400ngZip3 is the first 3 numbers of a zip for Tariff400NG calculations

func (*Tariff400ngZip3) Validate

func (t *Tariff400ngZip3) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type Tariff400ngZip3s

type Tariff400ngZip3s []Tariff400ngZip3

Tariff400ngZip3s is not required by pop and may be deleted

type Tariff400ngZip5RateArea

type Tariff400ngZip5RateArea struct {
	ID        uuid.UUID `json:"id" db:"id"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	Zip5      string    `json:"zip5" db:"zip5"`
	RateArea  string    `json:"rate_area" db:"rate_area"`
}

Tariff400ngZip5RateArea represents the mapping from a full 5-digit zipcode to a specific rate area. This is only needed for a small subset of zip3s.

func (*Tariff400ngZip5RateArea) Validate

func (t *Tariff400ngZip5RateArea) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type Tariff400ngZip5RateAreas

type Tariff400ngZip5RateAreas []Tariff400ngZip5RateArea

Tariff400ngZip5RateAreas is not required by pop and may be deleted

type TourType

type TourType string

TourType indicates whether the travel is Accompanied or Unaccompanied; i.e., are dependents authorized to accompany the service member on the move. For certain OCONUS destinations, the tour type affects the member's entitlement. Otherwise, it doesn't matter.

const (
	// TourTypeAccompanied captures enum value "accompanied"
	TourTypeAccompanied TourType = "accompanied"
	// TourTypeUnaccompanied captures enum value "unaccompanied"
	TourTypeUnaccompanied TourType = "unaccompanied"
	// TourTypeUnaccompaniedDependentsRestricted captures enum value "unaccompanied-dependents-restricted"
	TourTypeUnaccompaniedDependentsRestricted TourType = "unaccompanied-dependents-restricted"
)

type TrafficDistributionList

type TrafficDistributionList struct {
	ID                uuid.UUID `json:"id" db:"id"`
	CreatedAt         time.Time `json:"created_at" db:"created_at"`
	UpdatedAt         time.Time `json:"updated_at" db:"updated_at"`
	SourceRateArea    string    `json:"source_rate_area" db:"source_rate_area"`
	DestinationRegion string    `json:"destination_region" db:"destination_region"`
	CodeOfService     string    `json:"code_of_service" db:"code_of_service"`
}

TrafficDistributionList items are essentially different markets, based on source and destination, in which Transportation Service Providers (TSPs) bid on shipments.

func FetchOrCreateTDL

func FetchOrCreateTDL(db *pop.Connection, rateArea string, region string, codeOfService string) (TrafficDistributionList, error)

FetchOrCreateTDL attempts to return a TDL based on SourceRateArea, Region, and CodeOfService (COS) and creates one to return if it doesn't already exist.

func FetchTDL

func FetchTDL(db *pop.Connection, rateArea string, region string, codeOfService string) (TrafficDistributionList, error)

FetchTDL attempts to return a TDL based on SourceRateArea, Region, and CodeOfService (COS).

func (TrafficDistributionList) MarshalLogObject

func (t TrafficDistributionList) MarshalLogObject(encoder zapcore.ObjectEncoder) error

MarshalLogObject is required to be able to zap.Object log TDLs

func (*TrafficDistributionList) Validate

func (t *TrafficDistributionList) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type TrafficDistributionLists

type TrafficDistributionLists []TrafficDistributionList

TrafficDistributionLists is not required by pop and may be deleted

type TransportationAccountingCode

type TransportationAccountingCode struct {
	ID        uuid.UUID `json:"id" db:"id"`
	TAC       string    `json:"tac" db:"tac"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}

TransportationAccountingCode model struct that represents transportation accounting codes

type TransportationOffice

type TransportationOffice struct {
	ID               uuid.UUID             `json:"id" db:"id"`
	ShippingOfficeID *uuid.UUID            `json:"shipping_office_id" db:"shipping_office_id"`
	ShippingOffice   *TransportationOffice `belongs_to:"transportation_offices" fk_id:"shipping_office_id"`
	Name             string                `json:"name" db:"name"`
	Address          Address               `belongs_to:"address" fk_id:"address_id"`
	AddressID        uuid.UUID             `json:"address_id" db:"address_id"`
	Latitude         float32               `json:"latitude" db:"latitude"`
	Longitude        float32               `json:"longitude" db:"longitude"`
	PhoneLines       OfficePhoneLines      `has_many:"office_phone_lines" fk_id:"transportation_office_id"`
	Emails           OfficeEmails          `has_many:"office_emails" fk_id:"transportation_office_id"`
	Hours            *string               `json:"hours" db:"hours"`
	Services         *string               `json:"services" db:"services"`
	Note             *string               `json:"note" db:"note"`
	Gbloc            string                `json:"gbloc" db:"gbloc"`
	CreatedAt        time.Time             `json:"created_at" db:"created_at"`
	UpdatedAt        time.Time             `json:"updated_at" db:"updated_at"`
}

TransportationOffice is a PPPO, PPSO or JPPSO. If it is its own shipping office, ShippingOffice will be nil, otherwise its a pointer to the actual shipping office.

func FetchDutyLocationTransportationOffice

func FetchDutyLocationTransportationOffice(db *pop.Connection, dutyLocationID uuid.UUID) (TransportationOffice, error)

FetchDutyLocationTransportationOffice returns a transportation office for a duty location

func FetchNearestTransportationOffice

func FetchNearestTransportationOffice(tx *pop.Connection, long float32, lat float32) (TransportationOffice, error)

FetchNearestTransportationOffice fetches the nearest transportation office

func (*TransportationOffice) Validate

func (t *TransportationOffice) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*TransportationOffice) ValidateCreate

func (t *TransportationOffice) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*TransportationOffice) ValidateUpdate

func (t *TransportationOffice) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type TransportationOffices

type TransportationOffices []TransportationOffice

TransportationOffices is not required by pop and may be deleted

type TransportationServiceProvider

type TransportationServiceProvider struct {
	ID                       uuid.UUID `json:"id" db:"id"`
	CreatedAt                time.Time `json:"created_at" db:"created_at"`
	UpdatedAt                time.Time `json:"updated_at" db:"updated_at"`
	StandardCarrierAlphaCode string    `json:"standard_carrier_alpha_code" db:"standard_carrier_alpha_code"`
	Enrolled                 bool      `json:"enrolled" db:"enrolled"`
	Name                     *string   `json:"name" db:"name"`
	SupplierID               *string   `json:"supplier_id" db:"supplier_id"`
	PocGeneralName           *string   `json:"poc_general_name" db:"poc_general_name"`
	PocGeneralEmail          *string   `json:"poc_general_email" db:"poc_general_email"`
	PocGeneralPhone          *string   `json:"poc_general_phone" db:"poc_general_phone"`
	PocClaimsName            *string   `json:"poc_claims_name" db:"poc_claims_name"`
	PocClaimsEmail           *string   `json:"poc_claims_email" db:"poc_claims_email"`
	PocClaimsPhone           *string   `json:"poc_claims_phone" db:"poc_claims_phone"`
}

TransportationServiceProvider models moving companies used to move Shipments.

func FetchTransportationServiceProvider

func FetchTransportationServiceProvider(db *pop.Connection, id uuid.UUID) (*TransportationServiceProvider, error)

FetchTransportationServiceProvider Fetches a TSP model

func (TransportationServiceProvider) MarshalLogObject

func (t TransportationServiceProvider) MarshalLogObject(encoder zapcore.ObjectEncoder) error

MarshalLogObject is required to control the logging of this

func (*TransportationServiceProvider) Validate

func (t *TransportationServiceProvider) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type TransportationServiceProviderPerformance

type TransportationServiceProviderPerformance struct {
	ID                              uuid.UUID                     `json:"id" db:"id"`
	CreatedAt                       time.Time                     `json:"created_at" db:"created_at"`
	UpdatedAt                       time.Time                     `json:"updated_at" db:"updated_at"`
	PerformancePeriodStart          time.Time                     `json:"performance_period_start" db:"performance_period_start"`
	PerformancePeriodEnd            time.Time                     `json:"performance_period_end" db:"performance_period_end"`
	RateCycleStart                  time.Time                     `json:"rate_cycle_start" db:"rate_cycle_start"`
	RateCycleEnd                    time.Time                     `json:"rate_cycle_end" db:"rate_cycle_end"`
	TrafficDistributionListID       uuid.UUID                     `json:"traffic_distribution_list_id" db:"traffic_distribution_list_id"`
	TrafficDistributionList         TrafficDistributionList       `belongs_to:"traffic_distribution_list" fk_id:"traffic_distribution_list_id"`
	TransportationServiceProviderID uuid.UUID                     `json:"transportation_service_provider_id" db:"transportation_service_provider_id"`
	TransportationServiceProvider   TransportationServiceProvider `belongs_to:"transportation_service_provider" fk_id:"transportation_service_provider_id"`
	QualityBand                     *int                          `json:"quality_band" db:"quality_band"`
	BestValueScore                  float64                       `json:"best_value_score" db:"best_value_score"`
	LinehaulRate                    unit.DiscountRate             `json:"linehaul_rate" db:"linehaul_rate"`
	SITRate                         unit.DiscountRate             `json:"sit_rate" db:"sit_rate"`
	OfferCount                      int                           `json:"offer_count" db:"offer_count"`
}

TransportationServiceProviderPerformance is a combination of all TSP performance metrics (BVS, Quality Band) for a performance period.

func IncrementTSPPerformanceOfferCount

func IncrementTSPPerformanceOfferCount(db *pop.Connection, tspPerformanceID uuid.UUID) (TransportationServiceProviderPerformance, error)

IncrementTSPPerformanceOfferCount increments the offer_count column by 1 and validates. It returns the updated TSPPerformance record.

func NextEligibleTSPPerformance

func NextEligibleTSPPerformance(db *pop.Connection, tdlID uuid.UUID, bookDate time.Time, requestedPickupDate time.Time) (TransportationServiceProviderPerformance, error)

NextEligibleTSPPerformance wraps GatherNextEligibleTSPPerformances and DetermineNextTSPPerformance.

func NextTSPPerformanceInQualityBand

func NextTSPPerformanceInQualityBand(tx *pop.Connection, tdlID uuid.UUID,
	qualityBand int, bookDate time.Time, requestedPickupDate time.Time) (
	TransportationServiceProviderPerformance, error)

NextTSPPerformanceInQualityBand returns the TSP performance record in a given TDL and Quality Band that will next be offered a shipment.

func SelectNextTSPPerformance

SelectNextTSPPerformance returns the tspPerformance that is next to receive a shipment.

func (*TransportationServiceProviderPerformance) MarshalLogObject

MarshalLogObject is required to be able to zap.Object log a TSPP

func (*TransportationServiceProviderPerformance) Validate

func (t *TransportationServiceProviderPerformance) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type TransportationServiceProviderPerformances

type TransportationServiceProviderPerformances []TransportationServiceProviderPerformance

TransportationServiceProviderPerformances is a handy type for multiple TransportationServiceProviderPerformance structs

func FetchTSPPerformancesForQualityBandAssignment

func FetchTSPPerformancesForQualityBandAssignment(tx *pop.Connection, perfGroup TSPPerformanceGroup, mps float64) (TransportationServiceProviderPerformances, error)

FetchTSPPerformancesForQualityBandAssignment returns TSPPs in the given TSPP grouping in the order that they should be assigned quality bands.

type TransportationServiceProviders

type TransportationServiceProviders []TransportationServiceProvider

TransportationServiceProviders is not required by pop and may be deleted

type Upload

type Upload struct {
	ID          uuid.UUID  `db:"id"`
	Filename    string     `db:"filename"`
	Bytes       int64      `db:"bytes"`
	ContentType string     `db:"content_type"`
	Checksum    string     `db:"checksum"`
	StorageKey  string     `db:"storage_key"`
	UploadType  UploadType `db:"upload_type"`
	CreatedAt   time.Time  `db:"created_at"`
	UpdatedAt   time.Time  `db:"updated_at"`
	DeletedAt   *time.Time `db:"deleted_at"`
}

An Upload represents an uploaded file, such as an image or PDF.

func (*Upload) BeforeCreate

func (u *Upload) BeforeCreate(tx *pop.Connection) error

BeforeCreate populates the StorageKey on a newly created UserUpload

func (*Upload) Validate

func (u *Upload) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type UploadType

type UploadType string

UploadType represents the type of upload this is, whether is it uploaded for a User or for the Prime

const (
	// UploadTypeUSER string USER
	UploadTypeUSER UploadType = "USER"
	// UploadTypePRIME string PRIME
	UploadTypePRIME UploadType = "PRIME"
)

func (UploadType) Valid

func (ut UploadType) Valid() bool

Valid checks if UploadType is set to a valid value

type Uploads

type Uploads []Upload

Uploads is not required by pop and may be deleted

func UploadsFromPrimeUploads

func UploadsFromPrimeUploads(db *pop.Connection, primeUploads PrimeUploads) (Uploads, error)

UploadsFromPrimeUploads return a slice of uploads given a slice of prime uploads

func UploadsFromUserUploads

func UploadsFromUserUploads(db *pop.Connection, userUploads UserUploads) (Uploads, error)

UploadsFromUserUploads returns a slice of Uploads given a slice of UserUploads

func UploadsFromUserUploadsNoDatabase

func UploadsFromUserUploadsNoDatabase(userUploads UserUploads) (Uploads, error)

UploadsFromUserUploadsNoDatabase returns a slice of Uploads given a slice of UserUploads

type User

type User struct {
	ID                     uuid.UUID   `json:"id" db:"id"`
	CreatedAt              time.Time   `json:"created_at" db:"created_at"`
	UpdatedAt              time.Time   `json:"updated_at" db:"updated_at"`
	LoginGovUUID           *uuid.UUID  `json:"login_gov_uuid" db:"login_gov_uuid"`
	LoginGovEmail          string      `json:"login_gov_email" db:"login_gov_email"`
	Active                 bool        `json:"active" db:"active"`
	Roles                  roles.Roles `many_to_many:"users_roles"`
	CurrentAdminSessionID  string      `json:"current_admin_session_id" db:"current_admin_session_id"`
	CurrentOfficeSessionID string      `json:"current_office_session_id" db:"current_office_session_id"`
	CurrentMilSessionID    string      `json:"current_mil_session_id" db:"current_mil_session_id"`
}

User is an entity with a registered uuid and email at login.gov

func CreateUser

func CreateUser(db *pop.Connection, loginGovID string, email string) (*User, error)

CreateUser is called upon successful login.gov verification of a new user

func GetUser

func GetUser(db *pop.Connection, userID uuid.UUID) (*User, error)

GetUser loads the associated User from the DB using the user ID

func GetUserFromEmail

func GetUserFromEmail(db *pop.Connection, email string) (*User, error)

GetUserFromEmail loads the associated User from the DB using the user email

func (*User) Validate

func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*User) ValidateCreate

func (u *User) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*User) ValidateUpdate

func (u *User) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type UserIdentity

type UserIdentity struct {
	ID                     uuid.UUID   `db:"id"`
	Active                 bool        `db:"active"`
	Email                  string      `db:"email"`
	ServiceMemberID        *uuid.UUID  `db:"sm_id"`
	ServiceMemberFirstName *string     `db:"sm_fname"`
	ServiceMemberLastName  *string     `db:"sm_lname"`
	ServiceMemberMiddle    *string     `db:"sm_middle"`
	OfficeUserID           *uuid.UUID  `db:"ou_id"`
	OfficeUserFirstName    *string     `db:"ou_fname"`
	OfficeUserLastName     *string     `db:"ou_lname"`
	OfficeUserMiddle       *string     `db:"ou_middle"`
	OfficeActive           *bool       `db:"ou_active"`
	AdminUserID            *uuid.UUID  `db:"au_id"`
	AdminUserRole          *AdminRole  `db:"au_role"`
	AdminUserFirstName     *string     `db:"au_fname"`
	AdminUserLastName      *string     `db:"au_lname"`
	AdminUserActive        *bool       `db:"au_active"`
	Roles                  roles.Roles `many_to_many:"users_roles" primary_id:"user_id"`
}

UserIdentity is summary of the information about a user from the database

func FetchAppUserIdentities

func FetchAppUserIdentities(db *pop.Connection, appname auth.Application, limit int) ([]UserIdentity, error)

FetchAppUserIdentities returns a limited set of user records based on application

func FetchUserIdentity

func FetchUserIdentity(db *pop.Connection, loginGovID string) (*UserIdentity, error)

FetchUserIdentity queries the database for information about the logged in user

func (*UserIdentity) FirstName

func (ui *UserIdentity) FirstName() string

FirstName gets the firstname of the user from either the ServiceMember or OfficeUser identity

func (*UserIdentity) LastName

func (ui *UserIdentity) LastName() string

LastName gets the firstname of the user from either the ServiceMember or OfficeUser or TspUser identity

func (*UserIdentity) Middle

func (ui *UserIdentity) Middle() string

Middle gets the MiddleName or Initials from the ServiceMember or OfficeUser or TspUser Identity

type UserUpload

type UserUpload struct {
	ID         uuid.UUID  `db:"id"`
	DocumentID *uuid.UUID `db:"document_id"`
	Document   Document   `belongs_to:"documents" fk_id:"document_id"`
	UploaderID uuid.UUID  `db:"uploader_id"`
	UploadID   uuid.UUID  `db:"upload_id"`
	Upload     Upload     `belongs_to:"uploads" fk_id:"upload_id"`
	CreatedAt  time.Time  `db:"created_at"`
	UpdatedAt  time.Time  `db:"updated_at"`
	DeletedAt  *time.Time `db:"deleted_at"`
}

An UserUpload represents an user uploaded file, such as an image or PDF.

func FetchUserUpload

func FetchUserUpload(db *pop.Connection, session *auth.Session, id uuid.UUID) (UserUpload, error)

FetchUserUpload returns an UserUpload if the user has access to that upload

func FetchUserUploadFromUploadID

func FetchUserUploadFromUploadID(db *pop.Connection, session *auth.Session, uploadID uuid.UUID) (UserUpload, error)

FetchUserUploadFromUploadID returns an UserUpload if the user has access to that upload

func (*UserUpload) Validate

func (u *UserUpload) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type UserUploads

type UserUploads []UserUpload

UserUploads is not required by pop and may be deleted

func (UserUploads) FilterDeleted

func (u UserUploads) FilterDeleted() UserUploads

type Users

type Users []User

Users is not required by pop and may be deleted

type UsersRoles

type UsersRoles struct {
	ID        uuid.UUID  `db:"id"`
	UserID    uuid.UUID  `db:"user_id"`
	RoleID    uuid.UUID  `db:"role_id"`
	CreatedAt time.Time  `db:"created_at"`
	UpdateAt  time.Time  `db:"updated_at"`
	DeletedAt *time.Time `db:"deleted_at"`
}

UsersRoles represents a user and a role

type ValidateableModel

type ValidateableModel interface {
	Validate(*pop.Connection) (*validate.Errors, error)
}

ValidateableModel is here simply because `validateable` is private to `pop`

type WebhookNotification

type WebhookNotification struct {
	ID               uuid.UUID                 `db:"id"`
	EventKey         string                    `db:"event_key"`
	TraceID          *uuid.UUID                `db:"trace_id"`
	MoveTaskOrderID  *uuid.UUID                `db:"move_id"`
	MoveTaskOrder    Move                      `belongs_to:"moves" fk_id:"move_id"`
	ObjectID         *uuid.UUID                `db:"object_id"`
	Payload          string                    `db:"payload"`
	Status           WebhookNotificationStatus `db:"status"`
	CreatedAt        time.Time                 `db:"created_at"`
	UpdatedAt        time.Time                 `db:"updated_at"`
	FirstAttemptedAt *time.Time                `db:"first_attempted_at"`
}

WebhookNotification is used by pop to map your webhook_notifications database table to your go code.

func (WebhookNotification) String

func (w WebhookNotification) String() string

String is not required by pop and may be deleted

func (*WebhookNotification) Validate

func (w *WebhookNotification) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

func (*WebhookNotification) ValidateCreate

func (w *WebhookNotification) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method.

func (*WebhookNotification) ValidateUpdate

func (w *WebhookNotification) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method.

type WebhookNotificationStatus

type WebhookNotificationStatus string

WebhookNotificationStatus represents the possible statuses for a mto shipment

const (
	// WebhookNotificationPending is the pending status type for a WebhookNotification
	WebhookNotificationPending WebhookNotificationStatus = "PENDING"
	// WebhookNotificationSent is the sent status type for a WebhookNotification
	WebhookNotificationSent WebhookNotificationStatus = "SENT"
	// WebhookNotificationSkipped is the skipped status type for a WebhookNotification
	WebhookNotificationSkipped WebhookNotificationStatus = "SKIPPED"
	// WebhookNotificationFailing is the failing status type for a WebhookNotification
	// - indicates the send has failed at least once but we are still retrying it
	WebhookNotificationFailing WebhookNotificationStatus = "FAILING"
	// WebhookNotificationFailed is the failed status type for a WebhookNotification
	WebhookNotificationFailed WebhookNotificationStatus = "FAILED"
)

type WebhookNotifications

type WebhookNotifications []WebhookNotification

WebhookNotifications is not required by pop and may be deleted

func (WebhookNotifications) String

func (w WebhookNotifications) String() string

String is not required by pop and may be deleted

type WebhookSubscription

type WebhookSubscription struct {
	ID           uuid.UUID                 `db:"id"`
	Subscriber   Contractor                `belongs_to:"contractors" fk_id:"subscriber_id"`
	SubscriberID uuid.UUID                 `db:"subscriber_id"`
	Status       WebhookSubscriptionStatus `db:"status"`
	Severity     int                       `db:"severity"` // Zero indicates no severity value, 1 is highest
	EventKey     string                    `db:"event_key"`
	CallbackURL  string                    `db:"callback_url"`
	CreatedAt    time.Time                 `db:"created_at"`
	UpdatedAt    time.Time                 `db:"updated_at"`
}

A WebhookSubscription represents a webhook subscription

func (*WebhookSubscription) TableName

func (wS *WebhookSubscription) TableName() string

TableName overrides the table name used by Pop.

func (*WebhookSubscription) Validate

func (wS *WebhookSubscription) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type WebhookSubscriptionStatus

type WebhookSubscriptionStatus string

WebhookSubscriptionStatus is a type representing the webhook subscription status type - string

const (
	// WebhookSubscriptionStatusActive is the active status for Webhook Subscription
	WebhookSubscriptionStatusActive WebhookSubscriptionStatus = "ACTIVE"
	// WebhookSubscriptionStatusDisabled is the disabled status for Webhook Subscription
	WebhookSubscriptionStatusDisabled WebhookSubscriptionStatus = "DISABLED"
	// WebhookSubscriptionStatusFailing is the failing status for Webhook Subscription
	// - it indicates that we have experienced notifications failing to be sent, but
	// have not disabled this subscription yet.
	WebhookSubscriptionStatusFailing WebhookSubscriptionStatus = "FAILING"
)

type WebhookSubscriptions

type WebhookSubscriptions []WebhookSubscription

WebhookSubscriptions is an array of webhook subscriptions

type WeightAllotment

type WeightAllotment struct {
	TotalWeightSelf               int
	TotalWeightSelfPlusDependents int
	ProGearWeight                 int
	ProGearWeightSpouse           int
}

WeightAllotment represents the weights allotted for a rank

func GetWeightAllotment

func GetWeightAllotment(rank ServiceMemberRank) WeightAllotment

GetWeightAllotment returns the weight allotments for a given rank.

type WeightTicket

type WeightTicket struct {
	ID                                uuid.UUID          `json:"id" db:"id"`
	PPMShipmentID                     uuid.UUID          `json:"ppm_shipment_id" db:"ppm_shipment_id"`
	PPMShipment                       PPMShipment        `belongs_to:"ppm_shipments" fk_id:"ppm_shipment_id"`
	CreatedAt                         time.Time          `json:"created_at" db:"created_at"`
	UpdatedAt                         time.Time          `json:"updated_at" db:"updated_at"`
	DeletedAt                         *time.Time         `json:"deleted_at" db:"deleted_at"`
	VehicleDescription                *string            `json:"vehicle_description" db:"vehicle_description"`
	EmptyWeight                       *unit.Pound        `json:"empty_weight" db:"empty_weight"`
	MissingEmptyWeightTicket          *bool              `json:"missing_empty_weight_ticket" db:"missing_empty_weight_ticket"`
	EmptyDocumentID                   uuid.UUID          `json:"empty_document_id" db:"empty_document_id"`
	EmptyDocument                     Document           `belongs_to:"documents" fk_id:"empty_document_id"`
	FullWeight                        *unit.Pound        `json:"full_weight" db:"full_weight"`
	MissingFullWeightTicket           *bool              `json:"missing_full_weight_ticket" db:"missing_full_weight_ticket"`
	FullDocumentID                    uuid.UUID          `json:"full_document_id" db:"full_document_id"`
	FullDocument                      Document           `belongs_to:"documents" fk_id:"full_document_id"`
	OwnsTrailer                       *bool              `json:"owns_trailer" db:"owns_trailer"`
	TrailerMeetsCriteria              *bool              `json:"trailer_meets_criteria" db:"trailer_meets_criteria"`
	ProofOfTrailerOwnershipDocumentID uuid.UUID          `json:"proof_of_trailer_ownership_document_id" db:"proof_of_trailer_ownership_document_id"`
	ProofOfTrailerOwnershipDocument   Document           `belongs_to:"documents" fk_id:"proof_of_trailer_ownership_document_id"`
	Status                            *PPMDocumentStatus `json:"status" db:"status"`
	Reason                            *string            `json:"reason" db:"reason"`
}

WeightTicket represents the weight tickets and related data for a single trip of a PPM Shipment. Each trip should be its own record.

func (*WeightTicket) Validate

func (w *WeightTicket) Validate(_ *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This should contain validation that is for data integrity. Business validation should occur in service objects.

type WeightTickets

type WeightTickets []WeightTicket

type Zip3Distance

type Zip3Distance struct {
	ID            uuid.UUID `json:"id" db:"id"`
	FromZip3      string    `json:"from_zip3" db:"from_zip3"`
	ToZip3        string    `json:"to_zip3" db:"to_zip3"`
	DistanceMiles int       `json:"distance_miles" db:"distance_miles"`
	CreatedAt     time.Time `json:"created_at" db:"created_at"`
	UpdatedAt     time.Time `json:"updated_at" db:"updated_at"`
}

Zip3Distance model struct

func (*Zip3Distance) Validate

func (z *Zip3Distance) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

type Zip3Distances

type Zip3Distances []Zip3Distance

Zip3Distances is not required by pop and may be deleted

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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