dao

package
v0.0.0-...-f26ca9b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package dao is the package that holds the database access objects

Package dao is the package that holds the database access objects

Package dao is the package that holds the database access objects

Package dao is the package that holds the database access objects

Package dao is the package that holds the database access objects

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CityDAO

type CityDAO struct {
	Name   string `bson:"name"`
	Ballot bool   `bson:"ballot"`
}

CityDAO is the data access object for the City entity

type ConfirmationDAO

type ConfirmationDAO struct {
	UserID       primitive.ObjectID `bson:"userid"`
	Code         string             `bson:"code"`
	ValidityDate primitive.DateTime `bson:"validitydate"`
}

ConfirmationDAO represents the struct of Confirmation code and UserID to be stored in mongoDB

type ContactDetails

type ContactDetails struct {
	Email string `bson:"email"`
	Phone string `bson:"phone"`
}

ContactDetails is the data access object for the contact details object which is used for both supplier and requester.

type ConversationDAO

type ConversationDAO struct {
	ID                primitive.ObjectID `bson:"_id"`
	TripID            primitive.ObjectID `bson:"tripid"`
	RequestID         primitive.ObjectID `bson:"requestid"`
	RequesterID       primitive.ObjectID `bson:"requesterid"`
	RequesterName     string             `bson:"requestername"`
	SupplierID        primitive.ObjectID `bson:"supplierid"`
	SupplierName      string             `bson:"suppliername"`
	RequestedCapacity int                `bson:"requestedcapacity"`
	RequesterApproved bool               `bson:"requesterapprove"`
	SupplierApproved  bool               `bson:"supplierapprove"`
	RequesterContact  ContactDetails     `bson:"requestercontact"`
	SupplierContact   ContactDetails     `bson:"suppliercontact"`
	Messages          []MessageDAO       `bson:"messages"`
}

ConversationDAO is the data access object for the conversation object.

type CountryDAO

type CountryDAO struct {
	ID     primitive.ObjectID `bson:"_id,omitempty"`
	Name   string             `bson:"name"`
	Cities []CityDAO          `bson:"cities"`
}

CountryDAO is the data access object for the Country entity

type MessageDAO

type MessageDAO struct {
	Direction string             `bson:"direction"`
	Date      primitive.DateTime `bson:"date"`
	Text      string             `bson:"text"`
	Read      bool               `bson:"read"`
}

MessageDAO is the data access object for the message object.

type RequestDAO

type RequestDAO struct {
	ID             primitive.ObjectID   `bson:"_id"`
	RequesterID    primitive.ObjectID   `bson:"requesterid"`
	RequesterName  string               `bson:"requestername"`
	CountryID      primitive.ObjectID   `bson:"countryid"`
	Origin         string               `bson:"origin"`
	Destination    string               `bson:"destination"`
	Dates          []primitive.DateTime `bson:"dates"`
	RequestedSeats int                  `bson:"requestedseats"`
	State          int                  `bson:"state"`
}

RequestDAO is the data access object for the request entity

type TripDAO

type TripDAO struct {
	ID             primitive.ObjectID `bson:"_id"`
	SupplierID     primitive.ObjectID `bson:"supplierid"`
	CountryID      primitive.ObjectID `bson:"countryid"`
	Origin         string             `bson:"origin"`
	Destination    string             `bson:"destination"`
	Stops          []string           `bson:"stops"`
	TripDate       primitive.DateTime `bson:"tripdate"`
	AvailableSeats int                `bson:"availableseats"`
	Note           string             `bson:"note"`
}

TripDAO is the slim data access object for the Trip entity. This object just contains with foreign keys, without the relations

type TripDetailDAO

type TripDetailDAO struct {
	ID             primitive.ObjectID `bson:"_id"`
	SupplierID     primitive.ObjectID `bson:"supplierid"`
	SupplierName   string             `bson:"username"`
	Country        string             `bson:"countryname"`
	Origin         string             `bson:"origin"`
	Destination    string             `bson:"destination"`
	Stops          []string           `bson:"stops"`
	TripDate       primitive.DateTime `bson:"tripdate"`
	AvailableSeats int                `bson:"availableseats"`
	Note           string             `bson:"note"`
}

TripDetailDAO is the data access object for the Trip entity. This object contains the relations

type UserDAO

type UserDAO struct {
	ID       primitive.ObjectID `bson:"_id"`
	Name     string             `bson:"name"`
	Password string             `bson:"password"`
	Email    string             `bson:"email"`
	Phone    string             `bson:"phone"`
	Active   bool               `bson:"active"`
	Admin    bool               `bson:"admin"`
}

UserDAO represents the struct of User type to be stored in mongoDB

Jump to

Keyboard shortcuts

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