package antibioticsrc

import (
	e "simrs-vx/internal/domain/main-entities/antibiotic-src"

	pl "simrs-vx/pkg/logger"

	"gorm.io/gorm"
)

func setData(input any, data *e.AntibioticSrc) {
	switch input.(type) {
	case *e.CreateDto:
		data.Code = input.(*e.CreateDto).Code
		data.Name = input.(*e.CreateDto).Name
		data.AntibioticSrcCategory_Code = input.(*e.CreateDto).AntibioticSrcCategory_Code
		// data.Item_Id = input.(*e.CreateDto).Item_Id
	case *e.UpdateDto:
		data.Code = input.(*e.UpdateDto).Code
		data.Name = input.(*e.UpdateDto).Name
		data.AntibioticSrcCategory_Code = input.(*e.UpdateDto).AntibioticSrcCategory_Code
		// data.Item_Id = input.(*e.UpdateDto).Item_Id
	}
}

func createItem(input *e.CreateDto, event *pl.Event, tx *gorm.DB) error {
	// For antibiotic-src, we don't need to create items since Item_Id is commented out
	// This function is kept for consistency with the pattern but does nothing
	return nil
}
