251223:1649 On going update to 1.7.0: Refoctory drawing Module & document number Module
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-23 16:49:16 +07:00
parent 0d6432ab83
commit 7db6a003db
81 changed files with 4703 additions and 1449 deletions
@@ -14,6 +14,7 @@ import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
import { JwtAuthGuard } from '../../../common/guards/jwt-auth.guard';
import { RbacGuard } from '../../../common/guards/rbac.guard';
import { RequirePermission } from '../../../common/decorators/require-permission.decorator';
import { CurrentUser } from '../../../common/decorators/current-user.decorator';
@ApiTags('Admin / Document Numbering')
@ApiBearerAuth()
@@ -73,8 +74,8 @@ export class DocumentNumberingAdminController {
summary: 'Manually override or set a document number counter',
})
@RequirePermission('system.manage_settings')
async manualOverride(@Body() dto: any) {
return this.service.manualOverride(dto);
async manualOverride(@Body() dto: any, @CurrentUser() user: any) {
return this.service.manualOverride(dto, user.userId);
}
@Post('void-and-replace')
@@ -90,8 +90,8 @@ export class DocumentNumberingController {
async previewNumber(@Body() dto: PreviewNumberDto) {
return this.numberingService.previewNumber({
projectId: dto.projectId,
originatorOrganizationId: dto.originatorOrganizationId,
typeId: dto.correspondenceTypeId,
originatorOrganizationId: dto.originatorId,
typeId: dto.typeId,
subTypeId: dto.subTypeId,
rfaTypeId: dto.rfaTypeId,
disciplineId: dto.disciplineId,
@@ -0,0 +1,25 @@
import { Controller, Get, UseGuards } from '@nestjs/common';
import { MetricsService } from '../services/metrics.service';
// import { PermissionGuard } from '../../auth/guards/permission.guard';
// import { Permissions } from '../../auth/decorators/permissions.decorator';
@Controller('admin/document-numbering/metrics')
// @UseGuards(PermissionGuard)
export class NumberingMetricsController {
constructor(private readonly metricsService: MetricsService) {}
@Get()
// @Permissions('system.view_logs')
async getMetrics() {
// Determine how to return metrics.
// Standard Prometheus metrics are usually exposed via a separate /metrics endpoint processing all metrics.
// If the frontend needs JSON data, we might need to query the current values from the registry or metrics service.
// For now, returning a simple status or aggregated view if supported by MetricsService,
// otherwise this might be a placeholder for a custom dashboard API.
return {
status: 'Metrics are being collected',
// TODO: Implement custom JSON export of metric values if needed for custom dashboard
};
}
}