trade_document

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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 SetConsignee

func SetConsignee(td *bill_of_lading.TransportDocument, consignee string)

func SetDraft

func SetDraft(td *bill_of_lading.TransportDocument, draft bool)

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 File

type File struct {
	Name    string `json:"name"`    // File name
	Type    string `json:"type"`    // MIME type of the file.
	Content []byte `json:"content"` // File content.
}

type FileBaseEBLController

type FileBaseEBLParticipators

type FileBaseEBLParticipators struct {
	Issuer       string `json:"issuer"`
	Shipper      string `json:"shipper"`
	Consignee    string `json:"consignee"`
	ReleaseAgent string `json:"release_agent"`
}

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 GetFileBasedEBLRequest struct {
	Requester   string `json:"requester"`
	Application string `json:"application"`

	ID string `json:"id"`
}

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 ListFileBasedEBLRequest struct {
	Application string `json:"application"`
	RequestBy   string `json:"lister"`

	Offset  int    `json:"offset"`
	Limit   int    `json:"limit"`
	Status  string `json:"status"`
	Report  bool   `json:"report"`
	Keyword string `json:"keyword"`
}

type Location

type Location struct {
	LocationName string `json:"locationName"`
	UNLocCode    string `json:"UNLocationCode"`
}

type LocationRule

type LocationRule struct{}

func (LocationRule) Validate

func (r LocationRule) Validate(value interface{}) error

type NoteRule

type NoteRule struct{}

func (NoteRule) Validate

func (r NoteRule) Validate(value any) 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.
}

Jump to

Keyboard shortcuts

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