testdatagen

package
v0.0.0-...-c407d37 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultContractCode = "TRUSS_TEST"

DefaultContractCode is the default contract code for testing

View Source
const DefaultContractName = "Default contractor name for test"

DefaultContractName name used for contractor in testing

View Source
const DefaultContractNumber = "HTC111-11-1-1111"

DefaultContractNumber is the default contract number for testing

View Source
const DefaultContractType = "Prime"

DefaultContractType default prime type is Prime for testing

View Source
const DefaultServiceCode = "STEST"

DefaultServiceCode is the default service code for testing

View Source
const DefaultServiceItemParamKeyName = "testkey"

DefaultServiceItemParamKeyName is the default service code for testing

View Source
const DefaultWebhookSubscriptionCallbackURL = "/some/callback/url"

DefaultWebhookSubscriptionCallbackURL is the default webhooksubscription callback url for testing

Variables

View Source
var DateInsideNonPeakRateCycle = time.Date(TestYear, time.October, 2, 0, 0, 0, 0, time.UTC)

DateInsideNonPeakRateCycle is available as a convenient test date inside the NonPeak Rate Cycle

View Source
var DateInsidePeakRateCycle = time.Date(TestYear, time.May, 16, 0, 0, 0, 0, time.UTC)

DateInsidePeakRateCycle is available as a convenient test date inside the Peak Rate Cycle

View Source
var DateInsidePerformancePeriod = time.Date(TestYear, time.May, 16, 0, 0, 0, 0, time.UTC)

DateInsidePerformancePeriod is within the performance period defined by PerformancePeriodStart and PerformancePeriodEnd.

View Source
var DateOutsideNonPeakRateCycle = time.Date(TestYear+1, time.May, 16, 0, 0, 0, 0, time.UTC)

DateOutsideNonPeakRateCycle is available as a convenient test date outside the NonPeak Rate Cycle

View Source
var DateOutsidePeakRateCycle = time.Date(TestYear, time.October, 10, 0, 0, 0, 0, time.UTC)

DateOutsidePeakRateCycle is available as a convenient test date outside the Peak Rate Cycle

View Source
var DateOutsidePerformancePeriod = time.Date(TestYear, time.August, 1, 0, 0, 0, 0, time.UTC)

DateOutsidePerformancePeriod is after the performance period defined by PerformancePeriodStart and PerformancePeriodEnd.

View Source
var DefaultCOS = "D"

DefaultCOS is the default Code of Service for testing.

View Source
var DefaultDepartmentIndicator = "57 - United States Air Force"

DefaultDepartmentIndicator is a code for orders accounting that indicates which branch the orders are for.

View Source
var DefaultDstGBLOC = "HAFC"

DefaultDstGBLOC is the default GBLOC for testing.

View Source
var DefaultDstRegion = "6"

DefaultDstRegion is a default region (US South West) for testing.

View Source
var DefaultMarket = "dHHG"

DefaultMarket is the default market for testing.

View Source
var DefaultServiceArea = "4"

DefaultServiceArea is the default Service Area for testing.

View Source
var DefaultSrcGBLOC = "KKFA"

DefaultSrcGBLOC is the default GBLOC for testing.

View Source
var DefaultSrcRateArea = "US87"

DefaultSrcRateArea is a default rate area (California) for testing.

View Source
var DefaultTransportationAccountingCode = "F8J1"

DefaultTransportationAccountingCode (TAC) is an accounting code used for orders.

View Source
var DefaultZip3 = "902"

DefaultZip3 is the default zip3 for testing

View Source
var GHCTestYear = 2020

GHCTestYear is the default for GHC rate engine testing

View Source
var NextValidMoveDate = dates.NextValidMoveDate(time.Now(), cal)

NextValidMoveDate is the next valid move date

View Source
var NonPeakRateCycleEnd = time.Date(TestYear+1, time.May, 14, 0, 0, 0, 0, time.UTC)

NonPeakRateCycleEnd is the first instant that the peak rate cycle ends

View Source
var NonPeakRateCycleStart = time.Date(TestYear, time.October, 1, 0, 0, 0, 0, time.UTC)

NonPeakRateCycleStart is the first instant that the peak rate cycle starts

View Source
var OneDay = time.Hour * 24

OneDay creates a 1 day period

View Source
var OneWeek = time.Hour * 168

OneWeek creates a 1 week period

View Source
var PeakRateCycleEnd = time.Date(TestYear, time.September, 30, 0, 0, 0, 0, time.UTC)

PeakRateCycleEnd is the first instant that the peak rate cycle ends

View Source
var PeakRateCycleStart = time.Date(TestYear, time.May, 15, 0, 0, 0, 0, time.UTC)

PeakRateCycleStart is the first instant that the peak rate cycle starts

View Source
var PerformancePeriodEnd = time.Date(TestYear, time.July, 31, 0, 0, 0, 0, time.UTC)

PerformancePeriodEnd is the last day of the first performance period

View Source
var PerformancePeriodStart = time.Date(TestYear, time.May, 15, 0, 0, 0, 0, time.UTC)

PerformancePeriodStart is the first day of the first performance period

View Source
var RateEngineDate = time.Date(TestYear, time.May, 18, 0, 0, 0, 0, time.UTC)

RateEngineDate is a date for the rate engine to use on generation for tests.

View Source
var TestYear = 2018

TestYear is the default year for testing.

Functions

func ConvertUUIDStringToUUID

func ConvertUUIDStringToUUID(uuidString string) uuid.UUID

ConvertUUIDStringToUUID takes a uuid string and converts it to uuid.UUID; panic if uuid string isn't a valid UUID.

func CurrentDateWithoutTime

func CurrentDateWithoutTime() *time.Time

CurrentDateWithoutTime returns a pointer to a time.Time, stripped of any time info (so date only).

func FetchOrMakeGHCDieselFuelPrice

func FetchOrMakeGHCDieselFuelPrice(db *pop.Connection, assertions Assertions) models.GHCDieselFuelPrice

func FetchOrMakeReContract

func FetchOrMakeReContract(db *pop.Connection, assertions Assertions) models.ReContract

func FetchOrMakeReContractYear

func FetchOrMakeReContractYear(db *pop.Connection, assertions Assertions) models.ReContractYear

func FetchOrMakeReDomesticLinehaulPrice

func FetchOrMakeReDomesticLinehaulPrice(db *pop.Connection, assertions Assertions) models.ReDomesticLinehaulPrice

func FetchOrMakeReDomesticOtherPrice

func FetchOrMakeReDomesticOtherPrice(db *pop.Connection, assertions Assertions) models.ReDomesticOtherPrice

func FetchOrMakeReDomesticServiceArea

func FetchOrMakeReDomesticServiceArea(db *pop.Connection, assertions Assertions) models.ReDomesticServiceArea

func FetchOrMakeReDomesticServiceAreaPrice

func FetchOrMakeReDomesticServiceAreaPrice(db *pop.Connection, assertions Assertions) models.ReDomesticServiceAreaPrice

func FetchOrMakeReRateArea

func FetchOrMakeReRateArea(db *pop.Connection, assertions Assertions) models.ReRateArea

FetchOrMakeReRateArea returns the ReRateArea for a given rate area code, or creates one if the rate area does not exist yet.

func FetchOrMakeReService

func FetchOrMakeReService(db *pop.Connection, assertions Assertions) models.ReService

FetchOrMakeReService returns the ReService for a given service code, or creates one if the service code does not exist yet.

func FetchOrMakeReZip3

func FetchOrMakeReZip3(db *pop.Connection, assertions Assertions) models.ReZip3

func FetchOrMakeServiceItemParamKey

func FetchOrMakeServiceItemParamKey(db *pop.Connection, assertions Assertions) models.ServiceItemParamKey

FetchOrMakeServiceItemParamKey returns the ServiceItemParamKey for a given param key, or creates one if the param key does not exist yet.

func Fixture

func Fixture(name string) afero.File

Fixture opens a file from the testdata dir

func FixtureRuntimeFile

func FixtureRuntimeFile(name string) *runtime.File

FixtureRuntimeFile allows us to include a fixture like a PDF in the test

func GetOrCreateDocument

func GetOrCreateDocument(db *pop.Connection, document models.Document, assertions Assertions) models.Document

GetOrCreateDocument checks if a document exists. If it does, it returns it, otherwise, it creates it

func GetOrCreateDocumentWithUploads

func GetOrCreateDocumentWithUploads(db *pop.Connection, document models.Document, assertions Assertions) models.Document

GetOrCreateDocumentWithUploads checks if a document exists. If it doesn't, it creates it. Then checks if the document has any uploads. If not, creates an upload associated with the document. Returns the document at the end. This function expects to get a specific document assertion since we're dealing with multiple documents in this overall file.

Usage example:

emptyDocument := GetOrCreateDocumentWithUploads(db, assertions.WeightTicket.EmptyDocument, assertions)

func LookupOrMakeRole

func LookupOrMakeRole(db *pop.Connection, roleType roles.RoleType, roleName roles.RoleName) (roles.Role, error)

lookup a role by role type, if it doesn't exist make it

func LookupOrMakeRoleByRoleType

func LookupOrMakeRoleByRoleType(db *pop.Connection, roleType roles.RoleType) (roles.Role, error)

lookup a role by role type, if it doesn't exist make it

func MakeAddress

func MakeAddress(db *pop.Connection, assertions Assertions) models.Address

MakeAddress creates a single Address and associated service member.

func MakeAddress2

func MakeAddress2(db *pop.Connection, assertions Assertions) models.Address

MakeAddress2 creates a different single Address and associated service member.

func MakeAddress3

func MakeAddress3(db *pop.Connection, assertions Assertions) models.Address

MakeAddress3 creates a different single Address and associated service member.

func MakeDefaultAddress

func MakeDefaultAddress(db *pop.Connection) models.Address

MakeDefaultAddress makes an Address with default values

func MakeDefaultDistanceCalculation

func MakeDefaultDistanceCalculation(db *pop.Connection) models.DistanceCalculation

MakeDefaultDistanceCalculation returns a DistanceCalculation with default values

func MakeDefaultElectronicOrder

func MakeDefaultElectronicOrder(db *pop.Connection) models.ElectronicOrder

MakeDefaultElectronicOrder return an ElectronicOrder with default values (including a default ElectronicOrdersRevision)

func MakeDefaultFuelEIADieselPriceForDate

func MakeDefaultFuelEIADieselPriceForDate(db *pop.Connection, shipmentDate time.Time) models.FuelEIADieselPrice

MakeDefaultFuelEIADieselPriceForDate creates a single FuelEIADieselPrice record with default values for a given shipmentDate

func MakeDefaultFuelEIADieselPrices

func MakeDefaultFuelEIADieselPrices(db *pop.Connection)

MakeDefaultFuelEIADieselPrices creates a single FuelEIADieselPrice record with default values for a given shipmentDate

func MakeDefaultMTOServiceItem

func MakeDefaultMTOServiceItem(db *pop.Connection) models.MTOServiceItem

MakeDefaultMTOServiceItem returns a MTOServiceItem with default values

func MakeDefaultMTOServiceItemDimension

func MakeDefaultMTOServiceItemDimension(db *pop.Connection) models.MTOServiceItemDimension

MakeDefaultMTOServiceItemDimension returns a MTOServiceItemDimension with default values

func MakeDefaultReContract

func MakeDefaultReContract(db *pop.Connection) models.ReContract

MakeDefaultReContract makes a single ReContract with default values

func MakeDefaultReContractYear

func MakeDefaultReContractYear(db *pop.Connection) models.ReContractYear

MakeDefaultReContractYear makes a single ReContractYear with default values

func MakeDefaultReDomesticLinehaulPrice

func MakeDefaultReDomesticLinehaulPrice(db *pop.Connection) models.ReDomesticLinehaulPrice

MakeDefaultReDomesticLinehaulPrice makes a single ReDomesticLinehaulPrice with default values

func MakeDefaultReDomesticServiceArea

func MakeDefaultReDomesticServiceArea(db *pop.Connection) models.ReDomesticServiceArea

MakeDefaultReDomesticServiceArea makes a single ReDomesticServiceArea with default values

func MakeDefaultReService

func MakeDefaultReService(db *pop.Connection) models.ReService

MakeDefaultReService makes a single ReService with default values

func MakeDefaultReZip3

func MakeDefaultReZip3(db *pop.Connection) models.ReZip3

MakeDefaultReZip3 makes a single ReZip3 with default values

func MakeDefaultRequestedReimbursement

func MakeDefaultRequestedReimbursement(db *pop.Connection) models.Reimbursement

MakeDefaultRequestedReimbursement makes a user with default values

func MakeDefaultServiceItemParamKey

func MakeDefaultServiceItemParamKey(db *pop.Connection) models.ServiceItemParamKey

MakeDefaultServiceItemParamKey makes a ServiceItemParamKey with default values

func MakeDefaultStorageFacility

func MakeDefaultStorageFacility(db *pop.Connection) models.StorageFacility

MakeDefaultStorageFacility makes a single StorageFacility with default values

func MakeDefaultUser

func MakeDefaultUser(db *pop.Connection) models.User

MakeDefaultUser makes a user with default values

func MakeDefaultWebhookSubscription

func MakeDefaultWebhookSubscription(db *pop.Connection) models.WebhookSubscription

MakeDefaultWebhookSubscription makes a WebhookSubscription with default values

func MakeDefaultZip3Distance

func MakeDefaultZip3Distance(db *pop.Connection) models.Zip3Distance

MakeDefaultZip3Distance makes a single Zip3Distance with default values

func MakeDistanceCalculation

func MakeDistanceCalculation(db *pop.Connection, assertions Assertions) models.DistanceCalculation

MakeDistanceCalculation creates a single DistanceCalculation

func MakeElectronicOrder

func MakeElectronicOrder(db *pop.Connection, assertions Assertions) models.ElectronicOrder

MakeElectronicOrder returns a single ElectronicOrder with a single ElectronicOrdersRevision

func MakeFuelEIADieselPriceForDate

func MakeFuelEIADieselPriceForDate(db *pop.Connection, shipmentDate time.Time, assertions Assertions) models.FuelEIADieselPrice

MakeFuelEIADieselPriceForDate creates a single FuelEIADieselPrice record for the date provided Note: this function is only good for generating one (1) record and should not be called multiple times from the same function, unless care is taken to NOT use overlapping rate periods. If multiple rate periods (FuelEIADieselPrice) records are needed use function MakeFuelEIADieselPrices or some variation of it spanning a range of dates.

func MakeFuelEIADieselPrices

func MakeFuelEIADieselPrices(db *pop.Connection, assertions Assertions)

MakeFuelEIADieselPrices creates a series of FuelEIADieselPrice records using a default range or the start and end dates from assertions also can set the fuel prices and baselines from the assertions

func MakeGHCDieselFuelPrice

func MakeGHCDieselFuelPrice(db *pop.Connection, assertions Assertions) models.GHCDieselFuelPrice

func MakeMTOServiceItem

func MakeMTOServiceItem(db *pop.Connection, assertions Assertions) models.MTOServiceItem

MakeMTOServiceItem creates a single MTOServiceItem and associated set relationships

func MakeMTOServiceItemBasic

func MakeMTOServiceItemBasic(db *pop.Connection, assertions Assertions) models.MTOServiceItem

MakeMTOServiceItemBasic creates a single MTOServiceItem that is a basic type, meaning no shipment id associated.

func MakeMTOServiceItemCustomerContact

func MakeMTOServiceItemCustomerContact(db *pop.Connection, assertions Assertions) models.MTOServiceItemCustomerContact

MakeMTOServiceItemCustomerContact creates a single customer contact and associated set relationships

func MakeMTOServiceItemDimension

func MakeMTOServiceItemDimension(db *pop.Connection, assertions Assertions) models.MTOServiceItemDimension

MakeMTOServiceItemDimension creates a single MTOServiceItemDimension and associated set relationships

func MakeMTOServiceItemDomesticCrating

func MakeMTOServiceItemDomesticCrating(db *pop.Connection, assertions Assertions) models.MTOServiceItem

MakeMTOServiceItemDomesticCrating makes a domestic crating service item and its associated item and crate

func MakeMTOServiceItems

func MakeMTOServiceItems(db *pop.Connection) models.MTOServiceItems

MakeMTOServiceItems makes an array of MTOServiceItems

func MakeOfficeUser

func MakeOfficeUser(db *pop.Connection, assertions Assertions) models.OfficeUser

MakeOfficeUser creates a single office user and associated TransportOffice

func MakePWSViolation

func MakePWSViolation(db *pop.Connection, assertions Assertions) models.PWSViolation

func MakePaymentRequest

func MakePaymentRequest(db *pop.Connection, assertions Assertions) models.PaymentRequest

MakePaymentRequest creates a single PaymentRequest and associated set relationships

func MakeRandomNumberString

func MakeRandomNumberString(n int) string

MakeRandomNumberString makes a random numeric string of specified length

func MakeRandomString

func MakeRandomString(n int) string

Returns a random alphanumeric string of specified length

func MakeReContract

func MakeReContract(db *pop.Connection, assertions Assertions) models.ReContract

MakeReContract creates a single ReContract

func MakeReContractYear

func MakeReContractYear(db *pop.Connection, assertions Assertions) models.ReContractYear

MakeReContractYear creates a single ReContractYear with associations

func MakeReDomesticLinehaulPrice

func MakeReDomesticLinehaulPrice(db *pop.Connection, assertions Assertions) models.ReDomesticLinehaulPrice

MakeReDomesticLinehaulPrice creates a single ReDomesticLinehaulPrice

func MakeReDomesticOtherPrice

func MakeReDomesticOtherPrice(db *pop.Connection, assertions Assertions) models.ReDomesticOtherPrice

func MakeReDomesticServiceArea

func MakeReDomesticServiceArea(db *pop.Connection, assertions Assertions) models.ReDomesticServiceArea

MakeReDomesticServiceArea creates a single ReDomesticServiceArea

func MakeReDomesticServiceAreaPrice

func MakeReDomesticServiceAreaPrice(db *pop.Connection, assertions Assertions) models.ReDomesticServiceAreaPrice

func MakeReService

func MakeReService(db *pop.Connection, assertions Assertions) models.ReService

MakeReService creates a single ReService

func MakeReZip3

func MakeReZip3(db *pop.Connection, assertions Assertions) models.ReZip3

MakeReZip3 creates a single ReZip3

func MakeReZip5RateArea

func MakeReZip5RateArea(db *pop.Connection, assertions Assertions) models.ReZip5RateArea

MakeReZip5RateArea creates a single ReZip5RateArea

func MakeReportViolation

func MakeReportViolation(db *pop.Connection, assertions Assertions) models.ReportViolation

func MakeRequestedReimbursement

func MakeRequestedReimbursement(db *pop.Connection, assertions Assertions) models.Reimbursement

MakeRequestedReimbursement creates a single requested status Reimbursement

func MakeReweigh

func MakeReweigh(db *pop.Connection, assertions Assertions) models.Reweigh

MakeReweigh creates a reweigh request for a shipment with required fields

func MakeReweighForShipment

func MakeReweighForShipment(db *pop.Connection, assertions Assertions, shipment models.MTOShipment, pound unit.Pound) models.Reweigh

MakeReweighForShipment creates a reweigh request for given shipment and a given weight.

func MakeReweighWithNoWeightForShipment

func MakeReweighWithNoWeightForShipment(db *pop.Connection, assertions Assertions, shipment models.MTOShipment) models.Reweigh

MakeReweighWithNoWeightForShipment creates a reweigh request for a given shipment. It leaves the weight field empty to simulate that no reweigh was done.

func MakeRole

func MakeRole(db *pop.Connection, assertions Assertions) roles.Role

MakeRole creates a single Role defaulting to the customer.

func MakeServiceItemParamKey

func MakeServiceItemParamKey(db *pop.Connection, assertions Assertions) models.ServiceItemParamKey

MakeServiceItemParamKey creates a single ServiceItemParamKey

func MakeServiceParam

func MakeServiceParam(db *pop.Connection, assertions Assertions) models.ServiceParam

MakeServiceParam creates a single ServiceParam

func MakeStorageFacility

func MakeStorageFacility(db *pop.Connection, assertions Assertions) models.StorageFacility

MakeStorageFacility creates a single SIT Extension and associated set relationships

func MakeStubbedMTOServiceItem

func MakeStubbedMTOServiceItem(db *pop.Connection) models.MTOServiceItem

MakeMTOServiceItem creates a single MTOServiceItem and associated set relationships

func MakeStubbedUser

func MakeStubbedUser(db *pop.Connection) models.User

MakeStubbedUser returns a user without hitting the DB

func MakeTransportationOffice

func MakeTransportationOffice(db *pop.Connection, assertions Assertions) models.TransportationOffice

MakeTransportationOffice creates a single TransportationOffice.

func MakeUpload

func MakeUpload(db *pop.Connection, assertions Assertions) models.Upload

MakeUpload creates a single Upload.

func MakeUser

func MakeUser(db *pop.Connection, assertions Assertions) models.User

MakeUser creates a single User It will not replace a true assertion with false.

func MakeUserWithRoleTypes

func MakeUserWithRoleTypes(db *pop.Connection, roleTypes []roles.RoleType, assertions Assertions) models.User

MakeUserWithRolesTypes creates or fetches Roles by roleTypes and creates a User with those role types

func MakeUsersRoles

func MakeUsersRoles(db *pop.Connection, assertions Assertions) models.UsersRoles

MakeUsersRoles ties roles to the user

func MakeWebhookSubscription

func MakeWebhookSubscription(db *pop.Connection, assertions Assertions) models.WebhookSubscription

MakeWebhookSubscription creates a single WebhookSubscription.

func MakeZip3Distance

func MakeZip3Distance(db *pop.Connection, assertions Assertions) models.Zip3Distance

MakeZip3Distance creates a single Zip3Distance

func MergeModels

func MergeModels(dst, src interface{})

MergeModels exposes the private function mergeModels

func MustSave

func MustSave(db *pop.Connection, model interface{})

func RandomEdipi

func RandomEdipi() string

RandomEdipi creates a random Edipi for a service member

func Save

func Save(db *pop.Connection, model interface{}) error

func SetInvoiceSequenceNumber

func SetInvoiceSequenceNumber(db *pop.Connection, scac string, year int, sequenceNumber int) error

SetInvoiceSequenceNumber sets the invoice sequence number for a given SCAC/year.

func SetupServiceAreaRateArea

func SetupServiceAreaRateArea(db *pop.Connection, assertions Assertions) (models.ReContractYear, models.ReDomesticServiceArea, models.ReRateArea, models.ReZip3)

SetupServiceAreaRateArea sets up contract, service area, rate area, zip3 returns contractYear, serviceArea, rateArea, reZip3

Types

type Assertions

type Assertions struct {
	Address                                  models.Address
	AdminUser                                models.AdminUser
	BackupContact                            models.BackupContact
	ClientCert                               models.ClientCert
	Contractor                               models.Contractor
	CustomerSupportRemark                    models.CustomerSupportRemark
	DestinationAddress                       models.Address
	DistanceCalculation                      models.DistanceCalculation
	Document                                 models.Document
	DutyLocation                             models.DutyLocation
	ElectronicOrder                          models.ElectronicOrder
	ElectronicOrdersRevision                 models.ElectronicOrdersRevision
	Entitlement                              models.Entitlement
	EvaluationReport                         models.EvaluationReport
	File                                     afero.File
	FuelEIADieselPrice                       models.FuelEIADieselPrice
	GHCDieselFuelPrice                       models.GHCDieselFuelPrice
	Invoice                                  models.Invoice
	LineOfAccounting                         models.LineOfAccounting
	Move                                     models.Move
	MovingExpense                            models.MovingExpense
	MTOAgent                                 models.MTOAgent
	MTOServiceItem                           models.MTOServiceItem
	MTOServiceItemCustomerContact            models.MTOServiceItemCustomerContact
	MTOServiceItemDimension                  models.MTOServiceItemDimension
	MTOServiceItemDimensionCrate             models.MTOServiceItemDimension
	MTOShipment                              models.MTOShipment
	Notification                             models.Notification
	OfficeUser                               models.OfficeUser
	Order                                    models.Order
	Organization                             models.Organization
	OriginDutyLocation                       models.DutyLocation
	PaymentRequest                           models.PaymentRequest
	PaymentRequestToInterchangeControlNumber models.PaymentRequestToInterchangeControlNumber
	PaymentServiceItem                       models.PaymentServiceItem
	PaymentServiceItemParam                  models.PaymentServiceItemParam
	PaymentServiceItemParams                 models.PaymentServiceItemParams
	PickupAddress                            models.Address
	PPMShipment                              models.PPMShipment
	PrimeUpload                              models.PrimeUpload
	PrimeUploader                            *uploader.PrimeUploader
	ProgearWeightTicket                      models.ProgearWeightTicket
	ProofOfServiceDoc                        models.ProofOfServiceDoc
	ReContract                               models.ReContract
	ReContractYear                           models.ReContractYear
	ReDomesticLinehaulPrice                  models.ReDomesticLinehaulPrice
	ReDomesticOtherPrice                     models.ReDomesticOtherPrice
	ReDomesticServiceArea                    models.ReDomesticServiceArea
	ReDomesticServiceAreaPrice               models.ReDomesticServiceAreaPrice
	Reimbursement                            models.Reimbursement
	Report                                   models.EvaluationReport
	ReportViolation                          models.ReportViolation
	ReRateArea                               models.ReRateArea
	ReService                                models.ReService
	Reweigh                                  models.Reweigh
	ReZip3                                   models.ReZip3
	ReZip5RateArea                           models.ReZip5RateArea
	Role                                     roles.Role
	SecondaryDeliveryAddress                 models.Address
	SecondaryPickupAddress                   models.Address
	ServiceItemParamKey                      models.ServiceItemParamKey
	ServiceMember                            models.ServiceMember
	ServiceParam                             models.ServiceParam
	SignedCertification                      models.SignedCertification
	SITDurationUpdate                        models.SITDurationUpdate
	StorageFacility                          models.StorageFacility
	Stub                                     bool
	TransportationAccountingCode             models.TransportationAccountingCode
	TransportationOffice                     models.TransportationOffice
	Upload                                   models.Upload
	Uploader                                 *uploader.Uploader
	UploadUseZeroBytes                       bool
	User                                     models.User
	UsersRoles                               models.UsersRoles
	UserUpload                               models.UserUpload
	UserUploader                             *uploader.UserUploader
	Violation                                models.PWSViolation
	WebhookNotification                      models.WebhookNotification
	WebhookSubscription                      models.WebhookSubscription
	WeightTicket                             models.WeightTicket
	Zip3Distance                             models.Zip3Distance
}

Assertions defines assertions about what the data contains

func EnsureServiceMemberIsSetUpInAssertionsForDocumentCreation

func EnsureServiceMemberIsSetUpInAssertionsForDocumentCreation(db *pop.Connection, assertions Assertions) Assertions

EnsureServiceMemberIsSetUpInAssertionsForDocumentCreation checks for ServiceMember in assertions, or creates one if none exists. Several of the document functions need a service member, but they don't always share assertions, look at the same assertion, or create the service members in the same ways. We'll check now to see if we already have one created, and if not, create one that we can place in the assertions for all the rest.

Directories

Path Synopsis
RA Summary: gosec - errcheck - Unchecked return value RA: Linter flags errcheck error: Ignoring a method's return value can cause the program to overlook unexpected states and conditions.
RA Summary: gosec - errcheck - Unchecked return value RA: Linter flags errcheck error: Ignoring a method's return value can cause the program to overlook unexpected states and conditions.

Jump to

Keyboard shortcuts

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