Skip to content

Commit

Permalink
refactor: enum type for delete connection (#783)
Browse files Browse the repository at this point in the history
* feat: delete connection records

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

* refactor: enum changes

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

---------

Signed-off-by: bhavanakarwade <[email protected]>
Signed-off-by: KulkarniShashank <[email protected]>
  • Loading branch information
bhavanakarwade authored and KulkarniShashank committed Sep 11, 2024
1 parent 9fba46a commit 83fefe7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/connection/src/connection.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { agent_invitations, org_agents, platform_config, shortening_url } from '
import { IConnectionSearchCriteria, ICreateConnection, OrgAgent } from './interfaces/connection.interfaces';
import { IUserRequest } from '@credebl/user-request/user-request.interface';
import { IConnectionsListCount, IDeletedConnectionsRecord } from '@credebl/common/interfaces/connection.interface';
import { SortValue } from '@credebl/enum/enum';
import { PrismaTables, SortValue } from '@credebl/enum/enum';
// import { OrgAgent } from './interfaces/connection.interfaces';
@Injectable()
export class ConnectionRepository {
Expand Down Expand Up @@ -318,7 +318,7 @@ export class ConnectionRepository {
}

async deleteConnectionRecordsByOrgId(orgId: string): Promise<IDeletedConnectionsRecord> {
const tablesToCheck = ['credentials', 'presentations'];
const tablesToCheck = [`${PrismaTables.CREDENTIALS}`, `${PrismaTables.PRESENTATIONS}`];

try {
return await this.prisma.$transaction(async (prisma) => {
Expand Down
5 changes: 5 additions & 0 deletions libs/enum/src/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ export enum PromiseResult {
FULFILLED = 'fulfilled'
}

export enum PrismaTables {
PRESENTATIONS = 'presentations',
CREDENTIALS = 'credentials',
}

export enum VerificationProcessState {
PROPOSAL_SENT = 'proposal-sent',
PROPOSAL_RECEIVED = 'proposal-received',
Expand Down

0 comments on commit 83fefe7

Please sign in to comment.