cooperation_contract_relevant.go 1.7 KB
package transform

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

func TransformToCooperationContractRelevantDomainModelFromPgModels(cooperationContractRelevantModel *models.CooperationContractRelevant) (*domain.CooperationContractRelevant, error) {
	return &domain.CooperationContractRelevant{
		CooperationContractRelevantId: cooperationContractRelevantModel.CooperationContractRelevantId,
		CooperationContractNumber:     cooperationContractRelevantModel.CooperationContractNumber,
		Relevant: &domain.Relevant{
			RelevantId:                cooperationContractRelevantModel.CooperationContractRelevantId,
			CooperationContractNumber: cooperationContractRelevantModel.CooperationContractNumber,
			UserId:                    cooperationContractRelevantModel.UserId,
			UserBaseId:                cooperationContractRelevantModel.UserBaseId,
			Org:                       cooperationContractRelevantModel.Org,
			Orgs:                      cooperationContractRelevantModel.Orgs,
			Department:                cooperationContractRelevantModel.Department,
			Roles:                     cooperationContractRelevantModel.Role,
			UserInfo:                  cooperationContractRelevantModel.UserInfo,
			UserType:                  cooperationContractRelevantModel.UserType,
			Status:                    cooperationContractRelevantModel.Status,
			Company:                   cooperationContractRelevantModel.Company,
		},
		UpdatedAt: cooperationContractRelevantModel.UpdatedAt,
		DeletedAt: cooperationContractRelevantModel.DeletedAt,
		CreatedAt: cooperationContractRelevantModel.CreatedAt,
	}, nil
}