product_material_group.go 1.1 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 TransformToProductMaterialGroupDomainModelFromPgModels(productMaterialGroupModel *models.ProductMaterialGroup) (*domain.ProductMaterialGroup, error) {
	return &domain.ProductMaterialGroup{
		ProductMaterialGroupId: productMaterialGroupModel.ProductMaterialGroupId,
		CompanyId:              productMaterialGroupModel.CompanyId,
		OrgId:                  productMaterialGroupModel.OrgId,
		Pid:                    productMaterialGroupModel.Pid,
		//Path:                   productMaterialGroupModel.Path,
		MaterialGroupName:   productMaterialGroupModel.MaterialGroupName,
		MaterialGroupNumber: productMaterialGroupModel.MaterialGroupNumber,
		CreatedAt:           productMaterialGroupModel.CreatedAt,
		UpdatedAt:           productMaterialGroupModel.UpdatedAt,
		DeletedAt:           productMaterialGroupModel.DeletedAt,
		Ext:                 productMaterialGroupModel.Ext,
	}, nil
}