Skip to content

Commit 97a2b7e

Browse files
committed
feat/updated connection for credentials with connection table
Signed-off-by: Sujit <[email protected]>
1 parent cb2a713 commit 97a2b7e

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

apps/issuance/src/issuance.repository.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ export class IssuanceRepository {
121121
schemaId: string;
122122
state: string;
123123
orgId: string;
124+
connections: {
125+
theirLabel: string;
126+
};
124127
}[];
125128
}> {
126129
try {
@@ -144,7 +147,12 @@ export class IssuanceRepository {
144147
orgId: true,
145148
state: true,
146149
schemaId: true,
147-
connectionId: true
150+
connectionId: true,
151+
connections: {
152+
select: {
153+
theirLabel: true
154+
}
155+
}
148156
},
149157
orderBy: {
150158
[issuedCredentialsSearchCriteria?.sortField]:

libs/common/src/response-messages/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const ResponseMessages = {
7979
updateUserRoles: 'User roles updated successfully',
8080
delete: 'Organization deleted successfully',
8181
orgInvitationDeleted: 'Organization invitation deleted successfully',
82-
orgCredentials: 'Organization credentials created successfully',
82+
orgCredentials: 'Client credentials created successfully',
8383
fetchedOrgCredentials: 'Organization credentials fetched successfully',
8484
clientCredentials: 'Client credentials fetched successfully',
8585
deleteCredentials: 'Organization client credentials deleted',
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AddForeignKey
2+
ALTER TABLE "credentials" ADD CONSTRAINT "credentials_connectionId_fkey" FOREIGN KEY ("connectionId") REFERENCES "connections"("connectionId") ON DELETE SET NULL ON UPDATE CASCADE;

libs/prisma-service/prisma/schema.prisma

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ model connections {
326326
orgId String? @db.Uuid
327327
organisation organisation? @relation(fields: [orgId], references: [id])
328328
presentations presentations[]
329+
credentials credentials[]
329330
}
330331

331332
model credentials {
@@ -342,6 +343,7 @@ model credentials {
342343
credDefId String @default("")
343344
orgId String? @db.Uuid
344345
organisation organisation? @relation(fields: [orgId], references: [id])
346+
connections connections? @relation(fields: [connectionId], references: [connectionId])
345347
}
346348

347349
model presentations {
@@ -530,4 +532,4 @@ model client_aliases {
530532
lastChangedDateTime DateTime @default(now()) @db.Timestamptz(6)
531533
clientAlias String?
532534
clientUrl String
533-
}
535+
}

0 commit comments

Comments
 (0)