product.go 825 字节
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 TransformToProductDomainModelFromPgModels(productModel *models.Product) (*domain.Product, error) {
	return &domain.Product{
		CompanyId:       productModel.CompanyId,
		OrgId:           productModel.OrgId,
		ProductId:       productModel.ProductId,
		ProductCode:     productModel.ProductCode,
		ProductName:     productModel.ProductName,
		ProductCategory: productModel.ProductCategory,
		ProductSpec:     productModel.ProductSpec,
		CreatedAt:       productModel.CreatedAt,
		UpdatedAt:       productModel.UpdatedAt,
		DeletedAt:       productModel.DeletedAt,
		Ext:             productModel.Ext,
	}, nil
}