package procedureroomorder

import (
	erc "simrs-vx/internal/domain/references/common"

	ecore "simrs-vx/internal/domain/base-entities/core"
	emp "simrs-vx/internal/domain/main-entities/material-package"
	eproi "simrs-vx/internal/domain/main-entities/procedure-room-order-item/base"
)

type ProcedureRoomOrder struct {
	ecore.BigMain
	Encounter_Id uint64 `json:"encounter_id"`
	// Infra_Code           string               `json:"infra_code" gorm:"size:20"`
	// ProcedureRoom        *epr.ProcedureRoom   `json:"procedureRoom,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
	MaterialPackage_Code *string                        `json:"materialPackage_code" gorm:"size:20"`
	MaterialPackage      *emp.MaterialPackage           `json:"materialPackage,omitempty" gorm:"foreignKey:MaterialPackage_Code;references:Code"`
	Status_Code          erc.DataStatusCode             `json:"status_code" gorm:"size:20"`
	Items                []eproi.ProcedureRoomOrderItem `json:"items,omitempty" gorm:"foreignKey:ProcedureRoomOrder_Id;references:Id"`
}

func (d ProcedureRoomOrder) IsNotNew() bool {
	return d.Status_Code != erc.DSCNew
}
