contract_undertaker_feedback.go 1.8 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 TransformToContractUndertakerFeedbackDomainModelFromPgModels(
	contractUndertakerFeedbackModel *models.ContractUndertakerFeedback,
	cooperationMode *models.CooperationMode) (*domain.ContractUndertakerFeedback, error) {
	return &domain.ContractUndertakerFeedback{
		FeedbackId:                contractUndertakerFeedbackModel.FeedbackId,
		FeedbackAttachment:        contractUndertakerFeedbackModel.FeedbackAttachment,
		FeedbackContent:           contractUndertakerFeedbackModel.FeedbackContent,
		CooperationContractNumber: contractUndertakerFeedbackModel.CooperationContractNumber,
		ContractUndertaker:        contractUndertakerFeedbackModel.ContractUndertaker,
		CooperationMode: &domain.CooperationMode{
			CooperationModeId:     cooperationMode.CooperationModeId,
			CooperationModeNumber: cooperationMode.CooperationModeNumber,
			CooperationModeName:   cooperationMode.CooperationModeName,
			Status:                cooperationMode.Status,
			Org:                   cooperationMode.Org,
			Company:               cooperationMode.Company,
			Remarks:               cooperationMode.Remarks,
			Operator:              cooperationMode.Operator,
			OperateTime:           cooperationMode.OperateTime,
			UpdatedAt:             cooperationMode.UpdatedAt,
			DeletedAt:             cooperationMode.DeletedAt,
			CreatedAt:             cooperationMode.CreatedAt,
		},
		Org:       contractUndertakerFeedbackModel.Org,
		Company:   contractUndertakerFeedbackModel.Company,
		UpdatedAt: contractUndertakerFeedbackModel.UpdatedAt,
		DeletedAt: contractUndertakerFeedbackModel.DeletedAt,
		CreatedAt: contractUndertakerFeedbackModel.CreatedAt,
	}, nil
}