mongodb

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectionConfig added in v1.4.0

func CollectionConfig(ctx context.Context, log *logrus.Entry, stage string) (*mongo.Collection, error)

func CollectionInvoices added in v1.1.5

func CollectionInvoices(ctx context.Context, log *logrus.Entry, stage string) (*mongo.Collection, error)

func CollectionOrders added in v1.0.1

func CollectionOrders(ctx context.Context, log *logrus.Entry, stage string) (*mongo.Collection, error)

func CollectionResult added in v1.0.6

func CollectionResult(ctx context.Context, log *logrus.Entry, stage string) (*mongo.Collection, error)

func Disconnect added in v1.0.11

func Disconnect(ctx context.Context, log *logrus.Entry)

func UpdateFromPatch added in v1.0.16

func UpdateFromPatch(req rest.PatchRequest) (interface{}, error)

UpdateFromPatch convert JSON Patch to mongodb update object

Types

type Applicant added in v1.0.1

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"`

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

type Billing added in v1.0.1

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 added in v1.4.0

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"`
}

func GetConfig added in v1.4.0

func GetConfig(ctx context.Context, log *logrus.Entry, stage string) (*Config, error)

type Invoice added in v1.1.5

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 added in v1.1.5

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 added in v1.0.1

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"`

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

type Result added in v1.0.6

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 added in v1.0.6

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 added in v1.0.1

type Trip struct {
	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"`
}

Jump to

Keyboard shortcuts

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