Documentation
¶
Index ¶
- func AmendFileBasedBillOfLadingFromRequest(req AmendFileBasedEBLRequest, oldPack bill_of_lading.BillOfLadingPack, ...) *bill_of_lading.BillOfLading
- func CheckFileBasedEBLAllowAction(action FileBasedEBLAction, bl *bill_of_lading.BillOfLadingPack, bu string, ...) error
- func CreateFileBasedBillOfLadingFromRequest(request IssueFileBasedEBLRequest, oldBL *bill_of_lading.BillOfLading, ...) *bill_of_lading.BillOfLading
- func ExtractBLPackFromTradeDocument(td storage.TradeDocument) (bill_of_lading.BillOfLadingPack, error)
- func FallbackFileInfoFromOldBL(bl, oldBL *bill_of_lading.BillOfLading)
- func GetBillOfLadingPackMeta(blPack *bill_of_lading.BillOfLadingPack) (map[string]any, error)
- func GetCurrentOwner(blPack *bill_of_lading.BillOfLadingPack) string
- func GetDraft(blPack *bill_of_lading.BillOfLadingPack) *bool
- func GetIssuer(blPack *bill_of_lading.BillOfLadingPack) *string
- func GetLastBillOfLading(blPack *bill_of_lading.BillOfLadingPack) *bill_of_lading.BillOfLading
- func GetLastEvent(blPack *bill_of_lading.BillOfLadingPack) *bill_of_lading.BillOfLadingEvent
- func GetNextOwnerByAction(action FileBasedEBLAction, bu string, blPack *bill_of_lading.BillOfLadingPack) string
- func GetOwnerShipTransferringByEvent(event *bill_of_lading.BillOfLadingEvent) (string, string)
- func IsFileEBLAccomplishable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func IsFileEBLAmendable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func IsFileEBLDeletable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func IsFileEBLPrintable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func IsFileEBLRequestAmendable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func IsFileEBLReturnable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func IsFileEBLSurrenderable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func IsFileEBLTransferable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func IsFileEBLUpdatable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
- func PrepareDocumentParty(party string, partyFunction bill_of_lading.PartyFunction) bill_of_lading.DocumentParty
- func PrepareSI(td *bill_of_lading.TransportDocument) *bill_of_lading.ShippingInstruction
- func ReplaceSIParty(si *bill_of_lading.ShippingInstruction, party bill_of_lading.DocumentParty)
- func ReplaceShipmentLocation(td *bill_of_lading.TransportDocument, loc bill_of_lading.ShipmentLocation)
- func SetConsignee(td *bill_of_lading.TransportDocument, consignee string)
- func SetDraft(td *bill_of_lading.TransportDocument, draft bool)
- func SetETA(td *bill_of_lading.TransportDocument, eta model.DateTime)
- func SetIssuer(td *bill_of_lading.TransportDocument, issuer string)
- func SetPOD(td *bill_of_lading.TransportDocument, pod Location)
- func SetPOL(td *bill_of_lading.TransportDocument, pol Location)
- func SetReleaseAgent(td *bill_of_lading.TransportDocument, releaseAgent string)
- func SetShipper(td *bill_of_lading.TransportDocument, shipper string)
- func SetToOrder(td *bill_of_lading.TransportDocument, toOrder bool)
- func ValidateAccomplishEBLRequest(req AccomplishEBLRequest) error
- func ValidateAmendFileBasedEBLRequest(req AmendFileBasedEBLRequest) error
- func ValidateAmendmentRequestEBLRequest(req AmendmentRequestEBLRequest) error
- func ValidateDeleteEBLRequest(req DeleteEBLRequest) error
- func ValidateIssueFileBasedEBLRequest(req IssueFileBasedEBLRequest) error
- func ValidateListFileBasedEBLRequest(req ListFileBasedEBLRequest) error
- func ValidatePrintFileBasedEBLRequest(req PrintFileBasedEBLToPaperRequest) error
- func ValidateReturnFileBasedEBLRequest(req ReturnFileBasedEBLRequest) error
- func ValidateSurrenderEBLRequest(req SurrenderEBLRequest) error
- func ValidateTransferEBLRequest(req TransferEBLRequest) error
- func ValidateUpdateFileBasedEBLRequest(req UpdateFileBasedEBLDraftRequest) error
- type AccomplishEBLRequest
- type AmendFileBasedEBLRequest
- type AmendmentRequestEBLRequest
- type DeleteEBLRequest
- type File
- type FileBaseEBLController
- type FileBaseEBLParticipators
- type FileBasedBillOfLadingRecord
- type FileBasedEBLAction
- type GetFileBasedEBLRequest
- type IssueFileBasedEBLRequest
- type ListFileBasedEBLRecord
- type ListFileBasedEBLRequest
- type Location
- type LocationRule
- type NoteRule
- type PrintFileBasedEBLToPaperRequest
- type ReturnFileBasedEBLRequest
- type SurrenderEBLRequest
- type TransferEBLRequest
- type UpdateFileBasedEBLDraftRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AmendFileBasedBillOfLadingFromRequest ¶
func AmendFileBasedBillOfLadingFromRequest(req AmendFileBasedEBLRequest, oldPack bill_of_lading.BillOfLadingPack, currentTime model.DateTime) *bill_of_lading.BillOfLading
func CheckFileBasedEBLAllowAction ¶
func CheckFileBasedEBLAllowAction(action FileBasedEBLAction, bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func CreateFileBasedBillOfLadingFromRequest ¶
func CreateFileBasedBillOfLadingFromRequest(request IssueFileBasedEBLRequest, oldBL *bill_of_lading.BillOfLading, currentTime model.DateTime) *bill_of_lading.BillOfLading
func ExtractBLPackFromTradeDocument ¶
func ExtractBLPackFromTradeDocument(td storage.TradeDocument) (bill_of_lading.BillOfLadingPack, error)
func FallbackFileInfoFromOldBL ¶
func FallbackFileInfoFromOldBL(bl, oldBL *bill_of_lading.BillOfLading)
func GetBillOfLadingPackMeta ¶
func GetBillOfLadingPackMeta(blPack *bill_of_lading.BillOfLadingPack) (map[string]any, error)
func GetCurrentOwner ¶
func GetCurrentOwner(blPack *bill_of_lading.BillOfLadingPack) string
func GetDraft ¶
func GetDraft(blPack *bill_of_lading.BillOfLadingPack) *bool
func GetIssuer ¶
func GetIssuer(blPack *bill_of_lading.BillOfLadingPack) *string
func GetLastBillOfLading ¶
func GetLastBillOfLading(blPack *bill_of_lading.BillOfLadingPack) *bill_of_lading.BillOfLading
func GetLastEvent ¶
func GetLastEvent(blPack *bill_of_lading.BillOfLadingPack) *bill_of_lading.BillOfLadingEvent
func GetNextOwnerByAction ¶
func GetNextOwnerByAction(action FileBasedEBLAction, bu string, blPack *bill_of_lading.BillOfLadingPack) string
func GetOwnerShipTransferringByEvent ¶
func GetOwnerShipTransferringByEvent(event *bill_of_lading.BillOfLadingEvent) (string, string)
GetOwnerShipTransferringByEvent returns the transferring information of the bill of lading event. The first return value is the transferring by DID, and the second return value is the transferring to DID.
func IsFileEBLAccomplishable ¶
func IsFileEBLAccomplishable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func IsFileEBLAmendable ¶
func IsFileEBLAmendable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func IsFileEBLDeletable ¶
func IsFileEBLDeletable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func IsFileEBLPrintable ¶
func IsFileEBLPrintable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func IsFileEBLRequestAmendable ¶
func IsFileEBLRequestAmendable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func IsFileEBLReturnable ¶
func IsFileEBLReturnable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func IsFileEBLSurrenderable ¶
func IsFileEBLSurrenderable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func IsFileEBLTransferable ¶
func IsFileEBLTransferable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func IsFileEBLUpdatable ¶
func IsFileEBLUpdatable(bl *bill_of_lading.BillOfLadingPack, bu string, withDetail bool) error
func PrepareDocumentParty ¶
func PrepareDocumentParty(party string, partyFunction bill_of_lading.PartyFunction) bill_of_lading.DocumentParty
func PrepareSI ¶
func PrepareSI(td *bill_of_lading.TransportDocument) *bill_of_lading.ShippingInstruction
func ReplaceSIParty ¶
func ReplaceSIParty(si *bill_of_lading.ShippingInstruction, party bill_of_lading.DocumentParty)
func ReplaceShipmentLocation ¶
func ReplaceShipmentLocation(td *bill_of_lading.TransportDocument, loc bill_of_lading.ShipmentLocation)
func SetConsignee ¶
func SetConsignee(td *bill_of_lading.TransportDocument, consignee string)
func SetDraft ¶
func SetDraft(td *bill_of_lading.TransportDocument, draft bool)
func SetETA ¶
func SetETA(td *bill_of_lading.TransportDocument, eta model.DateTime)
func SetIssuer ¶
func SetIssuer(td *bill_of_lading.TransportDocument, issuer string)
func SetPOD ¶
func SetPOD(td *bill_of_lading.TransportDocument, pod Location)
func SetPOL ¶
func SetPOL(td *bill_of_lading.TransportDocument, pol Location)
func SetReleaseAgent ¶
func SetReleaseAgent(td *bill_of_lading.TransportDocument, releaseAgent string)
func SetShipper ¶
func SetShipper(td *bill_of_lading.TransportDocument, shipper string)
func SetToOrder ¶
func SetToOrder(td *bill_of_lading.TransportDocument, toOrder bool)
func ValidateAccomplishEBLRequest ¶
func ValidateAccomplishEBLRequest(req AccomplishEBLRequest) error
func ValidateAmendFileBasedEBLRequest ¶
func ValidateAmendFileBasedEBLRequest(req AmendFileBasedEBLRequest) error
func ValidateAmendmentRequestEBLRequest ¶
func ValidateAmendmentRequestEBLRequest(req AmendmentRequestEBLRequest) error
func ValidateDeleteEBLRequest ¶
func ValidateDeleteEBLRequest(req DeleteEBLRequest) error
func ValidateIssueFileBasedEBLRequest ¶
func ValidateIssueFileBasedEBLRequest(req IssueFileBasedEBLRequest) error
func ValidateListFileBasedEBLRequest ¶
func ValidateListFileBasedEBLRequest(req ListFileBasedEBLRequest) error
func ValidatePrintFileBasedEBLRequest ¶
func ValidatePrintFileBasedEBLRequest(req PrintFileBasedEBLToPaperRequest) error
func ValidateReturnFileBasedEBLRequest ¶
func ValidateReturnFileBasedEBLRequest(req ReturnFileBasedEBLRequest) error
func ValidateSurrenderEBLRequest ¶
func ValidateSurrenderEBLRequest(req SurrenderEBLRequest) error
func ValidateTransferEBLRequest ¶
func ValidateTransferEBLRequest(req TransferEBLRequest) error
func ValidateUpdateFileBasedEBLRequest ¶
func ValidateUpdateFileBasedEBLRequest(req UpdateFileBasedEBLDraftRequest) error
Types ¶
type AccomplishEBLRequest ¶
type AccomplishEBLRequest struct { Application string `json:"application"` RequestBy string `json:"request_by"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` ID string `json:"id"` Note string `json:"note"` }
type AmendFileBasedEBLRequest ¶
type AmendFileBasedEBLRequest struct { Application string `json:"application"` Issuer string `json:"issuer"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` ID string `json:"id"` File File `json:"file"` BLNumber string `json:"bl_number"` BLDocType bill_of_lading.BillOfLadingDocumentType `json:"bl_doc_type"` ToOrder bool `json:"to_order"` POL Location `json:"pol"` POD Location `json:"pod"` ETA *model.DateTime `json:"eta,omitempty"` Note string `json:"note"` }
type AmendmentRequestEBLRequest ¶
type AmendmentRequestEBLRequest struct { Application string `json:"application"` RequestBy string `json:"request_by"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` ID string `json:"id"` Note string `json:"note"` }
type DeleteEBLRequest ¶
type DeleteEBLRequest struct { Application string `json:"application"` RequestBy string `json:"request_by"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` ID string `json:"id"` Note string `json:"note"` }
type FileBaseEBLController ¶
type FileBaseEBLController interface { Create(ctx context.Context, ts int64, request IssueFileBasedEBLRequest) (FileBasedBillOfLadingRecord, error) UpdateDraft(ctx context.Context, ts int64, request UpdateFileBasedEBLDraftRequest) (FileBasedBillOfLadingRecord, error) Return(ctx context.Context, ts int64, request ReturnFileBasedEBLRequest) (FileBasedBillOfLadingRecord, error) List(ctx context.Context, request ListFileBasedEBLRequest) (ListFileBasedEBLRecord, error) Transfer(ctx context.Context, ts int64, request TransferEBLRequest) (FileBasedBillOfLadingRecord, error) AmendmentRequest(ctx context.Context, ts int64, request AmendmentRequestEBLRequest) (FileBasedBillOfLadingRecord, error) Amend(ctx context.Context, ts int64, request AmendFileBasedEBLRequest) (FileBasedBillOfLadingRecord, error) Surrender(ctx context.Context, ts int64, request SurrenderEBLRequest) (FileBasedBillOfLadingRecord, error) PrintToPaper(ctx context.Context, ts int64, request PrintFileBasedEBLToPaperRequest) (FileBasedBillOfLadingRecord, error) Accomplish(ctx context.Context, ts int64, request AccomplishEBLRequest) (FileBasedBillOfLadingRecord, error) Get(ctx context.Context, request GetFileBasedEBLRequest) (FileBasedBillOfLadingRecord, error) Delete(ctx context.Context, ts int64, request DeleteEBLRequest) (FileBasedBillOfLadingRecord, error) GetDocument(ctx context.Context, request GetFileBasedEBLRequest) (*model.File, error) }
func NewFileBaseEBLController ¶
func NewFileBaseEBLController(storage storage.TradeDocumentStorage, buCtrl business_unit.BusinessUnitManager, webhookCtrl webhook.WebhookController) FileBaseEBLController
type FileBaseEBLParticipators ¶
type FileBaseEBLParticipators struct { Issuer string `json:"issuer"` Shipper string `json:"shipper"` Consignee string `json:"consignee"` ReleaseAgent string `json:"release_agent"` }
func GetFileBaseEBLParticipatorFromBL ¶
func GetFileBaseEBLParticipatorFromBL(bl *bill_of_lading.BillOfLading) FileBaseEBLParticipators
func GetFileBaseEBLParticipatorsFromBLPack ¶
func GetFileBaseEBLParticipatorsFromBLPack(blPack *bill_of_lading.BillOfLadingPack) FileBaseEBLParticipators
type FileBasedBillOfLadingRecord ¶
type FileBasedBillOfLadingRecord struct { AllowActions []FileBasedEBLAction `json:"allow_actions"` BL *bill_of_lading.BillOfLadingPack `json:"bl"` }
type FileBasedEBLAction ¶
type FileBasedEBLAction string
const ( // FileBasedEBLActionAllow is the constant for allow action FILE_EBL_UPDATE_DRAFT FileBasedEBLAction = "UPDATE_DRAFT" FILE_EBL_AMEND FileBasedEBLAction = "AMEND" FILE_EBL_REQUEST_AMEND FileBasedEBLAction = "REQUEST_AMEND" FILE_EBL_PRINT FileBasedEBLAction = "PRINT" FILE_EBL_TRANSFER FileBasedEBLAction = "TRANSFER" FILE_EBL_RETURN FileBasedEBLAction = "RETURN" FILE_EBL_SURRENDER FileBasedEBLAction = "SURRENDER" FILE_EBL_ACCOMPLISH FileBasedEBLAction = "ACCOMPLISH" FILE_EBL_DELETE FileBasedEBLAction = "DELETE" )
func GetFileBasedEBLAllowActions ¶
func GetFileBasedEBLAllowActions(bl *bill_of_lading.BillOfLadingPack, bu string) []FileBasedEBLAction
type GetFileBasedEBLRequest ¶
type IssueFileBasedEBLRequest ¶
type IssueFileBasedEBLRequest struct { Application string `json:"application"` Issuer string `json:"issuer"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` File File `json:"file"` BLNumber string `json:"bl_number"` BLDocType bill_of_lading.BillOfLadingDocumentType `json:"bl_doc_type"` ToOrder bool `json:"to_order"` POL Location `json:"pol"` POD Location `json:"pod"` ETA *model.DateTime `json:"eta,omitempty"` Shipper string `json:"shipper"` Consignee string `json:"consignee"` ReleaseAgent string `json:"release_agent"` Note string `json:"note"` Draft *bool `json:"draft"` EncryptContent bool `json:"encrypt_content"` }
type ListFileBasedEBLRecord ¶
type ListFileBasedEBLRecord struct { Total int `json:"total"` Records []FileBasedBillOfLadingRecord `json:"records"` Report *storage.ListTradeDocumentReport `json:"report,omitempty"` }
type ListFileBasedEBLRequest ¶
type LocationRule ¶
type LocationRule struct{}
func (LocationRule) Validate ¶
func (r LocationRule) Validate(value interface{}) error
type PrintFileBasedEBLToPaperRequest ¶
type PrintFileBasedEBLToPaperRequest struct { Application string `json:"application"` RequestBy string `json:"request_by"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` ID string `json:"id"` Note string `json:"note"` }
type ReturnFileBasedEBLRequest ¶
type ReturnFileBasedEBLRequest struct { Application string `json:"application"` BusinessUnit string `json:"business_unit"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` ID string `json:"id"` Note string `json:"note"` }
type SurrenderEBLRequest ¶
type SurrenderEBLRequest struct { Application string `json:"application"` RequestBy string `json:"request_by"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` ID string `json:"id"` Note string `json:"note"` }
type TransferEBLRequest ¶
type TransferEBLRequest struct { Application string `json:"application"` TransferBy string `json:"transfer_by"` AuthenticationID string `json:"authentication_id"` MetaData bill_of_lading.ApplicationMetaData `json:"metadata"` ID string `json:"id"` Note string `json:"note"` }
type UpdateFileBasedEBLDraftRequest ¶
type UpdateFileBasedEBLDraftRequest struct { IssueFileBasedEBLRequest ID string `json:"id"` // ID of the bill of lading pack to be updated. }
Click to show internal directories.
Click to hide internal directories.