Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,25 @@ import { SortValue } from '../../enum';
import { Transform, Type } from 'class-transformer';
import { IsOptional, Max, Min } from 'class-validator';
import { toNumber } from '@credebl/common/cast.helper';
import { PaginationDto } from '@credebl/common/dtos/pagination.dto';

export class GetAllCredDefsDto {
@ApiProperty({ required: false, default: 1 })
@IsOptional()
@Transform(({ value }) => toNumber(value))
pageNumber: number = 1;
export class GetAllCredDefsDto extends PaginationDto{

@ApiProperty({ required: false, example: 'id' })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the formatting here

@IsOptional()
sorting: string = 'id';

@ApiProperty({ required: false })
@IsOptional()
@Type(() => String)
searchByText: string = '';
@ApiProperty({
enum: [SortValue.DESC, SortValue.ASC],
required: false,
example: SortValue.DESC,
})
@IsOptional()
@IsEnum(SortValue)
sortByValue: string = SortValue.DESC;

@ApiProperty({ required: false, default: 10 })
@IsOptional()
@Transform(({ value }) => toNumber(value))
@Min(1, { message: 'Page size must be greater than 0' })
@Max(100, { message: 'Page size must be less than 100' })
pageSize: number = 10;

@ApiProperty({ required: false })
@IsOptional()
sorting: string = 'id';

@ApiProperty({ required: false })
@IsOptional()
sortByValue: string = SortValue.DESC;

@ApiProperty({ required: false })
@IsOptional()
revocable: boolean = true;
@ApiProperty({ required: false, example: true })
@IsOptional()
revocable: boolean = true;
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface IConnectionSearchCriteria {
pageSize: number;
sortField: string;
sortBy: string;
searchByText: string;
search: string;
user?: IUserRequestInterface;
}

Expand Down
39 changes: 7 additions & 32 deletions apps/api-gateway/src/issuance/dtos/issuance.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { Transform, Type } from 'class-transformer';

import { SortFields } from 'apps/connection/src/enum/connection.enum';
import { trim } from '@credebl/common/cast.helper';
import { PaginationDto } from '@credebl/common/dtos/pagination.dto';

class Issuer {
@ApiProperty()
Expand Down Expand Up @@ -492,33 +493,13 @@ export class OOBCredentialDtoWithEmail {
orgId: string;
}

export class PreviewFileDetails {
@ApiProperty({ required: false, example: '1' })
@IsOptional()
pageNumber: number = 1;

@ApiProperty({ required: false, example: '10' })
@IsOptional()
pageSize: number = 10;

@ApiProperty({ required: false })
@IsOptional()
@Transform(({ value }) => trim(value))
@Type(() => String)
searchByText: string = '';
export class PreviewFileDetails extends PaginationDto {

}

export class FileParameter {
@ApiProperty({ required: false, example: '10' })
@IsOptional()
pageSize: number = 10;

@ApiProperty({ required: false, example: '1' })
@IsOptional()
pageNumber: number = 1;

@ApiProperty({
required: false
export class FileParameter extends PaginationDto {
@ApiProperty({
required: false,
})
@Transform(({ value }) => trim(value))
@IsOptional()
Expand All @@ -527,18 +508,12 @@ export class FileParameter {

@ApiProperty({
enum: [SortValue.DESC, SortValue.ASC],
required: false
required: false,
})
@Transform(({ value }) => trim(value))
@IsOptional()
@IsEnum(SortValue)
sortBy: string = SortValue.DESC;

@ApiProperty({ required: false })
@IsOptional()
@Transform(({ value }) => trim(value))
@Type(() => String)
searchByText: string = '';
}

export class ClientDetails {
Expand Down
4 changes: 2 additions & 2 deletions apps/api-gateway/src/schema/schema.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ export class SchemaController {
@User() user: IUserRequestInterface
): Promise<Response> {

const { pageSize, searchByText, pageNumber, sortField, sortBy } = getAllSchemaDto;
const { pageSize, search, pageNumber, sortField, sortBy } = getAllSchemaDto;
const schemaSearchCriteria: ISchemaSearchPayload = {
pageNumber,
searchByText,
search,
pageSize,
sortField,
sortBy
Expand Down
6 changes: 3 additions & 3 deletions apps/api-gateway/src/webhook/dtos/get-webhoook-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { trim } from '@credebl/common/cast.helper';
@ApiExtraModels()
export class GetWebhookDto {

@ApiPropertyOptional({example: '2a041d6e-d24c-4ed9-b011-1cfc371a8b8e'})
@IsOptional()
@ApiProperty({example: '2a041d6e-d24c-4ed9-b011-1cfc371a8b8e'})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a optional property

@Transform(({ value }) => trim(value))
@IsNotEmpty({ message: 'Please provide the valid orgID' })
@IsString({ message: 'Organization id must be in string format.' })
orgId?: string;
orgId: string;

@ApiPropertyOptional({example: '3a041d6e-d24c-4ed9-b011-1cfc371a8b8e'})
@IsOptional()
Expand Down
2 changes: 1 addition & 1 deletion apps/connection/src/interfaces/connection.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export interface IConnectionSearchCriteria {
pageSize: number;
sortField: string;
sortBy: string;
searchByText: string;
search: string;
user: IUserRequestInterface
}

Expand Down
1 change: 1 addition & 0 deletions platform
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this submodule?

Submodule platform added at ea4d5f