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 swagger response body for user #67 #135

Closed
wants to merge 1 commit into from
Closed
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
52 changes: 50 additions & 2 deletions src/modules/user/docUtils/user.responsedoc.ts
Original file line number Diff line number Diff line change
@@ -1,93 +1,118 @@
import { ApiProperty } from '@nestjs/swagger';

export default class UserResponseBody {
/**
* UserId
* @example 60ccf3037025096f45cb87bf
*/
@ApiProperty({ example: '60ccf3037025096f45cb87bf' })
id: string;

/**
* First name of the user
* @example 'John'
*/
@ApiProperty({ example: 'John' })
first_name: string;

/**
* Last name of the user
* @example 'Doe'
*/
@ApiProperty({ example: 'Doe' })
last_name: string;

/**
* Email of the user
* @example '[email protected]'
*/
@ApiProperty({ example: '[email protected]' })
email: string;

/**
* Phone number of the user
* @example '9000500000'
*/
@ApiProperty({ example: '9000500000' })
phone: string;

/**
* Address of the user
* @example 'Block C Amsterdam'
*/
@ApiProperty({ example: 'Block C Amsterdam' })
address: string;

/**
* Description of the user
* @example 'Aspiring Software Developer'
*/
@ApiProperty({ example: 'Aspiring Software Developer' })
description: string;

/**
* Score of the user
* @example 100
*/
@ApiProperty({ example: '100' })
score: number;

/**
* The field to show the role
* @example "student"
* @default "student"
* @example 'student'
* @default 'student'
*/
@ApiProperty({ example: 'student' })
role: string;

/**
* The photo url
* @example 'https://g.gle/mypic.jpeg'
*/
@ApiProperty({ example: 'https://g.gle/mypic.jpeg' })
photoUrl: string;

/**
* The cover photo url
* @example 'https://g.gle/mycover.jpeg'
*/
@ApiProperty({ example: 'https://g.gle/mycover.jpeg' })
coverPhotoUrl?: string;

/**
* The Wishlisted Courses
* @example ["60ccf3037025096f45cb87ba", "60ccf3037025096f45cb87bq"]
*/
@ApiProperty({
example: ['60ccf3037025096f45cb87ba', '60ccf3037025096f45cb87bq'],
})
wishlist: string[];

/**
* The Courses added to Cart
* @example ["60ccf3037025096f45cb87ba", "60ccf3037025096f45cb87bq"]
*/
@ApiProperty({
example: ['60ccf3037025096f45cb87ba', '60ccf3037025096f45cb87bq'],
})
cartList: string[];

/**
* The Firebase Id
* @example "60ccf3037025096f45cb87ba"
*/
@ApiProperty({
example: '60ccf3037025096f45cb87ba',
})
fId: string;

/**
* Login Time
* @example "Wed Aug 18 2021 00:13:13 GMT+0530 (India Standard Time)"
*/
@ApiProperty({
example: 'Wed Aug 18 2021 00:13:13 GMT+0530 (India Standard Time)',
})
log_in_time: string;
}

Expand All @@ -101,36 +126,46 @@ export class EnrolledCourseResponseBody {
* Student Id
* @example "6079cf782f9a2181bc7aadbf"
*/
@ApiProperty({ example: '60ccf3037025096f45cb87bf' })
studentId: string;

/**
* videos watched by the student
* @example [false, false]
*/
@ApiProperty({ example: [false, false] })
videosWatched: boolean[];

/**
* The assignments done by the student
* @example [false, false]
*/
@ApiProperty({ example: [false, false] })
assignmentsDone: boolean[];

/**
* The current video where student left
* @example { num: 1, timestamp: "12:PM" }
*/
@ApiProperty({ example: { num: 1, timestamp: '12:PM' } })
currentVideo: video[];

/**
* The doubts of the student
* @example ['problem in BFS', 'unable to understand Dynamic Programming']
*/
@ApiProperty({
example: ['problem in BFS', 'unable to understand Dynamic Programming'],
})
doubts: string[];

/**
* Course Id
* @example "60ccf06ad682336931f0a61b"
*/
@ApiProperty({
example: '60ccf06ad682336931f0a61b',
})
courseId: string;
}

Expand All @@ -139,23 +174,36 @@ export class getAllGamifiedResponseBody {
* First name of the user
* @example 'John'
*/
@ApiProperty({
example: 'John',
})
first_name: string;

/**
* Last name of the user
* @example 'Doe'
*/
@ApiProperty({
example: 'Doe',
})
last_name: string;

/**
* Score of the user
* @example 100
*/
@ApiProperty({
example: '100',
})
score: number;

/**
* The photo url
* @example 'https://cdn.pixabay.com/photo/2015/03/04/22/35/head-659652_1280.png'
*/
@ApiProperty({
example:
'https://cdn.pixabay.com/photo/2015/03/04/22/35/head-659652_1280.png',
})
photoUrl: string;
}