-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get endorsement transactions (#131)
* worked on the GET API for endorsement transactions Signed-off-by: Nishad <[email protected]> * Implemented type parameter in the GET API of endorser transactions Signed-off-by: Nishad <[email protected]> --------- Signed-off-by: Nishad <[email protected]> Signed-off-by: KulkarniShashank <[email protected]>
- Loading branch information
1 parent
24db899
commit 9e37c01
Showing
7 changed files
with
146 additions
and
8 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
apps/api-gateway/src/ecosystem/dtos/get-all-endorsements.dto.ts
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,35 @@ | ||
|
||
import { Transform, Type } from 'class-transformer'; | ||
import { toNumber } from '@credebl/common/cast.helper'; | ||
|
||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsEnum, IsOptional, IsString } from 'class-validator'; | ||
import { EndorserTransactionType } from '@credebl/enum/enum'; | ||
|
||
export class GetAllEndorsementsDto { | ||
@ApiProperty({ required: false, default: 1 }) | ||
@IsOptional() | ||
@Type(() => Number) | ||
@Transform(({ value }) => toNumber(value)) | ||
pageNumber = 1; | ||
|
||
@ApiProperty({ required: false }) | ||
@IsOptional() | ||
@IsString() | ||
@Type(() => String) | ||
search = ''; | ||
|
||
@ApiProperty({ required: false }) | ||
@IsOptional() | ||
@Type(() => Number) | ||
@Transform(({ value }) => toNumber(value)) | ||
pageSize = 10; | ||
|
||
@ApiProperty({ | ||
enum: [EndorserTransactionType.SCHEMA, EndorserTransactionType.CREDENTIAL_DEFINITION] | ||
}) | ||
@IsOptional() | ||
@IsEnum(EndorserTransactionType) | ||
type: EndorserTransactionType.SCHEMA | EndorserTransactionType.CREDENTIAL_DEFINITION; | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export interface GetEndorsementsPayload { | ||
ecosystemId: string; | ||
orgId: string; | ||
status: string; | ||
pageNumber: number; | ||
pageSize: number; | ||
search: string; | ||
type: string; | ||
} |
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
7 changes: 7 additions & 0 deletions
7
...isma-service/prisma/migrations/20231007125030_endorse_transaction_type_date/migration.sql
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,7 @@ | ||
-- AlterTable | ||
ALTER TABLE "endorsement_transaction" ADD COLUMN "createDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
ADD COLUMN "createdBy" INTEGER NOT NULL DEFAULT 1, | ||
ADD COLUMN "deletedAt" TIMESTAMP(6), | ||
ADD COLUMN "lastChangedBy" INTEGER NOT NULL DEFAULT 1, | ||
ADD COLUMN "lastChangedDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
ADD COLUMN "type" TEXT; |
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