Documentation ¶
Index ¶
- type CustomerModel
- type DeliveryModel
- func (m *DeliveryModel) Get(deliveryID int) (*models.Delivery, error)
- func (m *DeliveryModel) GetAllByCustomerID(customerID int) ([]*models.Delivery, error)
- func (m *DeliveryModel) GetAllByCustomerIDStatus(customerID int, status string) ([]*models.Delivery, error)
- func (m *DeliveryModel) GetAllByVendorID(vendorID int) ([]*models.Delivery, error)
- func (m *DeliveryModel) GetAllByVendorIDStatus(vendorID int, status string) ([]*models.Delivery, error)
- func (m *DeliveryModel) Insert(customerID, vendorID int, placementTime time.Time, dropLat, dropLong float64) (int, error)
- type ListingModel
- type OrderModel
- type VendorModel
- func (m *VendorModel) Authenticate(email, password string) (int, error)
- func (m *VendorModel) Get(id int) (*models.Vendor, error)
- func (m *VendorModel) GetByPincode(pincode, pincodeRange int) ([]*models.Vendor, error)
- func (m *VendorModel) Insert(name, address, email, password, phone string, pincode int, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomerModel ¶
CustomerModel wraps a connection pool
func (*CustomerModel) Authenticate ¶
func (m *CustomerModel) Authenticate(email, password string) (int, error)
Authenticate verifies the credentials and returns userid if valid details are provided.
type DeliveryModel ¶
DeliveryModel wraps a connection pool
func (*DeliveryModel) Get ¶
func (m *DeliveryModel) Get(deliveryID int) (*models.Delivery, error)
Get fetches a delivery
func (*DeliveryModel) GetAllByCustomerID ¶
func (m *DeliveryModel) GetAllByCustomerID(customerID int) ([]*models.Delivery, error)
GetAllByCustomerID fetches all deliveries associated with a customer id
func (*DeliveryModel) GetAllByCustomerIDStatus ¶
func (m *DeliveryModel) GetAllByCustomerIDStatus(customerID int, status string) ([]*models.Delivery, error)
GetAllByCustomerIDStatus fetches all deliveries associated with a customer id having a particular status
func (*DeliveryModel) GetAllByVendorID ¶
func (m *DeliveryModel) GetAllByVendorID(vendorID int) ([]*models.Delivery, error)
GetAllByVendorID fetches all deliveries associated with a vendor id
func (*DeliveryModel) GetAllByVendorIDStatus ¶
func (m *DeliveryModel) GetAllByVendorIDStatus(vendorID int, status string) ([]*models.Delivery, error)
GetAllByVendorIDStatus fetches all deliveries associated with a vendor id having a particular status
type ListingModel ¶
ListingModel wraps a connection pool
func (*ListingModel) All ¶
func (m *ListingModel) All(vendorID int) ([]*models.Listing, error)
All gets all listing for a particular vendor
type OrderModel ¶
OrderModel wraps a connection pool
func (*OrderModel) AllFromDeliveryID ¶
func (m *OrderModel) AllFromDeliveryID(deliveryID int) ([]*models.Order, error)
AllFromDeliveryID fetches all orders corresponding to a particular delivery ID
func (*OrderModel) Get ¶
func (m *OrderModel) Get(orderID int) (*models.Order, error)
Get fetches a particular order using order_id
func (*OrderModel) Insert ¶
func (m *OrderModel) Insert(deliveryID, listingID, orderQuantity, orderAmount int) error
Insert inserts a new listing into the database using delivery id
type VendorModel ¶
VendorModel wraps a connection pool
func (*VendorModel) Authenticate ¶
func (m *VendorModel) Authenticate(email, password string) (int, error)
Authenticate verifies the credentials and returns vendorid if valid details are provided.
func (*VendorModel) Get ¶
func (m *VendorModel) Get(id int) (*models.Vendor, error)
Get fetches the details of the vendor using its id
func (*VendorModel) GetByPincode ¶
func (m *VendorModel) GetByPincode(pincode, pincodeRange int) ([]*models.Vendor, error)
GetByPincode returns a slice of all vendors in a pincode within the specified range