mapping_rule.go 945 字节
package transform

import (
	"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/domain"
	"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/infrastructure/pg/models"
)

func TransformToMappingRuleDomainModelFromPgModels(mappingRuleModel *models.MappingRule) (*domain.MappingRule, error) {
	return &domain.MappingRule{
		MappingRuleId:      mappingRuleModel.MappingRuleId,
		Name:               mappingRuleModel.Name,
		TableId:            mappingRuleModel.TableId,
		FileId:             mappingRuleModel.FileId,
		MainTableFields:    mappingRuleModel.MainTableFields,
		VerifiedFileFields: mappingRuleModel.VerifiedFileFields,
		MappingFields:      mappingRuleModel.MappingFields,
		CreatedAt:          mappingRuleModel.CreatedAt,
		UpdatedAt:          mappingRuleModel.UpdatedAt,
		DeletedAt:          mappingRuleModel.DeletedAt,
		Context:            mappingRuleModel.Context,
	}, nil
}