package models

type ProductPlan struct {
	ID          *string `json:"id" db:"id" id_type:"UUID"`
	Name        *string `json:"name" db:"name"`
	Code        *string `json:"code" db:"code"`
	SaleOrderId *string `json:"saleOrderId" db:"sale_order_id"`
	BeginDate   *string `json:"beginDate" db:"begin_date"`
	EndDate     *string `json:"endDate" db:"end_date"`
	Remark      *string `json:"remark" db:"remark"`
	CreateTime  *string `json:"createTime" db:"create_time"`
	CreateId    *int64  `json:"createId" db:"create_id"`
	Status      *string `json:"status" db:"status"`
	TenantId    *string `json:"tenantId" db:"tenant_id"`
	UpdateId    *int64  `json:"updateId" db:"update_id"`
	UpdateTime  *string `json:"updateTime" db:"update_time"`

	EmptyField *[]string            `json:"emptyField" db:"-"`
	FileList   *[]MinioFile         `json:"fileList" db:"-"`
	SaleOrder  *SaleOrder           `json:"saleOrder" db:"-"`
	BomList    *[]ProductPlanBom    `json:"bomList" db:"-"`
	DeviceList *[]ProductPlanDevice `json:"deviceList" db:"-"`
	UserList   *[]ProductPlanUser   `json:"userList" db:"-"`
}

type ProductPlanBom struct {
	ID               *string  `json:"id" db:"id" id_type:"UUID"`
	PlanId           *string  `json:"planId" db:"plan_id"`
	BomId            *string  `json:"bomId" db:"bom_id"`
	RouteId          *string  `json:"routeId" db:"route_id"`
	Number           *float64 `json:"number" db:"number"`
	CreateTime       *string  `json:"createTime" db:"create_time"`
	InspectProgramId *string  `json:"inspectProgramId" db:"inspect_program_id"`

	ProductPlan           *ProductPlan           `json:"productPlan" db:"-"`
	ProductBom            *ProductBom            `json:"productBom" db:"-"`
	ProcessRoute          *ProcessRoute          `json:"processRoute" db:"-"`
	QualityInspectProgram *QualityInspectProgram `json:"inspectProgram" db:"-"`
}

type ProductPlanDevice struct {
	ID         *string `json:"id" db:"id" id_type:"UUID"`
	PlanId     *string `json:"planId" db:"plan_id"`
	DeviceId   *string `json:"deviceId" db:"device_id"`
	CreateTime *string `json:"createTime" db:"create_time"`

	ProductPlan *ProductPlan `json:"productPlan" db:"-"`
	Device      *Device      `json:"device" db:"-"`
}

type ProductPlanUser struct {
	ID        *string `json:"id" db:"id" id_type:"UUID"`
	PlanId    *string `json:"planId" db:"plan_id"`
	BeginTime *string `json:"beginTime" db:"begin_time"`
	EndTime   *string `json:"endTime" db:"end_time"`
	RouteId   *string `json:"routeId" db:"route_id"`
	StageId   *string `json:"stageId" db:"stage_id"`
	UserId    *int64  `json:"userId" db:"user_id"`

	ProductPlan *ProductPlan `json:"productPlan" db:"-"`
	User        *SysUser     `json:"user" db:"-"`
}
