package mcuordersubitem

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
	emoi "simrs-vx/internal/domain/main-entities/mcu-order-item"
	emss "simrs-vx/internal/domain/main-entities/mcu-sub-src"

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

type McuOrderSubItem struct {
	ecore.Main                      // adjust this according to the needs
	McuSubSrc    *emss.McuSubSrc    `json:"mcuSubSrc,omitempty" gorm:"foreignKey:McuSubSrc_Code;references:Code"`
	McuOrderItem *emoi.McuOrderItem `json:"mcuOrderItem,omitempty" gorm:"foreignKey:McuOrderItem_Id;references:Id"`
	emosi.McuOrderSubItem
}

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