intial commit

This commit is contained in:
2026-05-25 11:45:56 +05:30
commit 6ab508560f
73 changed files with 23713 additions and 0 deletions

91
models/common.go Normal file
View File

@@ -0,0 +1,91 @@
package models
type Result struct {
Code int `json:"code"`
Status bool `json:"status"`
Message string `json:"message"`
}
type GroupNotifications struct {
Notifications []NotificationData `json:"notifications"`
Fcmmodel *Notification `json:"fcmmodel"`
}
type Notifications struct {
Priority string `json:"priority"`
Registrationids []string `json:"registration_ids"`
Data Data `json:"data"`
Notify Notify `json:"notification"`
}
type NotifyUser struct {
Sender string `json:"sender"`
Accessid string `json:"accessid"`
Notification Notification `json:"notification"`
}
type Notification struct {
Priority string `json:"priority"`
To string `json:"to"`
Notify Notify `json:"notification"`
}
type LoginNotification struct {
Priority string `json:"priority"`
To string `json:"to"`
Notification Notify `json:"notification"`
}
type Notify struct {
Title string `json:"title"`
Body string `json:"body"`
Sound string `json:"sound"`
}
type FcmNotification struct {
Title string `json:"title"`
Body string `json:"body"`
// Type string `json:"type"`
}
type NotificationResult struct {
StatusCode int `json:"statuscode"`
Success int `json:"success"`
Failure int `json:"failure"`
}
type Data struct {
Notificationid int `json:"notificationid" gorm:"Primary_Key"`
Notificationdate string `json:"notificationdate"`
Title string `json:"title"`
Message string `json:"message"`
Configid int `json:"configid"`
Tenantid int64 `json:"tenantid"`
Orderheaderid int `json:"orderheaderid"`
Orderid string `json:"orderid"`
Success int `json:"success"`
Notifytype int `json:"notifytype"`
Notifyreason string `json:"notifyreason"`
Accessid string `json:"accessid" gorm:"<-:false"`
Customerid int64 `json:"customerid" gorm:"<-:false"`
ClickAction string `json:"clickaction" gorm:"<-:false"`
}
type NotificationData struct {
Notificationid int `json:"notificationid" gorm:"Primary_Key"`
Notificationdate string `json:"notificationdate"`
Title string `json:"title"`
Message string `json:"message"`
Configid int `json:"configid"`
Tenantid int64 `json:"tenantid"`
Orderheaderid int `json:"orderheaderid"`
Orderprocessid int `json:"orderprocessid"`
Orderstatus string `json:"orderstatus" gorm:"<-:false"`
Processing string `json:"processing" gorm:"<-:false"`
Shiftid int64 `json:"shiftid"`
Userid int `json:"userid"`
Orderid string `json:"orderid"`
Notifytype int `json:"notifytype"`
Notifyreason string `json:"notifyreason"`
Success int `json:"success"`
}

189
models/customer.go Normal file
View File

@@ -0,0 +1,189 @@
package models
import "time"
type CustomerResult struct {
Code int `json:"code"`
Status bool `json:"status"`
Message string `json:"message"`
Details Customers `json:"details"`
}
type CustomersResult struct {
Code int `json:"code"`
Status bool `json:"status"`
Message string `json:"message"`
Details []Customers `json:"details"`
}
type CustomerInfo struct {
Customerid int `json:"customerid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Profileimage string `json:"profileimage"`
Gender string `json:"gender"`
Dob string `json:"dob"`
Dialcode string `json:"dialcode"`
Contactno string `json:"contactno"`
Email string `json:"email"`
Deviceid string `json:"deviceid"`
Devicetype string `json:"devicetype"`
Authmode int `json:"authmode"`
Configid int `json:"configid"`
Customertoken string `json:"customertoken"`
Deliverylocationid int `json:"deliverylocationid"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Landmark string `json:"landmark"`
Doorno string `json:"doorno"`
Postcode string `json:"postcode"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Applocationid int `json:"applocationid"`
Allocationid int `json:"allocationid"`
Primaryaddress int `json:"primaryaddress"`
Tenantlocationid int `json:"tenantlocationid"`
Tenantid int `json:"tenantid"`
Status int `json:"status"`
Intro string `json:"intro"`
Selectedlatitude string `json:"selectedlatitude"`
Selectedlongitude string `json:"selectedlongitude"`
Radius string `json:"radius"`
Qrmode int `json:"qrmode"`
Quantity int `json:"quantity" gorm:"default:1"`
Collectionamt float32 `json:"collectionamt" gorm:"default:0.0"`
}
type Customers struct {
Customerid int `json:"customerid" gorm:"Primary_Key"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Profileimage string `json:"profileimage"`
Gender string `json:"gender"`
Dob string `json:"dob"`
Dialcode string `json:"dialcode"`
Contactno string `json:"contactno"`
Email string `json:"email"`
Deviceid string `json:"deviceid"`
Devicetype string `json:"devicetype"`
Authmode int `json:"authmode"`
Configid int `json:"configid"`
Customertoken string `json:"customertoken"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Landmark string `json:"landmark"`
Doorno string `json:"doorno"`
Postcode string `json:"postcode"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Applocationid int `json:"applocationid"`
Locationid int `json:"locationid,omitempty" gorm:"-"`
Defaultaddress string `json:"defaultaddress,omitempty" gorm:"-"`
Primaryaddress int `json:"primaryaddress,omitempty" gorm:"-"`
Tenantid int `json:"tenantid,omitempty" gorm:"-"`
Status int `json:"status"`
Intro string `json:"intro"`
Qrmode int `json:"qrmode,omitempty" gorm:"-"`
}
type Customer struct {
Customerid int `json:"customerid" gorm:"Primary_Key"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Profileimage string `json:"profileimage"`
Gender string `json:"gender"`
Dob string `json:"dob"`
Dialcode string `json:"dialcode"`
Contactno string `json:"contactno"`
Email string `json:"email"`
Deviceid string `json:"deviceid"`
Devicetype string `json:"devicetype"`
Authmode int `json:"authmode"`
Configid int `json:"configid"`
Customertoken string `json:"customertoken"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Landmark string `json:"landmark"`
Doorno string `json:"doorno"`
Postcode string `json:"postcode"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Applocationid int `json:"applocationid"`
Locationid int `json:"locationid,omitempty"`
Defaultaddress string `json:"defaultaddress,omitempty"`
Primaryaddress int `json:"primaryaddress,omitempty"`
Tenantid int `json:"tenantid,omitempty"`
Status int `json:"status"`
Intro string `json:"intro"`
Qrmode int `json:"qrmode,omitempty"`
}
type Tenantcustomers struct {
Tenantcustomerid int `json:"tenantcustomerid" gorm:"Primary_Key;autoIncrement"`
Tenantid int `json:"tenantid" `
Locationid int `json:"locationid"`
Customerid int `json:"customerid"`
Moduleid int `json:"moduleid"`
Status int `json:"status"`
}
type Tenantcustomer struct {
Tenantcustomerid int `json:"tenantcustomerid" gorm:"Primary_Key"`
// Tenantid int `json:"tenantid" `
Locationid int `json:"locationid"`
Customerid int `json:"customerid"`
Moduleid int `json:"moduleid"`
Status int `json:"status"`
}
type CustomersId struct {
Customerid int `json:"customerid"`
Locationid int `json:"locationsid"`
Pickuplocationid int `json:"pickuplocationid"`
Deliveryid int `json:"deliveryid"`
Droplocationid int `json:"droplocationid"`
}
type CustomerLocationResult struct {
Code int `json:"code"`
Status bool `json:"status"`
Message string `json:"message"`
Details []Customerlocations `json:"details"`
}
type Customerlocations struct {
Locationid int `json:"locationid" gorm:"Primary_Key"`
Customerid int `json:"customerid"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Landmark string `json:"landmark"`
Doorno string `json:"doorno"`
Postcode string `json:"postcode"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Primaryaddress int `json:"primaryaddress"`
Status int `json:"status"`
}
type CustomerRequest struct {
Customerrequestid int `json:"customerrequestid"`
Referencedate time.Time `json:"referencedate"`
Referencetype string `json:"referencetype"`
Customerid int `json:"customerid"`
Tenantid int `json:"tenantid"`
Apptypeid int `json:"apptypeid"`
Locationid int `json:"locationid"`
Subject string `json:"subject"`
Remarks string `json:"remarks"`
Status int `json:"status"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
}

443
models/delivery.go Normal file
View File

@@ -0,0 +1,443 @@
package models
import "gorm.io/gorm"
type Deliveries struct {
Deliveryid int `json:"deliveryid" gorm:"Primary_Key"`
Orderheaderid int `json:"orderheaderid"`
Applocationid int `json:"applocationid"`
Configid int `json:"configid"`
Partnerid int `json:"partnerid"`
Tenantid int `json:"tenantid"`
Moduleid int `json:"moduleid"`
Locationid int `json:"locationid"`
Categoryid int `json:"categoryid"`
Userid int `json:"userid"`
Subcategoryid int `json:"subcategoryid"`
Orderid string `json:"orderid"`
Deliverydate string `json:"deliverydate"`
Orderstatus string `json:"orderstatus"`
Assigntime string `json:"assigntime"`
Starttime string `json:"starttime"`
Arrivaltime string `json:"arrivaltime"`
Pickuptime string `json:"pickuptime"`
Acceptedtime string `json:"acceptedtime"`
Canceltime string `json:"canceltime"`
Itemcount int `json:"itemcount"`
Orderamount float64 `json:"orderamount" gorm:"type:numeric"`
Customerid int `json:"customerid"`
Pickupcustomer string `json:"pickupcustomer"`
Pickupcontactno string `json:"pickupcontactno"`
Pickuplocationid int `json:"pickuplocationid"`
Pickupaddress string `json:"Pickupaddress"`
Pickuplocation string `json:"pickuplocation"`
Pickuplat string `json:"pickuplat"`
Pickuplon string `json:"pickuplon"`
Deliverycustomerid int `json:"deliverycustomerid"`
Deliverylocationid int `json:"deliverylocationid"`
Deliverycustomer string `json:"deliverycustomer"`
Deliverycontactno string `json:"deliverycontactno"`
Deliveryaddress string `json:"deliveryaddress"`
Deliverylocation string `json:"deliverylocation"`
Droplat string `json:"droplat"`
Droplon string `json:"droplon"`
Deliverylat string `json:"deliverylat"`
Deliverylong string `json:"deliverylong"`
Deliverycharges float64 `json:"deliverycharges" gorm:"type:numeric"`
Deliveryamt float64 `json:"deliveryamt" gorm:"type:numeric"`
Deliverytype string `json:"deliverytype"`
Notes string `json:"notes"`
Ordernotes string `json:"ordernotes"`
Riderslat string `json:"riderslat"`
Riderslon string `json:"riderslon"`
Firstmilekm float64 `json:"firstmilekm" gorm:"type:numeric"`
Firstmilecharges float64 `json:"firstmilecharges" gorm:"type:numeric"`
Lastmilecharges float64 `json:"lastmilecharges" gorm:"type:numeric"`
Ridercharges float64 `json:"ridercharges" gorm:"type:numeric"`
Kms string `json:"kms"`
Actualkms string `json:"actualkms"`
Smsdelivery int `json:"smsdelivery"`
Paymenttype int `json:"paymenttype" gorm:"default:0"`
Previouskms int `json:"previouskms" gorm:"default:0"`
Cumulativekms int `json:"cumulativekms" gorm:"default:0"`
Step int `json:"step" gorm:"default:0"`
Eta string `json:"eta" gorm:"type:varchar(100);default:''"`
Quantity int `josn:"quantity"`
Collectionamt float64 `json:"collectionamt" gorm:"type:numeric"`
Collectedamt float64 `json:"collectedamt" gorm:"type:numeric"`
Collectionstatus float64 `json:"collectionstatus" gorm:"type:numeric"`
Ridertime int `json:"ridertime"`
// GPS tracking fields (nullable — old app versions may not send these)
RawLatitude *string `json:"raw_latitude" gorm:"column:raw_latitude"`
RawLongitude *string `json:"raw_longitude" gorm:"column:raw_longitude"`
VelocityLat *string `json:"velocity_lat" gorm:"column:velocity_lat"`
VelocityLng *string `json:"velocity_lng" gorm:"column:velocity_lng"`
Speed *string `json:"speed" gorm:"column:speed"`
Heading *string `json:"heading" gorm:"column:heading"`
Expecteddeliverytime string `json:"expecteddeliverytime"`
Profit float64 `json:"profit"`
Transitminutes float64 `json:"transitminutes" gorm:"type:numeric"`
Calculationdistancekm float64 `json:"calculationdistancekm" gorm:"type:numeric"`
}
type UpdateDeliveryStatus struct {
Deliveryid int `json:"deliveryid"`
Deliverytype string `json:"deliverytype"`
Pickuplocationid int `json:"pickuplocationid"`
Deliverylocationid int `json:"deliverylocationid"`
Orderheaderid int `json:"orderheaderid"`
Userid int `json:"userid"`
Orderstatus string `json:"orderstatus"`
Assigntime string `json:"assigntime"`
Starttime string `json:"starttime"`
Arrivaltime string `json:"arrivaltime"`
Pickuptime string `json:"pickuptime"`
Acceptedtime string `json:"acceptedtime"`
Deliverytime string `json:"deliverytime"`
Canceltime string `json:"canceltime"`
Pickuplat string `json:"pickuplat"`
Pickuplon string `json:"picklon"`
Pickupimage string `json:"pickupimage"`
Riderslat string `json:"riderslat"`
Riderslon string `json:"riderslon"`
Deliverylat string `json:"deliverylat"`
Deliverylong string `json:"deliverylong"`
Dropimage string `json:"dropimage"`
Address string `json:"address" gorm:"<-:false"`
Suburb string `json:"suburb" gorm:"<-:false"`
City string `json:"city" gorm:"<-:false"`
State string `json:"state" gorm:"<-:false"`
Postcode string `json:"postcode" gorm:"<-:false"`
Deliveryamt float64 `json:"deliveryamt" gorm:"type:numeric"`
Kms string `json:"kms"`
// Actualkms string `json:"actualkms"`
Riderkms string `json:"riderkms"`
Ridercharges float64 `json:"ridercharges" gorm:"type:numeric"`
Kmcal string `json:"kmcal"`
Notes string `json:"notes"`
Feedback string `json:"feedback"`
Smsdelivery int `json:"smsdelivery"`
Previouskms int `json:"previouskms" gorm:"default:0"`
Cumulativekms int `json:"cumulativekms" gorm:"default:0"`
Step int `json:"step" gorm:"default:0"`
Eta string `json:"eta"`
Quantity int `josn:"quantity"`
Collectionamt float64 `json:"collectionamt" gorm:"type:numeric"`
Collectedamt float64 `json:"collectedamt" gorm:"type:numeric"`
Collectionstatus int `json:"collectionstatus" gorm:"default:0"`
Ridertime int `json:"ridertime" gorm:"default:0"`
Bonuspts int `json:"bonuspts"`
Skippedtime string `json:"skippedtime"`
Activelat string `json:"activelat"`
Activelon string `json:"activelon"`
// GPS tracking fields (nullable — old app versions may not send these)
RawLatitude *string `json:"raw_latitude" gorm:"column:raw_latitude"`
RawLongitude *string `json:"raw_longitude" gorm:"column:raw_longitude"`
VelocityLat *string `json:"velocity_lat" gorm:"column:velocity_lat"`
VelocityLng *string `json:"velocity_lng" gorm:"column:velocity_lng"`
Speed *string `json:"speed" gorm:"column:speed"`
Heading *string `json:"heading" gorm:"column:heading"`
Expecteddeliverytime string `json:"expecteddeliverytime"`
Profit float64 `json:"profit"`
Transitminutes float64 `json:"transitminutes" gorm:"type:numeric"`
Calculationdistancekm float64 `json:"calculationdistancekm" gorm:"type:numeric"`
}
type Deliveryinfo struct {
Deliveryid int `json:"deliveryid"`
Orderheaderid int `json:"orderheaderid"`
Applocationid int `json:"applocationid"`
Applocation string `json:"applocation"`
Configid int `json:"configid"`
Partnerid int `json:"partnerid"`
Tenantid int `json:"tenantid"`
Moduleid int `json:"moduleid"`
Locationid int `json:"locationid"`
Categoryid int `json:"categoryid"`
Userid int `json:"userid"`
Subcategoryid int `json:"subcategoryid"`
Orderid string `json:"orderid"`
Deliverydate string `json:"deliverydate"`
Orderstatus string `json:"orderstatus"`
Assigntime string `json:"assigntime"`
Starttime string `json:"starttime"`
Arrivaltime string `json:"arrivaltime"`
Pickuptime string `json:"pickuptime"`
Acceptedtime string `json:"acceptedtime"`
Deliverytime string `json:"deliverytime"`
Canceltime string `json:"canceltime"`
Itemcount int `json:"itemcount"`
Orderamount float64 `json:"orderamount" gorm:"type:numeric"`
Customerid int `json:"customerid"`
Pickupcustomer string `json:"pickupcustomer"`
Pickupcontactno string `json:"pickupcontactno"`
Pickuplocationid int `json:"pickuplocationid"`
Pickupaddress string `json:"Pickupaddress"`
Pickuplocation string `json:"pickuplocation"`
Pickuplat string `json:"pickuplat"`
Pickuplon string `json:"pickuplon"`
Deliverycustomerid int `json:"deliverycustomerid"`
Deliverylocationid int `json:"deliverylocationid"`
Deliverycustomer string `json:"deliverycustomer"`
Deliverycontactno string `json:"deliverycontactno"`
Deliveryaddress string `json:"deliveryaddress"`
Deliverylocation string `json:"deliverylocation"`
Droplat string `json:"droplat"`
Droplon string `json:"droplon"`
Deliverylat string `json:"deliverylat"`
Deliverylong string `json:"deliverylong"`
Deliverycharges float64 `json:"deliverycharges" gorm:"type:numeric"`
Deliveryamt float64 `json:"deliveryamt" gorm:"type:numeric"`
Deliverytype string `json:"deliverytype"`
Notes string `json:"notes"`
Ordernotes string `json:"ordernotes"`
Riderslat string `json:"riderslat"`
Riderslon string `json:"riderslon"`
Firstmilekm float64 `json:"firstmilekm" gorm:"type:numeric"`
Firstmilecharges float64 `json:"firstmilecharges" gorm:"type:numeric"`
Lastmilecharges float64 `json:"lastmilecharges" gorm:"type:numeric"`
Ridercharges float64 `json:"ridercharges" gorm:"type:numeric"`
Kms string `json:"kms"`
Actualkms string `json:"actualkms"`
Riderkms string `json:"riderkms"`
Paymenttype int `json:"paymenttype"`
Tenantname string `json:"tenantname"`
Tenantcontactno string `json:"tenantcontactno"`
Tenanttoken string `json:"tenanttoken"`
Tenantsuburb string `json:"tenantsuburb"`
Tenantcity string `json:"tenantcity"`
Tenantaddress string `json:"tenantaddress"`
Locationname string `json:"locationname"`
Locationcontactno string `json:"locationcontactno"`
Locationsuburb string `json:"locationsuburb"`
Locationaddress string `json:"locationaddress"`
Ridername string `json:"ridername"`
Userfcmtoken string `json:"userfcmtoken"`
Queueid int `json:"queueid"`
Smsdelivery int `json:"smsdelivery"`
Customertoken string `json:"customertoken"`
Ridercontact string `json:"ridercontact"`
Previouskms int `json:"previouskms" `
Cumulativekms int `json:"cumulativekms" `
Step int `json:"step" gorm:"default:0"`
Eta string `json:"eta" gorm:"type:varchar(100);default:''"`
Quantity int `josn:"quantity"`
Collectionamt float64 `json:"collectionamt" gorm:"type:numeric"`
Collectedamt float64 `json:"collectedamt" gorm:"type:numeric"`
Collectionstatus float64 `json:"collectionstatus" gorm:"type:numeric"`
Ridertime int `json:"ridertime"`
Slab string `json:"slab"`
Pricingdate string `json:"pricingdate"`
Baseprice float64 `json:"baseprice" gorm:"type:numeric"`
Minkm int `json:"minkm"`
Priceperkm float64 `json:"priceperkm" gorm:"type:numeric"`
Maxkm int `json:"maxkm"`
Orders int `json:"orders"`
Othercharges float64 `json:"othercharges" gorm:"type:numeric"`
Surgecharges float64 `json:"surgecharges" gorm:"type:numeric"`
Expecteddeliverytime string `json:"expecteddeliverytime"`
Profit float64 `json:"profit"`
Transitminutes float64 `json:"transitminutes" gorm:"type:numeric"`
Calculationdistancekm float64 `json:"calculationdistancekm" gorm:"type:numeric"`
}
type Deliveryqueues struct {
Queueid int `json:"queueid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Orderheaderid int `json:"orderheaderid"`
Deliveryid int `json:"deliveryid"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Orderid string `json:"orderid"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Accept int `json:"accept"`
Decline int `json:"decline"`
Queuestatus int `json:"queuestatus"`
}
type Deliverylogs struct {
Logid int `json:"logid" gorm:"Primary_Key"`
Logdate string `json:"logdate"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Orderheaderid int `json:"orderheaderid"`
Deliveryid int `json:"deliveryid"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Orderid string `json:"orderid"`
Orderstatus string `json:"orderstatus"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Logstatus *int `json:"logstatus" gorm:"default:0"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
// GPS tracking fields (nullable — old app versions may not send these)
RawLatitude *string `json:"raw_latitude" gorm:"column:raw_latitude"`
RawLongitude *string `json:"raw_longitude" gorm:"column:raw_longitude"`
VelocityLat *string `json:"velocity_lat" gorm:"column:velocity_lat"`
VelocityLng *string `json:"velocity_lng" gorm:"column:velocity_lng"`
Speed *string `json:"speed" gorm:"column:speed"`
Heading *string `json:"heading" gorm:"column:heading"`
}
type Deliverydet struct {
Deliveries int `json:"deliveries"`
Delivered int `json:"Delivered"`
Cancelled int `json:"cancelled"`
Kms float64 `json:"kms" gorm:"type:numeric"`
Amount float64 `json:"amount" gorm:"type:numeric"`
}
type DeliverySummary struct {
Total int `json:"total"`
Created int `json:"created"`
Pending int `json:"pending"`
Accepted int `json:"accepted"`
Arrived int `json:"arrived"`
Picked int `json:"picked"`
Active int `json:"active"`
Delivered int `json:"delivered"`
Cancelled int `json:"cancelled"`
Skipped int `json:"skipped"`
}
type DeliveryDetailsCount struct {
Assigned int `json:"assigned"`
Accepted int `json:"accepted"`
Arrived int `json:"Arrived"`
Picked int `json:"picked"`
Active int `json:"active"`
Delivered int `json:"delivered"`
Cancelled int `json:"cancelled"`
}
type ReportSummary struct {
Tenantid int `json:"tenantid"`
Tenantname string `json:"tenantname"`
Locationid int `json:"locationid"`
Locationname string `json:"locationname"`
Totalorders int `json:"totalorders"`
Orderscreated int `json:"orderscreated"`
Orderspending int `json:"Orderspending"`
Orderscompleted int `json:"orderscompleted"`
Orderscancelled int `json:"orderscancelled"`
Deliveriespending int `json:"deliveriespending"`
Deliveriescompleted int `json:"deliveriescompleted"`
Deliveriescancelled int `json:"deliveriescancelled"`
Paylater float64 `json:"paylater" gorm:"type:numeric"`
Payondelivery float64 `json:"payondelivery" gorm:"type:numeric"`
Kms float64 `json:"kms" gorm:"type:numeric"`
Actualkms float64 `json:"actualkms" gorm:"type:numeric"`
Charges float64 `json:"charges" gorm:"type:numeric"`
Previouskms int `json:"previouskms"`
Cumulativekms int `json:"cumulativekms"`
Deliveryamt float64 `json:"deliveryamt" gorm:"type:numeric"`
Riderkms float64 `json:"riderkms" gorm:"type:numeric"`
Quantity int `josn:"quantity"`
Collectionamt float64 `json:"collectionamt" gorm:"type:numeric"`
Collectedamt float64 `json:"collectedamt" gorm:"type:numeric"`
Collectionstatus float64 `json:"collectionstatus" gorm:"type:numeric"`
}
type UserReportSummary struct {
// 🔹 User (Rider) details
Userid int `json:"userid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Ridercontact string `json:"ridercontact"`
// 🔹 Tenant details
Tenantid int `json:"tenantid"`
Tenantname string `json:"tenantname"`
// 🔹 Location details
Locationid int `json:"locationid"`
Locationname string `json:"locationname"`
// 🔹 Order summary
Totalorders int `json:"totalorders"`
Orderscreated int `json:"orderscreated"`
Orderspending int `json:"orderspending"`
Orderscompleted int `json:"orderscompleted"`
Orderscancelled int `json:"orderscancelled"`
// 🔹 Delivery summary
Deliveriespending int `json:"deliveriespending"`
Deliveriescompleted int `json:"deliveriescompleted"`
Deliveriescancelled int `json:"deliveriescancelled"`
// 🔹 Payment summary
Paylater float64 `json:"paylater"`
Payondelivery float64 `json:"payondelivery"`
// 🔹 Distance summary
Kms float64 `json:"kms"`
Actualkms float64 `json:"actualkms"`
Previouskms float64 `json:"previouskms"`
Cumulativekms float64 `json:"cumulativekms"`
Riderkms float64 `json:"riderkms"`
// 🔹 Amount summary
Charges float64 `json:"charges"`
Deliveryamt float64 `json:"deliveryamt"`
// 🔹 Collection summary
Quantity int `json:"quantity"`
Collectionamt float64 `json:"collectionamt"`
Collectedamt float64 `json:"collectedamt"`
Collectionstatus int `json:"collectionstatus"`
}
type Ridersummary struct {
Userid int `json:"userid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Ridercontact string `json:"ridercontact"`
Tenantid int `json:"tenantid"`
Tenantname string `json:"tenantname"`
Locationid int `json:"locationid"`
Locationname string `json:"locationname"`
Totalorders int `json:"totalorders"`
Pending int `json:"pending"`
Assigned int `json:"assigned"`
Accepted int `json:"accepted"`
Picked int `json:"picked"`
Arrived int `json:"arrived"`
Active int `json:"active"`
Skipped int `json:"skipped"`
Delivered int `json:"delivered"`
Cancelled int `json:"cancelled"`
Kms float64 `json:"kms" gorm:"type:numeric"`
Actualkms float64 `json:"actualkms" gorm:"type:numeric"`
Previouskms int `json:"previouskms"`
Cumulativekms int `json:"cumulativekms"`
Payondelivery float64 `json:"payondelivery" gorm:"type:numeric"`
Paylater float64 `json:"Paylater" gorm:"type:numeric"`
Deliveryamt float64 `json:"deliveryamt" gorm:"type:numeric"`
Status string `json:"status"`
Quantity int `josn:"quantity"`
Collectionamt float64 `json:"collectionamt" gorm:"type:numeric"`
Collectedamt float64 `json:"collectedamt" gorm:"type:numeric"`
Collectionstatus float64 `json:"collectionstatus" gorm:"type:numeric"`
}
type DeliveryQuery struct {
Tenantid int
Partnerid int
UserID int
Appuserid int
Applocationid int
Locationid int
Configid int
Fromdate string
ToDate string
Status string
Pageno int
Pagesize int
Conn *gorm.DB
Keyword string `json:"keyword"`
}

89
models/invoice.go Normal file
View File

@@ -0,0 +1,89 @@
package models
type Tenantsales struct {
Salesid int `json:"salesid" gorm:"Primary_Key"`
Transactiondate string `json:"transactiondate"`
Duedate string `json:"duedate"`
Applocationid int `json:"applocationid"`
Invoiceid string `json:"invoiceid"`
Invoiceno string `json:"invoiceno"`
Tenantid int `json:"tenantid"`
Pricingtypeid int `json:"pricingtypeid"`
Pricingtype string `json:"pricingtype"`
Tenantname string `json:"tenantname"`
Contactperson string `json:"contactperson"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Itemcount int `json:"itemcount"`
Salesamount float32 `json:"salesamount"`
Discountpercent float32 `json:"discountpercent"`
Discountamt float32 `json:"discountamt"`
Taxpercent float32 `json:"taxpercent"`
Taxamount float32 `json:"taxamount"`
Totalamount float32 `json:"totalamount"`
Billstatus int `json:"billstatus"`
Billcancel int `json:"billcancel"`
Remarks string `json:"remarks"`
Referenceno string `json:"referenceno"`
Referencedate string `json:"referencedate" gorm:"default:NULL"`
Paymentremarks string `json:"paymentremarks"`
Status string `json:"status" gorm:"default:pending"`
Tenantsalesdetails []Tenantsalesdetails `json:"tenantsalesdetails" gorm:"ForeignKey:salesid"`
}
type Tenantsalesdetails struct {
Salesdetailid int `json:"salesdetailid" gorm:"Primary_Key"`
Salesid int `json:"salesid" `
Tenantid int `json:"tenantid"`
Particulars string `json:"particulars"`
Fromdate string `json:"fromdate"`
Todate string `json:"todate"`
Pricingtypeid int `json:"pricingtypeid"`
Pricingtype string `json:"pricingtype"`
Baserate float32 `json:"baserate"`
Quantity float32 `json:"quantity"`
Amount float32 `json:"amount"`
Othercharges float32 `json:"othercharges"`
Taxpercent float32 `json:"taxpercent"`
Taxamount float32 `json:"taxamount"`
Totalamount float32 `json:"totalamount"`
Billstatus int `json:"billstatus" gorm:"<-:false"`
Orderheaderid int `json:"orderheaderid" gorm:"<-:false"`
Orderid string `json:"orderid" gorm:"<-:false"`
Orderdate string `json:"orderdate" gorm:"<-:false"`
Pickup string `json:"pickup" gorm:"<-:false"`
Drop string `json:"drop" gorm:"<-:false"`
}
type InvoiceOrders struct {
Deliveries int `json:"deliveries"`
Kms int `json:"kms"`
Actualkms int `json:"actualkms"`
}
type InvoiceInsight struct {
Total float32 `json:"total"`
Totalcount int `json:"totalcount"`
Pending float32 `json:"pending"`
Pendingcount int `json:"pendingcount"`
Pendingpercent float32 `json:"pendingpercent"`
Confirmed float32 `json:"confirmed"`
Confirmedcount int `json:"confirmedcount"`
Confirmedpercent float32 `json:"confirmedpercent"`
Paid float32 `json:"paid"`
Paidcount int `json:"paidcount"`
Paidpercent float32 `json:"paidpercent"`
Overduecount int `json:"overduecount"`
Overdue float32 `json:"overdue"`
Overduepercent float32 `json:"overduepercent"`
}
type InvoiceStatus struct {
Salesid int `json:"salesid" gorm:"Primary_Key"`
Referenceno string `json:"Referenceno"`
Referencedate string `json:"referencedate"`
Billstatus int `json:"billstatus"`
Paymentremarks string `json:"paymentremarks"`
}

460
models/order.go Normal file
View File

@@ -0,0 +1,460 @@
package models
type OrderInfo struct {
Orderheaderid int `json:"orderheaderid"`
Applocationid int `json:"applocationid"`
Applocation string `json:"applocation"`
Tenantid int `json:"tenantid"`
Partnerid int `json:"partnerid"`
Locationid int `json:"locationid"`
Categoryid int `json:"categoryid"`
Subcategoryid int `json:"subcategoryid"`
Moduleid int `json:"moduleid"`
Configid int `json:"configid"`
Orderid string `json:"orderid"`
Orderdate string `json:"orderdate"`
Deliverydate string `json:"deliverydate"`
Orderstatus string `json:"orderstatus"`
Deliverystatus string `json:"deliverystatus"`
Deliveryamt float64 `json:"deliveryamt"`
Itemcount int `json:"itemcount"`
Ordernotes string `json:"ordernotes"`
Kms string `json:"kms"`
Actualkms string `json:"actualkms"`
Pending string `json:"Pending"`
Processing string `json:"processing"`
Ready string `json:"ready"`
Cancelled string `json:"cancelled"`
Delivered string `json:"delivered"`
Assigntime string `json:"assigntime"`
Starttime string `json:"starttime"`
Arrivaltime string `json:"arrivaltime"`
Pickuptime string `json:"pickuptime"`
Deliverytime string `json:"deliverytime"`
Canceltime string `json:"canceltime"`
Deliverycharge float64 `json:"deliverycharge"`
Orderamount float64 `json:"orderamount"`
Customerid int `json:"customerid"`
Pickupcustomer string `json:"pickupcustomer"`
Pickupcontactno string `json:"pickupcontactno"`
Pickuplocationid int `json:"pickuplocationid"`
Pickupaddress string `json:"pickupaddress"`
Pickupsuburb string `json:"pickupsuburb"`
Pickupcity string `json:"pickupcity"`
Pickuplat string `json:"pickuplat"`
Pickuplong string `json:"pickuplong"`
Pickupslot string `json:"pickupslot"`
Deliveryid int `json:"deliveryid"`
Deliverycustomerid int `json:"deliverycustomerid"`
Deliverycustomer string `json:"deliverycustomer"`
Deliverycontactno string `json:"deliverycontactno"`
Deliverylocationid int `json:"deliverylocationid"`
Deliveryaddress string `json:"deliveryaddress"`
Deliverysuburb string `json:"deliverysuburb"`
Droplat string `json:"droplat"`
Droplon string `json:"droplon"`
Deliverylat string `json:"deliverylat"`
Deliverylong string `json:"deliverylong"`
Deliverytype string `json:"deliverytype"`
Paymenttype int `json:"paymenttype"`
Tenantname string `json:"tenantname"`
Tenanttoken string `json:"tenanttoken"`
Tenantsuburb string `json:"tenantsuburb"`
Tenantcity string `json:"tenantcity"`
Tenantcontactno string `json:"tenantcontactno"`
Tenantpostcode string `json:"tenantpostcode"`
Tenantaddress string `json:"tenantaddress"`
Locationname string `json:"locationname"`
Locationsuburb string `json:"locationsuburb"`
Locationcity string `json:"locationcity"`
Locationcontactno string `json:"locationcontactno"`
Locationaddress string `json:"locationaddress"`
Rider string `json:"rider"`
Ridercontactno string `json:"ridercontactno"`
Riderkms string `json:"riderkms"`
Smsdelivery int `json:"smsdelivery"`
Customertoken string `json:"customertoken"`
Ridertoken string `json:"ridertoken"`
Previouskms int `json:"previouskms" gorm:"default:0"`
Cumulativekms int `json:"cumulativekms" gorm:"default:0"`
Step int `json:"step" gorm:"default:0"`
Eta string `json:"eta" gorm:"type:varchar(100);default:''"`
Quantity int `json:"quantity" gorm:"default:0"`
Collectionamt float64 `json:"collectionamt" gorm:"default:0"`
Slab string `json:"slab"`
Pricingdate string `json:"pricingdate"`
Baseprice float64 `json:"baseprice"`
Minkm int `json:"minkm"`
Priceperkm float64 `json:"priceperkm"`
Maxkm int `json:"maxkm"`
Orders int `json:"orders"`
Othercharges float64 `json:"othercharges"`
Surgecharges float64 `json:"surgecharges"`
}
// type TenantOrders struct {
// Orderheaderid int `json:"orderheaderid"`
// Tenantid int `json:"tenantid"`
// Locationid int `json:"locationid"`
// Categoryid int `json:"categoryid"`
// Subcategoryid int `json:"subcategoryid"`
// Moduleid int `json:"moduleid"`
// Configid int `json:"configid"`
// Orderid string `json:"orderid"`
// Customerid int `json:"customerid"`
// Customername string `json:"customername"`
// Contactno string `json:"contactno"`
// Deliverydate string `json:"deliverydate"`
// Orderstatus string `json:"orderstatus"`
// Starttime string `json:"starttime"`
// Arrivaltime string `json:"arrivaltime"`
// Pickuptime string `json:"pickuptime"`
// Deliverytime string `json:"deliverytime"`
// Deliveryaddress string `json:"deliveryaddress"`
// Deliverylat string `json:"deliverylat"`
// Deliverylong string `json:"deliverylong"`
// Pickupaddress string `json:"pickupaddress"`
// Pickuplat string `json:"pickuplat"`
// Pickuplong string `json:"pickuplong"`
// Droplat string `json:"droplat"`
// Droplon string `json:"droplon"`
// Notes string `json:"notes"`
// Ordernotes string `json:"ordernotes"`
// Locationname string `json:"locationname"`
// }
type Ordersequences struct {
Sequenceid int `json:"sequenceid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Orderprefix string `json:"orderprefix" gorm:"default:ORD"`
Customerprefix string `json:"customerprefix" gorm:"default:CUS"`
Appointmentprefix string `json:"appointmentprefix" gorm:"default:ORD"`
Receiptprefix string `json:"receiptprefix" gorm:"default:REC"`
Paymentprefix string `json:"paymentprefix" gorm:"default:PAY"`
}
type Orders struct {
Orderheaderid int `json:"orderheaderid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Applocationid int `json:"applocationid"`
Moduleid int `json:"moduleid"`
Partnerid int `json:"partnerid"`
Configid int `json:"configid"`
Categoryid int `json:"categoryid"`
Subcategoryid int `json:"subcategoryid"`
Orderid string `json:"orderid"`
Orderdate string `json:"orderdate,omitempty"`
Deliverytime string `json:"deliverytime"`
Deliverytype string `json:"deliverytype"`
Orderstatus string `json:"orderstatus"`
Pending string `json:"pending"`
Processing string `json:"processing"`
Ready string `json:"ready"`
Delivered string `json:"delivered"`
Cancelled string `json:"cancelled"`
Customerid int `json:"customerid"`
Pickupcustomer string `json:"pickupcustomer"`
Pickupcontactno string `json:"pickupcontactno"`
Pickuplandmark string `json:"pickuplandmark"`
Pickuplocationid int `json:"pickuplocationid"`
Pickupaddress string `json:"pickupaddress"`
Pickuplocation string `json:"pickuplocation"`
Pickupcity string `json:"pickupcity"`
Pickuplat string `json:"pickuplat"`
Pickuplong string `json:"pickuplong"`
Pickupslot string `json:"pickupslot"`
Deliveryid int `json:"deliveryid"`
Deliverylocationid int `json:"deliverylocationid"`
Deliverycustomer string `json:"deliverycustomer"`
Deliverycontactno string `json:"deliverycontactno"`
Deliverylandmark string `json:"deliverylandmark"`
Deliverylocation string `json:"deliverylocation"`
Deliverycity string `json:"deliverycity"`
Deliveryaddress string `json:"deliveryaddress"`
Deliverylat string `json:"deliverylat"`
Deliverylong string `json:"deliverylong"`
Promotionid int `json:"promotionid"`
Promoname string `json:"promoname"`
Promoterms string `json:"promoterms"`
Promovalue int `json:"promovalue"`
Promoamount float64 `json:"promoamount" gorm:"type:numeric"`
Orderamount float64 `json:"orderamount" gorm:"type:numeric"`
Taxamount float64 `json:"taxamount" gorm:"type:numeric"`
Ordercharges float64 `json:"ordercharges" gorm:"type:numeric"`
Ordervalue float64 `json:"ordervalue" gorm:"type:numeric"`
Itemcount int `json:"itemcount"`
Paymenttype int `json:"paymenttype"`
Paymentstatus int `json:"paymentstatus"`
Deliverycharge float64 `json:"deliverycharge" gorm:"type:numeric"`
Ordernotes string `json:"ordernotes"`
Kms string `json:"kms"`
Remarks string `json:"remarks"`
Tenantuserid int `json:"tenantuserid"`
Partneruserid int `json:"partneruserid"`
Smsdelivery int `json:"smsdelivery" gorm:"default:0"`
Quantity int `josn:"quantity"`
Collectionamt float64 `json:"collectionamt" gorm:"type:numeric"`
Items []OrderDetail `json:"items" gorm:"-"`
}
type OrderDetail struct {
Orderdetailid int `json:"orderdetailid" gorm:"primaryKey;autoIncrement"`
Orderheaderid int `json:"orderheaderid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Productid int `json:"productid"`
Productname string `json:"productname"`
Productdescription string `json:"productdescription"`
Supplyqty float64 `json:"supplyqty"`
Balanceqty float64 `json:"balanceqty"`
Orderqty float64 `json:"orderqty"`
Price float64 `json:"price"`
Unitid int `json:"unitid"`
Unitname string `json:"unitname"`
Productaddonid int `json:"productaddonid"`
Addontypeid int `json:"addontypeid"`
Productmapid int `json:"productmapid"`
Productvariantid int `json:"productvariantid"`
Productaddondescription string `json:"productaddondescription"`
Discountid int `json:"discountid"`
Discountname string `json:"discountname"`
Discountcode string `json:"discountcode"`
Discountterms string `json:"discountterms"`
Discountpercentage float64 `json:"discountpercentage"`
Discountamount float64 `json:"discountamount"`
Landingamount float64 `json:"landingamount"`
Taxpercentage float64 `json:"taxpercentage"`
Taxamount float64 `json:"taxamount"`
Productsumprice float64 `json:"productsumprice"`
Itemstatus string `json:"itemstatus"`
Delivered string `json:"delivered"`
Orderamount float64 `json:"-" gorm:"-"`
Productimage string `json:"productimage" gorm:"-"` // only for JSON
}
// ✅ GORM will now use `orderdetails` instead of `order_details`
func (OrderDetail) TableName() string {
return "orderdetails"
}
type OrderDetails struct {
Orderdetailid int `json:"orderdetailid" gorm:"primaryKey;autoIncrement"`
Orderheaderid int `json:"orderheaderid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Productid int `json:"productid"`
Productname string `json:"productname"`
Productdescription string `json:"productdescription"`
Supplyqty float64 `json:"supplyqty"`
Balanceqty float64 `json:"balanceqty"`
Orderqty float64 `json:"orderqty"`
Price float64 `json:"price"`
Unitid int `json:"unitid"`
Unitname string `json:"unitname"`
Productaddonid int `json:"productaddonid"`
Addontypeid int `json:"addontypeid"`
Productmapid int `json:"productmapid"`
Productvariantid int `json:"productvariantid"`
Productaddondescription string `json:"productaddondescription"`
Discountid int `json:"discountid"`
Discountname string `json:"discountname"`
Discountcode string `json:"discountcode"`
Discountterms string `json:"discountterms"`
Discountpercentage float64 `json:"discountpercentage"`
Discountamount float64 `json:"discountamount"`
Landingamount float64 `json:"landingamount"`
Taxpercentage float64 `json:"taxpercentage"`
Taxamount float64 `json:"taxamount"`
Totaltaxamount float64 `json:"totaltaxamount"`
Productsumprice float64 `json:"productsumprice"`
Itemstatus string `json:"itemstatus"`
Delivered string `json:"delivered"`
Orderamount float64 `json:"Orderamount"` // 👈 Correct way
Productimage string `json:"productimage"` // only for JSON
}
func (OrderDetails) TableName() string {
return "orderdetails"
}
type Customerorder struct {
Orders Orders `json:"orders"`
Pickup Customers `json:"pickup"`
Drop Customers `json:"drop"`
}
type CustomerorderV2 struct {
Orders Orders `json:"orders"`
}
type Updateorderstatus struct {
Orderheaderid int `json:"Orderheaderid"`
Orderstatus string `json:"Orderstatus"`
Pending string `json:"pending"`
Processing string `json:"processing"`
Cancelled string `json:"cancelled"`
Delivered string `json:"delivered"`
Userid int `json:"userid"`
}
type Ordersummary struct {
Total int `json:"total"`
Created int `json:"created"`
Pending int `json:"pending"`
Processing int `json:"processing"`
Delivered int `json:"delivered"`
Cancelled int `json:"cancelled"`
Locationname string `json:"locationname"`
Applocationid string `json:"applocationid"`
}
type Ordersummarydaily struct {
Total int `json:"total"`
Created int `json:"created"`
Pending int `json:"pending"`
Processing int `json:"processing"`
Delivered int `json:"delivered"`
Cancelled int `json:"cancelled"`
Tenantid int `json:"tenantid"`
Tenantname string `json:"tenantname"`
}
type Ordersummarylocation struct {
Total int `json:"total"`
Created int `json:"created"`
Pending int `json:"pending"`
Processing int `json:"processing"`
Delivered int `json:"delivered"`
Cancelled int `json:"cancelled"`
Locationid int `json:"locationid"`
Locationname string `json:"locationname"`
}
type OrderInsight struct {
Applocationid int `json:"applocationid" gorm:"Primary_Key"`
Locationname string `json:"locationname"`
Ordermonths *Ordermonths `json:"ordermonths" gorm:"-"`
}
type OrderInsightv1 struct {
Locationid int `json:"locationid" gorm:"Primary_Key"`
Locationname string `json:"locationname"`
Ordermonths *Ordermonths `json:"ordermonths" gorm:"-"`
}
type Ordermonths struct {
Jan int `json:"jan"`
Feb int `json:"feb"`
Mar int `json:"mar"`
Apr int `json:"apr"`
May int `json:"may"`
Jun int `json:"jun"`
Jul int `json:"jul"`
Aug int `Json:"aug"`
Sep int `Json:"sep"`
Oct int `Json:"oct"`
Nov int `Json:"nov"`
Dece int `Json:"dece"`
// Applocationid int `json:"applocationid"`
}
type CustomerOrder struct {
Orderheaderid int `json:"orderheaderid" gorm:"Primary_Key"`
Applocationid int `json:"applocationid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Partnerid int `json:"partnerid"`
Configid int `json:"configid"`
Categoryid int `json:"categoryid"`
Subcategoryid int `json:"subcategoryid"`
Moduleid int `json:"moduleid"`
Orderid string `json:"orderid"`
Orderstatus string `json:"orderstatus"`
Orderdate string `json:"orderdate,omitempty"`
Ordernotes string `json:"ordernotes"`
Itemcount int `json:"itemcount"`
Deliverytime string `json:"deliverytime"` // alias for delivered
Pending string `json:"pending"`
Processing string `json:"processing"`
Ready string `json:"ready"`
Delivered string `json:"delivered"` // original delivered column
Cancelled string `json:"cancelled"`
Deliverycharge float32 `json:"deliverycharge"`
Kms string `json:"kms"`
Customerid int `json:"customerid"`
Pickupaddress string `json:"pickupaddress"`
Pickuplat string `json:"pickuplat"`
Pickuplong string `json:"pickuplong"`
Pickupcustomer string `json:"pickupcustomer"`
Pickupcontactno string `json:"pickupcontactno"`
Pickuplocation string `json:"pickupsuburb"` // alias
Pickupcity string `json:"pickupcity"`
Deliveryid int `json:"deliverycustomerid"` // alias
Deliveryaddress string `json:"deliveryaddress"`
Deliverylat string `json:"deliverylat"`
Deliverylong string `json:"deliverylong"`
Deliverytype string `json:"deliverytype"`
Deliverycustomer string `json:"deliverycustomer"`
Deliverycontactno string `json:"deliverycontactno"`
Deliverylocation string `json:"deliverysuburb"` // alias
Deliverycity string `json:"deliverycity"`
Paymenttype int `json:"paymenttype"`
Smsdelivery int `json:"smsdelivery"`
// Tenant Info
Tenantname string `json:"tenantname"`
Tenanttoken string `json:"tenanttoken"`
Tenantcontactno string `json:"tenantcontactno"`
Tenantpostcode string `json:"tenantpostcode"`
Tenantsuburb string `json:"tenantsuburb"`
Tenantcity string `json:"tenantcity"`
// Location Info
Locationname string `json:"locationname"`
Locationcontactno string `json:"locationcontactno"`
Locationpostcode string `json:"locationpostcode"`
Locationsuburb string `json:"locationsuburb"`
Locationcity string `json:"locationcity"`
// App Location
Applocation string `json:"applocation"`
// Delivery Info (from `deliveries` table)
Deliverystatus string `json:"deliverystatus"`
DeliveryUserID int `json:"deliveryid"` // alias
Assigntime string `json:"assigntime"`
Starttime string `json:"starttime"`
Arrivaltime string `json:"arrivaltime"`
Pickuptime string `json:"pickuptime"`
Finaldeliverytime string `json:"finaldeliverytime"` // alias for f.deliverytime
Canceltime string `json:"canceltime"`
// Actualkms sql.NullFloat64 `json:"actualkms"`
// Riderkms sql.NullFloat64 `json:"riderkms"`
// Deliveryamt sql.NullFloat64 `json:"deliveryamt"`
Droplat string `json:"droplat"`
Droplon string `json:"droplon"`
// Rider
Rider string `json:"rider"`
Orderamount float64 `json:"orderamount"`
Taxamount float64 `json:"taxamount"`
// Items if applicable
OrderDetails []OrderDetails `json:"orderdetails" gorm:"-"`
}
type CustomerOrderLocation struct {
Locationname string `json:"locationname" gorm:"column:locationname"`
Ordercount int `json:"ordercount" gorm:"column:ordercount"`
Contactno string `json:"contactno" gorm:"column:contactno"`
Address string `json:"address" gorm:"column:address"`
Suburb string `json:"suburb" gorm:"column:suburb"`
City string `json:"city" gorm:"column:city"`
State string `json:"state" gorm:"column:state"`
Postcode string `json:"postcode" gorm:"column:postcode"`
Latitude float64 `json:"latitude" gorm:"column:latitude"`
Longitude float64 `json:"longitude" gorm:"column:longitude"`
}

353
models/partner.go Normal file
View File

@@ -0,0 +1,353 @@
package models
import (
"time"
)
type RiderPoolResult struct {
Status bool `json:"status"`
Code int `json:"code"`
Message string `json:"message"`
Details []RiderPool `json:"Details"`
}
type RiderPool struct {
Poolid int `json:"poolid"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Fullname string `json:"fullname"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Userfcmtoken string `json:"userfcmtoken"`
Identificationno string `json:"identificationno"`
Vehicleid int `json:"vehicleid"`
Vehiclename string `json:"vehiclename"`
Registrationno string `json:"registrationno"`
Licenseno string `json:"licenseno"`
Shiftid int `json:"shiftid"`
Starttime string `json:"starttime"`
Endtime string `json:"endtime"`
Shifthours float32 `json:"shifthours"`
Basefare float32 `json:"basefare"`
Fuelcharge float32 `json:"fuelcharge"`
Applocationid int `json:"applocationid"`
Status string `json:"status"`
}
type Partnerinfo struct {
Partnerid int `json:"partnerid" gorm:"Primary_Key"`
Partnertypeid int `json:"partnertypeid"`
Applocationid int `json:"applocationid"`
Partnername string `json:"partnername"`
Registrationno string `json:"registrationno"`
Primarycontact string `json:"primartcontact"`
Primaryemail string `json:"primaryemail"`
Contactno string `json:"contactno"`
Bizcategoryid int `json:"bizcategoryid"`
Bizsubcategoryid int `json:"bizsubcategoryid"`
Adderss string `json:"address"`
Suburb string `json:"suburb"`
State string `json:"state"`
City string `json:"city"`
Postcode string `json:"postcode"`
Partnerinfo string `json:"partnerinfo"`
Partnerimage string `json:"partnerimage"`
}
type AdminToken struct {
Userid int `json:"userid"`
Userfcmtoken string `json:"userfcmtokem"`
Notify string `json:"notify"`
Applocationid int `json:"applocationid"`
Closetime string `json:"closetime"`
Opentime string `json:"opentime"`
Tenantid int `json:"tenantid"`
}
type Rider struct {
Userid int `json:"userid" gorm:"primaryKey"`
Authname string `json:"authname"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Password string `json:"password"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Pin int `json:"pin"`
Deviceid string `json:"deviceid"`
Devicetype string `json:"devicetype"`
Userfcmtoken string `json:"userfcmtoken"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Partnerid int `json:"partnerid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Applocationid int `json:"applocationid"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Name string `json:"name"`
Capacity int `json:"capacity"`
Rangekm int `json:"rangekm"`
Batterypercentage int `json:"batterypercentage"`
Type string `json:"type"`
Status string `json:"status" gorm:"column:status;default:InActive"`
Ridersettings Ridersettings `json:"ridersettings" gorm:"-"`
}
type RiderDetails struct {
Userid int `json:"userid"`
Authname string `json:"authname"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Fullname string `json:"fullname"`
Password string `json:"password"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Userfcmtoken string `json:"userfcmtoken"`
Pin int `json:"pin"`
Partnerid int `json:"partnerid"`
Riderid int `json:"riderid"`
Identificationno string `json:"identificationno"`
Shiftid int `json:"shiftid"`
Starttime string `json:"starttime"`
Endtime string `json:"endtime"`
Shifthours float32 `json:"shifthours"`
Basefare float32 `json:"basefare"`
Additionalcharges float32 `json:"additionalcharges"`
Additionalkm float32 `json:"additionalkm"`
Orders int `json:"orders"`
Fuelcharge float32 `json:"fuelcharge"`
Accountno string `json:"accountno"`
Accountname string `json:"accountname"`
Accounttypeid int `json:"accounttypeid"`
Accounttype string `json:"accounttype"`
Bankname string `json:"bankname"`
Ifsccode string `json:"ifsccode"`
Branch string `json:"branch"`
Vehicleid int `json:"vehicleid"`
Vehiclename string `json:"vehiclename"`
Vehicleno string `json:"vehicleno"`
Model string `json:"model"`
Color string `json:"color"`
Licenseno string `json:"licenseno"`
Insuranceno string `json:"insuranceno"`
Insurancedate string `json:"insurancedate"`
Applocationid int `json:"applocationid"`
Status string `json:"status"`
}
type Ridersettings struct {
Riderid int `json:"riderid" grom:"Primary_Key"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Shiftid int `json:"shiftid"`
Identificationno string `json:"identificationno"`
Basefare float32 `json:"basefare"`
Additionalkm float32 `json:"additionalkm"`
Additionalcharges float32 `json:"additionalcharges"`
Accountno string `json:"accountno"`
Accountname string `json:"accountname"`
Accounttypeid int `json:"accounttypeid"`
Accounttype string `json:"accounttype"`
Bankname string `json:"bankname"`
Ifsccode string `json:"ifsccode"`
Branch string `json:"branch"`
Vehicleid int `json:"vehicleid"`
Vehiclename string `json:"vehiclename"`
Vehicleno string `json:"vehicleno"`
Model string `json:"model"`
Color string `json:"color"`
Licenseno string `json:"licenseno"`
Insuranceno string `json:"insuranceno"`
Insurancedate string `json:"insurancedate"`
Status int `json:"status"`
}
type Ridershifts struct {
Shiftid int `json:"shiftid" gorm:"Primary_Key"`
Shiftdate string `json:"shiftdate"`
Starttime string `json:"starttime"`
Endtime string `json:"endtime"`
Shifthours float32 `json:"shifthours"`
Basefare float32 `json:"basefare"`
Additionalkm float32 `json:"additionalkm"`
Additionalcharges float32 `json:"additionalcharges"`
Orders int `json:"orders"`
Fuelcharge float32 `json:"fuelcharge"`
Shiftname string `json:"shiftname" gorm:"<-:false"`
}
type Riderlogs struct {
Logid int `json:"logid" gorm:"Primary_Key"`
Logdate string `json:"logdate"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Shiftid int `json:"shiftid"`
Shifthours float64 `json:"shifthours" gorm:"type:numeric"`
Login string `json:"login,omitempty" gorm:"column:login;default:NULL"`
Logout string `json:"logout,omitempty" gorm:"column:logout;default:NULL"`
Latitude string `json:"latitude"`
Workhours float64 `json:"workhours" gorm:"type:numeric"`
Shorthours float64 `json:"shorthours" gorm:"type:numeric"`
Logstatus int `json:"logstatus"`
Longitude string `json:"longitude"`
Status string `json:"status"`
Breakhours float32 `json:"breakhours" gorm:"<-:false"`
Onduty int `json:"onduty" gorm:"<-:false"`
Firstname string `json:"firstname" gorm:"<-:false"`
Lastname string `json:"lastname" gorm:"<-:false"`
Username string `json:"username"`
Contactno string `json:"contactno"`
Userfcmtoken string `json:"userfcmtoken"`
Applocationid int `json:"applocationid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Orderid string `json:"orderid"`
Raw_latitude string `json:"raw_latitude"`
Raw_longitude string `json:"raw_longitude"`
Velocity_lat string `json:"velocity_lat"`
Velocity_long string `json:"velocity_long"`
Speed string `json:"speed"`
Heading string `json:"heading"`
}
type Riderlogsv1 struct {
Logid int `json:"logid" gorm:"Primary_Key"`
Logdate string `json:"logdate"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Shiftid int `json:"shiftid"`
Shifthours float32 `json:"shifthours"`
Login string `json:"login,omitempty" gorm:"column:login;default:NULL"`
Logout string `json:"logout,omitempty" gorm:"column:logout;default:NULL"`
Latitude string `json:"latitude"`
Workhours float32 `json:"workhours"`
Shorthours float32 `json:"shorthours"`
Logstatus int `json:"logstatus"`
Longitude string `json:"longitude"`
Breakhours float32 `json:"breakhours" `
Onduty int `json:"onduty" `
Status string `json:"status"`
Firstname string `json:"firstname" `
Lastname string `json:"lastname" `
Contactno string `json:"contactno" `
Username string `json:"username" `
Userfcmtoken string `json:"userfcmtoken"`
Applocationid int `json:"applocationid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Orderid string `json:"orderid"`
}
type Riderbreaks struct {
Breakid int `json:"breakid" gorm:"Primary_Key"`
Logid int `json:"logid"`
Breakdate string `json:"breakdate"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Shiftid int `json:"shiftid"`
Breakstart string `json:"breakstart,omitempty" gorm:"column:breakstart;default:NULL"`
Breakend string `json:"breakend,omitempty" gorm:"column:breakend;default:NULL"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Breakhours float32 `json:"breakhours"`
}
type RiderlogDetails struct {
Logid int `json:"logid"`
Logdate string `json:"logdate"`
Userid int `json:"userid"`
Username string `json:"username"`
Partnerid int `json:"partnerid"`
Shiftid int `json:"shiftid"`
Shifthours float32 `json:"shifthours"`
Login string `json:"login"`
Logout string `json:"logout"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Workhours float32 `json:"workhours"`
Shorthours float32 `json:"shorthours"`
Breakhours float32 `json:"breakhours"`
Logstatus int `json:"logstatus"`
}
type Userpools struct {
Poolid int `json:"poolid" gorm:"primaryKey;autoIncrement"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Vehicleid int `json:"vehicleid"`
Onduty int `json:"onduty" gorm:"column:onduty;default:0"`
Status string `json:"status" gorm:"column:status;default:idle"`
}
type Locationconfigs struct {
Applocationid int `json:"applocationid"`
Configid int `json:"configid"`
Locationname string `json:"locationname"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Status string `json:"status"`
}
type DeliveryStats struct {
Today int `json:"today"`
Week int `json:"week"`
Month int `json:"month"`
Total int `json:"total"`
Cancelled int `json:"cancelled"`
}
type RiderPricing struct {
Shiftid int `json:"shiftid"`
Basefare float32 `json:"basefare"`
Additionalcharges float32 `json:"additionalcharges"`
Fuelcharge float32 `json:"fuelcharge"`
Applocationid int `json:"applocationid"`
Locationname string `json:"locationname"`
}
type RiderKms struct {
Day string `json:"day"`
Kms float64 `json:"kms"`
}
type RiderWeeklyKms struct {
Details []RiderKms `json:"details"`
TotalKms float64 `json:"totalkms"`
OverallKms float64 `json:"overallkms"`
}
type RiderSupport struct {
Ridersupportid int `json:"ridersupportid" gorm:"primaryKey;autoIncrement"`
Userid int `json:"userid"`
Category string `json:"category"`
Priority string `json:"priority"`
Subject string `json:"subject"`
Issue string `json:"issue"`
Image string `json:"image"`
Created time.Time `json:"created" gorm:"autoCreateTime"`
Updated time.Time `json:"updated" gorm:"autoUpdateTime"`
}
type RidersSummary struct {
Active int `json:"active"`
Inactive int `json:"inactive"`
Total int `json:"total"`
}

46
models/payments.go Normal file
View File

@@ -0,0 +1,46 @@
package models
type Paymentrequests struct {
Requestid int `json:"requestid" gorm:"Primary_Key"`
Partnerid int `json:"partnerid"`
Requestdate string `json:"requestdate"`
Referenceno string `json:"referenceno"`
Apptypeid int `json:"apptypeid"`
Requesttype int `json:"requestype"`
Reason string `json:"reason"`
Userid int `json:"userid"`
Requestor string `json:"requestor"`
Amount float32 `json:"amount"`
Accountno string `json:"accountno"`
Bankname string `json:"bankname"`
Ifsccode string `json:"ifsccode"`
Status int `json:"status"`
}
type RequestInfo struct {
Requestid int `json:"requestid"`
Requestdate string `json:"requestdate"`
Referenceno string `json:"referenceno"`
Apptypeid int `json:"apptypeid"`
Requesttype int `json:"requestype"`
Reason string `json:"reason"`
Userid int `json:"userid"`
Requestor string `json:"requestor"`
Amount float32 `json:"amount"`
Accountno string `json:"accountno"`
Bankname string `json:"bankname"`
Ifsccode string `json:"ifsccode"`
Paymentref string `json:"paymentref"`
Paymentdate string `json:"paymentdate"`
Status int `json:"status"`
}
type Paymentdetails struct {
Paymentdetailsid int `json:"Paymentdetailsid" gorm:"Primary_Key"`
Requestid int `json:"requestid"`
Userid int `json:"userid"`
Paymentdate string `json:"paymentdate"`
Referenceno string `json:"referenceno"`
Amount float32 `json:"amount"`
Status int `json:"status"`
}

23
models/platform.go Normal file
View File

@@ -0,0 +1,23 @@
package models
type AppModules struct {
Moduleid int `json:"moduleid"`
Modulename string `json:"modulename"`
Logourl string `json:"logourl"`
Business int `json:"business"`
Orders int `json:"orders"`
}
type Smsproviders struct {
Providerid int `json:"providerid"`
Templatetypeid int `json:"templatetypeid"`
Templatename string `json:"templatename"`
Templateid int `json:"templateid"`
Providerapi string `json:"providerapi"`
Content string `json:"content"`
Defaultprovider int `json:"defaultprovider"`
Passkey int `json:"passkey"`
}
// https://msg.lionsms.com/api/smsapi?key=e57f5c9679af26077be1a7eadabb1b2a&route=7&sender=NEARLE&number=&templateid=1107168725266104678&sms=

258
models/product.go Normal file
View File

@@ -0,0 +1,258 @@
package models
import (
"time"
)
type Products struct {
Productid int `json:"productid"`
AppLocationid int `json:"applocationid" gorm:"column:applocationid"`
Tenantid *int `json:"tenantid,omitempty"`
Categoryid int `json:"categoryid"`
Categoryname string `json:"categoryname" gorm:"->"`
Subcategoryid *int `json:"subcategoryid,omitempty"`
Subcategoryname string `json:"Subcategoryname" gorm:"->"`
Catalogueid *int `json:"catalogueid,omitempty"`
Addonid *int `json:"addonid,omitempty"`
Discountid *int `json:"discountid,omitempty"`
Pricingid *int `json:"pricingid,omitempty"`
Productname *string `json:"productname,omitempty"`
Productimage *string `json:"productimage,omitempty"`
Productdesc *string `json:"productdesc,omitempty"`
Productsku *string `json:"productsku,omitempty"`
Brandid *int `json:"brandid,omitempty"`
Productbrand *string `json:"productbrand,omitempty"`
Productunit *string `json:"productunit,omitempty"`
Unitvalue *string `json:"unitvalue,omitempty"`
Toppicks *string `json:"toppicks,omitempty"`
Productcost *float64 `json:"productcost,omitempty"`
Taxamount *float64 `json:"taxamount,omitempty"`
Taxpercent *float64 `json:"taxpercent,omitempty"`
Producttax *int `json:"producttax" gorm:"default:0"`
Productstock *int `json:"productstock" gorm:"default:0"`
Productcombo *int `json:"productcombo" gorm:"default:0"`
Variants int `json:"variants" gorm:"default:0"`
Quantity int `json:"quantity"`
Retailprice float64 `json:"retailprice,omitempty"`
Diffprice float64 `json:"diffprice,omitempty"`
Diffpercent float64 `json:"diffpercent,omitempty"`
Othercost float64 `json:"othercost,omitempty"`
Approve *int `json:"approve" gorm:"default:0"`
Productstatus string `json:"productstatus" gorm:"default:available"`
}
type ProductCategory struct {
Categoryid int `json:"categoryid"`
Moduleid int `json:"moduleid"`
Tenantid *int `json:"tenantid,omitempty"`
Categorytypeid *int `json:"categorytypeid,omitempty"`
Categoryname *string `json:"categoryname,omitempty"`
Image *string `json:"image,omitempty"`
Catalougecategoryid *int `json:"catalougecategoryid,omitempty"`
Sortorder *int `json:"sortorder,omitempty"`
Status string `json:"status"`
Createdby *int `json:"createdby,omitempty"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
}
type Productstockstatement struct {
Productid int `json:"productid"`
Productname string `json:"productname"`
Productimage string `json:"productimage"`
Categoryid int `json:"categoryid"`
Subcategoryid int `json:"subcategoryid"`
Productunit string `json:"productunit"`
Unitvalue string `json:"unitvalue"`
Productcost float32 `json:"productcost"`
Taxpercent float32 `json:"taxpercent"`
Taxamount float32 `json:"taxamount"`
Retailprice float32 `json:"retailprice"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Opening int `json:"opening"`
Credit int `json:"credit"`
Debit int `json:"debit"`
Closing int `json:"closing"`
}
type Productcount struct {
Total int `json:"total"`
Available int `json:"available"`
Outofstock int `json:"outofstock"`
}
type ProductSubCategory struct {
Subcatid int `json:"subcatid"`
Categoryid int `json:"categoryid,omitempty"`
Tenantid int `json:"tenantid,omitempty"`
Subcatname string `json:"subcatname,omitempty"`
Image string `json:"image,omitempty"`
Status string `json:"status,omitempty"`
Sortorder int `json:"sortorder,omitempty"`
Createdby int `json:"createdby,omitempty"`
Created time.Time `json:"created,omitempty"`
Updated time.Time `json:"updated,omitempty"`
}
// Struct to match the `productsubcategories` table
type Subcategory struct {
Subcategoryid int `json:"subcategoryid" gorm:"column:subcatid"`
Subcategoryname string `json:"subcategoryname" gorm:"column:subcatname"`
Categoryid int `json:"categoryid" gorm:"column:categoryid"`
}
// Response format
type SubcategoryProductResponse struct {
SubcategoryID int `json:"subcategoryid"`
SubcategoryName string `json:"subcategoryname"`
Products []Products `json:"products"`
}
type TenantInfo struct {
Tenantid int `json:"tenantid"`
Tenantname string `json:"tenantname"`
Address string `json:"address"`
Licenseno string `json:"licenseno"`
Primaryemail string `json:"primaryemail"`
Primarycontact string `json:"primarycontact"`
Pickuplocationid int `json:"pickuplocationid"`
Applocationid int `json:"applocationid"`
Suburb string `json:"suburb"`
City string `json:"city"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Postcode string `json:"postcode"`
Tenantimage string `json:"tenantimage"`
Locationid int `json:"locationid"`
Locationname string `json:"locationname"`
Subcategoryid int `json:"subcategoryid"`
Categoryid int `json:"categoryid"`
Registrationno string `json:"registrationno"`
}
type ProductListResponse struct {
Tenantid int `json:"tenantid"`
Tenantname string `json:"tenantname"`
Address string `json:"address"`
Licenseno string `json:"licenseno"`
Primaryemail string `json:"primaryemail"`
Pickupcontactno string `json:"primarycontact"`
Applocationid int `json:"applocationid"`
Pickuplocationid int `json:"pickuplocationid"`
Pickupsuburb string `json:"suburb"`
Pickupcity string `json:"city"`
Pickuplat string `json:"pickuplat"`
Pickuplong string `json:"pickuplong"`
Tenantpostcode string `json:"postcode"`
Locationname string `json:"locationname"`
Categoryname string `json:"categoryname"`
Products []Products `json:"products"`
}
type Tenantproducts struct {
Tenant TenantInfo `json:"tenant"`
Products []Products `json:"products"`
}
type Productvariant struct {
Variantid int `json:"variantid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Variantname string `json:"variantname"`
Categoryid int `json:"categoryid" gorm:"default:0"`
Categoryname string `json:"categoryname" gorm:"-"`
Subcategoryid int `json:"subcategoryid"`
Status string `json:"status" gorm:"default:active"`
}
type Productlocations struct {
Productlocationid int `json:"productlocationid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Productid int `json:"productid"`
Catlougeid int `json:"catlougeid"`
Minquantity int `json:"minquantity" gorm:"default:0"`
Maxquantity int `json:"maxquantity" gorm:"default:0"`
Price float32 `json:"price" gorm:"default:0.0"`
Quantity int `json:"quantity" gorm:"<-:false"`
Stocktype string `json:"stocktype" gorm:"<-:false"`
Status string `json:"status"`
}
type Productstock struct {
Productstockid int `json:"productstockid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Stockdate time.Time `json:"stockdate"`
Locationid int `json:"locationid"`
Productid int `json:"productid"`
Quantity int `json:"quantity"`
Stocktype string `json:"stocktype"`
Status string `json:"status"`
}
type Productstocks struct {
Productstockid int `json:"productstockid" gorm:"Primary_Key"`
Locationid int `json:"locationid"`
Tenantid int `json:"tenantid"`
Stockdate string `json:"stockdate"`
Productid int `json:"productid"`
Quantity int `json:"quantity"`
Stocktype string `json:"stocktype"`
Status string `json:"status"`
AppLocationid int `json:"applocationid"`
Categoryid int `json:"categoryid"`
Categoryname string `json:"categoryname" gorm:"->"`
Subcategoryid int `json:"subcategoryid,omitempty"`
Subcategoryname string `json:"Subcategoryname" `
Productname string `json:"productname,omitempty"`
Productimage string `json:"productimage,omitempty"`
Productdesc *string `json:"productdesc,omitempty"`
Productsku *string `json:"productsku,omitempty"`
Brandid *int `json:"brandid,omitempty"`
Productbrand *string `json:"productbrand,omitempty"`
Productunit *string `json:"productunit,omitempty"`
Unitvalue *string `json:"unitvalue,omitempty"`
Toppicks *string `json:"toppicks,omitempty"`
Productcost *float64 `json:"productcost,omitempty"`
Taxamount *float64 `json:"taxamount,omitempty"`
Taxpercent *float64 `json:"taxpercent,omitempty"`
Producttax *int `json:"producttax,omitempty"`
Productstock *int `json:"productstock,omitempty"`
Productcombo *int `json:"productcombo,omitempty"`
Variants int `json:"variants"`
Retailprice float64 `json:"retailprice,omitempty"`
Diffprice float64 `json:"diffprice,omitempty"`
Diffpercent float64 `json:"diffpercent,omitempty"`
Othercost float64 `json:"othercost,omitempty"`
Approve *int `json:"approve"`
}
type SubCategorySummary struct {
SubCategoryID int `json:"subcategoryid"`
SubCategoryName string `json:"subcatname"`
Image string `json:"image"`
ProductCount int `json:"productcount"`
}
type ProductSummary struct {
Subcategoryid int `json:"subcategoryid"`
Subcategroyname string `json:"subcategroyname"`
Image string `json:"image"`
Productcount int `json:"productcount"`
}
type ProductDiscount struct {
Discountid int `json:"discountid" gorm:"column:discountid;primaryKey"`
Discounttypeid int `json:"discounttypeid" gorm:"column:discounttypeid"`
Tenantid int `json:"tenantid" gorm:"column:tenantid"`
Moduleid int `json:"moduleid" gorm:"column:moduleid"`
Productid int `json:"productid" gorm:"column:productid"`
Locationid []string `json:"locationid" gorm:"-"`
LocationidStr string `json:"-" gorm:"column:locationid"`
Discountname string `json:"discountname" gorm:"column:discountname"`
Discountcode string `json:"discountcode" gorm:"column:discountcode"`
Discountterms string `json:"discountterms" gorm:"column:discountterms"`
Discountvalue float64 `json:"discountvalue" gorm:"column:discountvalue"`
Startdate string `json:"startdate" gorm:"column:startdate"`
Enddate string `json:"enddate" gorm:"column:enddate"`
Status string `json:"status" gorm:"column:status"`
}

410
models/tenant.go Normal file
View File

@@ -0,0 +1,410 @@
package models
import "time"
type TenantResult struct {
Status bool `json:"status"`
Code int `json:"code"`
Message string `json:"message"`
Details Tenants `json:"Details"`
}
type Tenants struct {
Tenantid int `json:"tenantid" gorm:"Primary_Key"`
Tenantname string `json:"tenantname"`
Configid int `json:"configid"`
Partnerid int `json:"partnerid"`
Moduleid int `json:"moduleid"`
Tenanttype string `json:"tenanttype"`
Registrationno string `json:"registrationno"`
Tenanttoken string `json:"tenanttoken"`
Companyname string `json:"companyname"`
Devicetype string `json:"devicetype"`
Deviceid string `json:"deviceid"`
Firstname string `json:"firstname"`
Primaryemail string `json:"primaryemail"`
Primarycontact string `json:"primarycontact"`
Categoryid int `json:"categoryid"`
Subcategoryid int `json:"subcategoryid"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Tenantimage string `json:"tenantimage"`
Tenantinfo string `json:"tenantinfo"`
Paymode1 int `json:"paymode1"`
Paymode2 int `json:"paymode2"`
Promotion int `json:"promotion"`
Minorder int `json:"minorder"`
Applocationid int `json:"applocationid"`
Approved *int `json:"approved" gorm:"default:0"`
Status string `json:"status" gorm:"default:Active"`
Partneruserid int `json:"partneruserid"`
Tenantlocations Tenantlocations `json:"tenantlocations" gorm:"ForeignKey:tenantid"`
Tenantsubscriptions Tenantsubscriptions `json:"tenantsubscriptions" gorm:"ForeignKey:tenantid"`
}
type TenantUser struct {
Tenantid int `json:"tenantid" gorm:"Primary_Key"`
Tenantname string `json:"tenantname"`
Tenanttype string `json:"tenanttype"`
Registrationno string `json:"registrationno"`
Tenanttoken string `json:"tenanttoken"`
Companyname string `json:"companyname"`
Primaryperson string `json:"primaryperson"`
Primaryemail string `json:"primaryemail"`
Primarycontact string `json:"primarycontact"`
Bizcategoryid int `json:"Bizcategoryid"`
Bizsubcategoryid int `json:"Bizsubcategoryid"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Tenantimage string `json:"tenantimage"`
Tenantinfo string `json:"tenantinfo"`
Paymode1 int `json:"paymode1"`
Paymode2 int `json:"paymode2"`
Promotion int `json:"promotion"`
Partnerid int `json:"partnerid"`
Minorder int `json:"minorder"`
Applocationid int `json:"applocationid"`
Approved int `json:"approved"`
Moduleid int `json:"moduleid"`
Tenantlocations Tenantlocations `json:"tenantlocations" gorm:"ForeignKey:tenantid"`
Tenantsubscriptions Tenantsubscriptions `json:"tenantsubscriptions" gorm:"ForeignKey:tenantid"`
}
type Tenantinfo struct {
Tenantid int `json:"tenantid" gorm:"Primary_Key"`
Locationid int `json:"locationid"`
Tenantname string `json:"tenantname"`
Tenanttype string `json:"tenanttype"`
Registrationno string `json:"registrationno"`
Tenanttoken string `json:"tenanttoken"`
Companyname string `json:"companyname"`
Primaryemail string `json:"primaryemail"`
Primarycontact string `json:"primarycontact"`
Categoryid int `json:"categoryid"`
Subcategoryid int `json:"subcategoryid"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Tenantimage string `json:"tenantimage"`
Tenantinfo string `json:"tenantinfo"`
Paymenttype int `json:"paymenttype"`
Paymode1 int `json:"paymode1"`
Paymode2 int `json:"paymode2"`
Promotion int `json:"promotion"`
Partnerid int `json:"partnerid"`
Minorder int `json:"minorder"`
Applocationid int `json:"applolcationid"`
Applocation string `json:"applocation"`
Approved int `json:"approved"`
Moduleid int `json:"moduleid"`
Categoryname string `json:"categoryname"`
Subcategoryname string `json:"subcategoryname"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Accountname string `json:"Accountname"`
Status string `json:"status"`
Allocationid int `json:"allocationid"`
Allocationtype string `json:"allocationtype"`
Allocationmode int `json:"allocationmode"`
Slab string `json:"slab"`
Pricingdate string `json:"pricingdate"`
Baseprice float32 `json:"baseprice"`
Minkm int `json:"minkm"`
Priceperkm float32 `json:"priceperkm"`
Maxkm int `json:"maxkm"`
Orders int `json:"orders"`
Othercharges float32 `json:"othercharges"`
Surgecharges float32 `json:"surgecharges"`
}
type Tenantsubscriptions struct {
Subscriptionid int `json:"subscriptionid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Transactiondate string `json:"transactiondate"`
Moduleid int `json:"moduleid"`
Applocationid int `json:"applocationid"`
Promoid int `json:"promoid"`
Categoryid int `json:"categoryid"`
Subcategoryid int `json:"subcategoryid"`
Promoprice float32 `json:"float32"`
Subscriptionprice float32 `json:"subscriptionprice"`
Quantity int `json:"quantity"`
Taxpercent int `json:"taxpercent"`
Taxamount float32 `json:"taxamount"`
Totalamount float32 `json:"totalamount"`
Validitydate string `json:"validitydate"`
}
type Tenantlocationinfo struct {
Locationid int `json:"locationid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Moduleid int `json:"moduleid"`
Locationname string `json:"locationname"`
Locationemail string `json:"locationemail" gorm:"column:email"`
Locationcontact string `json:"locationcontact" gorm:"column:contactno"`
Locationlatitude string `json:"locationlatitude" gorm:"column:latitude"`
Locationlong string `json:"locationlong" gorm:"column:longitude"`
Locationaddress string `json:"locationaddress" gorm:"column:address"`
Locationsuburb string `json:"locationsuburb" gorm:"column:suburb"`
Locationstate string `json:"locationstate" gorm:"column:state"`
Locationcity string `json:"locationcity" gorm:"column:city"`
Locationpostcode string `json:"locationpostcode" gorm:"column:postcode"`
Opentime string `json:"opentime"`
Closetime string `json:"closetime"`
Partnerid int `json:"partnerid"`
Deliveryradius int `json:"deliveryradius"`
Deliverymins int `json:"deliverymins"`
Cancelsecs int `json:"cancelsecs"`
Applocationid int `json:"applocationid"`
Slot1 string `json:"slot1"`
Slot2 string `json:"slot2"`
Slot3 string `json:"slot3"`
Status string `json:"status"`
Roleid int `json:"roleid"`
}
func (Tenantlocationinfo) TableName() string {
return "tenantlocations"
}
type Tenantslot struct {
// Slotid int `json:"slotid" gorm:"Primary_Key"`
Slot1 string `json:"slot1"`
Slot2 string `json:"slot2"`
Slot3 string `json:"slot3"`
}
type TenantLocationSummary struct {
Locationid int `json:"locationid"`
Locationname string `json:"locationname"`
Locationsuburb string `json:"locationsuburb"`
Total int `json:"total"`
Created int `json:"created"`
Pending int `json:"pending"`
Delivered int `json:"delivered"`
Cancelled int `json:"cancelled"`
}
type Tenantlocations struct {
Locationid int `json:"locationid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Applocationid int `json:"applocationid"`
Moduleid int `json:"moduleid"`
Locationname string `json:"locationname"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Opentime string `json:"opentime"`
Closetime string `json:"closetime"`
Partnerid int `json:"partnerid"`
Deliveryradius int `json:"deliveryradius"`
Deliverymins int `json:"deliverymins"`
Cancelsecs int `json:"cancelsecs"`
Slot1 string `json:"slot1"`
Slot2 string `json:"slot2"`
Slot3 string `json:"slot3"`
Slot4 string `json:"slot4"`
Slot5 string `json:"slot5"`
Status string `json:"status" gorm:"default:Active"`
}
type Tenantlocation struct {
Locationid int `json:"locationid" gorm:"Primary_Key"`
Tenantid int `json:"tenantid"`
Applocationid int `json:"applocationid"`
Moduleid int `json:"moduleid"`
Locationname string `json:"locationname"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Opentime string `json:"opentime"`
Closetime string `json:"closetime"`
Partnerid int `json:"partnerid"`
Deliveryradius int `json:"deliveryradius"`
Deliverymins int `json:"deliverymins"`
Cancelsecs int `json:"cancelsecs"`
Status string `json:"status" gorm:"default:Active"`
}
type Tenantpricing struct {
Tenantpricingid int `json:"tenantpricingid" gorm:"Primary_Key"`
Pricingid int `json:"pricingid"`
Tenantid int `json:"tenantid"`
Applocationid int `json:"applocationid"`
Pricingtypeid int `json:"pricingtypeid"`
Slab string `json:"slab"`
Configid int `json:"configid"`
Pricingdate string `json:"pricingdate"`
Baseprice float32 `json:"baseprice"`
Priceperkm float32 `json:"priceperkm"`
Minkm int `json:"minkm"`
Maxkm int `json:"maxkm"`
Orders int `json:"orders"`
Othercharges float32 `json:"othercharges"`
Surgecharges float32 `json:"surgecharges"`
}
type TenantCustomer struct {
TenantCustomerID int `json:"tenantcustomerid" gorm:"primaryKey;column:tenantcustomerid"`
ModuleID int `json:"moduleid" gorm:"column:moduleid"`
TenantID int `json:"tenantid" gorm:"column:tenantid"`
LocationID int `json:"locationid" gorm:"column:locationid"`
CustomerID int `json:"customerid" gorm:"column:customerid"`
CustomerLocationID int `json:"customerlocationid" gorm:"column:customerlocationid"`
Status int `json:"status" gorm:"column:status"`
Created time.Time `json:"created" gorm:"column:created;autoCreateTime"`
Updated time.Time `json:"updated" gorm:"column:updated;autoUpdateTime"`
}
// If needed, define the table name explicitly
func (TenantCustomer) TableName() string {
return "tenantcustomers"
}
type CreateTenantCustomerRequest struct {
ModuleID int `json:"moduleid"`
TenantID int `json:"tenantid"`
LocationID int `json:"locationid"`
CustomerID int `json:"customerid"`
CustomerLocationID int `json:"customerlocationid"`
Status int `json:"status"`
}
// type CustomerInfo struct {
// Customerid int `json:"customerid"`
// Customername string `json:"customername"`
// Contactno string `json:"contactno"`
// }
// type TenantInfo struct {
// Tenantid int `json:"tenantid"`
// Tenantname string `json:"tenantname"`
// }
type CustomerTenantResponse struct {
Customer Customers `json:"customer"`
// Tenants []TenantInfo `json:"tenants"`
Tenantlocations []LocationDetails `json:"locations"`
}
type Tenantuser struct {
Userid int `json:"userid" gorm:"Primary_Key"`
Authname string `json:"authname"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Password string `json:"password"`
Email string `json:"email"`
Dialcode string `json:"dialcode"`
Contactno string `json:"contactno"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Pin int `json:"pin"`
Deviceid string `json:"deviceid"`
Devicetype string `json:"devicetype"`
Userfcmtoken string `json:"userfcmtoken"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Partnerid int `json:"partnerid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Applocationid int `json:"applocationid"`
Status string `json:"status"`
}
type LocationSummary struct {
ActiveCount int `json:"active"`
InactiveCount int `json:"inactive"`
TotalCount int `json:"total"`
}
type TenantUserSummary struct {
ActiveCount int `json:"active"`
InactiveCount int `json:"inactive"`
TotalCount int `json:"total"`
}
type TenantRequest struct {
Requestid int `json:"requestid"`
Requestdate time.Time `json:"requestdate"`
Requesttype int `json:"requesttype"`
Subject string `json:"subject"`
Apptypeid int `json:"apptypeid"`
Userid int `json:"userid"`
Tenantid int `json:"tenantid"`
Referenceid int `json:"referenceid"`
Referencetype string `json:"referencetype"`
Remarks string `json:"remarks"`
Resolution string `json:"resolution"`
Orderheaderid int `json:"orderheaderid"`
Eventname string `json:"eventname"`
Status int `json:"status"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
}
type LocationDetails struct {
Locationid int `json:"locationid"`
Locationname string `json:"locationname"`
Tenantid int `json:"tenantid"`
Tenantname string `json:"tenantname"`
Address string `json:"address"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Applocationid int `json:"applocationid"`
Suburb string `json:"suburb"`
City string `json:"city"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Postcode string `json:"postcode"`
}
type Tenantpromotions struct {
Promotionid int `json:"promotionid" gorm:"primaryKey"`
Promotiontypeid int `json:"promotiontypeid"`
Tenantid int `json:"tenantid"`
Locationid []string `json:"locationid" gorm:"-"`
LocationidStr string `json:"-" gorm:"column:locationid"`
Applocationid int `json:"applocationid"`
Moduleid int `json:"moduleid"`
Categoryid int `json:"categoryid"`
Promoname string `json:"promoname"`
Promocode string `json:"promocode"`
Description string `json:"description"`
Product string `json:"product"`
Productimage string `json:"productimage"`
Promoamount float32 `json:"promoamount"`
Promovalue float32 `json:"promovalue"`
Purchasevalue float32 `json:"purchasevalue"`
Startdate string `json:"startdate"`
Enddate string `json:"enddate"`
}

333
models/user.go Normal file
View File

@@ -0,0 +1,333 @@
package models
type User struct {
Userid int `json:"userid" gorm:"Primary_Key"`
Authname string `json:"authname"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Password string `json:"password"`
Email string `json:"email"`
Dialcode string `json:"dialcode"`
Contactno string `json:"contactno"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Rolename string `json:"rolename"`
Pin int `json:"pin"`
Deviceid string `json:"deviceid"`
Devicetype string `json:"devicetype"`
Userfcmtoken string `json:"userfcmtoken"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Partnerid int `json:"partnerid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Applocationid int `json:"applocationid"`
Status string `json:"status"`
Shiftid int `json:"shiftid"`
Bonuspts int `json:"bonuspts" gorm:"-"`
Hashsalt string `json:"hashsalt" gorm:"-"`
}
type Users struct {
Userid int `json:"userid" gorm:"Primary_Key"`
Email string `json:"email"`
Username string `json:"username"`
Contactno string `json:"contactno"`
Roleid int `json:"roleid"`
Configid int `json:"configid"`
Password string `json:"password"`
}
type AppLocation struct {
Applocationid int `json:"applocationid"`
Applocationname string `json:"applocationname"`
Status string `json:"status"`
}
type UserInfo struct {
Userid int `json:"userid"`
Authname string `json:"authname"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Rolename string `json:"rolename"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Fullname string `json:"fullname"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Userfcmtoken string `json:"userfcmtoken"`
Shiftid int `json:"shiftid"`
Shiftname string `json:"shiftname"`
Pin int `json:"pin"`
Tenantid int `json:"tenantid"`
Status string `json:"status"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Applocations []AppLocation `json:"applocations" gorm:"-"`
}
type UserInfov2 struct {
Userid int `json:"userid"`
Authname string `json:"authname"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Fullname string `json:"fullname"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Userfcmtoken string `json:"userfcmtoken"`
Shiftid int `json:"shiftid"`
Shiftname string `json:"shiftname"`
Pin int `json:"pin"`
Tenantid int `json:"tenantid"`
ApplocationidsRaw string `json:"-"`
ApplocationnamesRaw string `json:"-"`
Applocationids []int `json:"applocationids"`
Applocationnames []string `json:"applocationnames"`
Status string `json:"status"`
}
type TenantUserInfo struct {
Userid int `json:"userid"`
Authname string `json:"authname"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Fullname string `json:"fullname"`
Password string `json:"password"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Userfcmtoken string `json:"userfcmtoken"`
Pin int `json:"pin"`
Partnerid int `json:"partnerid"`
Locationid int `json:"locationid"`
Applocationid int `json:"applocationid"`
Tenantid int `json:"tenantid"`
Tenantname string `json:"tenantname"`
Tenantaddress string `json:"tenantaddress"`
Tenantcity string `json:"tenantcity"`
Tenantpostcode string `json:"tenantpostcode"`
Tenantlat string `json:"tenantlat"`
Tenantlong string `json:"tenantlong"`
Locationname string `json:"locationname"`
Applocation string `json:"applocation"`
Applatitude string `json:"applatitude"`
Applongitude string `json:"applongitude"`
Appradius int `json:"appradius"`
Moduleid int `json:"moduleid"`
Categoryid int `json:"categoryid"`
Categoryname string `json:"categoryname"`
Subcategoryid int `json:"subcategoryid"`
}
type StaffInfo struct {
Userid int `json:"userid"`
Authname string `json:"authname"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Fullname string `json:"fullname"`
Password string `json:"password"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Userfcmtoken string `json:"userfcmtoken"`
Pin int `json:"pin"`
Applocationid int `json:"applocationid"`
Partnerid int `json:"partnerid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Locationname string `json:"locationname"`
}
type RiderInfo struct {
Userid int `json:"userid"`
Authname string `json:"authname"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
Contactno string `json:"contactno"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Userfcmtoken string `json:"userfcmtoken"`
Pin int `json:"pin"`
Partnerid int `json:"partnerid"`
Identificationno string `json:"identificationno"`
Vehiclename string `json:"vehiclename"`
Vehicleno string `json:"vehicleno"`
Licenseno string `json:"licenseno"`
Insuranceno string `json:"insoranceno"`
Insurancedate string `json:"insurancedate"`
Shiftid int `json:"shiftid"`
Firstmilecharge float32 `json:"firstmilecharge"`
Starttime string `json:"starttime"`
Endtime string `json:"endtime"`
Shifthours float32 `json:"shifthours"`
Basefare float32 `json:"basefare"`
Additionalcharges float32 `json:"additionalcharges"`
Orders int `json:"orders"`
Fuelcharge float32 `json:"fuelcharge"`
Logdate string `json:"logdate"`
Applocationid int `json:"applocationid"`
Applocation string `json:"applocation"`
Logseconds int `json:"logseconds"`
Deliveryradius int `json:"deliveryradius"`
Riderid int `json:"riderid"`
Status string `json:"status"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Logid int `json:"logid"`
Onduty int `json:"onduty"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Bonuspts int `json:"bonuspts"`
Name string `json:"name"`
Capacity int `json:"capacity"`
Rangekm int `json:"rangekm"`
Batterypercentage int `json:"batterypercentage"`
Type string `json:"type"`
}
type AppUserpools struct {
Poolid int `json:"poolid" gorm:"Primary_key"`
Userid int `json:"userid"`
Partnerid int `json:"partnerid"`
Vehicleid int `json:"vehicleid"`
Onduty int `json:"onduty"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Status string `json:"status"`
}
type Tenantstaffs struct {
Tenantstaffid int `json:"tenantstaffid" gorm:"Primary_key"`
Tenantid int `json:"tenantid"`
Moduleid int `json:"moduleid"`
Locationid int `json:"locationid"`
Userid int `json:"userid"`
Status string `json:"status"`
}
type Riderinfo struct {
Userid int `json:"userid" gorm:"Primary_Key"`
Authname string `json:"authname"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Password string `json:"password"`
Email string `json:"email"`
Dialcode string `json:"dialcode"`
Contactno string `json:"contactno"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Pin int `json:"pin"`
Deviceid string `json:"deviceid"`
Devicetype string `json:"devicetype"`
Userfcmtoken string `json:"userfcmtoken"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Partnerid int `json:"partnerid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Applocationid int `json:"applocationid"`
Status string `json:"status"`
Shiftid int `json:"shiftid"`
Bonuspts int `json:"bonuspts"`
Hashsalt string `json:"hashsalt" gorm:"-"`
}
type AppLocationConfig struct {
Applocationconfigid int `gorm:"primaryKey"`
Applocationid int
Configid int
Userid int
Partnerid int
Notify string
Status string
}
type ConsoleUser struct {
Userid int `json:"userid" gorm:"Primary_Key"`
Authname string `json:"authname"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Password string `json:"password"`
Email string `json:"email"`
Dialcode string `json:"dialcode"`
Contactno string `json:"contactno"`
Configid int `json:"configid"`
Authmode int `json:"authmode"`
Roleid int `json:"roleid"`
Pin int `json:"pin"`
Deviceid string `json:"deviceid"`
Devicetype string `json:"devicetype"`
Userfcmtoken string `json:"userfcmtoken"`
Address string `json:"address"`
Suburb string `json:"suburb"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Partnerid int `json:"partnerid"`
Tenantid int `json:"tenantid"`
Locationid int `json:"locationid"`
Applocationid int `json:"applocationid"`
Status string `json:"status"`
Shiftid int `json:"shiftid"`
Bonuspts int `json:"bonuspts" gorm:"-"`
Hashsalt string `json:"hashsalt" gorm:"-"`
// Applocationids []int `json:"applocationids" gorm:"-"`
}
type AppLocationConfigRequest struct {
Userid int `json:"userid"`
Configid int `json:"configid"`
Partnerid int `json:"partnerid"`
Applocationids []int `json:"applocationids"`
Notify string `json:"notify"`
Status string `json:"status"`
}

156
models/utils.go Normal file
View File

@@ -0,0 +1,156 @@
package models
import "time"
type Applocations struct {
Applocationid int `json:"applocationid" gorm:"Primary_Key"`
Locationname string `json:"locationname"`
Image string `json:"image"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Opentime string `json:"opentime"`
Closetime string `json:"closetime"`
Radius int `json:"radius"`
Applocationadmins []Applocationadmins `json:"applocationadmins" gorm:"ForeignKey:applocationid"`
}
type Applocationadmins struct {
Applocationconfigid int `json:"applocationconfigid" gorm:"Primary_Key"`
Applocationid int `json:"applocationid"`
Userid int `json:"userid"`
Userfcmtoken string `json:"userfcmtokem"`
Notify string `json:"notify"`
}
type ApplocationsResult struct {
Code int `json:"code"`
Status bool `json:"status"`
Message string `json:"message"`
Details []Applocations `json:"details"`
}
type Apppricing struct {
Pricingid int `json:"pricingid"`
Pricingdate string `json:"pricingdate"`
Pricingtypeid int `json:"pricingtypeid"`
Applocationid int `json:"applocationid"`
Configid int `json:"configid"`
Slab string `json:"slab"`
Baseprice float32 `json:"baseprice"`
Minkm int `json:"minkm"`
Priceperkm float32 `json:"priceperkm"`
Maxkm int `json:"maxkm"`
Minorder int `json:"minorder"`
Status int `json:"status" gorm:"default:0"`
Applocation string `json:"applocation" gorm:"<-:false"`
Appname string `json:"appname" gorm:"<-:false"`
}
type Appconfig struct {
Configid int `json:"configid"`
Appname string `json:"appname"`
Paymentdevkey string `json:"paymentdevkey"`
Paymentlivekey string `json:"paymentlivekey"`
Fcmkey string `json:"fcmkey"`
Googleapikey string `json:"googleapikey"`
Applocationradius int `json:"applocationradius"`
Smsproviderid int `json:"smsproviderid"`
Providerapi string `json:"providerapi"`
Providerkey string `json:"providerkey"`
Sender string `json:"sender"`
Templateid string `json:"templateid"`
Defaultprovider int `json:"defaultprovider"`
}
type Apptypes struct {
Apptypeid int `json:"apptypeid"`
Typename string `json:"typename"`
Mapid int `json:"mapid"`
Tag string `json:"tag"`
Status string `json:"status"`
}
type Appsubcategories struct {
Subcategoryid int `json:"subcategoryid"`
Categoryid int `json:"categoryid"`
Subcategoryname string `json:"subcategoryname"`
Categoryname string `json:"catgeoryname"`
Moduleid int `json:"moduleid"`
Status string `json:"status"`
}
type AppCategory struct {
Categoryid int `json:"categoryid"`
Categoryname string `json:"categoryname"`
Categorytype string `json:"categorytype"`
Moduleid int `json:"moduleid"`
Sortorder int `json:"sortorder"`
Imageurl string `json:"imageurl"`
Iconurl string `json:"iconurl"`
Profileurl string `json:"profileurl"`
Crossaxis int `json:"crossaxis"`
Mainaxis int `json:"mainaxis"`
Status string `json:"status"`
}
type AppModule struct {
Moduleid int `json:"moduleid"`
Modulename string `json:"modulename"`
Categoryid int `json:"categoryid"`
Baseprice float32 `json:"baseprice"`
Taxpercent float32 `json:"taxpercent"`
Taxamount float32 `json:"taxamount"`
Amount float32 `json:"amount"`
Commisiontype string `json:"commisiontype"`
Commisionvalue float32 `json:"commisionvalue"`
Content string `json:"content"`
Logourl string `json:"logourl"`
Iconurl string `json:"iconurl"`
Sortorder int `json:"sortorder"`
Status string `json:"status"`
Createdby int `json:"createdby"`
}
type TenantNotification struct {
Notificationid int `json:"notificationid"`
Title string `json:"title"`
Message string `json:"message"`
Tenantid int `json:"tenantid"`
Moduleid int `json:"moduleid"`
Locationid int `json:"locationid"`
Customerid int `json:"customerid"`
Notificationdate time.Time `json:"notificationdate"`
Successcode int `json:"successcode"`
}
type UserRoles struct {
Roleid int `json:"roleid"`
Rolename string `json:"rolename"`
Configid int `json:"configid"`
}
type RiderLog struct {
UserID int `json:"userid"`
Username string `json:"username"`
LogDate string `json:"logdate"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Speed string `json:"speed"`
Heading string `json:"heading"`
Accuracy string `json:"accuracy"`
Status string `json:"status"`
OrderID string `json:"orderid"`
Battery string `json:"battery"`
IsCharging bool `json:"is_charging"`
Connection string `json:"connection"`
LocationService string `json:"location_service"`
IsBackground bool `json:"is_background"`
}
type RiderStatus struct {
UserID int `json:"userid"`
Status string `json:"status"`
}