Files
doormile_backend/models/doormile_pricing.go
Suriya c91c887726 Add assignment engine, FCM, WebSockets, city gate, and internal APIs
- internal/assignment: GEORADIUS miler assignment with retry/escalation,
  customer-side provider scoring, FCM notifications on assign
- internal/notify: Firebase Admin SDK (FCM) client initialisation
- internal/ws: WebSocket handlers for live parcel tracking and
  customer↔miler chat
- middlewares: city gate (pincode prefix validation), internal API key
  auth, WebSocket JWT auth
- controllers: InternalNotify + InternalReassign for machine-to-machine
  calls; pricing helpers wired into CreateCustomerBooking and CreateCRMBooking
- routes: /internal/*, /ws/bookings/:id/track, /ws/bookings/:id/chat
- models/users, models/doormile_pricing: new fields for device tokens,
  assignment state, pricing bands
- seed_data.sql: initial pricing seed rows

.env and Firebase service-account JSON intentionally excluded.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 12:31:53 +05:30

30 lines
1.6 KiB
Go

package models
import "time"
// Zone values: Local | Interstate | OtherState
// Category values: General | Documents | Electronics | Clothing | Fragile | Medical | Automotive | Food
// ServiceType: Normal | Express
type DoormilePricing struct {
Doormile_pricing_id int `json:"doormile_pricing_id" gorm:"primaryKey;column:doormile_pricing_id"`
Zone string `json:"zone" gorm:"column:zone;not null"`
Category string `json:"category" gorm:"column:category;not null"`
Servicetype string `json:"servicetype" gorm:"column:servicetype;not null"`
Minweight float64 `json:"min_weight" gorm:"column:min_weight;not null"`
Maxweight float64 `json:"max_weight" gorm:"column:max_weight;not null"`
Minprice float64 `json:"min_price" gorm:"column:min_price;not null"`
Maxprice float64 `json:"max_price" gorm:"column:max_price;not null"`
Currency string `json:"currency" gorm:"column:currency;default:INR"`
Providercompany string `json:"provider_company" gorm:"column:provider_company;default:Doormile"`
Reliabilityscore float64 `json:"reliability_score" gorm:"column:reliability_score;default:5.0"`
Status string `json:"status" gorm:"column:status;default:Active"`
Createdat time.Time `json:"createdat" gorm:"column:createdat;default:CURRENT_TIMESTAMP"`
Updatedat time.Time `json:"updatedat" gorm:"column:updatedat;default:CURRENT_TIMESTAMP"`
Deletedat *time.Time `json:"deletedat,omitempty" gorm:"column:deletedat"`
}
func (DoormilePricing) TableName() string {
return "doormile_pricing"
}