-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflows): add review endpoint (#28)
* feat: add review endpoint Signed-off-by: ShikharBhatt <shikhar.bhatt@impactility.com> * Revert "feat: add review endpoint" This reverts commit e93196d. * feat: add review endpoint Signed-off-by: ShikharBhatt <shikhar.bhatt@impactility.com> * fix: e2e tests Signed-off-by: ShikharBhatt <shikhar.bhatt@impactility.com> * refactor: OnlyRedirect is duplicate of RedirectUrl Signed-off-by: John Henderson <jrhender@users.noreply.github.com> --------- Signed-off-by: ShikharBhatt <shikhar.bhatt@impactility.com> Signed-off-by: John Henderson <jrhender@users.noreply.github.com> Co-authored-by: John Henderson <jrhender@users.noreply.github.com>
- Loading branch information
1 parent
4db0c92
commit 1f9e199
Showing
7 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
apps/vc-api/src/vc-api/workflows/dtos/submission-review.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,32 @@ | ||
/* | ||
* Copyright 2021 - 2023 Energy Web Foundation | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { Type } from 'class-transformer'; | ||
import { IsEnum, IsOptional, ValidateNested } from 'class-validator'; | ||
import { VerifiablePresentationDto } from '../../credentials/dtos/verifiable-presentation.dto'; | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
|
||
export enum ReviewResult { | ||
approved = 'approved', | ||
rejected = 'rejected' | ||
} | ||
|
||
export class SubmissionReviewDto { | ||
@IsEnum(ReviewResult) | ||
@ApiProperty({ | ||
description: 'The judgement made by the reviewer', | ||
enum: ReviewResult, | ||
enumName: 'ReviewResult' | ||
}) | ||
result: ReviewResult; | ||
|
||
@ValidateNested() | ||
@IsOptional() | ||
@Type(() => VerifiablePresentationDto) | ||
@ApiPropertyOptional({ | ||
description: 'A reviewer may want to include credentials (wrapped in a VP) to the holder' | ||
}) | ||
vp?: VerifiablePresentationDto; | ||
} |
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