132 lines
5.5 KiB
Go
132 lines
5.5 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
type WorkOrder struct {
|
|
ID int `db:"id" json:"id"`
|
|
WONumber string `db:"wo_number" json:"wo_number"`
|
|
Title string `db:"title" json:"title"`
|
|
Description string `db:"description" json:"description"`
|
|
Instructions string `db:"instructions" json:"instructions"`
|
|
Status string `db:"status" json:"status"`
|
|
Priority string `db:"priority" json:"priority"`
|
|
ScheduledStart *time.Time `db:"scheduled_start" json:"scheduled_start"`
|
|
ScheduledEnd *time.Time `db:"scheduled_end" json:"scheduled_end"`
|
|
ActualStart *time.Time `db:"actual_start" json:"actual_start"`
|
|
ActualEnd *time.Time `db:"actual_end" json:"actual_end"`
|
|
SiteName string `db:"site_name" json:"site_name"`
|
|
Address string `db:"address" json:"address"`
|
|
Lat *float64 `db:"lat" json:"lat"`
|
|
Lng *float64 `db:"lng" json:"lng"`
|
|
AccessNotes string `db:"access_notes" json:"access_notes"`
|
|
ParentType *string `db:"parent_type" json:"parent_type"`
|
|
ParentID *int `db:"parent_id" json:"parent_id"`
|
|
CreatedBy string `db:"created_by" json:"created_by"`
|
|
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
|
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
|
|
ClosedAt *time.Time `db:"closed_at" json:"closed_at"`
|
|
ClosedBy *string `db:"closed_by" json:"closed_by"`
|
|
}
|
|
|
|
type WorkOrderListItem struct {
|
|
ID int `db:"id" json:"id"`
|
|
WONumber string `db:"wo_number" json:"wo_number"`
|
|
Title string `db:"title" json:"title"`
|
|
Status string `db:"status" json:"status"`
|
|
Priority string `db:"priority" json:"priority"`
|
|
SiteName string `db:"site_name" json:"site_name"`
|
|
ScheduledStart *time.Time `db:"scheduled_start" json:"scheduled_start"`
|
|
StepCount int `db:"step_count" json:"step_count"`
|
|
StepsDone int `db:"steps_done" json:"steps_done"`
|
|
PhotoCount int `db:"photo_count" json:"photo_count"`
|
|
}
|
|
|
|
type Step struct {
|
|
ID int `db:"id" json:"id"`
|
|
WOID int `db:"wo_id" json:"wo_id"`
|
|
StepOrder int `db:"step_order" json:"step_order"`
|
|
Title string `db:"title" json:"title"`
|
|
Description string `db:"description" json:"description"`
|
|
Required bool `db:"required" json:"required"`
|
|
Completed bool `db:"completed" json:"completed"`
|
|
CompletedBy *string `db:"completed_by" json:"completed_by"`
|
|
CompletedAt *time.Time `db:"completed_at" json:"completed_at"`
|
|
Notes string `db:"notes" json:"notes"`
|
|
}
|
|
|
|
type AssignedResource struct {
|
|
ID int `db:"id" json:"id"`
|
|
WOID int `db:"wo_id" json:"wo_id"`
|
|
ResourceType string `db:"resource_type" json:"resource_type"`
|
|
ResourceID int `db:"resource_id" json:"resource_id"`
|
|
Name string `db:"name" json:"name"`
|
|
Quantity *float64 `db:"quantity" json:"quantity"`
|
|
Notes string `db:"notes" json:"notes"`
|
|
AssignedAt time.Time `db:"assigned_at" json:"assigned_at"`
|
|
}
|
|
|
|
type Attachment struct {
|
|
ID int `db:"id" json:"id"`
|
|
WOID int `db:"wo_id" json:"wo_id"`
|
|
StepID *int `db:"step_id" json:"step_id"`
|
|
FileName string `db:"file_name" json:"file_name"`
|
|
FilePath string `db:"file_path" json:"file_path"`
|
|
FileType string `db:"file_type" json:"file_type"`
|
|
FileSize int64 `db:"file_size" json:"file_size"`
|
|
Caption string `db:"caption" json:"caption"`
|
|
Phase string `db:"phase" json:"phase"`
|
|
Lat *float64 `db:"lat" json:"lat"`
|
|
Lng *float64 `db:"lng" json:"lng"`
|
|
UploadedBy string `db:"uploaded_by" json:"uploaded_by"`
|
|
UploadedAt time.Time `db:"uploaded_at" json:"uploaded_at"`
|
|
URL string `db:"-" json:"url"`
|
|
}
|
|
|
|
type AccountingCode struct {
|
|
ID int `db:"id" json:"id"`
|
|
WOID int `db:"wo_id" json:"wo_id"`
|
|
CodeType string `db:"code_type" json:"code_type"`
|
|
CodeValue string `db:"code_value" json:"code_value"`
|
|
Description string `db:"description" json:"description"`
|
|
}
|
|
|
|
type RegistryPerson struct {
|
|
ID int `db:"id" json:"id"`
|
|
Name string `db:"name" json:"name"`
|
|
Role string `db:"role" json:"role"`
|
|
Email string `db:"email" json:"email"`
|
|
Phone string `db:"phone" json:"phone"`
|
|
}
|
|
|
|
type RegistryVehicle struct {
|
|
ID int `db:"id" json:"id"`
|
|
UnitNumber string `db:"unit_number" json:"unit_number"`
|
|
Description string `db:"description" json:"description"`
|
|
VehicleType string `db:"vehicle_type" json:"vehicle_type"`
|
|
}
|
|
|
|
type RegistryEquipment struct {
|
|
ID int `db:"id" json:"id"`
|
|
Name string `db:"name" json:"name"`
|
|
AssetTag string `db:"asset_tag" json:"asset_tag"`
|
|
Category string `db:"category" json:"category"`
|
|
}
|
|
|
|
type RegistryMaterial struct {
|
|
ID int `db:"id" json:"id"`
|
|
Name string `db:"name" json:"name"`
|
|
Unit string `db:"unit" json:"unit"`
|
|
PartNumber string `db:"part_number" json:"part_number"`
|
|
}
|
|
|
|
type UserClaims struct {
|
|
Sub string
|
|
Email string
|
|
Name string
|
|
Roles []string
|
|
}
|
|
|
|
type CtxKey string
|
|
|
|
const CtxUserKey CtxKey = "user"
|