Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add onboarding seen #457

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/validators/UserControllerRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export class UserPatches implements IUserPatches {
@Allow()
isAttendancePublic?: boolean;

@Allow()
onboardingSeen?: boolean;

@Type(() => PasswordUpdate)
@ValidateNested()
@HasMatchingPasswords()
Expand Down
25 changes: 25 additions & 0 deletions migrations/0047-add-onboarding-seen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';

const TABLE_NAME = 'Users';

export class AddOnboardingSeen1730353019494 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.addColumn(TABLE_NAME,
new TableColumn({
name: 'onboardingSeen',
type: 'boolean',
isNullable: true,
default: false,
}));
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropColumn(TABLE_NAME,
new TableColumn({
name: 'onboardingSeen',
type: 'boolean',
isNullable: true,
default: false,
}));
}
}
7 changes: 7 additions & 0 deletions models/UserModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export class UserModel extends BaseEntity {
@Column('integer', { default: 0 })
credits: number;

@Column('boolean', { default: false })
onboardingSeen: boolean;

@OneToMany((type) => ActivityModel, (activity) => activity.user, { cascade: true })
activities: ActivityModel[];

Expand Down Expand Up @@ -154,10 +157,14 @@ export class UserModel extends BaseEntity {
points: this.points,
credits: this.credits,
isAttendancePublic: this.isAttendancePublic,
onboardingSeen: this.onboardingSeen,
};
if (this.userSocialMedia) {
fullUserProfile.userSocialMedia = this.userSocialMedia.map((sm) => sm.getPublicSocialMedia());
}
if (this.resumes) {
fullUserProfile.resumes = this.resumes.map((rm) => rm.getPublicResume());
}
return fullUserProfile;
}
}
1 change: 1 addition & 0 deletions types/ApiRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export interface UserPatches {
graduationYear?: number;
bio?: string;
isAttendancePublic?: boolean;
onboardingSeen?: boolean;
passwordChange?: PasswordUpdate;
}

Expand Down
1 change: 1 addition & 0 deletions types/ApiResponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ export interface PrivateProfile extends PublicProfile {
state: string,
credits: number,
resumes?: PublicResume[],
onboardingSeen: boolean,
}

export interface PublicFeedback {
Expand Down
Loading