251208:0010 Backend & Frontend Debug
This commit is contained in:
24
backend/src/modules/dashboard/dto/dashboard-stats.dto.ts
Normal file
24
backend/src/modules/dashboard/dto/dashboard-stats.dto.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// File: src/modules/dashboard/dto/dashboard-stats.dto.ts
|
||||
// บันทึกการแก้ไข: สร้างใหม่สำหรับ Dashboard Stats Response
|
||||
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
/**
|
||||
* DTO สำหรับ Response ของ Dashboard Statistics
|
||||
*/
|
||||
export class DashboardStatsDto {
|
||||
@ApiProperty({ description: 'จำนวนเอกสารทั้งหมด', example: 150 })
|
||||
totalDocuments!: number;
|
||||
|
||||
@ApiProperty({ description: 'จำนวนเอกสารเดือนนี้', example: 25 })
|
||||
documentsThisMonth!: number;
|
||||
|
||||
@ApiProperty({ description: 'จำนวนงานที่รออนุมัติ', example: 12 })
|
||||
pendingApprovals!: number;
|
||||
|
||||
@ApiProperty({ description: 'จำนวน RFA ทั้งหมด', example: 45 })
|
||||
totalRfas!: number;
|
||||
|
||||
@ApiProperty({ description: 'จำนวน Circulation ทั้งหมด', example: 30 })
|
||||
totalCirculations!: number;
|
||||
}
|
||||
42
backend/src/modules/dashboard/dto/get-activity.dto.ts
Normal file
42
backend/src/modules/dashboard/dto/get-activity.dto.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
// File: src/modules/dashboard/dto/get-activity.dto.ts
|
||||
// บันทึกการแก้ไข: สร้างใหม่สำหรับ Query params ของ Activity endpoint
|
||||
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsInt, IsOptional, Max, Min } from 'class-validator';
|
||||
|
||||
/**
|
||||
* DTO สำหรับ Query params ของ GET /dashboard/activity
|
||||
*/
|
||||
export class GetActivityDto {
|
||||
@ApiPropertyOptional({ description: 'จำนวนรายการที่ต้องการ', default: 10 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(50)
|
||||
limit?: number = 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* DTO สำหรับ Response ของ Activity Item
|
||||
*/
|
||||
export class ActivityItemDto {
|
||||
@ApiPropertyOptional({ description: 'Action ที่กระทำ' })
|
||||
action!: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'ประเภท Entity' })
|
||||
entityType?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'ID ของ Entity' })
|
||||
entityId?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'รายละเอียด' })
|
||||
details?: Record<string, unknown>;
|
||||
|
||||
@ApiPropertyOptional({ description: 'วันที่กระทำ' })
|
||||
createdAt!: Date;
|
||||
|
||||
@ApiPropertyOptional({ description: 'ชื่อผู้ใช้' })
|
||||
username?: string;
|
||||
}
|
||||
55
backend/src/modules/dashboard/dto/get-pending.dto.ts
Normal file
55
backend/src/modules/dashboard/dto/get-pending.dto.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
// File: src/modules/dashboard/dto/get-pending.dto.ts
|
||||
// บันทึกการแก้ไข: สร้างใหม่สำหรับ Query params ของ Pending endpoint
|
||||
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsInt, IsOptional, Max, Min } from 'class-validator';
|
||||
|
||||
/**
|
||||
* DTO สำหรับ Query params ของ GET /dashboard/pending
|
||||
*/
|
||||
export class GetPendingDto {
|
||||
@ApiPropertyOptional({ description: 'หน้าที่ต้องการ', default: 1 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
page?: number = 1;
|
||||
|
||||
@ApiPropertyOptional({ description: 'จำนวนรายการต่อหน้า', default: 10 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(50)
|
||||
limit?: number = 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* DTO สำหรับ Response ของ Pending Task Item
|
||||
*/
|
||||
export class PendingTaskItemDto {
|
||||
@ApiPropertyOptional({ description: 'Instance ID ของ Workflow' })
|
||||
instanceId!: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Workflow Code' })
|
||||
workflowCode!: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'State ปัจจุบัน' })
|
||||
currentState!: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'ประเภทเอกสาร' })
|
||||
entityType!: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'ID ของเอกสาร' })
|
||||
entityId!: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'เลขที่เอกสาร' })
|
||||
documentNumber!: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'หัวข้อเรื่อง' })
|
||||
subject!: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'วันที่ได้รับมอบหมาย' })
|
||||
assignedAt!: Date;
|
||||
}
|
||||
6
backend/src/modules/dashboard/dto/index.ts
Normal file
6
backend/src/modules/dashboard/dto/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// File: src/modules/dashboard/dto/index.ts
|
||||
// บันทึกการแก้ไข: สร้างใหม่สำหรับ export DTOs ทั้งหมด
|
||||
|
||||
export * from './dashboard-stats.dto';
|
||||
export * from './get-activity.dto';
|
||||
export * from './get-pending.dto';
|
||||
Reference in New Issue
Block a user