package models

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

	EmptyField       *[]string             `json:"emptyField" db:"-"`
	FileList         *[]MinioFile          `json:"fileList" db:"-"`
	ChildrenList     *[]PurchasePlanDetail `json:"childrenList" db:"-"`
	SaleOrder        *SaleOrder            `json:"saleOrder" db:"-"`
	PurchaseUserName *string               `json:"purchaseUserName" db:"-"`
}

type PurchasePlanDetail struct {
	ID           *string  `json:"id" db:"id" id_type:"UUID"`
	PlanId       *string  `json:"planId" db:"plan_id"`
	MaterialCode *string  `json:"materialCode" db:"material_code"`
	Number       *float64 `json:"number" db:"number"`

	ProductMaterial *ProductMaterial `json:"material" db:"-"`
}

type PurchaseOrder struct {
	ID                *string `json:"id" db:"id" id_type:"UUID"`
	Code              *string `json:"code" db:"code"`
	SaleOrderId       *string `json:"saleOrderId" db:"sale_order_id"`
	CustomerId        *string `json:"customerId" db:"customer_id"`
	CreateTime        *string `json:"createTime" db:"create_time"`
	Status            *string `json:"status" db:"status"`
	PlanReceiveDate   *string `json:"planReceiveDate" db:"plan_receive_date"`
	ActualReceiveDate *string `json:"actualReceiveDate" db:"actual_receive_date"`
	PurchasePlanId    *string `json:"purchasePlanId" db:"purchase_plan_id"`
	CreateId          *int64  `json:"createId" db:"create_id"`
	UpdateId          *int64  `json:"updateId" db:"update_id"`
	TenantId          *string `json:"tenantId" db:"tenant_id"`
	UpdateTime        *string `json:"updateTime" db:"update_time"`
	ExpressNo         *string `json:"expressNo" db:"express_no"`

	EmptyField   *[]string              `json:"emptyField" db:"-"`
	FileList     *[]MinioFile           `json:"fileList" db:"-"`
	ChildrenList *[]PurchaseOrderDetail `json:"childrenList" db:"-"`
	SaleOrder    *SaleOrder             `json:"saleOrder" db:"-"`
	Customer     *Customer              `json:"customer" db:"-"`
	PurchasePlan *PurchasePlan          `json:"purchasePlan" db:"-"`
}

type PurchaseOrderDetail struct {
	ID           *string  `json:"id" db:"id" id_type:"UUID"`
	OrderId      *string  `json:"orderId" db:"order_id"`
	MaterialCode *string  `json:"materialCode" db:"material_code"`
	Number       *float64 `json:"number" db:"number"`
	Status       *string  `json:"status" db:"status"`

	ProductMaterial *ProductMaterial `json:"material" db:"-"`
}
