package mcuorderitem

import (
	emo "simrs-vx/internal/domain/main-entities/mcu-order"
	emoib "simrs-vx/internal/domain/main-entities/mcu-order-item/base"

	emosi "simrs-vx/internal/domain/main-entities/mcu-order-sub-item/base"
	erc "simrs-vx/internal/domain/references/common"
)

type McuOrderItem struct {
	emoib.McuOrderItem
	McuOrder *emo.McuOrder            `json:"mcuOrder,omitempty" gorm:"foreignKey:McuOrder_Id;references:Id"`
	Items    []*emosi.McuOrderSubItem `json:"items" gorm:"foreignKey:McuOrderItem_Id;references:Id"`
}

func (d McuOrderItem) IsCompleted() bool {
	return d.Status_Code == erc.DSCDone
}
