factory

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: 35 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 DummyClientID = "dummyClientID"
View Source
const DummyOktaCallbackURL = "https://dummy.okta.com/auth/callback"
View Source
const DummyOktaOrgURL = "https://dummy.okta.com"
View Source
const DummySecret = "dummySecret"

Variables

View Source
var Addresses = addressGroup{
	PickupAddress:                 "PickupAddress",
	DeliveryAddress:               "DeliveryAddress",
	SecondaryPickupAddress:        "SecondaryPickupAddress",
	SecondaryDeliveryAddress:      "SecondaryDeliveryAddress",
	ResidentialAddress:            "ResidentialAddress",
	BackupMailingAddress:          "BackupMailingAddress",
	DutyLocationAddress:           "DutyLocationAddress",
	DutyLocationTOAddress:         "DutyLocationTOAddress",
	SITAddressUpdateNewAddress:    "SITAddressUpdateNewAddress",
	SITAddressUpdateOldAddress:    "SITAddressUpdateOldAddress",
	SITOriginHHGOriginalAddress:   "SITOriginHHGOriginalAddress",
	SITOriginHHGActualAddress:     "SITOriginHHGActualAddress",
	SITDestinationFinalAddress:    "SITDestinationFinalAddress",
	SITDestinationOriginalAddress: "SITDestinationOriginalAddress",
	W2Address:                     "W2Address",
	OriginalAddress:               "OriginalAddress",
	NewAddress:                    "NewAddress",
}

Addresses is the struct to access the various fields externally

View Source
var Dimensions = dimensionGroup{

	CrateDimension: "CrateDimension",
	ItemDimension:  "ItemDimension",
}

Dimensions is the struct to access the fields externally

View Source
var Documents = documentGroup{

	UploadedOrders:        "UploadedOrders",
	UploadedAmendedOrders: "UploadedAmendedOrders",
}
View Source
var DummyOIDCScope = []string{"openid", "profile", "email"}
View Source
var DutyLocations = dutyLocationsGroup{

	OriginDutyLocation: "OriginDutyLocation",
	NewDutyLocation:    "NewDutyLocation",
}

DutyLocations is the struct to access the fields externally

View Source
var ErrNestedModel = errors.New("NESTED_MODEL_ERROR")
View Source
var GHCTestYear = 2020

GHCTestYear is the default for GHC rate engine testing

View Source
var TransportationOffices = transportationOfficeGroup{
	OriginDutyLocation: "OriginDutyLocationTransportationOffice",
	NewDutyLocation:    "NewDutyLocationTransportationOffice",
	CloseoutOffice:     "CloseoutOffice",
}

TransportationOffices is the struct to access the fields externally

View Source
var Uploads = uploadGroup{
	UploadTypePrime: "UploadTypePrime",
	UploadTypeUser:  "UploadTypeUser",
}

Uploads is the struct to access the fields externally

Functions

func AddMovingExpenseToPPMShipment

func AddMovingExpenseToPPMShipment(db *pop.Connection, ppmShipment *models.PPMShipment, userUploader *uploader.UserUploader, movingExpenseTemplate *models.MovingExpense)

AddMovingExpenseToPPMShipment adds a progear weight ticket to an existing PPMShipment

func AddPPMShipmentToMTOShipment

func AddPPMShipmentToMTOShipment(db *pop.Connection, mtoShipment *models.MTOShipment, ppmShipment models.PPMShipment)

func AddPaymentPacketToPPMShipment

func AddPaymentPacketToPPMShipment(db *pop.Connection, ppmShipment *models.PPMShipment, userUploader *uploader.UserUploader)

AddPaymentPacketToPPMShipment adds a payment packet to a PPMShipment. It is to the caller to save the shipment changes.

func AddProgearWeightTicketToPPMShipment

func AddProgearWeightTicketToPPMShipment(db *pop.Connection, ppmShipment *models.PPMShipment, userUploader *uploader.UserUploader, progearWeightTicketTemplate *models.ProgearWeightTicket)

AddProgearWeightTicketToPPMShipment adds a progear weight ticket to an existing PPMShipment

func AddSignedCertificationToPPMShipment

func AddSignedCertificationToPPMShipment(db *pop.Connection, ppmShipment *models.PPMShipment, signedCertification models.SignedCertification)

func AddWeightTicketToPPMShipment

func AddWeightTicketToPPMShipment(db *pop.Connection, ppmShipment *models.PPMShipment, userUploader *uploader.UserUploader, weightTicketTemplate *models.WeightTicket)

AddWeightTicketToPPMShipment adds a weight ticket to an existing PPMShipment

func BuildAddress

func BuildAddress(db *pop.Connection, customs []Customization, traits []Trait) models.Address

BuildAddress creates a single Address. Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildAdminUser

func BuildAdminUser(db *pop.Connection, customs []Customization, traits []Trait) models.AdminUser

BuildAdminUser creates an AdminUser Also creates, if not provided

  • User

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildApprovalsRequestedMove

func BuildApprovalsRequestedMove(db *pop.Connection, customs []Customization, traits []Trait) models.Move

func BuildAvailableToPrimeMove

func BuildAvailableToPrimeMove(db *pop.Connection, customs []Customization, traits []Trait) models.Move

BuildAvailableMove builds a Move that is available to the prime

func BuildBackupContact

func BuildBackupContact(db *pop.Connection, customs []Customization, traits []Trait) models.BackupContact

BuildBackupContact creates a single BackupContact. Also creates, if not provided - ServiceMember Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildBaseMTOShipment

func BuildBaseMTOShipment(db *pop.Connection, customs []Customization, traits []Trait) models.MTOShipment

BuildBaseMTOShipment creates a single MTOShipment with the base set of data required for a shipment.

func BuildClientCert

func BuildClientCert(db *pop.Connection, customs []Customization, traits []Trait) models.ClientCert

BuildClientCert creates a single ClientCert Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildContractor

func BuildContractor(db *pop.Connection, customs []Customization, traits []Trait) models.Contractor

BuildContractor creates a single Contractor Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildCustomerSupportRemark

func BuildCustomerSupportRemark(db *pop.Connection, customs []Customization, traits []Trait) models.CustomerSupportRemark

BuildCustomerSupportRemark creates a single CustomerSupportRemark. Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildDDFSITReService

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

BuildDDFSITReService creates the three destination SIT service codes: DDFSIT, DDASIT, DDDSIT. Returns DDFSIT only.

func BuildDOFSITReService

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

BuildDOFSITReService creates the three origin SIT service codes: DOFSIT, DOPSIT, DOASIT. Returns DOFSIT only.

func BuildDefaultAddress

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

BuildDefaultAddress makes an Address with default values

func BuildDefaultAdminUser

func BuildDefaultAdminUser(db *pop.Connection) models.AdminUser

BuildDefaultAdminUser returns an admin user with appropriate email Also creates

  • User

func BuildDefaultLineOfAccounting

func BuildDefaultLineOfAccounting(db *pop.Connection) models.LineOfAccounting

func BuildDefaultTransportationAccountingCode

func BuildDefaultTransportationAccountingCode(db *pop.Connection) models.TransportationAccountingCode

func BuildDefaultTransportationOffice

func BuildDefaultTransportationOffice(db *pop.Connection) models.TransportationOffice

BuildDefaultTransportationOffice creates one with a phoneline hooked up.

func BuildDefaultUsPostRegionCity

func BuildDefaultUsPostRegionCity(db *pop.Connection) models.UsPostRegionCity

Creates a default UsPostRegionCity for MacDill AFB, Florida

func BuildDefaultUser

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

BuildDefaultUser creates an active user db can be set to nil to create a stubbed model that is not stored in DB.

func BuildDestSITServiceItems

func BuildDestSITServiceItems(db *pop.Connection, move models.Move, shipment models.MTOShipment, entryDate *time.Time, departureDate *time.Time) models.MTOServiceItems

BuildDestSITServiceItems makes all of the service items that are associated with Destination SIT. A move and shipment that exist in the db are required params, and entryDate and departureDate can be specificed optionally.

func BuildDestSITServiceItemsNoSITDepartureDate

func BuildDestSITServiceItemsNoSITDepartureDate(db *pop.Connection, move models.Move, shipment models.MTOShipment, entryDate *time.Time) models.MTOServiceItems

func BuildDocument

func BuildDocument(db *pop.Connection, customs []Customization, traits []Trait) models.Document

BuildDocument creates a single Document. Also creates, if not provided - ServiceMember Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildDocumentLinkServiceMember

func BuildDocumentLinkServiceMember(db *pop.Connection, serviceMember models.ServiceMember) models.Document

func BuildDutyLocation

func BuildDutyLocation(db *pop.Connection, customs []Customization, traits []Trait) models.DutyLocation

BuildDutyLocation creates a single DutyLocation Also creates:

  • Address of the DL (use Addresses.DutyLocationAddress)
  • TransportationOffice
  • Address of the TO (use Addresses.DutyLocationTOAddress)

Params:

  • customs is a slice that will be modified by the factory
  • db can be set to nil to create a stubbed model that is not stored in DB.

Example:

dutyLocation := BuildDutyLocation(suite.DB(), []Customization{
       {Model: customDutyLocation},
       {Model: customDutyLocationAddress, Type: &Addresses.DutyLocationAddress},
       {Model: customTransportationOfficeAddress, Type: &Addresses.DutyLocationTOAddress},
       }, nil)

func BuildDutyLocationWithoutTransportationOffice

func BuildDutyLocationWithoutTransportationOffice(db *pop.Connection, customs []Customization, traits []Trait) models.DutyLocation

BuildDutyLocationWithoutTransportationOffice returns a duty location without a transportation office. Also creates:

  • Address of the DL (use Addresses.DutyLocationAddress)
  • Will not create a Transportation Office even if one is supplied in the customizations or traits

Params:

  • customs is a slice that will be modified by the factory
  • db can be set to nil to create a stubbed model that is not stored in DB.

Example:

dutyLocation := BuildDutyLocationWithoutTransportationOffice(suite.DB(), []Customization{
       {Model: customDutyLocation},
       {Model: customDutyLocationAddress, Type: &Addresses.DutyLocationAddress},
       }, nil)

func BuildEntitlement

func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trait) models.Entitlement

BuildEntitlement creates an Entitlement Does not create other models If Orders customization is provided - it will use the grade to calculate weight allotment Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildEvaluationReport

func BuildEvaluationReport(db *pop.Connection, customs []Customization, traits []Trait) models.EvaluationReport

BuildEvaluationReport creates an unsubmitted EvaluationReport. Also creates, if not provided - OfficeUser - Move

Notes: if evaluation report Type == models.EvaluationReportTypeShipment, it also creates

  • MTOShipment

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildExtendedServiceMember

func BuildExtendedServiceMember(db *pop.Connection, customs []Customization, traits []Trait) models.ServiceMember

BuildExtendedServiceMember creates a single ServiceMember If not provided it will also create an associated

  • User,
  • ResidentialAddress
  • BackupMailingAddress
  • DutyLocation
  • BackupContact

func BuildFullDLHMTOServiceItems

func BuildFullDLHMTOServiceItems(db *pop.Connection, customs []Customization, traits []Trait) (models.Move, models.MTOServiceItems)

BuildFullDLHMTOServiceItems makes a DLH type service item along with all its expected parameters returns the created move and all service items

NOTE: the original did an override of the MTOShipment.Status to ensure it was Approved, but that is now the responsibility of the caller

func BuildFullLineOfAccounting

func BuildFullLineOfAccounting(db *pop.Connection, customs []Customization, traits []Trait) models.LineOfAccounting

func BuildFullOriginMTOServiceItems

func BuildFullOriginMTOServiceItems(db *pop.Connection, customs []Customization, traits []Trait) (models.Move, models.MTOServiceItems)

BuildFullOriginMTOServiceItems (follow-on to BuildFullDLHMTOServiceItem) makes a DLH type service item along with all its expected parameters returns the created move and all service items

NOTE: the original did an override of the MTOShipment.Status to ensure it was Approved, but that is now the responsibility of the caller

func BuildFullTransportationAccountingCode

func BuildFullTransportationAccountingCode(db *pop.Connection) models.TransportationAccountingCode

func BuildLineOfAccounting

func BuildLineOfAccounting(db *pop.Connection, customs []Customization, traits []Trait) models.LineOfAccounting

func BuildMTOAgent

func BuildMTOAgent(db *pop.Connection, customs []Customization, traits []Trait) models.MTOAgent

func BuildMTOServiceItem

func BuildMTOServiceItem(db *pop.Connection, customs []Customization, traits []Trait) models.MTOServiceItem

BuildMTOServiceItem creates a single extended MTOServiceItem

func BuildMTOServiceItemBasic

func BuildMTOServiceItemBasic(db *pop.Connection, customs []Customization, traits []Trait) models.MTOServiceItem

BuildMTOServiceItemBasic creates a single basic MTOServiceItem

func BuildMTOServiceItemDimension

func BuildMTOServiceItemDimension(db *pop.Connection, customs []Customization, traits []Trait) models.MTOServiceItemDimension

func BuildMTOShipment

func BuildMTOShipment(db *pop.Connection, customs []Customization, traits []Trait) models.MTOShipment

BuildMTOShipment creates a single MTOShipment and associated set relationships It will make a move record, if one is not provided. It will make pickup addresses if the shipment type is not one of (HHGOutOfNTSDom, PPM) It will make delivery addresses if the shipment type is not one of (HHGIntoNTSDom, PPM) It will make a storage facility if the shipment type is HHGOutOfNTSDom

func BuildMTOShipmentMinimal

func BuildMTOShipmentMinimal(db *pop.Connection, customs []Customization, traits []Trait) models.MTOShipment

BuildMTOShipmentMinimal creates a single MTOShipment with a minimal set of data as could be possible through the UI for any shipment that doesn't have a child table associated with the MTOShipment model. It does not create associated addresses.

func BuildMTOShipmentWithMove

func BuildMTOShipmentWithMove(move *models.Move, db *pop.Connection, customs []Customization, traits []Trait) models.MTOShipment

func BuildMinimalAddress

func BuildMinimalAddress(db *pop.Connection, customs []Customization, traits []Trait) models.Address

func BuildMinimalPPMShipment

func BuildMinimalPPMShipment(db *pop.Connection, customs []Customization, traits []Trait) models.PPMShipment

func BuildMove

func BuildMove(db *pop.Connection, customs []Customization, traits []Trait) models.Move

func BuildMoveWithPPMShipment

func BuildMoveWithPPMShipment(db *pop.Connection, customs []Customization, traits []Trait) models.Move

func BuildMoveWithShipment

func BuildMoveWithShipment(db *pop.Connection, customs []Customization, traits []Trait) models.Move

BuildMoveWithShipment builds a submitted move with a submitted HHG shipment

func BuildMovingExpense

func BuildMovingExpense(db *pop.Connection, customs []Customization, traits []Trait) models.MovingExpense

func BuildNTSRShipment

func BuildNTSRShipment(db *pop.Connection, customs []Customization, traits []Trait) models.MTOShipment

func BuildNTSShipment

func BuildNTSShipment(db *pop.Connection, customs []Customization, traits []Trait) models.MTOShipment

func BuildNeedsServiceCounselingMove

func BuildNeedsServiceCounselingMove(db *pop.Connection, customs []Customization, traits []Trait) models.Move

func BuildNotification

func BuildNotification(db *pop.Connection, customs []Customization, traits []Trait) models.Notification

BuildNotification creates a single Notification. Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildOfficePhoneLine

func BuildOfficePhoneLine(db *pop.Connection, customs []Customization, traits []Trait) models.OfficePhoneLine

BuildOfficePhoneLine creates a OfficePhoneLine Also creates, if not provided - TransportationOffice Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildOfficeUser

func BuildOfficeUser(db *pop.Connection, customs []Customization, traits []Trait) models.OfficeUser

BuildOfficeUser creates an OfficeUser Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB. Notes:

  • To build an office user with one or more roles use BuildOfficeUserWithRoles
  • There's a uniqueness constraint on office user emails so use the GetTraitOfficeUserEmail trait when creating a test with multiple office users
  • The OfficeUser returned won't have an ID if the db is nil. If an ID is needed for a stubbed user, use trait GetTraitOfficeUserWithID

func BuildOfficeUserWithPrivileges

func BuildOfficeUserWithPrivileges(db *pop.Connection, customs []Customization, traits []Trait) models.OfficeUser

BuildOfficeUserWithPrivileges returns an office user with an ID, unique email, and privileges Also creates

  • User
  • Privilege
  • UsersPrivileges

Notes:

  • privilegeTypes passed into the function will overwrite over any privileges in a User customization
  • a unique email for the user will be created
  • a UUID will be added to the OfficeUser record when it's stubbed

func BuildOfficeUserWithRoles

func BuildOfficeUserWithRoles(db *pop.Connection, customs []Customization, roleTypes []roles.RoleType) models.OfficeUser

BuildOfficeUserWithRoles returns an office user with an ID, unique email, and roles Also creates

  • User
  • Role
  • UsersRoles

Notes:

  • roleTypes passed into the function will overwrite over any roles in a User customization
  • a unique email for the user will be created
  • a UUID will be added to the OfficeUser record when it's stubbed

func BuildOktaProvider

func BuildOktaProvider(name string) (*okta.Provider, error)

func BuildOrder

func BuildOrder(db *pop.Connection, customs []Customization, traits []Trait) models.Order

BuildOrder creates an Order.

Params:

  • customs is a slice that will be modified by the factory
  • db can be set to nil to create a stubbed model that is not stored in DB.

func BuildOrderWithoutDefaults

func BuildOrderWithoutDefaults(db *pop.Connection, customs []Customization, traits []Trait) models.Order

BuildOrderWithoutDefaults creates an Order that only includes fields that the server member would have supplied prior to uploading their documents

Params:

  • customs is a slice that will be modified by the factory
  • db can be set to nil to create a stubbed model that is not stored in DB.

func BuildOrganization

func BuildOrganization(db *pop.Connection, customs []Customization, traits []Trait) models.Organization

BuildOrganization creates a Organization Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildOriginSITServiceItems

func BuildOriginSITServiceItems(db *pop.Connection, move models.Move, shipment models.MTOShipment, entryDate *time.Time, departureDate *time.Time) models.MTOServiceItems

BuildOriginSITServiceItems makes all of the service items that are associated with Origin SIT. A move and shipment that exist in the db are required params, and entryDate and departureDate can be specificed optionally.

func BuildPPMShipment

func BuildPPMShipment(db *pop.Connection, customs []Customization, traits []Trait) models.PPMShipment

func BuildPPMShipmentReadyForFinalCustomerCloseOut

func BuildPPMShipmentReadyForFinalCustomerCloseOut(db *pop.Connection, userUploader *uploader.UserUploader, customs []Customization) models.PPMShipment

BuildPPMShipmentReadyForFinalCustomerCloseOut creates a single PPMShipment that has customer documents and is ready for the customer to sign and submit.

This function does not accept traits directly to reduce the complexity of supporting different variations for tests

func BuildPPMShipmentReadyForFinalCustomerCloseOutWithAllDocTypes

func BuildPPMShipmentReadyForFinalCustomerCloseOutWithAllDocTypes(db *pop.Connection, userUploader *uploader.UserUploader) models.PPMShipment

BuildPPMShipmentReadyForFinalCustomerCloseOutWithAllDocTypes creates a single PPMShipment that has one of each type of customer documents (weight ticket, pro-gear weight ticket, and a moving expense) and is ready for the customer to sign and submit.

This function does not accept customizations to reduce the complexity of supporting different variations for tests

func BuildPPMShipmentThatNeedsPaymentApproval

func BuildPPMShipmentThatNeedsPaymentApproval(db *pop.Connection, userUploader *uploader.UserUploader, customs []Customization) models.PPMShipment

BuildPPMShipmentThatNeedsPaymentApproval creates a PPMShipment that is waiting for a counselor to review after a customer has submitted all the necessary documents.

This function needs to accept customizations, but that somewhat complicates the private functions above

func BuildPPMShipmentThatNeedsPaymentApprovalWithAllDocTypes

func BuildPPMShipmentThatNeedsPaymentApprovalWithAllDocTypes(db *pop.Connection, userUploader *uploader.UserUploader) models.PPMShipment

BuildPPMShipmentThatNeedsPaymentApprovalWithAllDocTypes creates a PPMShipment that contains one of each type of customer document (weight ticket, pro-gear weight ticket, and a moving expense) that is waiting for a counselor to review after a customer has submitted their documents.

This function does not accept customizations to reduce the complexity of supporting different variations for tests

func BuildPPMShipmentThatNeedsToBeResubmitted

func BuildPPMShipmentThatNeedsToBeResubmitted(db *pop.Connection, userUploader *uploader.UserUploader) models.PPMShipment

BuildPPMShipmentThatNeedsToBeResubmitted creates a PPMShipment that a counselor has sent back to the customer

This function does not accept customizations to reduce the complexity of supporting different variations for tests

func BuildPPMShipmentWithAllDocTypesApproved

func BuildPPMShipmentWithAllDocTypesApproved(db *pop.Connection, userUploader *uploader.UserUploader) models.PPMShipment

BuildPPMShipmentWithAllDocTypesApproved creates a PPMShipment that has at least one of each doc type, all approved, and has had a payment packet generated & saved.

This function does not accept customizations to reduce the complexity of supporting different variations for tests

func BuildPPMShipmentWithAllDocTypesApprovedMissingPaymentPacket

func BuildPPMShipmentWithAllDocTypesApprovedMissingPaymentPacket(db *pop.Connection, userUploader *uploader.UserUploader, customs []Customization) models.PPMShipment

BuildPPMShipmentWithAllDocTypesApprovedMissingPaymentPacket creates a PPMShipment that has at least one of each doc type, all approved, but missing the payment packet.

This function needs to accept customizations, but that somewhat complicates the private functions above

func BuildPPMShipmentWithApprovedDocuments

func BuildPPMShipmentWithApprovedDocuments(db *pop.Connection) models.PPMShipment

BuildPPMShipmentWithApprovedDocuments creates a PPMShipment that has all the documents approved and has had a payment packet generated & saved.

The only caller of this function provides no customization, so keep this simple for now

func BuildPPMShipmentWithApprovedDocumentsMissingPaymentPacket

func BuildPPMShipmentWithApprovedDocumentsMissingPaymentPacket(db *pop.Connection, userUploader *uploader.UserUploader, customs []Customization) models.PPMShipment

BuildPPMShipmentWithApprovedDocumentsMissingPaymentPacket creates a PPMShipment that has all the documents approved, but is missing the payment packet.

This function needs to accept customizations, but that somewhat complicates the private functions above

func BuildPaymentRequest

func BuildPaymentRequest(db *pop.Connection, customs []Customization, traits []Trait) models.PaymentRequest

func BuildPaymentRequestToInterchangeControlNumber

func BuildPaymentRequestToInterchangeControlNumber(db *pop.Connection, customs []Customization, traits []Trait) models.PaymentRequestToInterchangeControlNumber

BuildPaymentRequestToInterchangeControlNumber creates a single PaymentRequest and PaymentRequestToInterchangeControlNumber

func BuildPaymentServiceItem

func BuildPaymentServiceItem(db *pop.Connection, customs []Customization, traits []Trait) models.PaymentServiceItem

func BuildPaymentServiceItemParam

func BuildPaymentServiceItemParam(db *pop.Connection, customs []Customization, traits []Trait) models.PaymentServiceItemParam

func BuildPaymentServiceItemWithParams

func BuildPaymentServiceItemWithParams(db *pop.Connection, serviceCode models.ReServiceCode, paramsToCreate []CreatePaymentServiceItemParams, customs []Customization, traits []Trait) models.PaymentServiceItem

func BuildPostalCodeToGBLOC

func BuildPostalCodeToGBLOC(db *pop.Connection, customs []Customization, traits []Trait) models.PostalCodeToGBLOC

BuildPostalCodeToGBLOC creates a single PostalCodeToGBLOC entry. Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildPrimeClientCert

func BuildPrimeClientCert(db *pop.Connection) models.ClientCert

func BuildPrimeUpload

func BuildPrimeUpload(db *pop.Connection, customs []Customization, traits []Trait) models.PrimeUpload

BuildPrimeUpload creates a PrimeUpload.

The customization for BuildPrimeUpload allows dev to provide an PrimeUploadExtendedParams object. This extended mode uses an Uploader object to create the upload vs. using the model. If an Uploader is provided, the model customizations are ignored in favor of the actual file provided for upload. In addition, an AppContext must be provided.

Params:

  • customs is a slice that will be modified by the factory
  • db can be set to nil to create a stubbed model that is not stored in DB.

Notes: If you want to customize the Contractor and are using LinkOnly customizations, make sure the Contractor customizations are set when BuildMove is called This function uses FetchOrBuildDefaultContractor and the Contractor is first created

func BuildPrivilege

func BuildPrivilege(db *pop.Connection, customs []Customization, traits []Trait) models.Privilege

BuildPrivilege creates a Privilege Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildProgearWeightTicket

func BuildProgearWeightTicket(db *pop.Connection, customs []Customization, traits []Trait) models.ProgearWeightTicket

func BuildProofOfServiceDoc

func BuildProofOfServiceDoc(db *pop.Connection, customs []Customization, traits []Trait) models.ProofOfServiceDoc

BuildProofOfServiceDoc creates ProofOfServiceDoc. Also creates, if not provided - PaymentRequest and associated set relationships

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildReService

func BuildReService(db *pop.Connection, customs []Customization, traits []Trait) models.ReService

BuildReService creates a ReService Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildReServiceByCode

func BuildReServiceByCode(db *pop.Connection, reServiceCode models.ReServiceCode) models.ReService

BuildReServiceByCode builds ReService using ReServiceCode

func BuildRealMTOServiceItemWithAllDeps

func BuildRealMTOServiceItemWithAllDeps(db *pop.Connection, serviceCode models.ReServiceCode, mto models.Move, mtoShipment models.MTOShipment, customs []Customization, traits []Trait) models.MTOServiceItem

BuildRealMTOServiceItemWithAllDeps builds an MTOServiceItem along with its service params if they don't already exist Customizations that link the MTOServiceItem to the move, shipment, and service are created by default

func BuildRole

func BuildRole(db *pop.Connection, customs []Customization, traits []Trait) roles.Role

BuildRole creates a Role Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildSITAddressUpdate

func BuildSITAddressUpdate(db *pop.Connection, customs []Customization, traits []Trait) models.SITAddressUpdate

BuildSITAddressUpdate creates an SITAddressUpdate It builds

  • MTOServiceItem and associated set relationships
  • OldAddress
  • NewAddress

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildSITDurationUpdate

func BuildSITDurationUpdate(db *pop.Connection, customs []Customization, traits []Trait) models.SITDurationUpdate

BuildSITDurationUpdate creates an SITDurationUpdate It builds

  • MTOShipment and associated set relationships

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildServiceCounselingCompletedMove

func BuildServiceCounselingCompletedMove(db *pop.Connection, customs []Customization, traits []Trait) models.Move

func BuildServiceItemParamKey

func BuildServiceItemParamKey(db *pop.Connection, customs []Customization, traits []Trait) models.ServiceItemParamKey

BuildServiceItemParamKey creates a single ServiceItemParamKey

Params:

  • customs is a slice that will be modified by the factory

  • db can be set to nil to create a stubbed model that is not stored in DB.

    serviceItemParamKey := BuildServiceItemParamKey(suite.DB(), []Customization{ {Model: customServiceItemParamKey}, }, nil)

func BuildServiceMember

func BuildServiceMember(db *pop.Connection, customs []Customization, traits []Trait) models.ServiceMember

BuildServiceMember creates a single ServiceMember Also creates, if not provided: - Residential Address of the ServiceMember - User

Will also build User, ResidentialAddress, BackupMailingAddress and DutyLocation if and only if a customization is provided

Will never build a BackupContact

func BuildServiceParam

func BuildServiceParam(db *pop.Connection, customs []Customization, traits []Trait) models.ServiceParam

BuildServiceParam creates a single ServiceParam

Params:

  • customs is a slice that will be modified by the factory

  • db can be set to nil to create a stubbed model that is not stored in DB.

    serviceParam := BuildServiceParam(suite.DB(), []Customization{ {Model: customServiceParam}, }, nil)

func BuildServiceRequestDocument

func BuildServiceRequestDocument(db *pop.Connection, customs []Customization, traits []Trait) models.ServiceRequestDocument

BuildServiceRequestDocument creates ServiceRequestDocument. Also creates, if not provided - MTOServiceItem and associated set relationships

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildServiceRequestDocumentUpload

func BuildServiceRequestDocumentUpload(db *pop.Connection, customs []Customization, traits []Trait) models.ServiceRequestDocumentUpload

BuildServiceRequestDocumentUpload creates a ServiceRequestDocumentUpload.

The customization for BuildServiceRequestDocumentUpload allows dev to provide an ServiceRequestDocumentUploadExtendedParams object. This extended mode uses an Uploader object to create the upload vs. using the model. If an Uploader is provided, the model customizations are ignored in favor of the actual file provided for upload. In addition, an AppContext must be provided.

Params:

  • customs is a slice that will be modified by the factory
  • db can be set to nil to create a stubbed model that is not stored in DB.

Notes: If you want to customize the Contractor and are using LinkOnly customizations, make sure the Contractor customizations are set when BuildMove is called This function uses FetchOrBuildDefaultContractor and the Contractor is first created

func BuildShipmentAddressUpdate

func BuildShipmentAddressUpdate(db *pop.Connection, customs []Customization, traits []Trait) models.ShipmentAddressUpdate

BuildShipmentAddressUpdate creates a ShipmentAddressUpdate Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildSignedCertification

func BuildSignedCertification(db *pop.Connection, customs []Customization, traits []Trait) models.SignedCertification

BuildSignedCertification creates a single SignedCertification. Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildStorageFacility

func BuildStorageFacility(db *pop.Connection, customs []Customization, traits []Trait) models.StorageFacility

BuildStorageFacility creates a single StorageFacility. Also creates, if not provided - Address Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildStubbedMoveWithStatus

func BuildStubbedMoveWithStatus(status models.MoveStatus) models.Move

func BuildSubmittedMove

func BuildSubmittedMove(db *pop.Connection, customs []Customization, traits []Trait) models.Move

func BuildTransportationAccountingCode

func BuildTransportationAccountingCode(db *pop.Connection, customs []Customization, traits []Trait) models.TransportationAccountingCode

func BuildTransportationAccountingCodeWithoutAttachedLoa

func BuildTransportationAccountingCodeWithoutAttachedLoa(db *pop.Connection, customs []Customization, traits []Trait) models.TransportationAccountingCode

func BuildTransportationOffice

func BuildTransportationOffice(db *pop.Connection, customs []Customization, traits []Trait) models.TransportationOffice

BuildTransportationOffice creates a single TransportationOffice. Also creates, if not provided - Address Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildTransportationOfficeWithPhoneLine

func BuildTransportationOfficeWithPhoneLine(db *pop.Connection, customs []Customization, traits []Trait) models.TransportationOffice

BuildTransportationOfficeWithPhoneLine creates a single TransportationOffice. Also creates, if not provided - Address - OfficePhoneLine Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildUpload

func BuildUpload(db *pop.Connection, customs []Customization, traits []Trait) models.Upload

BuildUpload creates an Upload.

The customization for BuildUpload allows dev to provide an UploadExtendedParams object. This extended mode uses an Uploader object to create the upload vs. using the model. If an Uploader is provided, the model customizations are ignored in favor of the actual file provided for upload. In addition, an AppContext must be provided.

Params:

  • customs is a slice that will be modified by the factory
  • db can be set to nil to create a stubbed model that is not stored in DB.

func BuildUsPostRegionCity

func BuildUsPostRegionCity(db *pop.Connection, customs []Customization, traits []Trait) models.UsPostRegionCity

Creates a UsPostRegionCity for MacDill AFB, Florida

func BuildUser

func BuildUser(db *pop.Connection, customs []Customization, traits []Trait) models.User

BuildUser creates a User It does not create Roles or UsersRoles. To create a User associated with certain roles, use BuildUserAndUsersRoles Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func BuildUserAndUsersRoles

func BuildUserAndUsersRoles(db *pop.Connection, customs []Customization, _ []Trait) models.User

BuildUserAndUsersRoles creates a User

  • If the user has Roles in the customizations, Roles and UsersRoles will also be created

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB, but Roles and UsersRoles won't be created

func BuildUserAndUsersRolesAndUsersPrivileges

func BuildUserAndUsersRolesAndUsersPrivileges(db *pop.Connection, customs []Customization, _ []Trait) models.User

BuildUserAndUsersRolesAndUsersPrivileges creates a User

  • If the user has Roles in the customizations, Roles and UsersRoles will also be created
  • If the user has Privileges in the customizations, Privileges and UsersPrivileges will also be created

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB, but Roles and UsersRoles won't be created

func BuildUserUpload

func BuildUserUpload(db *pop.Connection, customs []Customization, traits []Trait) models.UserUpload

BuildUserUpload creates an UserUpload.

The customization for BuildUserUpload allows dev to provide an UserUploadExtendedParams object. This extended mode uses an Uploader object to create the upload vs. using the model. If an Uploader is provided, the model customizations are ignored in favor of the actual file provided for upload. In addition, an AppContext must be provided.

Params:

  • customs is a slice that will be modified by the factory
  • db can be set to nil to create a stubbed model that is not stored in DB.

func BuildUsersPrivileges

func BuildUsersPrivileges(db *pop.Connection, customs []Customization, traits []Trait) models.UsersPrivileges

BuildUsersPrivileges creates UsersPrivileges and ties privileges to the user Params: - customs is a slice that will be modified by the factory

  • UserID and PrivilegeID are required to be in customs

- db can be set to nil to create a stubbed model that is not stored in DB.

func BuildUsersRoles

func BuildUsersRoles(db *pop.Connection, customs []Customization, traits []Trait) models.UsersRoles

BuildUsersRoles creates UsersRoles and ties roles to the user Params: - customs is a slice that will be modified by the factory

  • UserID and RoleID are required to be in customs

- db can be set to nil to create a stubbed model that is not stored in DB.

func BuildWebhookNotification

func BuildWebhookNotification(db *pop.Connection, customs []Customization, traits []Trait) models.WebhookNotification

func BuildWeightTicket

func BuildWeightTicket(db *pop.Connection, customs []Customization, traits []Trait) models.WeightTicket

func BuildWeightTicketWithConstructedWeight

func BuildWeightTicketWithConstructedWeight(db *pop.Connection, customs []Customization, traits []Trait) models.WeightTicket

func CreateAndWrapProvider

func CreateAndWrapProvider(config ProviderConfig) (*okta.Provider, error)

func FetchOrBuildCurrentDutyLocation

func FetchOrBuildCurrentDutyLocation(db *pop.Connection) models.DutyLocation

FetchOrBuildCurrentDutyLocation returns a default duty location It always fetches or builds a Yuma AFB Duty Location

func FetchOrBuildDefaultContractor

func FetchOrBuildDefaultContractor(db *pop.Connection, customs []Customization, traits []Trait) models.Contractor

FetchOrBuildDefaultContractor tries fetching an existing contractor, then falls back to creating one

func FetchOrBuildDevlocalClientCert

func FetchOrBuildDevlocalClientCert(db *pop.Connection) models.ClientCert

FetchOrBuildDevlocalClientCert tries fetching an existing clientCert, then falls back to creating one

func FetchOrBuildOrdersDutyLocation

func FetchOrBuildOrdersDutyLocation(db *pop.Connection) models.DutyLocation

FetchOrBuildOrdersDutyLocation returns a default orders duty location It always fetches or builds a Fort Eisenhower duty location with the specified city/state/postal code Some tests rely on the duty location being in 30813

func FetchOrBuildPostalCodeToGBLOC

func FetchOrBuildPostalCodeToGBLOC(db *pop.Connection, postalCode string, gbloc string) models.PostalCodeToGBLOC

func FetchOrBuildPrivilegeByPrivilegeType

func FetchOrBuildPrivilegeByPrivilegeType(db *pop.Connection, privilegeType models.PrivilegeType) models.Privilege

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

func FetchOrBuildReService

func FetchOrBuildReService(db *pop.Connection, customs []Customization, traits []Trait) models.ReService

FetchOrBuildReService tries fetching a ReService using ReServiceCode, then falls back to creating one

func FetchOrBuildReServiceByCode

func FetchOrBuildReServiceByCode(db *pop.Connection, reServiceCode models.ReServiceCode) models.ReService

func FetchOrBuildRoleByRoleType

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

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

func FetchOrBuildServiceItemParamKey

func FetchOrBuildServiceItemParamKey(db *pop.Connection, customs []Customization, traits []Trait) models.ServiceItemParamKey

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

func FetchOrBuildServiceParam

func FetchOrBuildServiceParam(db *pop.Connection, customs []Customization, traits []Trait) models.ServiceParam

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

func FixtureOpen

func FixtureOpen(name string) afero.File

FixtureOpen opens a file from the testdata dir

func Generatex509CertAndSecret

func Generatex509CertAndSecret() (*x509.Certificate, *rsa.PrivateKey, error)

func MakeRandomString

func MakeRandomString(n int) string

Returns a random alphanumeric string of specified length

func RandomEdipi

func RandomEdipi() string

RandomEdipi creates a random Edipi for a service member

Types

type CreatePaymentServiceItemParams

type CreatePaymentServiceItemParams struct {
	Key     models.ServiceItemParamName
	KeyType models.ServiceItemParamType
	Value   string
}

CreatePaymentServiceItemParams helper struct to facilitate creation of multiple payment service item params

type CustomType

type CustomType string

CustomType is a string that represents what kind of customization it is

var Address CustomType = "Address"

Model customizations will each have a "type" here This does not have to match the model type but generally will You can have CustomType like ResidentialAddress to define specifically where this address will get created and nested

var AdminUser CustomType = "AdminUser"
var AuditHistory CustomType = "AuditHistory"
var BackupContact CustomType = "BackupContact"
var ClientCert CustomType = "ClientCert"
var Contractor CustomType = "Contractor"
var CustomerSupportRemark CustomType = "CustomerSupportRemark"
var Document CustomType = "Document"
var DutyLocation CustomType = "DutyLocation"
var Entitlement CustomType = "Entitlement"
var EvaluationReport CustomType = "EvaluationReport"
var LineOfAccounting CustomType = "LineOfAccounting"
var MTOAgent CustomType = "MTOAgent"
var MTOServiceItem CustomType = "MTOServiceItem"
var MTOServiceItemDimension CustomType = "MTOServiceItemDimension"
var MTOShipment CustomType = "MTOShipment"
var Move CustomType = "Move"
var MovingExpense CustomType = "MovingExpense"
var Notification CustomType = "Notification"
var OfficePhoneLine CustomType = "OfficePhoneLine"
var OfficeUser CustomType = "OfficeUser"
var Order CustomType = "Order"
var Organization CustomType = "Organization"
var PPMShipment CustomType = "PPMShipment"
var PaymentRequest CustomType = "PaymentRequest"
var PaymentRequestToInterchangeControlNumber CustomType = "PaymentRequestToInterchangeControlNumber"
var PaymentServiceItem CustomType = "PaymentServiceItem"
var PaymentServiceItemParam CustomType = "PaymentServiceItemParam"
var PostalCodeToGBLOC CustomType = "PostalCodeToGBLOC"
var PrimeUpload CustomType = "PrimeUpload"
var Privilege CustomType = "Privilege"
var ProgearWeightTicket CustomType = "ProgearWeightTicket"
var ProofOfServiceDoc CustomType = "ProofOfServiceDoc"
var ReService CustomType = "ReService"
var Role CustomType = "Role"
var SITAddressUpdate CustomType = "SITAddressUpdate"
var SITDurationUpdate CustomType = "SITDurationUpdate"
var ServiceItemParamKey CustomType = "ServiceItemParamKey"
var ServiceMember CustomType = "ServiceMember"
var ServiceParam CustomType = "ServiceParam"
var ServiceRequestDocument CustomType = "ServiceRequestDocument"
var ServiceRequestDocumentUpload CustomType = "ServiceRequestDocumentUpload"
var ShipmentAddressUpdate CustomType = "ShipmentAddressUpdate"
var SignedCertification CustomType = "SignedCertification"
var StorageFacility CustomType = "StorageFacility"
var TransportationAccountingCode CustomType = "TransportationAccountingCode"
var TransportationOffice CustomType = "TransportationOffice"
var Upload CustomType = "Upload"
var UsPostRegionCity CustomType = "UsPostRegionCity"
var User CustomType = "User"
var UserUpload CustomType = "UserUpload"
var UsersPrivileges CustomType = "UsersPrivileges"
var UsersRoles CustomType = "UsersRoles"
var WebhookNotification CustomType = "WebhookNotification"
var WeightTicket CustomType = "WeightTicket"

type Customization

type Customization struct {
	Model interface{} // The model that the factory will build
	Type  *CustomType // Custom type, usually same as model,
	// except for models that appear in multiple fields
	LinkOnly       bool        // Tells factory to just link in this model, do not create
	ExtendedParams interface{} // Some models need extra data for creation, pointer to extended params
}

Customization type is the building block for passing in customizations and traits

func GetTraitActiveAdminUser

func GetTraitActiveAdminUser() []Customization

GetTraitActiveAdminUser sets the User and AdminUser as Active

func GetTraitActiveOfficeUser

func GetTraitActiveOfficeUser() []Customization

GetTraitOfficeUserActive sets the User and OfficeUser as Active

func GetTraitActiveServiceMemberUser

func GetTraitActiveServiceMemberUser() []Customization

GetTraitServiceMemberUserActive sets the User as Active

func GetTraitActiveUser

func GetTraitActiveUser() []Customization

GetTraitActiveUser returns a customization to enable active on a user

func GetTraitAddress2

func GetTraitAddress2() []Customization

GetTraitAddress2 is a sample GetTraitFunc

func GetTraitAddress3

func GetTraitAddress3() []Customization

GetTraitAddress3 is a sample GetTraitFunc

func GetTraitAddress4

func GetTraitAddress4() []Customization

GetTraitAddress4 is a sample GetTraitFunc

func GetTraitAdminUserEmail

func GetTraitAdminUserEmail() []Customization

GetTraitAdminUserEmail helps comply with the uniqueness constraint on emails

func GetTraitApprovalsRequestedMove

func GetTraitApprovalsRequestedMove() []Customization

func GetTraitApprovedOfficeUser

func GetTraitApprovedOfficeUser() []Customization

GetTraitApprovedOfficeUser sets the OfficeUser in an APPROVED status

func GetTraitApprovedPPMShipment

func GetTraitApprovedPPMShipment() []Customization

func GetTraitApprovedPPMWithActualInfo

func GetTraitApprovedPPMWithActualInfo() []Customization

func GetTraitApprovedSITDurationUpdate

func GetTraitApprovedSITDurationUpdate() []Customization

func GetTraitArmy

func GetTraitArmy() []Customization

GetTraitArmy is a sample GetTraitFunc

func GetTraitAvailableToPrimeMove

func GetTraitAvailableToPrimeMove() []Customization

func GetTraitClientCertDevlocal

func GetTraitClientCertDevlocal() []Customization

Traits GetTraitOfficeUserActive sets the User and OfficeUser as Active

func GetTraitContractingOfficerRole

func GetTraitContractingOfficerRole() []Customization

func GetTraitCustomerRole

func GetTraitCustomerRole() []Customization

GetTraitCustomerRole returns a customization to enable active on a user

func GetTraitDefaultOrdersDutyLocation

func GetTraitDefaultOrdersDutyLocation() []Customization

func GetTraitHasDependents

func GetTraitHasDependents() []Customization

GetTraitHasDependents returns a customization to enable dependents on an order

func GetTraitNavy

func GetTraitNavy() []Customization

GetTraitNavy is a sample GetTraitFunc

func GetTraitNeedsServiceCounselingMove

func GetTraitNeedsServiceCounselingMove() []Customization

func GetTraitOfficeUserEmail

func GetTraitOfficeUserEmail() []Customization

GetTraitOfficeUserEmail helps comply with the uniqueness constraint on emails

func GetTraitOfficeUserWithID

func GetTraitOfficeUserWithID() []Customization

GetTraitOfficeUserWithID adds a UUID to the record regardless of whether it's stubbed or not

func GetTraitPPMShipment

func GetTraitPPMShipment() []Customization

func GetTraitPPMShipmentReadyForPaymentRequest

func GetTraitPPMShipmentReadyForPaymentRequest() []Customization

func GetTraitPrimeSimulatorRole

func GetTraitPrimeSimulatorRole() []Customization

func GetTraitPrimeUploadDeleted

func GetTraitPrimeUploadDeleted() []Customization

func GetTraitPrimeUser

func GetTraitPrimeUser() []Customization

GetTraitActiveUser returns a customization to enable active on a user

func GetTraitQaeCsrRole

func GetTraitQaeCsrRole() []Customization

func GetTraitRequestedOfficeUser

func GetTraitRequestedOfficeUser() []Customization

GetTraitRequestedOfficeUser sets the OfficeUser in an REQUESTED status

func GetTraitSITAddressUpdateOver50Miles

func GetTraitSITAddressUpdateOver50Miles() []Customization

func GetTraitSITAddressUpdateUnder50Miles

func GetTraitSITAddressUpdateUnder50Miles() []Customization

func GetTraitSITAddressUpdateWithMoveSetUp

func GetTraitSITAddressUpdateWithMoveSetUp() []Customization

GetTraitSITAddressUpdateWithMoveSetUp sets up a move with a REQUESTED SITAddressUpdate of over 50 miles

func GetTraitServiceCounselingCompletedMove

func GetTraitServiceCounselingCompletedMove() []Customization

func GetTraitServiceItemStatusApproved

func GetTraitServiceItemStatusApproved() []Customization

func GetTraitServiceMemberSetIDs

func GetTraitServiceMemberSetIDs() []Customization

GetTraitServiceMemberSetIDs is a sample GetTraitFunc that sets ids for both ServiceMember and User models

func GetTraitServicesCounselorRole

func GetTraitServicesCounselorRole() []Customization

func GetTraitShipmentAddressUpdateApproved

func GetTraitShipmentAddressUpdateApproved() []Customization

func GetTraitShipmentAddressUpdateRejected

func GetTraitShipmentAddressUpdateRejected() []Customization

func GetTraitShipmentAddressUpdateRequested

func GetTraitShipmentAddressUpdateRequested() []Customization

func GetTraitStorageFacilityKKFA

func GetTraitStorageFacilityKKFA() []Customization

GetTraitOfficeUserEmail helps comply with the uniqueness constraint on emails

func GetTraitSubmittedMove

func GetTraitSubmittedMove() []Customization

func GetTraitSubmittedShipment

func GetTraitSubmittedShipment() []Customization

------------------------

TRAITS

------------------------

func GetTraitTIORole

func GetTraitTIORole() []Customization

func GetTraitTOORole

func GetTraitTOORole() []Customization

func GetTraitTimestampedUpload

func GetTraitTimestampedUpload() []Customization

func GetTraitTimestampedUserUpload

func GetTraitTimestampedUserUpload() []Customization

func GetTraitUploadTypePrime

func GetTraitUploadTypePrime() []Customization

func GetTraitUploadTypePrimeServiceRequest

func GetTraitUploadTypePrimeServiceRequest() []Customization

type PrimeUploadExtendedParams

type PrimeUploadExtendedParams struct {
	PrimeUploader *uploader.PrimeUploader
	UploaderID    uuid.UUID
	File          afero.File
	AppContext    appcontext.AppContext
}

type ProviderConfig

type ProviderConfig struct {
	Name        string
	OrgURL      string
	CallbackURL string
	ClientID    string
	Secret      string
	Scope       []string
	Logger      *zap.Logger
}

type ServiceRequestDocumentUploadExtendedParams

type ServiceRequestDocumentUploadExtendedParams struct {
	ServiceRequestDocumentUploader *uploader.ServiceRequestUploader
	UploaderID                     uuid.UUID
	File                           afero.File
	AppContext                     appcontext.AppContext
}

type TestDataAuditHistory

type TestDataAuditHistory 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
	TableNameDB 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:"-"`
	SessionUserLastName  *string         `json:"session_user_last_name" db:"-"`
	SessionUserEmail     *string         `json:"session_user_email" db:"-"`
	SessionUserTelephone *string         `json:"session_user_telephone" db:"-"`
	Context              *models.JSONMap `json:"context" db:"-"`
	ContextID            *string         `json:"context_id" db:"-"`
	// 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     *models.JSONMap `json:"old_data" db:"old_data"`
	ChangedData *models.JSONMap `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"`
}

TestDataAuditHistory for testing purposes only Had to separate this from AuditHistory struct because some calculated fields are not meant to be saved but still need to define a "db" map to fetch.

func BuildAuditHistory

func BuildAuditHistory(db *pop.Connection, customs []Customization, traits []Trait) TestDataAuditHistory

BuildAuditHistory creates an AuditHistory Notes:

  • SessionUserID and ObjectID are only set if they're passed in via customizations
  • This follows a slightly different pattern than other factories.
  • If necessary caller should create Objects/Users and set ObjectID/SessionUserID in customizations, rather than creating LinkOnly models

Params: - customs is a slice that will be modified by the factory - db can be set to nil to create a stubbed model that is not stored in DB.

func (TestDataAuditHistory) TableName

func (t TestDataAuditHistory) TableName() string

TableName overrides the table name used by Pop.

type Trait

type Trait func() []Customization

Trait is a function that returns a set of customizations Every Trait should start with GetTrait for discoverability

type UploadExtendedParams

type UploadExtendedParams struct {
	Uploader   *uploader.Uploader
	File       afero.File
	AppContext appcontext.AppContext
}

type UserUploadExtendedParams

type UserUploadExtendedParams struct {
	UserUploader *uploader.UserUploader
	UploaderID   uuid.UUID
	File         afero.File
	AppContext   appcontext.AppContext
}

Source Files

Jump to

Keyboard shortcuts

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