improvement: added a history action button to connected orgs row inordr to see a brief report of the relevant cases between two orgs and the status of each related task.

This commit is contained in:
2026-06-28 23:19:33 +03:30
parent 2a48946a51
commit 3e81c110a3
11 changed files with 739 additions and 15 deletions

View File

@@ -18,6 +18,7 @@ import { InviteOrganizationDto } from './dto/invite-organization.dto';
import { PreviewOrganizationInviteDto } from './dto/preview-organization-invite.dto';
import { RespondConnectionRequestDto } from './dto/respond-connection-request.dto';
import { OrganizationService } from './organization.service';
import { ListLabCasesDto } from '../cases/dto/cases.dto';
/**
* Counterpart orgs (clinic↔lab).
@@ -121,6 +122,40 @@ export class OrganizationController {
return this.organizationService.deleteConnection(req.user.id, organizationId, connectionId);
}
@Get('connections/:connectionId/cases')
@UseGuards(JwtAuthGuard)
@ApiOperation({ summary: 'List cases exchanged with a connected organization' })
listConnectionCases(
@Req() req: { user: { id: string; organizationId?: string } },
@Param('connectionId') connectionId: string,
@Query() query: ListLabCasesDto,
) {
const organizationId = this.organizationService.getOrganizationIdFromUser(req.user);
return this.organizationService.listConnectionCases(
req.user.id,
organizationId,
connectionId,
query,
);
}
@Get('connections/:connectionId/cases/:caseId')
@UseGuards(JwtAuthGuard)
@ApiOperation({ summary: 'Get one case exchanged with a connected organization' })
getConnectionCase(
@Req() req: { user: { id: string; organizationId?: string } },
@Param('connectionId') connectionId: string,
@Param('caseId') caseId: string,
) {
const organizationId = this.organizationService.getOrganizationIdFromUser(req.user);
return this.organizationService.getConnectionCase(
req.user.id,
organizationId,
connectionId,
caseId,
);
}
@Post('invitations/:invitationId/link')
@UseGuards(JwtAuthGuard)
@ApiOperation({ summary: 'Get a shareable invite link for a pending invitation' })