Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertUUIDStringToUUID(uuidString string) uuid.UUID
- func CurrentDateWithoutTime() *time.Time
- func FetchOrMakeGHCDieselFuelPrice(db *pop.Connection, assertions Assertions) models.GHCDieselFuelPrice
- func FetchOrMakeReContract(db *pop.Connection, assertions Assertions) models.ReContract
- func FetchOrMakeReContractYear(db *pop.Connection, assertions Assertions) models.ReContractYear
- func FetchOrMakeReDomesticLinehaulPrice(db *pop.Connection, assertions Assertions) models.ReDomesticLinehaulPrice
- func FetchOrMakeReDomesticOtherPrice(db *pop.Connection, assertions Assertions) models.ReDomesticOtherPrice
- func FetchOrMakeReDomesticServiceArea(db *pop.Connection, assertions Assertions) models.ReDomesticServiceArea
- func FetchOrMakeReDomesticServiceAreaPrice(db *pop.Connection, assertions Assertions) models.ReDomesticServiceAreaPrice
- func FetchOrMakeReRateArea(db *pop.Connection, assertions Assertions) models.ReRateArea
- func FetchOrMakeReService(db *pop.Connection, assertions Assertions) models.ReService
- func FetchOrMakeReZip3(db *pop.Connection, assertions Assertions) models.ReZip3
- func FetchOrMakeServiceItemParamKey(db *pop.Connection, assertions Assertions) models.ServiceItemParamKey
- func Fixture(name string) afero.File
- func FixtureRuntimeFile(name string) *runtime.File
- func GetOrCreateDocument(db *pop.Connection, document models.Document, assertions Assertions) models.Document
- func GetOrCreateDocumentWithUploads(db *pop.Connection, document models.Document, assertions Assertions) models.Document
- func LookupOrMakeRole(db *pop.Connection, roleType roles.RoleType, roleName roles.RoleName) (roles.Role, error)
- func LookupOrMakeRoleByRoleType(db *pop.Connection, roleType roles.RoleType) (roles.Role, error)
- func MakeAddress(db *pop.Connection, assertions Assertions) models.Address
- func MakeAddress2(db *pop.Connection, assertions Assertions) models.Address
- func MakeAddress3(db *pop.Connection, assertions Assertions) models.Address
- func MakeDefaultAddress(db *pop.Connection) models.Address
- func MakeDefaultDistanceCalculation(db *pop.Connection) models.DistanceCalculation
- func MakeDefaultElectronicOrder(db *pop.Connection) models.ElectronicOrder
- func MakeDefaultFuelEIADieselPriceForDate(db *pop.Connection, shipmentDate time.Time) models.FuelEIADieselPrice
- func MakeDefaultFuelEIADieselPrices(db *pop.Connection)
- func MakeDefaultMTOServiceItem(db *pop.Connection) models.MTOServiceItem
- func MakeDefaultMTOServiceItemDimension(db *pop.Connection) models.MTOServiceItemDimension
- func MakeDefaultReContract(db *pop.Connection) models.ReContract
- func MakeDefaultReContractYear(db *pop.Connection) models.ReContractYear
- func MakeDefaultReDomesticLinehaulPrice(db *pop.Connection) models.ReDomesticLinehaulPrice
- func MakeDefaultReDomesticServiceArea(db *pop.Connection) models.ReDomesticServiceArea
- func MakeDefaultReService(db *pop.Connection) models.ReService
- func MakeDefaultReZip3(db *pop.Connection) models.ReZip3
- func MakeDefaultRequestedReimbursement(db *pop.Connection) models.Reimbursement
- func MakeDefaultServiceItemParamKey(db *pop.Connection) models.ServiceItemParamKey
- func MakeDefaultStorageFacility(db *pop.Connection) models.StorageFacility
- func MakeDefaultUser(db *pop.Connection) models.User
- func MakeDefaultWebhookSubscription(db *pop.Connection) models.WebhookSubscription
- func MakeDefaultZip3Distance(db *pop.Connection) models.Zip3Distance
- func MakeDistanceCalculation(db *pop.Connection, assertions Assertions) models.DistanceCalculation
- func MakeElectronicOrder(db *pop.Connection, assertions Assertions) models.ElectronicOrder
- func MakeFuelEIADieselPriceForDate(db *pop.Connection, shipmentDate time.Time, assertions Assertions) models.FuelEIADieselPrice
- func MakeFuelEIADieselPrices(db *pop.Connection, assertions Assertions)
- func MakeGHCDieselFuelPrice(db *pop.Connection, assertions Assertions) models.GHCDieselFuelPrice
- func MakeMTOServiceItem(db *pop.Connection, assertions Assertions) models.MTOServiceItem
- func MakeMTOServiceItemBasic(db *pop.Connection, assertions Assertions) models.MTOServiceItem
- func MakeMTOServiceItemCustomerContact(db *pop.Connection, assertions Assertions) models.MTOServiceItemCustomerContact
- func MakeMTOServiceItemDimension(db *pop.Connection, assertions Assertions) models.MTOServiceItemDimension
- func MakeMTOServiceItemDomesticCrating(db *pop.Connection, assertions Assertions) models.MTOServiceItem
- func MakeMTOServiceItems(db *pop.Connection) models.MTOServiceItems
- func MakeOfficeUser(db *pop.Connection, assertions Assertions) models.OfficeUser
- func MakePWSViolation(db *pop.Connection, assertions Assertions) models.PWSViolation
- func MakePaymentRequest(db *pop.Connection, assertions Assertions) models.PaymentRequest
- func MakeRandomNumberString(n int) string
- func MakeRandomString(n int) string
- func MakeReContract(db *pop.Connection, assertions Assertions) models.ReContract
- func MakeReContractYear(db *pop.Connection, assertions Assertions) models.ReContractYear
- func MakeReDomesticLinehaulPrice(db *pop.Connection, assertions Assertions) models.ReDomesticLinehaulPrice
- func MakeReDomesticOtherPrice(db *pop.Connection, assertions Assertions) models.ReDomesticOtherPrice
- func MakeReDomesticServiceArea(db *pop.Connection, assertions Assertions) models.ReDomesticServiceArea
- func MakeReDomesticServiceAreaPrice(db *pop.Connection, assertions Assertions) models.ReDomesticServiceAreaPrice
- func MakeReService(db *pop.Connection, assertions Assertions) models.ReService
- func MakeReZip3(db *pop.Connection, assertions Assertions) models.ReZip3
- func MakeReZip5RateArea(db *pop.Connection, assertions Assertions) models.ReZip5RateArea
- func MakeReportViolation(db *pop.Connection, assertions Assertions) models.ReportViolation
- func MakeRequestedReimbursement(db *pop.Connection, assertions Assertions) models.Reimbursement
- func MakeReweigh(db *pop.Connection, assertions Assertions) models.Reweigh
- func MakeReweighForShipment(db *pop.Connection, assertions Assertions, shipment models.MTOShipment, ...) models.Reweigh
- func MakeReweighWithNoWeightForShipment(db *pop.Connection, assertions Assertions, shipment models.MTOShipment) models.Reweigh
- func MakeRole(db *pop.Connection, assertions Assertions) roles.Role
- func MakeServiceItemParamKey(db *pop.Connection, assertions Assertions) models.ServiceItemParamKey
- func MakeServiceParam(db *pop.Connection, assertions Assertions) models.ServiceParam
- func MakeStorageFacility(db *pop.Connection, assertions Assertions) models.StorageFacility
- func MakeStubbedMTOServiceItem(db *pop.Connection) models.MTOServiceItem
- func MakeStubbedUser(db *pop.Connection) models.User
- func MakeTransportationOffice(db *pop.Connection, assertions Assertions) models.TransportationOffice
- func MakeUpload(db *pop.Connection, assertions Assertions) models.Upload
- func MakeUser(db *pop.Connection, assertions Assertions) models.User
- func MakeUserWithRoleTypes(db *pop.Connection, roleTypes []roles.RoleType, assertions Assertions) models.User
- func MakeUsersRoles(db *pop.Connection, assertions Assertions) models.UsersRoles
- func MakeWebhookSubscription(db *pop.Connection, assertions Assertions) models.WebhookSubscription
- func MakeZip3Distance(db *pop.Connection, assertions Assertions) models.Zip3Distance
- func MergeModels(dst, src interface{})
- func MustSave(db *pop.Connection, model interface{})
- func RandomEdipi() string
- func Save(db *pop.Connection, model interface{}) error
- func SetInvoiceSequenceNumber(db *pop.Connection, scac string, year int, sequenceNumber int) error
- func SetupServiceAreaRateArea(db *pop.Connection, assertions Assertions) (models.ReContractYear, models.ReDomesticServiceArea, models.ReRateArea, ...)
- type Assertions
Constants ¶
const DefaultContractCode = "TRUSS_TEST"
DefaultContractCode is the default contract code for testing
const DefaultContractName = "Default contractor name for test"
DefaultContractName name used for contractor in testing
const DefaultContractNumber = "HTC111-11-1-1111"
DefaultContractNumber is the default contract number for testing
const DefaultContractType = "Prime"
DefaultContractType default prime type is Prime for testing
const DefaultServiceCode = "STEST"
DefaultServiceCode is the default service code for testing
const DefaultServiceItemParamKeyName = "testkey"
DefaultServiceItemParamKeyName is the default service code for testing
const DefaultWebhookSubscriptionCallbackURL = "/some/callback/url"
DefaultWebhookSubscriptionCallbackURL is the default webhooksubscription callback url for testing
Variables ¶
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
DateInsidePeakRateCycle is available as a convenient test date inside the Peak Rate Cycle
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.
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
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
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.
var DefaultCOS = "D"
DefaultCOS is the default Code of Service for testing.
var DefaultDepartmentIndicator = "57 - United States Air Force"
DefaultDepartmentIndicator is a code for orders accounting that indicates which branch the orders are for.
var DefaultDstGBLOC = "HAFC"
DefaultDstGBLOC is the default GBLOC for testing.
var DefaultDstRegion = "6"
DefaultDstRegion is a default region (US South West) for testing.
var DefaultMarket = "dHHG"
DefaultMarket is the default market for testing.
var DefaultServiceArea = "4"
DefaultServiceArea is the default Service Area for testing.
var DefaultSrcGBLOC = "KKFA"
DefaultSrcGBLOC is the default GBLOC for testing.
var DefaultSrcRateArea = "US87"
DefaultSrcRateArea is a default rate area (California) for testing.
var DefaultTransportationAccountingCode = "F8J1"
DefaultTransportationAccountingCode (TAC) is an accounting code used for orders.
var DefaultZip3 = "902"
DefaultZip3 is the default zip3 for testing
var GHCTestYear = 2020
GHCTestYear is the default for GHC rate engine testing
var NextValidMoveDate = dates.NextValidMoveDate(time.Now(), cal)
NextValidMoveDate is the next valid move date
NonPeakRateCycleEnd is the first instant that the peak rate cycle ends
NonPeakRateCycleStart is the first instant that the peak rate cycle starts
var OneDay = time.Hour * 24
OneDay creates a 1 day period
var OneWeek = time.Hour * 168
OneWeek creates a 1 week period
PeakRateCycleEnd is the first instant that the peak rate cycle ends
PeakRateCycleStart is the first instant that the peak rate cycle starts
PerformancePeriodEnd is the last day of the first performance period
PerformancePeriodStart is the first day of the first performance period
RateEngineDate is a date for the rate engine to use on generation for tests.
var TestYear = 2018
TestYear is the default year for testing.
Functions ¶
func ConvertUUIDStringToUUID ¶
ConvertUUIDStringToUUID takes a uuid string and converts it to uuid.UUID; panic if uuid string isn't a valid UUID.
func CurrentDateWithoutTime ¶
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 FixtureRuntimeFile ¶
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 ¶
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 ¶
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 ¶
MakeDefaultReService makes a single ReService with default values
func MakeDefaultReZip3 ¶
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 ¶
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 ¶
MakeRandomNumberString makes a random numeric string of specified length
func MakeRandomString ¶
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 ¶
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 RandomEdipi ¶
func RandomEdipi() string
RandomEdipi creates a random Edipi for a service member
func SetInvoiceSequenceNumber ¶
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.
Source Files ¶
- constants.go
- make_address.go
- make_backup_contact.go
- make_contractor.go
- make_distance_calculation.go
- make_document.go
- make_duty_location.go
- make_electronic_order.go
- make_entitlement.go
- make_evaluation_report.go
- make_fuel_eia_diesel_price.go
- make_ghc_diesel_fuel_price.go
- make_invoice.go
- make_move.go
- make_mto_service_item.go
- make_mto_service_item_customer_contact.go
- make_mto_service_item_dimension.go
- make_mto_shipment.go
- make_office_user.go
- make_order.go
- make_payment_request.go
- make_postal_code_to_gbloc.go
- make_pricing_data.go
- make_pws_violation.go
- make_re_contract.go
- make_re_contract_year.go
- make_re_domestic_linehaul_price.go
- make_re_domestic_other_price.go
- make_re_domestic_service_area.go
- make_re_domestic_service_area_price.go
- make_re_rate_area.go
- make_re_service.go
- make_re_zip3.go
- make_re_zip5_rate_area.go
- make_reimbursement.go
- make_report_violation.go
- make_reweigh.go
- make_role.go
- make_service_item_param_key.go
- make_service_member.go
- make_service_param.go
- make_storage_facility.go
- make_transportation_office.go
- make_upload.go
- make_user.go
- make_user_upload.go
- make_webhook_subscription.go
- make_zip3_distance.go
- shared.go
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. |