Initial commit including .env
This commit is contained in:
102
dto/admin.go
Normal file
102
dto/admin.go
Normal file
@@ -0,0 +1,102 @@
|
||||
package dto
|
||||
|
||||
import "time"
|
||||
|
||||
type TenantCreateRequest struct {
|
||||
Tenantname string `json:"tenantname"`
|
||||
Primaryemail string `json:"primaryemail"`
|
||||
Primarycontact string `json:"primarycontact"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type TenantLocationCreateRequest struct {
|
||||
Address string `json:"address"`
|
||||
City string `json:"city"`
|
||||
State string `json:"state"`
|
||||
Pincode string `json:"pincode"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Isprimary bool `json:"isprimary"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type TenantCustomerCreateRequest struct {
|
||||
Firstname string `json:"firstname"`
|
||||
Lastname string `json:"lastname"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
type HubCreateRequest struct {
|
||||
Hubname string `json:"hubname"`
|
||||
Hubtype string `json:"hubtype"` // sorting_center, delivery_hub
|
||||
Applocationid int `json:"applocationid"`
|
||||
Contactno string `json:"contactno"`
|
||||
Address string `json:"address"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Pincode string `json:"pincode"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type VehicleCreateRequest struct {
|
||||
Vehicleno string `json:"vehicleno"`
|
||||
Vehicletype string `json:"vehicletype"`
|
||||
Maxweight float64 `json:"maxweight"`
|
||||
Maxvolume float64 `json:"maxvolume"`
|
||||
Partnerid *int `json:"partnerid"`
|
||||
Batterypercentage int `json:"batterypercentage"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type MilerCreateRequest struct {
|
||||
Authname string `json:"authname"`
|
||||
Email string `json:"email"`
|
||||
Contactno string `json:"contactno"`
|
||||
Password string `json:"password"`
|
||||
Displayname string `json:"displayname"`
|
||||
Defaultvehicletype string `json:"defaultvehicletype"`
|
||||
Applocationid int `json:"applocationid"`
|
||||
}
|
||||
|
||||
type PricingCreateRequest struct {
|
||||
Tenantid int `json:"tenantid"`
|
||||
Applocationid int `json:"applocationid"`
|
||||
Vehicletype string `json:"vehicletype"`
|
||||
Baseprice float64 `json:"baseprice"`
|
||||
Baseweight float64 `json:"baseweight"`
|
||||
Priceperkg float64 `json:"priceperkg"`
|
||||
Basedistance float64 `json:"basedistance"`
|
||||
Priceperkm float64 `json:"priceperkm"`
|
||||
Handlingcharges float64 `json:"handlingcharges"`
|
||||
Effectivefrom time.Time `json:"effectivefrom"`
|
||||
Effectiveto time.Time `json:"effectiveto"`
|
||||
Currency string `json:"currency"`
|
||||
Priority int `json:"priority"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type TripsheetCreateRequest struct {
|
||||
Sourcehubid int `json:"sourcehubid"`
|
||||
Destinationhubid int `json:"destinationhubid"`
|
||||
Vehicleid *int `json:"vehicleid"`
|
||||
Driveruserid *int `json:"driveruserid"`
|
||||
}
|
||||
|
||||
type TripsheetItemAddRequest struct {
|
||||
Consignmentid int `json:"consignmentid"`
|
||||
}
|
||||
|
||||
type ExceptionCreateRequest struct {
|
||||
Consignmentid int `json:"consignmentid"`
|
||||
Tripsheetid *int `json:"tripsheetid"`
|
||||
Hubid *int `json:"hubid"`
|
||||
Exceptiontype string `json:"exceptiontype"` // Lost, Damaged, Misrouted, Receiver_Refused, Missing_Contents, Undeliverable
|
||||
Severity string `json:"severity"` // Low, Medium, High, Critical
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type ExceptionResolveRequest struct {
|
||||
Resolution string `json:"resolution"`
|
||||
Status string `json:"status"` // Resolved, Closed
|
||||
}
|
||||
48
dto/auth.go
Normal file
48
dto/auth.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package dto
|
||||
|
||||
type CustomerRegisterRequest struct {
|
||||
Firstname string `json:"firstname" xml:"firstname" form:"firstname"`
|
||||
Lastname string `json:"lastname" xml:"lastname" form:"lastname"`
|
||||
Phone string `json:"phone" xml:"phone" form:"phone"`
|
||||
Email string `json:"email" xml:"email" form:"email"`
|
||||
Pin string `json:"pin" xml:"pin" form:"pin"` // 4 or 6 digit PIN
|
||||
Configid int `json:"configid"`
|
||||
}
|
||||
|
||||
type CustomerLoginRequest struct {
|
||||
Phone string `json:"phone" xml:"phone" form:"phone"`
|
||||
Configid int `json:"configid"`
|
||||
}
|
||||
|
||||
type CustomerPinVerifyRequest struct {
|
||||
Phone string `json:"phone" xml:"phone" form:"phone"`
|
||||
Pin string `json:"pin" xml:"pin" form:"pin"`
|
||||
Configid int `json:"configid"`
|
||||
}
|
||||
|
||||
type CustomerResetPinRequest struct {
|
||||
Phone string `json:"phone" xml:"phone" form:"phone"`
|
||||
NewPin string `json:"new_pin" xml:"new_pin" form:"new_pin"`
|
||||
Configid int `json:"configid"`
|
||||
}
|
||||
|
||||
type MilerLoginRequest struct {
|
||||
Phone string `json:"phone" xml:"phone" form:"phone"`
|
||||
Configid int `json:"configid"`
|
||||
}
|
||||
|
||||
type MilerPinVerifyRequest struct {
|
||||
Phone string `json:"phone" xml:"phone" form:"phone"`
|
||||
Pin string `json:"pin" xml:"pin" form:"pin"`
|
||||
Configid int `json:"configid"`
|
||||
}
|
||||
|
||||
type AdminLoginRequest struct {
|
||||
Email string `json:"email" xml:"email" form:"email"`
|
||||
Password string `json:"password" xml:"password" form:"password"`
|
||||
}
|
||||
|
||||
type LoginResponse struct {
|
||||
Token string `json:"token"`
|
||||
User interface{} `json:"user"`
|
||||
}
|
||||
72
dto/booking.go
Normal file
72
dto/booking.go
Normal file
@@ -0,0 +1,72 @@
|
||||
package dto
|
||||
|
||||
import "time"
|
||||
|
||||
type LocationCreateRequest struct {
|
||||
Label string `json:"label"` // Home, Work, etc.
|
||||
Receivername string `json:"receivername"`
|
||||
Receiverphone string `json:"receiverphone"`
|
||||
Address string `json:"address"`
|
||||
Landmark string `json:"landmark"`
|
||||
City string `json:"city"`
|
||||
State string `json:"state"`
|
||||
Pincode string `json:"pincode"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Isdefault bool `json:"isdefault"`
|
||||
}
|
||||
|
||||
type ParcelRequest struct {
|
||||
Itemcategory string `json:"itemcategory"`
|
||||
Itemdescription string `json:"itemdescription"`
|
||||
Declaredvalue float64 `json:"declaredvalue"`
|
||||
Weight float64 `json:"weight"` // optional — miler weighs at pickup
|
||||
Length float64 `json:"length"` // optional
|
||||
Width float64 `json:"width"` // optional
|
||||
Height float64 `json:"height"` // optional
|
||||
Isfragile bool `json:"isfragile"`
|
||||
Needsinsurance bool `json:"needsinsurance"`
|
||||
Requireslargevehicle bool `json:"requireslargevehicle"`
|
||||
}
|
||||
|
||||
type PickupBookingRequest struct {
|
||||
Pickuplocationid *int `json:"pickuplocationid"`
|
||||
Pickupaddress string `json:"pickupaddress"` // required
|
||||
Pickuppincode string `json:"pickuppincode"` // required
|
||||
Pickuplatitude float64 `json:"pickuplatitude"`
|
||||
Pickuplongitude float64 `json:"pickuplongitude"`
|
||||
Deliveryaddress string `json:"deliveryaddress"` // optional — can be filled later
|
||||
Deliverypincode string `json:"deliverypincode"` // optional
|
||||
Deliverylatitude float64 `json:"deliverylatitude"`
|
||||
Deliverylongitude float64 `json:"deliverylongitude"`
|
||||
Preferredpickupfrom *time.Time `json:"preferredpickupfrom"`
|
||||
Preferredpickupto *time.Time `json:"preferredpickupto"`
|
||||
ServiceOption string `json:"serviceoption"` // Normal, Fast, Superfast
|
||||
Parcels []ParcelRequest `json:"parcels"`
|
||||
}
|
||||
|
||||
type PaymentRequest struct {
|
||||
Amount float64 `json:"amount"`
|
||||
Paymentmode string `json:"paymentmode"` // Cash, UPI, Card, Wallet
|
||||
Transactionref string `json:"transactionref"`
|
||||
}
|
||||
|
||||
type MilerLocationUpdateRequest struct {
|
||||
Latitude float64 `json:"latitude"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Pincode string `json:"pincode"`
|
||||
}
|
||||
|
||||
type MilerAvailabilityRequest struct {
|
||||
Status string `json:"status"` // Offline, Available, Break, etc.
|
||||
}
|
||||
|
||||
type PricingQuoteRequest struct {
|
||||
Pickuppincode string `json:"pickuppincode"`
|
||||
Deliverypincode string `json:"deliverypincode"`
|
||||
Pickuplatitude float64 `json:"pickuplatitude"`
|
||||
Pickuplongitude float64 `json:"pickuplongitude"`
|
||||
Deliverylatitude float64 `json:"deliverylatitude"`
|
||||
Deliverylongitude float64 `json:"deliverylongitude"`
|
||||
Parcels []ParcelRequest `json:"parcels"`
|
||||
}
|
||||
91
dto/client.go
Normal file
91
dto/client.go
Normal file
@@ -0,0 +1,91 @@
|
||||
package dto
|
||||
|
||||
type CreateClientRequest struct {
|
||||
// Core identity — form sends first_name (snake), rest is camelCase
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Phone string `json:"phone"`
|
||||
|
||||
// Location
|
||||
Address string `json:"address"`
|
||||
City string `json:"city"`
|
||||
State string `json:"businessState"`
|
||||
Neighbourhood string `json:"neighbourhood"`
|
||||
Pincode string `json:"pincode"`
|
||||
|
||||
// GPS survey data — form sends snake_case for lat/long
|
||||
SurveyLat float64 `json:"survey_lat"`
|
||||
SurveyLong float64 `json:"survey_long"`
|
||||
SurveyAddress string `json:"surveyAddress"`
|
||||
SurveyZone string `json:"surveyZone"`
|
||||
SurveyPincode string `json:"surveyPincode"`
|
||||
|
||||
// Business profile — form sends camelCase
|
||||
BusinessType string `json:"businessType"`
|
||||
Status string `json:"status"`
|
||||
ShippingFrequency string `json:"frequency"`
|
||||
LogisticsSegment string `json:"logisticsSegment"`
|
||||
TransitFrom string `json:"transitFrom"`
|
||||
TransitTo string `json:"transitTo"`
|
||||
|
||||
// Full-consent-only fields
|
||||
ParcelVolume float64 `json:"parcelVolume"`
|
||||
ActiveContracts int `json:"activeContracts"`
|
||||
LogisticsProvider string `json:"provider"`
|
||||
ProviderEfficiency string `json:"efficiency"`
|
||||
Notes string `json:"notes"`
|
||||
|
||||
// Consent & registration tracking
|
||||
DataConsent string `json:"dataConsent"`
|
||||
RegistrationSource string `json:"registration_source"`
|
||||
RegisteredByID uint64 `json:"registered_by_id"`
|
||||
}
|
||||
|
||||
type ClientResponse struct {
|
||||
ID uint64 `json:"id"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
LastUpdated string `json:"lastUpdated"`
|
||||
|
||||
// Core identity
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
|
||||
// Location
|
||||
Address string `json:"address"`
|
||||
City string `json:"city"`
|
||||
State string `json:"businessState"`
|
||||
Neighbourhood string `json:"neighbourhood"`
|
||||
Pincode string `json:"pincode"`
|
||||
|
||||
// GPS survey data
|
||||
SurveyLat float64 `json:"survey_lat"`
|
||||
SurveyLong float64 `json:"survey_long"`
|
||||
SurveyAddress string `json:"surveyAddress"`
|
||||
SurveyZone string `json:"surveyZone"`
|
||||
SurveyPincode string `json:"surveyPincode"`
|
||||
|
||||
// Business profile
|
||||
BusinessType string `json:"businessType"`
|
||||
Status string `json:"status"`
|
||||
ShippingFrequency string `json:"frequency"`
|
||||
LogisticsSegment string `json:"logisticsSegment"`
|
||||
TransitFrom string `json:"transitFrom"`
|
||||
TransitTo string `json:"transitTo"`
|
||||
|
||||
// Full-consent-only fields
|
||||
ParcelVolume float64 `json:"parcelVolume"`
|
||||
ActiveContracts int `json:"activeContracts"`
|
||||
LogisticsProvider string `json:"provider"`
|
||||
ProviderEfficiency string `json:"efficiency"`
|
||||
Notes string `json:"notes"`
|
||||
|
||||
// Consent & registration tracking
|
||||
DataConsent string `json:"dataConsent"`
|
||||
RegistrationSource string `json:"registration_source"`
|
||||
RegisteredByID uint64 `json:"registered_by_id"`
|
||||
Role string `json:"role"`
|
||||
}
|
||||
Reference in New Issue
Block a user