unit_conversion.go 1.0 KB
package transform

import (
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)

func TransformToUnitConversionDomainModelFromPgModels(unitConversionModel *models.UnitConversion) (*domain.UnitConversion, error) {
	return &domain.UnitConversion{
		UnitConversionId:        unitConversionModel.UnitConversionId,
		CompanyId:               unitConversionModel.CompanyId,
		OrgId:                   unitConversionModel.OrgId,
		WorkStation:             unitConversionModel.WorkStation,
		Material:                unitConversionModel.Material,
		FromUnitQuantity:        unitConversionModel.FromUnitQuantity,
		ToUnitQuantity:          unitConversionModel.ToUnitQuantity,
		IntelligentWeighingFlag: unitConversionModel.IntelligentWeighingFlag,
		CreatedAt:               unitConversionModel.CreatedAt,
		UpdatedAt:               unitConversionModel.UpdatedAt,
		DeletedAt:               unitConversionModel.DeletedAt,
	}, nil
}