credit_account.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 TransformToCreditAccountDomainModelFromPgModels(creditAccountModel *models.CreditAccount) (*domain.CreditAccount, error) {
	return &domain.CreditAccount{
		CreditAccountId:            creditAccountModel.CreditAccountId,
		ActuallyPaidAmount:         creditAccountModel.ActuallyPaidAmount,
		CreditAccountOrderNum:      creditAccountModel.CreditAccountOrderNum,
		PaymentStatus:              creditAccountModel.PaymentStatus,
		PaymentTime:                creditAccountModel.PaymentTime,
		SettlementAmount:           creditAccountModel.SettlementAmount,
		SettlementTime:             creditAccountModel.SettlementTime,
		CooperationContractNumber:  creditAccountModel.CooperationContractNumber,
		Participator:               creditAccountModel.Participator,
		ParticipateType:            creditAccountModel.ParticipateType,
		AccountDetail:              creditAccountModel.AccountDetail,
		GoodAmountCount:            creditAccountModel.GoodAmountCount,
		PaymentDocumentAttachments: creditAccountModel.PaymentDocumentAttachments,
		Org:                        creditAccountModel.Org,
		Company:                    creditAccountModel.Company,
		Operator:                   creditAccountModel.Operator,
		OperateTime:                creditAccountModel.OperateTime,
		CreatedAt:                  creditAccountModel.CreatedAt,
		DeletedAt:                  creditAccountModel.DeletedAt,
		UpdatedAt:                  creditAccountModel.UpdatedAt,
		Remarks:                    creditAccountModel.Remarks,
	}, nil
}