Skip to content

Commit

Permalink
merge: develop to qa (17-07-2024) (#833)
Browse files Browse the repository at this point in the history
* fix: create organisation changes and added geo-location attribute in response

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: send email verification issue (#823)

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: bulk issuance template list response changes (#824)

* refactor: updated schema response for get API

Signed-off-by: tipusinghaw <[email protected]>

* fix: schema already exist logic

Signed-off-by: tipusinghaw <[email protected]>

* fix: schema attribute while w3c schema creation

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* feat: batch bulk issunace (#826)

* feat: batch bulk issuance

Signed-off-by: tipusinghaw <[email protected]>

* stoped queue to remove issuance data

Signed-off-by: tipusinghaw <[email protected]>

* feat: added delay for 1 min

Signed-off-by: tipusinghaw <[email protected]>

* refactor: changed batch config

Signed-off-by: tipusinghaw <[email protected]>

* feat: changed delay time for batch

Signed-off-by: tipusinghaw <[email protected]>

* feat: added batch for retry

Signed-off-by: tipusinghaw <[email protected]>

* refactor: added common constant in libs

Signed-off-by: tipusinghaw <[email protected]>

* refactor: removed duplicate value from schema DTO

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* fix: constant issue for bulk issunace (#827)

* feat: batch bulk issuance

Signed-off-by: tipusinghaw <[email protected]>

* stoped queue to remove issuance data

Signed-off-by: tipusinghaw <[email protected]>

* feat: added delay for 1 min

Signed-off-by: tipusinghaw <[email protected]>

* refactor: changed batch config

Signed-off-by: tipusinghaw <[email protected]>

* feat: changed delay time for batch

Signed-off-by: tipusinghaw <[email protected]>

* feat: added batch for retry

Signed-off-by: tipusinghaw <[email protected]>

* refactor: added common constant in libs

Signed-off-by: tipusinghaw <[email protected]>

* refactor: removed duplicate value from schema DTO

Signed-off-by: tipusinghaw <[email protected]>

* fix: constent issue

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* refactor: schema endorsement flow (#828)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs (#829)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* feature:added schema details in file_upload data and fix minor changes

Signed-off-by: Ganesh Nawle <[email protected]>

* feature:added schema details in file_upload data,fix minor exception changes and resovle PR conflict

Signed-off-by: Ganesh Nawle <[email protected]>

* feat: added schema details in  table

Signed-off-by: Ganesh Nawle <[email protected]>

* refactor: endorsement flow for key and web method (#831)

* refactor: endorsement flow for key and web method

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: send email for issuance

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: prisma model issue and refactored file_upload model

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue (#835)

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: parameter and response related bugs (#837)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix:rollback statistics changes

Signed-off-by: Ganesh Nawle <[email protected]>

* Fix/bugs (#839)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue for verification process (#840)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made reuqest Id parameter optional (#841)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added temaplateId column in file_upload table (#842)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added templateId mapping in file upload functionality

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: interface types

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* feat: changed issuance email template for EDUCRED

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:refactored preview uploaded file api changed query Param to path param

Signed-off-by: Ganesh Nawle <[email protected]>

* added-logger statement

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:Minor fixes

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:removed all console logs

Signed-off-by: Ganesh Nawle <[email protected]>

* feat:refactored  api to add dynamic support to email template

Signed-off-by: Ganesh Nawle <[email protected]>

---------

Signed-off-by: Ganesh Nawle <[email protected]>
Signed-off-by: bhavanakarwade <[email protected]>
Signed-off-by: tipusinghaw <[email protected]>
Co-authored-by: Ganesh Nawle <[email protected]>
Co-authored-by: ganesh_nawle <[email protected]>
Co-authored-by: tipusinghaw <[email protected]>
Co-authored-by: shitrerohit <[email protected]>
Signed-off-by: KulkarniShashank <[email protected]>
  • Loading branch information
5 people authored and KulkarniShashank committed Sep 12, 2024
1 parent d0d0f83 commit 0952830
Show file tree
Hide file tree
Showing 23 changed files with 680 additions and 576 deletions.
1 change: 1 addition & 0 deletions apps/api-gateway/src/ecosystem/ecosystem.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { CreateEcosystemDto } from './dtos/create-ecosystem-dto';
import { PaginationDto } from '@credebl/common/dtos/pagination.dto';
import { IEcosystemInvitations, IEditEcosystem, IEndorsementTransaction } from 'apps/ecosystem/interfaces/ecosystem.interfaces';
import { AddOrganizationsDto } from './dtos/add-organizations.dto';
import { TrimStringParamPipe } from '@credebl/common/cast.helper';


@UseFilters(CustomExceptionFilter)
Expand Down
1 change: 1 addition & 0 deletions apps/api-gateway/src/ecosystem/ecosystem.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { IEcosystemDashboard, IEcosystemInvitation, IEcosystemInvitations, IEcos
import { PaginationDto } from '@credebl/common/dtos/pagination.dto';
import { IEcosystemDetails } from '@credebl/common/interfaces/ecosystem.interface';
import { AddOrganizationsDto } from './dtos/add-organizations.dto';
import { user } from '@prisma/client';

@Injectable()
export class EcosystemService extends BaseService {
Expand Down
63 changes: 9 additions & 54 deletions apps/api-gateway/src/issuance/dtos/issuance.dto.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import {
ArrayMaxSize,
ArrayMinSize,
IsArray,
IsBoolean,
IsDefined,
IsEmail,
IsEnum,
IsNotEmpty,
IsObject,
IsOptional,
IsString,
IsUrl,
MaxLength,
ValidateNested
} from 'class-validator';
import { ArrayMaxSize, ArrayMinSize, IsArray, IsBoolean, IsDefined, IsEmail, IsEnum, IsNotEmpty, IsObject, IsOptional, IsString, IsUrl, MaxLength, ValidateNested } from 'class-validator';
import { IsCredentialJsonLdContext, SingleOrArray } from '../utils/helper';
import {
IssueCredentialType,
Expand Down Expand Up @@ -509,17 +494,6 @@ export class OOBCredentialDtoWithEmail {
@IsOptional()
credentialType: IssueCredentialType;

@ApiPropertyOptional({ default: true })
@IsOptional()
@IsNotEmpty({ message: 'please provide valid value for isReuseConnection' })
@IsBoolean({ message: 'isReuseConnection must be a boolean' })
isReuseConnection?: boolean;

imageUrl?: string;

orgId: string;
}

export class PreviewFileDetails {
@ApiProperty({ required: false, example: '1' })
@IsOptional()
Expand Down Expand Up @@ -585,45 +559,26 @@ export class ClientDetails {
@Type(() => Boolean)
isSelectiveIssuance?: boolean = false;

userId?: string;
userId?: string;

@ApiPropertyOptional({ example: 'https://example.com/logo.png' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsUrl(
{
// eslint-disable-next-line camelcase
require_protocol: true,
// eslint-disable-next-line camelcase
@IsUrl({
// eslint-disable-next-line camelcase
require_protocol: true,
// eslint-disable-next-line camelcase
require_tld: true
},
{ message: 'brandLogoUrl should be a valid URL' }
)
{ message: 'brandLogoUrl should be a valid URL' })
organizationLogoUrl?: string;

@ApiPropertyOptional({ example: 'MyPlatform' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'platformName should be string' })
platformName?: string;

@ApiPropertyOptional()
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'Certificate should be string' })
certificate?: string;

@ApiPropertyOptional({ example: 'a4' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'Size should be string' })
size?: string;

@ApiPropertyOptional({ example: 'landscape' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'Orientation should be string' })
orientation?: string;

}

export class TemplateDetails {
Expand Down Expand Up @@ -652,7 +607,7 @@ export class CredentialQuery {
@IsString({ message: 'Cred def Id should be string' })
@IsNotEmpty({ message: 'Cred def Id is required' })
@Transform(({ value }) => trim(value))
credDefId?: string;
credDefId?: string;
}

export class TemplateQuery {
Expand Down
5 changes: 3 additions & 2 deletions apps/api-gateway/src/issuance/issuance.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {
Logger,
BadRequestException,
NotFoundException,
ParseUUIDPipe
ParseUUIDPipe,
Delete,
ValidationPipe
} from '@nestjs/common';
import {
ApiTags,
Expand Down Expand Up @@ -411,7 +413,6 @@ async downloadBulkIssuanceCSVTemplate(
@Param('orgId') orgId: string,
@User() user: user,
@Query(new ValidationPipe({ transform: true })) query: CredentialQuery,
@Res() res: Response,
@Body() fileDetails?: object,
@UploadedFile() file?: Express.Multer.File
): Promise<Response> {
Expand Down
4 changes: 2 additions & 2 deletions apps/api-gateway/src/issuance/issuance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ export class IssuanceService extends BaseService {
return this.sendNatsMessage(this.issuanceProxy, 'issue-bulk-credentials', payload);
}

async retryBulkCredential(fileId: string, orgId: string, clientDetails: ClientDetails): Promise<object> {
async retryBulkCredential(fileId: string, orgId: string, clientDetails: ClientDetails): Promise<{ response: object }> {
const payload = { fileId, orgId, clientDetails };
return this.sendNatsMessage(this.issuanceProxy, 'retry-bulk-credentials', payload);
return this.sendNats(this.issuanceProxy, 'retry-bulk-credentials', payload);
}

async _getWebhookUrl(tenantId?: string, orgId?: string): Promise<string> {
Expand Down
96 changes: 55 additions & 41 deletions apps/api-gateway/src/organization/dtos/create-organization-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,59 @@ export class CreateOrganizationDto {
@IsNotSQLInjection({ message: 'Organization name is required.' })
name: string;

@ApiProperty()
@Transform(({ value }) => trim(value))
@IsNotEmpty({ message: 'Organization name is required.' })
@MinLength(2, { message: 'Organization name must be at least 2 characters.' })
@MaxLength(50, { message: 'Organization name must be at most 50 characters.' })
@IsString({ message: 'Organization name must be in string format.' })
@IsNotSQLInjection({ message: 'Organization name is required.' })
name: string;

@ApiPropertyOptional()
@Transform(({ value }) => trim(value))
@IsNotEmpty({ message: 'Description is required.' })
@MinLength(2, { message: 'Description must be at least 2 characters.' })
@MaxLength(255, { message: 'Description must be at most 255 characters.' })
@IsString({ message: 'Description must be in string format.' })
description: string;

@ApiPropertyOptional()
@IsOptional()
@Transform(({ value }) => trim(value))
website?: string;

@ApiPropertyOptional()
@IsOptional()
@Transform(({ value }) => trim(value))
@IsNotEmpty({ message: 'notificationWebhook is required.' })
@IsString({ message: 'notificationWebhook must be in string format.' })
@IsUrl({
// eslint-disable-next-line camelcase
require_protocol: true, // require URL protocol (e.g., http:// or https://)
// eslint-disable-next-line camelcase
require_tld: true // require top-level domain (e.g., .com, .net)

})
notificationWebhook?: string;

@ApiPropertyOptional()
@IsOptional()
@Transform(({ value }) => trim(value))
@IsString({ message: 'logo must be in string format.' })
logo?: string = '';
@ApiProperty()
@Transform(({ value }) => trim(value))
@IsNotEmpty({ message: 'Description is required.' })
@MinLength(2, { message: 'Description must be at least 2 characters.' })
@MaxLength(255, { message: 'Description must be at most 255 characters.' })
@IsString({ message: 'Description must be in string format.' })
description: string;

@ApiPropertyOptional()
@IsOptional()
@Transform(({ value }) => trim(value))
website?: string;

@ApiPropertyOptional()
@IsOptional()
@Transform(({ value }) => trim(value))
@IsNotEmpty({ message: 'notificationWebhook is required.' })
@IsString({ message: 'notificationWebhook must be in string format.' })
@IsUrl({
// eslint-disable-next-line camelcase
require_protocol: true, // require URL protocol (e.g., http:// or https://)
// eslint-disable-next-line camelcase
require_tld: true // require top-level domain (e.g., .com, .net)
})
notificationWebhook?: string;

@ApiPropertyOptional()
@IsOptional()
@Transform(({ value }) => trim(value))
@IsString({ message: 'logo must be in string format.' })
logo?: string = '';

@ApiPropertyOptional()
@IsOptional()
@Transform(({ value }) => trim(value))
@IsString({ message: 'registrationNumber must be in string format.' })
registrationNumber?: string;

@ApiPropertyOptional({ example: 101 })
@IsOptional()
@IsNotEmpty({ message: 'country is required' })
@IsNumber({}, { message: 'countryId must be a number' })
countryId?: number;

@ApiPropertyOptional({ example: 4008 })
@IsOptional()
@IsNotEmpty({ message: 'state is required' })
@IsNumber({}, { message: 'stateId must be a number' })
stateId?: number;

@ApiPropertyOptional({ example: 1000 })
@IsOptional()
@IsNotEmpty({ message: 'city is required' })
@IsNumber({}, { message: 'cityId must be a number' })
cityId?: number;
}
69 changes: 69 additions & 0 deletions apps/ecosystem/interfaces/ecosystem.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,72 @@ export interface IEcosystemOrgDetails {
count: Prisma.BatchPayload;
ecosystemOrgs: IEcosystemOrgsData[];
}

export interface IEcosystemEndorsementFlag {
autoEndorsement: boolean;
}


interface IEcosystemRole {
id: string;
name: string;
description: string;
createDateTime: Date;
lastChangedDateTime: Date;
deletedAt: Date;
}

interface IEcosystemMemberOrgs extends IEcosystemOrgs{
id: string;
createDateTime: Date;
lastChangedDateTime: Date;
deletedAt: Date;
ecosystemRole: IEcosystemRole;
}

export interface IEcosystemData {
id: string;
name: string;
description: string;
tags: string;
createDateTime: Date;
createdBy: string;
lastChangedDateTime: Date;
lastChangedBy: string;
deletedAt: Date;
logoUrl: string;
autoEndorsement: boolean;
ledgers: Prisma.JsonValue;
ecosystemOrgs: IEcosystemMemberOrgs[];
}

interface IW3CAttributeValue {
attributeName: string;
schemaDataType: W3CSchemaDataType;
displayName: string;
isRequired: boolean;
}

export interface ISubmitIndySchema {
schemaVersion?: string;
schemaName: string;
attributes: IAttributeValue[];
orgId?: string;
orgDid?: string;
}
export interface ISubmitW3CSchema {
attributes: IW3CAttributeValue[];
schemaName: string;
description: string;
schemaType: JSONSchemaType;
}
export interface ISubmitSchemaEndorsement {
type: SchemaTypeEnum;
schemaPayload: ISubmitIndySchema | ISubmitW3CSchema;
}

export interface IschemaPayload {
schemaDetails: ISubmitSchemaEndorsement,
user: IUserRequestInterface,
orgId: string
}
6 changes: 4 additions & 2 deletions apps/ecosystem/src/ecosystem.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { AcceptRejectEcosystemInvitationDto } from '../dtos/accept-reject-ecosys
import { FetchInvitationsPayload } from '../interfaces/invitations.interface';
import { EcosystemMembersPayload } from '../interfaces/ecosystemMembers.interface';
import { GetEndorsementsPayload, ISchemasResponse } from '../interfaces/endorsements.interface';
import { IEcosystemDashboard, RequestCredDeffEndorsement, RequestSchemaEndorsement, IEcosystem, IEcosystemInvitation, IEcosystemInvitations, IEditEcosystem, IEndorsementTransaction, IEcosystemList, IEcosystemLeadOrgs } from '../interfaces/ecosystem.interfaces';
import { IEcosystemDetails } from '@credebl/common/interfaces/ecosystem.interface';
import { IEcosystemDashboard, RequestCredDeffEndorsement, IEcosystem, IEcosystemInvitation, IEcosystemInvitations, IEditEcosystem, IEndorsementTransaction, IEcosystemList, IEcosystemLeadOrgs, IRequestSchemaEndorsement } from '../interfaces/ecosystem.interfaces';
import { IEcosystemDataDeletionResults, IEcosystemDetails } from '@credebl/common/interfaces/ecosystem.interface';
import { user } from '@prisma/client';
import { IUserRequestInterface } from 'apps/ledger/src/credential-definition/interfaces';
// eslint-disable-next-line camelcase

@Controller()
Expand Down
Loading

0 comments on commit 0952830

Please sign in to comment.