src/user/dtos/response/get-users.dto.ts
DTO for paginated response of user data.
Properties |
| data |
Type : T[]
|
Decorators :
@ApiProperty({description: 'The data property contains the paginated data', type: 'array', items: undefined})
|
|
Inherited from
PaginationResponseDto
|
|
Defined in
PaginationResponseDto:69
|
|
The data property contains the paginated data. |
| links |
Type : literal type
|
Decorators :
@ApiProperty({description: 'The links property contains information about the pagination links', type: 'object', properties: undefined})
|
|
Inherited from
PaginationResponseDto
|
|
Defined in
PaginationResponseDto:110
|
|
The links property contains information about the pagination links. |
| meta |
Type : literal type
|
Decorators :
@ApiProperty({description: 'The meta property contains information about the pagination', type: 'object', properties: undefined})
|
|
Inherited from
PaginationResponseDto
|
|
Defined in
PaginationResponseDto:86
|
|
The meta property contains information about the pagination. |
| paginated |
|
Inherited from
PaginationResponseDto
|
|
Defined in
PaginationResponseDto:57
|
|
The paginated property indicates whether the data is paginated or not. this is not a part of the response |
import { ApiProperty } from '@nestjs/swagger';
import { PaginationResponseDto } from 'src/common/pagination/dtos/pagination.dto';
/**
* DTO for returning user data.
* @class GetUsersResponseDto
* @description Data Transfer Object for user information returned in API responses.
* @property {number} id - Unique identifier for the user.
* @property {string} firstName - First name of the user.
* @property {string} lastName - Last name of the user.
* @property {string} email - Email address of the user.
* @property {Date} createdAt - Timestamp when the user was created.
* @property {Date} updateAt - Timestamp when the user was last updated.
* @property {Date} deletedAt - Timestamp when the user was deleted.
* @property {boolean} hasSubscription - Indicates if the user has an active subscription.
*/
export class GetUsersDto {
/**
* Unique identifier for the user
* @type {number}
*/
@ApiProperty({ description: 'Unique identifier for the user' })
id: number;
/**
* First name of the user
* @type {string}
*/
@ApiProperty({
description: 'First name of the user',
type: 'string',
nullable: true,
})
firstName: string | null;
/**
* Last name of the user
* @type {string}
*/
@ApiProperty({
description: 'Last name of the user',
type: 'string',
nullable: true,
})
lastName: string | null;
/**
* Email address of the user
* @type {string}
*/
@ApiProperty({ description: 'Email address of the user' })
email: string;
/**
* Avatar URL of the user
* @type {string | null}
*/
@ApiProperty({
description: 'Avatar URL of the user',
type: String,
nullable: true,
})
avatarUrl: string | null;
/**
* Timestamp when the user was created
* @type {Date}
*/
@ApiProperty({
description: 'Timestamp when the user was created',
type: Date,
})
createdAt: Date;
/**
* Timestamp when the user was last updated
* @type {Date | null}
*/
@ApiProperty({
description: 'Timestamp when the user was last updated',
type: Date,
nullable: true,
})
updateAt: Date | null;
/**
* Indicates if the user has an active subscription
* @type {boolean}
*/
@ApiProperty({
description: 'Indicates if the user has an active subscription',
})
hasSubscription: boolean;
}
/**
* DTO for paginated response of user data.
* @class GetUsersResponseDto
* @description Data Transfer Object for paginated user information returned in API responses.
* @extends PaginationResponseDto<GetUsersDto>
*/
export class GetUsersResponseDto extends PaginationResponseDto<GetUsersDto> {}