Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Order ¶
type Order struct { ID uint `json:"id"` RiderID uint `json:"rider_id"` UserID uint `json:"user_id"` RefID string `json:"ref_id" gorm:"uniqueIndex;size:30"` Status StatusType `json:"status" gorm:"default:Pending"` Item string `json:"item"` Quantity int `json:"quantity"` Charge float64 `json:"price"` PaymentStatus PaymentStatus `json:"payment_status"` PickUpAddress string `json:"pickup_address"` DropOffAddress string `json:"dropoff_address"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Acknowledge bool `json:"acknowledge" gorm:"default:false"` }
type OrderRepo ¶
type OrderRepo interface { CreateOrder(order *Order) error GetOrders(userID uint) ([]orderDto.OrderResponseDTO, error) UpdateDeliveryStatus(orderId uint, status StatusType) error UpdateAcknowledgeStatus(orderId uint) error GetOrderByID(orderId uint) (orderDto.OrderResponseDTO, error) }
type PaymentStatus ¶
type PaymentStatus string
const ( Paid PaymentStatus = "Paid" Unpaid PaymentStatus = "Unpaid" )
type Rider ¶
type Rider struct { ID uint `json:"id" gorm:"primaryKey"` RiderID string `json:"rider_id" gorm:"uniqueIndex;size:8"` BikeNumber string `json:"bike_number"` FirstName string `json:"first_name"` LastName string `json:"last_name"` UserID uint `json:"user_id"` NextOfKinName string `json:"next_of_kin_name"` NextOfKinPhone string `json:"next_of_kin_phone"` DriverLicenseNumber string `json:"driver_license_number"` NextOfKinAddress string `json:"next_of_kin_address"` Address string `json:"address"` SuccessfulRides int64 `json:"successful_rides"` Rating float64 `json:"rating"` Level string `json:"level"` CurrentLocation string `json:"current_location"` Reviews []Review `json:"reviews" gorm:"foreignKey:RiderID"` Orders []Order `json:"orders" gorm:"foreignKey:RiderID"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` // add minimum and maximum charge to this MinimumCharge float64 `json:"minimum_charge"` MaximumCharge float64 `json:"maximum_charge"` AvailabilityStatus RiderAvailabilityStatus `json:"availability_status" gorm:"default:Available"` }
type RiderAvailabilityStatus ¶
type RiderAvailabilityStatus string
const ( Available RiderAvailabilityStatus = "Available" OnBreak RiderAvailabilityStatus = "On Break" Busy RiderAvailabilityStatus = "Busy" )
type RiderRepository ¶
type RiderRepository interface { CreateRider(rider *Rider) error GetRiders(req *http.Request) ([]dto.RiderListResponse, error) GetRider(id int, req *http.Request) (dto.RiderResponse, error) GetRiderByUserID(userID uint) (*Rider, error) GetRiderByID(id uint) (*Rider, error) UpdateRating(riderId uint) error UpdateMinAndMaxCharge(minCharge float64, maxCharge float64, userID uint) error GetRiderReviews(rideId uint) ([]Review, error) UpdateRiderAvailability(riderID uint, status string) error }
type StatusType ¶
type StatusType string
const ( Delivered StatusType = "Delivered" Canceled StatusType = "Canceled" Pending StatusType = "Pending" InDelivery StatusType = "InDelivery" )
type User ¶
type User struct { ID uint `json:"id" gorm:"primaryKey"` UserName string `json:"username"` Email string `json:"email required" gorm:"unique"` PhoneNumber string `json:"phone_number" gorm:"unique"` WalletBalance float64 `json:"wallet_balance"` AccountNumber string `json:"account_number" gorm:""` AccountName string `json:"account_name"` BankName string `json:"bank_name"` Password string `json:"password"` Verified bool `json:"verified" gorm:"default:false"` Rider Rider `gorm:"foreignKey:UserID"` Orders []Order `json:"orders" gorm:"foreignKey:UserID"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.