package apmcuorder

import (
	eamob "simrs-vx/internal/domain/main-entities/ap-mcu-order/base"
	ed "simrs-vx/internal/domain/main-entities/doctor"
	ee "simrs-vx/internal/domain/main-entities/encounter"
	erc "simrs-vx/internal/domain/references/common"
)

type ApMcuOrder struct {
	eamob.ApMcuOrder
	Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
	Doctor    *ed.Doctor    `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
}

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

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

func (d ApMcuOrder) IsSameDoctor(doctor_code *string) bool {
	return d.Doctor_Code == *doctor_code
}
