|
|
package transform
|
|
|
|
|
|
import (
|
|
|
"github.com/shopspring/decimal"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils"
|
...
|
...
|
@@ -8,10 +9,11 @@ import ( |
|
|
|
|
|
func TransformToMoneyIncentivesRuleDomainModelFromPgModels(moneyIncentivesRuleModel *models.MoneyIncentivesRule) (*domain.MoneyIncentivesRule, error) {
|
|
|
stageString := utils.NumberToCNNumber(int(moneyIncentivesRuleModel.MoneyIncentivesStage))
|
|
|
moneyIncentivesAmount, _ := decimal.NewFromFloatWithExponent(moneyIncentivesRuleModel.MoneyIncentivesAmount, -2).Float64()
|
|
|
return &domain.MoneyIncentivesRule{
|
|
|
MoneyIncentivesRuleId: moneyIncentivesRuleModel.MoneyIncentivesRuleId,
|
|
|
CooperationContractNumber: moneyIncentivesRuleModel.CooperationContractNumber,
|
|
|
MoneyIncentivesAmount: moneyIncentivesRuleModel.MoneyIncentivesAmount,
|
|
|
MoneyIncentivesAmount: moneyIncentivesAmount,
|
|
|
MoneyIncentivesStage: moneyIncentivesRuleModel.MoneyIncentivesStage,
|
|
|
MoneyIncentivesStageCN: stageString,
|
|
|
MoneyIncentivesStageEnd: moneyIncentivesRuleModel.MoneyIncentivesStageEnd,
|
...
|
...
|
|