package micromcuorderitem

import (
	ems "simrs-vx/internal/domain/main-entities/mcu-src"
	emo "simrs-vx/internal/domain/main-entities/micro-mcu-order"
	emoib "simrs-vx/internal/domain/main-entities/micro-mcu-order-item/base"
	erc "simrs-vx/internal/domain/references/common"
)

type MicroMcuOrderItem struct {
	emoib.MicroMcuOrderItem
	MicroMcuOrder *emo.MicroMcuOrder `json:"microMcuOrder,omitempty" gorm:"foreignKey:MicroMcuOrder_Id;references:Id"`
	McuSrc        *ems.McuSrc        `json:"mcuSrc,omitempty" gorm:"foreignKey:McuSrc_Code;references:Code"`
}

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