db

package
v2.27.12 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrderToContext

func AddOrderToContext(ctx context.Context, order Order) context.Context

AddOrderToContext adds order data to context

func CollectionConfig

func CollectionConfig(ctx context.Context) (*mongo.Collection, error)

func CollectionInvoices

func CollectionInvoices(ctx context.Context) (*mongo.Collection, error)

func CollectionOrders

func CollectionOrders(ctx context.Context) (*mongo.Collection, error)

func CollectionResult

func CollectionResult(ctx context.Context) (*mongo.Collection, error)

Types

type Applicant

type Applicant struct {
	FirstName          string               `bson:"firstName" json:"firstName"`
	LastName           string               `bson:"lastName" json:"lastName"`
	DateOfBirth        string               `bson:"dateOfBirth" json:"dateOfBirth"`
	Sex                string               `bson:"sex" json:"sex"`
	Nationality        string               `bson:"nationality" json:"nationality"`
	PassportNumber     string               `bson:"passportNumber" json:"passportNumber"`
	PassportExpiry     string               `bson:"passportExpiry" json:"passportExpiry"`
	RegistrationCode   string               `bson:"registrationCode" json:"registrationCode"`
	Email              string               `bson:"email" json:"email"`
	AttachmentPortrait *ApplicantAttachment `bson:"attachmentPortrait,omitempty" json:"attachmentPortrait,omitempty"`
	AttachmentPassport *ApplicantAttachment `bson:"attachmentPassport,omitempty" json:"attachmentPassport,omitempty"`
	AddressHome        string               `bson:"addressHome" json:"addressHome"`
	PhoneNumberHome    string               `bson:"phoneNumberHome" json:"phoneNumberHome"`
	AddressVietnam     string               `bson:"addressVietnam" json:"addressVietnam"`
	PreviousVisitCount string               `bson:"previousVisitCount" json:"previousVisitCount"`
	LawViolation       string               `bson:"lawViolation" json:"lawViolation"`

	VisaS3Key    string `bson:"visaS3Key" json:"visaS3Key"`
	VisaSent     bool   `bson:"visaSent" json:"visaSent"`
	CancelReason string `bson:"cancelReason" json:"cancelReason"`
}

type ApplicantAttachment

type ApplicantAttachment struct {
	S3Key          string                    `bson:"s3Key" json:"s3Key"`
	Status         ApplicantAttachmentStatus `bson:"status" json:"status"`
	RejectedReason *string                   `bson:"rejectedReason,omitempty" json:"rejectedReason,omitempty"`
}

type ApplicantAttachmentStatus

type ApplicantAttachmentStatus string
const (
	ApplicantAttachmentStatusPending  ApplicantAttachmentStatus = "Pending"
	ApplicantAttachmentStatusRejected ApplicantAttachmentStatus = "Rejected"
	ApplicantAttachmentStatusApproved ApplicantAttachmentStatus = "Approved"
)

type Billing

type Billing struct {
	FirstName string `bson:"firstName" json:"firstName"`
	LastName  string `bson:"lastName" json:"lastName"`
	Email     string `bson:"email" json:"email"`
	Email2    string `bson:"email2" json:"email2"`
	Phone     string `bson:"phone" json:"phone"`
}

type Config

type Config struct {
	ID                                    primitive.ObjectID `bson:"_id" json:"id"`
	PusherAppID                           string             `bson:"pusherAppId" json:"pusherAppId"`
	PusherAppKey                          string             `bson:"pusherAppKey" json:"pusherAppKey"`
	PusherAppSecret                       string             `bson:"pusherAppSecret" json:"pusherAppSecret"`
	PusherCluster                         string             `bson:"pusherCluster" json:"pusherCluster"`
	AdminDomain                           string             `bson:"adminDomain" json:"adminDomain"`
	CustomerDomain                        string             `bson:"customerDomain" json:"customerDomain"`
	EmailCustomerCC                       string             `bson:"emailCustomerCc" json:"emailCustomerCc"`
	EmailCustomerTemplateID               int                `bson:"emailCustomerTemplateId" json:"emailCustomerTemplateId"`
	EmailCustomerPendingReviewTemplateID  int                `bson:"emailCustomerPendingReviewTemplateId" json:"emailCustomerPendingReviewTemplateId"`
	EmailCustomerRejectedImagesTemplateID int                `bson:"emailCustomerRejectedImagesTemplateId" json:"emailCustomerRejectedImagesTemplateId"`
	EmailPartner                          string             `bson:"emailPartner" json:"emailPartner"`
	EmailPartnerCC                        string             `bson:"emailPartnerCc" json:"emailPartnerCc"`
	EmailPartnerTemplateID                int                `bson:"emailPartnerTemplateId" json:"emailPartnerTemplateId"`
	PriorityEmailCustomerTemplateID       int                `bson:"priorityEmailCustomerTemplateId" json:"priorityEmailCustomerTemplateId"`
	PriorityEmailPartnerTemplateID        int                `bson:"priorityEmailPartnerTemplateId" json:"priorityEmailPartnerTemplateId"`
	APIRoot                               string             `bson:"apiRoot" json:"apiRoot"`
	APIKey                                string             `bson:"apiKey" json:"apiKey"`
	PushoverToken                         string             `bson:"pushoverToken" json:"pushoverToken"`
	PushoverUsers                         string             `bson:"pushoverUsers" json:"pushoverUsers"`
}

func GetConfig

func GetConfig(ctx context.Context) (*Config, error)

type Invoice

type Invoice struct {
	ID    primitive.ObjectID `bson:"_id" json:"id"`
	Items []InvoiceItem      `bson:"items" json:"items"`
	Title string             `bson:"title" json:"title"`

	CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
	UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"`
}

type InvoiceItem

type InvoiceItem struct {
	ID             primitive.ObjectID `bson:"_id" json:"id"`
	PassportNumber string             `bson:"passportNumber" json:"passportNumber"`
	Name           string             `bson:"name" json:"name"`
	Country        string             `bson:"country" json:"country"`
	Service        string             `bson:"service" json:"service"`
	OrderDate      string             `bson:"orderDate" json:"orderDate"`
	ArrivalDate    string             `bson:"arrivalDate" json:"arrivalDate"`
	Port           string             `bson:"port" json:"port"`
	Cost           string             `bson:"cost" json:"cost"`

	Found   bool   `bson:"found" json:"found"`
	Comment string `bson:"comment" json:"comment"`
}

type Order

type Order struct {
	ID                 primitive.ObjectID `bson:"_id" json:"id"`
	OrderID            int                `bson:"orderId" json:"orderId"`
	Total              string             `bson:"total" json:"total"`
	OrderKey           string             `bson:"orderKey" json:"orderKey"`
	Billing            Billing            `bson:"billing" json:"billing"`
	PaymentMethodTitle string             `bson:"paymentMethodTitle" json:"paymentMethodTitle"`
	Number             string             `bson:"number" json:"number"`
	Trip               Trip               `bson:"trip" json:"trip"`
	Applicants         []Applicant        `bson:"applicants" json:"applicants"`
	Type               OrderType          `bson:"type" json:"type"`
	Variant            OrderVariant       `bson:"variant" json:"variant"`

	AdminKey     *string   `bson:"adminKey,omitempty" json:"adminKey,omitempty"`
	AllVisaSent  bool      `bson:"allVisaSent" json:"allVisaSent"`
	InvoiceDocID string    `bson:"invoiceDocId" json:"invoiceDocId"`
	CreatedAt    time.Time `bson:"createdAt" json:"createdAt"`
	UpdatedAt    time.Time `bson:"updatedAt" json:"updatedAt"`
}

type OrderType

type OrderType string
const (
	OrderTypeVisa     OrderType = ""
	OrderTypePriority OrderType = "Priority"
)

type OrderVariant added in v2.17.0

type OrderVariant string
const (
	OrderVariantEVisa         OrderVariant = ""
	OrderVariantVisaOnArrival OrderVariant = "VisaOnArrival"
)

type Result

type Result struct {
	ID       primitive.ObjectID `bson:"_id" json:"id"`
	S3DirKey string             `bson:"s3DirKey" json:"s3DirKey"`
	Files    []ResultFile       `bson:"files" json:"files"`

	CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
	UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"`
}

type ResultFile

type ResultFile struct {
	Name         string `bson:"name" json:"name"`
	Processed    bool   `bson:"processed" json:"processed"`
	ErrorMessage string `bson:"errorMessage" json:"errorMessage"`
	OrderNumber  string `bson:"orderNumber" json:"orderNumber"`
	// PassportNumber used to match CV manually
	PassportNumber string `bson:"passportNumber" json:"passportNumber"`
}

type Trip

type Trip struct {
	// ArrivalDate is the raw value from woocommerce order
	VisaType         string `bson:"visaType" json:"visaType"`
	VisitPurpose     string `bson:"visitPurpose" json:"visitPurpose"`
	ArrivalDate      string `bson:"arrivalDate" json:"arrivalDate"`
	Checkpoint       string `bson:"checkpoint" json:"checkpoint"`
	ProcessingTime   string `bson:"processingTime" json:"processingTime"`
	FastTrack        string `bson:"fastTrack" json:"fastTrack"`
	CarPickup        bool   `bson:"carPickup" json:"carPickup"`
	Flight           string `bson:"flight" json:"flight"`
	CarPickupAddress string `bson:"carPickupAddress" json:"carPickupAddress"`

	// Arrival is the parsed value from ArrivalDate
	Arrival time.Time `bson:"arrival" json:"arrival"`
}

Jump to

Keyboard shortcuts

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