models

package
v0.13.8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Courier

type Courier struct {
	gorm.Model
	/*
			Inside gorm.Model:

			ID        uint           `gorm:"primaryKey"` incrementing
		    CreatedAt time.Time
		    UpdatedAt time.Time
		    DeletedAt gorm.DeletedAt `gorm:"index"`
	*/
	Name  string // Name of the courier
	Phone string // Phone address of the courier
}

Courier DB table model

func (Courier) TableName

func (Courier) TableName() string

Name of the Courier structs in the DB

type Locker

type Locker struct {
	gorm.Model
	/*
		ID        string `gorm:"primaryKey"`
		CreatedAt time.Time
		UpdatedAt time.Time
		DeletedAt gorm.DeletedAt `gorm:"index"`
	*/
	City      string //Name of the city where the locker is
	Address   string // Address of the locker
	Latitude  float64
	Longitude float64

	Capacity uint // Shows how many packages could be there
}

Locker DB table Model

func (Locker) TableName

func (Locker) TableName() string

Name of the Locker structs in the DB

type LockerGroup

type LockerGroup struct {
	ID   uint   // Identification of the locker group
	City string // For human readability, which city is this group in
}

LockerGroup DB table Model

func (LockerGroup) TableName

func (LockerGroup) TableName() string

Name of the LockerGroup structs in the DB

type Package

type Package struct {
	gorm.Model
	/*
			Inside gorm.Model:

			ID        uint           `gorm:"primaryKey"` incrementing
		    CreatedAt time.Time
		    UpdatedAt time.Time
		    DeletedAt gorm.DeletedAt `gorm:"index"`
	*/
	TrackID             string    // Code for package tracking
	UserID              uint      // Sender user's id
	SenderLockerId      uint      // Sender locker's id
	DestinationLockerId uint      // Destination locker's id
	ReceiverName        string    // Name of the person who gets the package
	ReceiverEmail       string    // Email of the person who gets the package
	Size                string    // Could be small, medium or large
	DeliverySpeed       string    // Type of delivery
	Price               float64   // Delivery fee (how to calculate?)
	Code                string    // Code to open the locker (both sender and receiver) - random 6 digit number maybe?
	DeliveryDate        time.Time // Date when the package arrives
	Co2                 float64   // Amount of CO2 spared with this package
	Note                string    // Extra note
	CourierID           uint      // Courier's id who delivers the package (can be different from send. locker to warehouse and warehouse to dest. locker?)
}

Package DB table model

func (Package) TableName

func (Package) TableName() string

Name of the Package structs in the DB

type PackageLocker

type PackageLocker struct {
	Package_id uint `gorm:"primaryKey"`
	Locker_id  uint `gorm:"primaryKey"`
}

PackageLocker DB table model

func (PackageLocker) TableName

func (PackageLocker) TableName() string

Name of the PackageStatus structs in the DB

type PackageStatus

type PackageStatus struct {
	Package_id uint `gorm:"primaryKey"`
	Status_id  uint `gorm:"primaryKey"`
}

PackageStatus DB table model

func (PackageStatus) TableName

func (PackageStatus) TableName() string

Name of the PackageStatus structs in the DB

type ResetPasswordCode

type ResetPasswordCode struct {
	gorm.Model
	/*
			Inside gorm.Model:

			ID        uint           `gorm:"primaryKey"` incrementing
		    CreatedAt time.Time
		    UpdatedAt time.Time
		    DeletedAt gorm.DeletedAt `gorm:"index"`
	*/
	Code    string
	User_id uint
}

ResetPasswordCode DB table model

func (ResetPasswordCode) TableName

func (ResetPasswordCode) TableName() string

Name of the ResetPasswordCode structs in the DB

type Status

type Status struct {
	Id   uint `gorm:"primaryKey"`
	Name string
}

Status DB table model

func (Status) TableName

func (Status) TableName() string

Name of the Status structs in the DB

type User

type User struct {
	gorm.Model
	/*
			Inside gorm.Model:

			ID        uint           `gorm:"primaryKey"` incrementing
		    CreatedAt time.Time
		    UpdatedAt time.Time
		    DeletedAt gorm.DeletedAt `gorm:"index"`
	*/
	Name        string
	Address     string
	Phone       string
	Email       string
	Password    string
	AccessLevel uint
	Packages    []Package
}

User DB table model

func (User) TableName

func (User) TableName() string

Name of the User structs in the DB

type UserRequest

type UserRequest struct {
	Name     string `json:"name"`
	Address  string `json:"address"`
	Phone    string `json:"phone"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

UserRequest DTO for incoming request bodies

Jump to

Keyboard shortcuts

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