dividends_incentives_rule.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"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils"
)
func TransformToDividendsIncentivesRuleDomainModelFromPgModels(dividendsIncentivesRuleModel *models.DividendsIncentivesRule) (*domain.DividendsIncentivesRule, error) {
stageString := utils.NumberToCNNumber(int(dividendsIncentivesRuleModel.DividendsIncentivesStage))
return &domain.DividendsIncentivesRule{
DividendsIncentivesRuleId: dividendsIncentivesRuleModel.DividendsIncentivesRuleId,
CooperationContractNumber: dividendsIncentivesRuleModel.CooperationContractNumber,
ReferrerPercentage: dividendsIncentivesRuleModel.ReferrerPercentage,
SalesmanPercentage: dividendsIncentivesRuleModel.SalesmanPercentage,
DividendsIncentivesPercentage: dividendsIncentivesRuleModel.DividendsIncentivesPercentage,
DividendsIncentivesStage: dividendsIncentivesRuleModel.DividendsIncentivesStage,
DividendsIncentivesStageCN: stageString,
DividendsIncentivesStageEnd: dividendsIncentivesRuleModel.DividendsIncentivesStageEnd,
DividendsIncentivesStageStart: dividendsIncentivesRuleModel.DividendsIncentivesStageStart,
Remarks: dividendsIncentivesRuleModel.Remarks,
Org: dividendsIncentivesRuleModel.Org,
Company: dividendsIncentivesRuleModel.Company,
UpdatedAt: dividendsIncentivesRuleModel.UpdatedAt,
DeletedAt: dividendsIncentivesRuleModel.DeletedAt,
CreatedAt: dividendsIncentivesRuleModel.CreatedAt,
}, nil
}