-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add profile/info route handling via nestjs
- Loading branch information
1 parent
6259c7b
commit a4a9d3f
Showing
25 changed files
with
2,608 additions
and
511 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from './profile-course.dto'; | ||
export * from './update-user.dto'; | ||
export * from './update-profile.dto'; | ||
export * from './profile-info.dto'; | ||
export * from './update-profile-info.dto'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Type } from 'class-transformer'; | ||
import { IsBoolean, IsOptional } from 'class-validator'; | ||
|
||
export interface Permissions { | ||
isProfileVisible: boolean; | ||
isAboutVisible: boolean; | ||
isEducationVisible: boolean; | ||
isEnglishVisible: boolean; | ||
isEmailVisible: boolean; | ||
isTelegramVisible: boolean; | ||
isSkypeVisible: boolean; | ||
isWhatsAppVisible: boolean; | ||
isPhoneVisible: boolean; | ||
isContactsNotesVisible: boolean; | ||
isLinkedInVisible: boolean; | ||
isPublicFeedbackVisible: boolean; | ||
isMentorStatsVisible: boolean; | ||
isStudentStatsVisible: boolean; | ||
isStageInterviewFeedbackVisible: boolean; | ||
isCoreJsFeedbackVisible: boolean; | ||
isConsentsVisible: boolean; | ||
isExpellingReasonVisible: boolean; | ||
} | ||
|
||
class PublicVisibilitySettings { | ||
@ApiProperty() | ||
@IsBoolean() | ||
all: boolean; | ||
} | ||
|
||
class PartialStudentVisibilitySettings extends PublicVisibilitySettings { | ||
@ApiProperty() | ||
@IsBoolean() | ||
student: boolean; | ||
} | ||
|
||
class ContactsVisibilitySettings extends PublicVisibilitySettings { | ||
@ApiProperty() | ||
@IsBoolean() | ||
student: boolean; | ||
} | ||
|
||
class VisibilitySettings extends PublicVisibilitySettings { | ||
@ApiProperty() | ||
@IsBoolean() | ||
mentor: boolean; | ||
|
||
@ApiProperty() | ||
@IsBoolean() | ||
student: boolean; | ||
} | ||
|
||
export class ConfigurableProfilePermissions { | ||
@ApiProperty({ required: false, type: PublicVisibilitySettings }) | ||
@Type(() => PublicVisibilitySettings) | ||
@IsOptional() | ||
isProfileVisible?: PublicVisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: VisibilitySettings }) | ||
@Type(() => VisibilitySettings) | ||
@IsOptional() | ||
isAboutVisible?: VisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: VisibilitySettings }) | ||
@Type(() => VisibilitySettings) | ||
@IsOptional() | ||
isEducationVisible?: VisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: PartialStudentVisibilitySettings }) | ||
@Type(() => PartialStudentVisibilitySettings) | ||
@IsOptional() | ||
isEnglishVisible?: PartialStudentVisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: ContactsVisibilitySettings }) | ||
@Type(() => ContactsVisibilitySettings) | ||
@IsOptional() | ||
isEmailVisible?: ContactsVisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: ContactsVisibilitySettings }) | ||
@Type(() => ContactsVisibilitySettings) | ||
@IsOptional() | ||
isTelegramVisible?: ContactsVisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: ContactsVisibilitySettings }) | ||
@Type(() => ContactsVisibilitySettings) | ||
@IsOptional() | ||
isSkypeVisible?: ContactsVisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: ContactsVisibilitySettings }) | ||
@Type(() => ContactsVisibilitySettings) | ||
@IsOptional() | ||
isPhoneVisible?: ContactsVisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: ContactsVisibilitySettings }) | ||
@Type(() => ContactsVisibilitySettings) | ||
@IsOptional() | ||
isContactsNotesVisible?: ContactsVisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: VisibilitySettings }) | ||
@Type(() => VisibilitySettings) | ||
@IsOptional() | ||
isLinkedInVisible?: VisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: VisibilitySettings }) | ||
@Type(() => VisibilitySettings) | ||
@IsOptional() | ||
isPublicFeedbackVisible?: VisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: VisibilitySettings }) | ||
@Type(() => VisibilitySettings) | ||
@IsOptional() | ||
isMentorStatsVisible?: VisibilitySettings; | ||
|
||
@ApiProperty({ required: false, type: PartialStudentVisibilitySettings }) | ||
@Type(() => PartialStudentVisibilitySettings) | ||
@IsOptional() | ||
isStudentStatsVisible?: PartialStudentVisibilitySettings; | ||
} |
Oops, something went wrong.