|
1 | 1 | /* eslint-disable prefer-destructuring */ |
2 | 2 | /* eslint-disable camelcase */ |
3 | 3 |
|
4 | | -import { ConflictException, Injectable, Logger, NotFoundException, InternalServerErrorException } from '@nestjs/common'; |
5 | | -// eslint-disable-next-line camelcase |
| 4 | +import { ConflictException, Injectable, InternalServerErrorException, Logger, NotFoundException } from '@nestjs/common'; |
6 | 5 | import { |
7 | | - Prisma, |
8 | | - agent_invitations, |
9 | | - org_agents, |
10 | | - org_invitations, |
11 | | - user, |
12 | | - user_org_roles, |
13 | | - organisation, |
14 | | - org_roles |
15 | | -} from '@prisma/client'; |
16 | | - |
17 | | -import { CreateOrganizationDto } from '../dtos/create-organization.dto'; |
| 6 | + IDeleteOrganization, |
| 7 | + IOrganization, |
| 8 | + IOrganizationDashboard, |
| 9 | + IOrganizationInvitations |
| 10 | +} from '@credebl/common/interfaces/organization.interface'; |
18 | 11 | import { |
19 | | - IGetDids, |
20 | 12 | IDidDetails, |
21 | 13 | IDidList, |
| 14 | + IGetDids, |
22 | 15 | IGetOrgById, |
23 | 16 | IGetOrganization, |
24 | | - IPrimaryDidDetails, |
25 | | - IUpdateOrganization, |
26 | | - ILedgerNameSpace, |
27 | | - OrgInvitation, |
28 | 17 | ILedgerDetails, |
| 18 | + ILedgerNameSpace, |
| 19 | + IOrgDetails, |
29 | 20 | IOrgRoleDetails, |
30 | | - IOrgDetails |
| 21 | + IPrimaryDidDetails, |
| 22 | + IUpdateOrganization, |
| 23 | + OrgInvitation |
31 | 24 | } from '../interfaces/organization.interface'; |
32 | 25 | import { Invitation, PrismaTables, SortValue } from '@credebl/enum/enum'; |
33 | | -import { PrismaService } from '@credebl/prisma-service'; |
34 | | -import { UserOrgRolesService } from '@credebl/user-org-roles'; |
35 | | -import { ResponseMessages } from '@credebl/common/response-messages'; |
| 26 | +// eslint-disable-next-line camelcase |
36 | 27 | import { |
37 | | - IOrganizationInvitations, |
38 | | - IOrganization, |
39 | | - IOrganizationDashboard, |
40 | | - IDeleteOrganization |
41 | | -} from '@credebl/common/interfaces/organization.interface'; |
| 28 | + Prisma, |
| 29 | + agent_invitations, |
| 30 | + org_agents, |
| 31 | + org_invitations, |
| 32 | + org_roles, |
| 33 | + organisation, |
| 34 | + user, |
| 35 | + user_org_roles |
| 36 | +} from '@prisma/client'; |
| 37 | + |
| 38 | +import { CreateOrganizationDto } from '../dtos/create-organization.dto'; |
42 | 39 | import { IOrgRoles } from 'libs/org-roles/interfaces/org-roles.interface'; |
| 40 | +import { PrismaService } from '@credebl/prisma-service'; |
| 41 | +import { ResponseMessages } from '@credebl/common/response-messages'; |
| 42 | +import { UserOrgRolesService } from '@credebl/user-org-roles'; |
43 | 43 |
|
44 | 44 | @Injectable() |
45 | 45 | export class OrganizationRepository { |
@@ -479,6 +479,13 @@ export class OrganizationRepository { |
479 | 479 | createDateTime: true, |
480 | 480 | tenantId: true, |
481 | 481 | agent_invitations: { |
| 482 | + where: { |
| 483 | + multiUse: true |
| 484 | + }, |
| 485 | + orderBy: { |
| 486 | + lastChangedDateTime: SortValue.DESC |
| 487 | + }, |
| 488 | + take: 1, |
482 | 489 | select: { |
483 | 490 | id: true, |
484 | 491 | connectionInvitation: true, |
|
0 commit comments