package models

type SaleOrder struct {
	ID                *string  `json:"id" db:"id" id_type:"UUID"`
	Code              *string  `json:"code" db:"code"`
	CustomerId        *string  `json:"customerId" db:"customer_id"`
	ManagerId         *int64   `json:"managerId" db:"manager_id"`
	IncomePrice       *float64 `json:"incomePrice" db:"income_price"`
	FreePrice         *float64 `json:"freePrice" db:"free_price"`
	ActualPrice       *float64 `json:"actualPrice" db:"actual_price"`
	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"`
	DeliveryDate      *string  `json:"deliveryDate" db:"delivery_date"`
	DeliveryAddress   *string  `json:"deliveryAddress" db:"delivery_address"`
	ContractNo        *string  `json:"contractNo" db:"contract_no"`
	OrderDate         *string  `json:"orderDate" db:"order_date"`
	Remark            *string  `json:"remark" db:"remark"`
	TenantId          *string  `json:"tenantId" db:"tenant_id"`
	CreateId          *int64   `json:"createId" db:"create_id"`
	UpdateId          *int64   `json:"updateId" db:"update_id"`
	UpdateTime        *string  `json:"updateTime" db:"update_time"`

	ManagerName  *string            `json:"managerName" db:"-"`
	CustomerName *string            `json:"customerName" db:"-"`
	EmptyField   *[]string          `json:"emptyField" db:"-"`
	FileList     *[]MinioFile       `json:"fileList" db:"-"`
	ChildrenList *[]SaleOrderDetail `json:"childrenList" db:"-"`
}

type SaleOrderDetail struct {
	ID               *string  `json:"id" db:"id" id_type:"UUID"`
	MaterialCode     *string  `json:"materialCode" db:"material_code"`
	MaterialQuantity *int32   `json:"materialQuantity" db:"material_quantity"`
	OrderId          *string  `json:"orderId" db:"order_id"`
	CreateTime       *string  `json:"createTime" db:"create_time"`
	MaterialPrice    *float64 `json:"materialPrice" db:"material_price"`

	Material              *ProductMaterial     `json:"material" db:"-"`
	BomList               *[]ProductBom        `json:"bomList" db:"-"`
	WarehouseMaterialList *[]WarehouseMaterial `json:"warehouseMaterialList" db:"-"`
}

type SalePlan struct {
	ID         *string  `json:"id" db:"id" id_type:"UUID"`
	Code       *string  `json:"code" db:"code"`
	Name       *string  `json:"name" db:"name"`
	Type       *string  `json:"type" db:"type"`
	ParentId   *string  `json:"parentId" db:"parent_id"`
	BeginDate  *string  `json:"beginDate" db:"begin_date"`
	EndDate    *string  `json:"endDate" db:"end_date"`
	SaleAmount *float64 `json:"saleAmount" db:"sale_amount"`
	CreateTime *string  `json:"createTime" db:"create_time"`
	Remark     *string  `json:"remark" db:"remark"`
	TenantId   *string  `json:"tenantId" db:"tenant_id"`
	CreateId   *int64   `json:"createId" db:"create_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:"-"`
	TotalActualPrice *float64     `json:"totalActualPrice" db:"-"`
}

type SalePriceByDay struct {
	Date    *string  `json:"date" db:"date"`
	DateStr *string  `json:"date2" db:"datestr"`
	Price   *float64 `json:"price" db:"price"`
}

type SalePerformance struct {
	PlanSalePriceByMonth   *float64 `json:"planSalePriceByMonth" db:"plan_sale_price_by_month"`
	PlanSalePriceByYear    *float64 `json:"planSalePriceByYear" db:"plan_sale_price_by_year"`
	ActualSalePriceByMonth *float64 `json:"actualSalePriceByMonth" db:"actual_sale_price_by_month"`
	ActualSalePriceByYear  *float64 `json:"actualSalePriceByYear" db:"actual_sale_price_by_year"`

	PlanList   *[]SalePriceByDay `json:"planList" db:"-"`
	ActualList *[]SalePriceByDay `json:"actualList" db:"-"`
}
