diff --git a/models/UserModel.ts b/models/UserModel.ts index 8796c349..d2194a8d 100644 --- a/models/UserModel.ts +++ b/models/UserModel.ts @@ -69,7 +69,7 @@ export class UserModel extends BaseEntity { onboardingSeen: boolean; @Column('boolean', { default: false }) - onboardingCollected: boolean; + firstTasksCompleted: boolean; @OneToMany((type) => ActivityModel, (activity) => activity.user, { cascade: true }) activities: ActivityModel[]; @@ -161,7 +161,7 @@ export class UserModel extends BaseEntity { credits: this.credits, isAttendancePublic: this.isAttendancePublic, onboardingSeen: this.onboardingSeen, - onboardingCollected: this.onboardingCollected, + firstTasksCompleted: this.firstTasksCompleted, }; if (this.attendances) { fullUserProfile.attendanceCount = this.attendances.length; diff --git a/services/UserAccountService.ts b/services/UserAccountService.ts index 4719b8f3..e738787c 100644 --- a/services/UserAccountService.ts +++ b/services/UserAccountService.ts @@ -174,14 +174,14 @@ export default class UserAccountService { || userProfile.bio == null) { throw new BadRequestError('Onboarding tasks not completed!'); } - if (userProfile.onboardingCollected) { + if (userProfile.firstTasksCompleted) { throw new BadRequestError('Onboarding reward already collected!'); } return this.transactions.readWrite(async (txn) => { const userRepository = Repositories.user(txn); await userRepository.addPoints(user, 10); Repositories.activity(txn).logBonus([user], 'First tasks reward', 10); - return userRepository.upsertUser(user, { onboardingCollected: true }); + return userRepository.upsertUser(user, { firstTasksCompleted: true }); }); } diff --git a/types/ApiResponses.ts b/types/ApiResponses.ts index cef331e7..aef0277b 100644 --- a/types/ApiResponses.ts +++ b/types/ApiResponses.ts @@ -360,7 +360,7 @@ export interface PrivateProfile extends PublicProfile { resumes?: PublicResume[], attendanceCount?: number, onboardingSeen: boolean, - onboardingCollected: boolean, + firstTasksCompleted: boolean, } export interface PublicFeedback {