feat: Add rider substitution system

This commit is contained in:
2026-06-22 17:38:05 +05:30
parent 6ab508560f
commit 588f27b917
6 changed files with 334 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package models
import "time"
// RiderSubstitution represents the rider_substitutions table
type RiderSubstitution struct {
ID int `json:"id" gorm:"primaryKey;autoIncrement"`
TenantID int `json:"tenant_id" gorm:"not null;uniqueIndex:uq_date_absent"`
SubDate string `json:"sub_date" gorm:"type:date;not null;uniqueIndex:uq_date_absent;index:idx_date;index:idx_tenant_date"`
AbsentRiderID int `json:"absent_rider_id" gorm:"not null;uniqueIndex:uq_date_absent"`
AbsentRiderName string `json:"absent_rider_name" gorm:"size:100;not null"`
SubRiderID int `json:"sub_rider_id" gorm:"not null"`
SubRiderName string `json:"sub_rider_name" gorm:"size:100;not null"`
Reason string `json:"reason" gorm:"size:255"`
Status string `json:"status" gorm:"type:enum('scheduled','active','completed','cancelled');default:'scheduled';not null;index:idx_status"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}