diff --git a/backend/services/authorization-service/src/domain/aggregates/authorization-role.aggregate.ts b/backend/services/authorization-service/src/domain/aggregates/authorization-role.aggregate.ts index 17a7fae3..49cc5fd2 100644 --- a/backend/services/authorization-service/src/domain/aggregates/authorization-role.aggregate.ts +++ b/backend/services/authorization-service/src/domain/aggregates/authorization-role.aggregate.ts @@ -371,14 +371,14 @@ export class AuthorizationRole extends AggregateRoot { } // 工厂方法 - 创建正式省公司 + // 授权即激活,开始按月考核(150, 300, 600, 1200, 2400, 4800, 9600, 19200, 11750) static createProvinceCompany(params: { userId: UserId provinceCode: string provinceName: string adminId: AdminUserId - skipAssessment?: boolean + skipAssessment?: boolean // 保留兼容,但不再影响激活状态 }): AuthorizationRole { - const skipAssessment = params.skipAssessment ?? false const now = new Date() const auth = new AuthorizationRole({ authorizationId: AuthorizationId.generate(), @@ -396,14 +396,14 @@ export class AuthorizationRole extends AggregateRoot { assessmentConfig: AssessmentConfig.forProvince(), requireLocalPercentage: 0, exemptFromPercentageCheck: true, - benefitActive: skipAssessment, - benefitActivatedAt: skipAssessment ? now : null, + benefitActive: true, // 授权即激活 + benefitActivatedAt: now, benefitDeactivatedAt: null, - benefitValidUntil: skipAssessment ? AuthorizationRole.calculateBenefitValidUntil(now) : null, - lastAssessmentMonth: skipAssessment ? AuthorizationRole.getCurrentMonthString(now) : null, + benefitValidUntil: AuthorizationRole.calculateBenefitValidUntil(now), + lastAssessmentMonth: AuthorizationRole.getCurrentMonthString(now), monthlyTreesAdded: 0, lastMonthTreesAdded: 0, - currentMonthIndex: skipAssessment ? 1 : 0, + currentMonthIndex: 1, // 从第1个月开始考核 createdAt: now, updatedAt: now, }) @@ -469,14 +469,14 @@ export class AuthorizationRole extends AggregateRoot { } // 工厂方法 - 创建正式市公司 + // 授权即激活,开始按月考核(30, 60, 120, 240, 480, 960, 1920, 3840, 2350) static createCityCompany(params: { userId: UserId cityCode: string cityName: string adminId: AdminUserId - skipAssessment?: boolean + skipAssessment?: boolean // 保留兼容,但不再影响激活状态 }): AuthorizationRole { - const skipAssessment = params.skipAssessment ?? false const now = new Date() const auth = new AuthorizationRole({ authorizationId: AuthorizationId.generate(), @@ -494,14 +494,14 @@ export class AuthorizationRole extends AggregateRoot { assessmentConfig: AssessmentConfig.forCity(), requireLocalPercentage: 0, exemptFromPercentageCheck: true, - benefitActive: skipAssessment, - benefitActivatedAt: skipAssessment ? now : null, + benefitActive: true, // 授权即激活 + benefitActivatedAt: now, benefitDeactivatedAt: null, - benefitValidUntil: skipAssessment ? AuthorizationRole.calculateBenefitValidUntil(now) : null, - lastAssessmentMonth: skipAssessment ? AuthorizationRole.getCurrentMonthString(now) : null, + benefitValidUntil: AuthorizationRole.calculateBenefitValidUntil(now), + lastAssessmentMonth: AuthorizationRole.getCurrentMonthString(now), monthlyTreesAdded: 0, lastMonthTreesAdded: 0, - currentMonthIndex: skipAssessment ? 1 : 0, + currentMonthIndex: 1, // 从第1个月开始考核 createdAt: now, updatedAt: now, })