ef20839f99
Phase 1-2: Setup, SQL schema, enums, queue constants, base entities
Phase 3 (US1): ReviewTeam, ReviewTeamMember, ReviewTask, TaskCreationService
Phase 4 (US2): ResponseCode, ResponseCodeRule, ImplicationsService, NotificationTriggerService
Phase 5 (US3): Delegation entity, CircularDetectionService, DelegationService/Controller/Module
Phase 6 (US4): ReminderRule, SchedulerService, EscalationService, ReminderProcessor, ReminderModule
Phase 7 (US5): DistributionMatrix, DistributionRecipient, ApprovalListenerService (Strangler),
TransmittalCreatorService, DistributionProcessor, DistributionModule
Phase 8 (US6): MatrixManagementService, InheritanceService (global→project override)
Phase 9 (Polish): AggregateStatusService, ConsensusService, VetoOverrideService,
ParallelGatewayHandler, review-validators, optimistic locking in completeReview,
test stubs (unit/integration/e2e), jest.config.js updated for tests/ directory
Frontend: ReviewTaskInbox, ParallelProgress, VetoOverrideDialog, DelegationForm,
DelegatedBadge, MatrixEditor, ProjectOverrideManager, DistributionStatus,
ReminderHistory, ResponseCodeSelector, CodeImplications, CompleteReviewForm,
ReviewTeamForm, ReviewTeamSelector, TeamMemberManager
Closes #1
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
// File: src/modules/distribution/distribution.controller.ts
|
|
// Admin endpoints สำหรับจัดการ Distribution Matrix (T058)
|
|
import { Controller, Get, Post, Delete, Body, Param, Query, UseGuards } from '@nestjs/common';
|
|
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
|
|
import { DistributionMatrixService } from './distribution-matrix.service';
|
|
|
|
class CreateMatrixDto {
|
|
projectId!: number;
|
|
documentTypeCode!: string;
|
|
responseCodeFilter?: string[];
|
|
}
|
|
|
|
class AddRecipientDto {
|
|
recipientType!: string;
|
|
recipientId?: number;
|
|
roleCode?: string;
|
|
deliveryMethod?: string;
|
|
isCc?: boolean;
|
|
}
|
|
|
|
@Controller('admin/distribution-matrices')
|
|
@UseGuards(JwtAuthGuard)
|
|
export class DistributionController {
|
|
constructor(private readonly matrixService: DistributionMatrixService) {}
|
|
|
|
@Get()
|
|
findByProject(@Query('projectId') projectId: string) {
|
|
return this.matrixService.findByProject(parseInt(projectId, 10));
|
|
}
|
|
|
|
@Post()
|
|
create(@Body() dto: CreateMatrixDto) {
|
|
return this.matrixService.create(dto);
|
|
}
|
|
|
|
@Post(':publicId/recipients')
|
|
addRecipient(@Param('publicId') publicId: string, @Body() dto: AddRecipientDto) {
|
|
return this.matrixService.addRecipient(publicId, dto);
|
|
}
|
|
|
|
@Delete(':publicId/recipients/:recipientPublicId')
|
|
removeRecipient(@Param('recipientPublicId') recipientPublicId: string) {
|
|
return this.matrixService.removeRecipient(recipientPublicId);
|
|
}
|
|
|
|
@Delete(':publicId')
|
|
remove(@Param('publicId') publicId: string) {
|
|
return this.matrixService.remove(publicId);
|
|
}
|
|
}
|