diff --git a/src/app/(pages)/(main)/assign/page.tsx b/src/app/(pages)/(main)/assign/page.tsx index 64f09b7..5090bc4 100644 --- a/src/app/(pages)/(main)/assign/page.tsx +++ b/src/app/(pages)/(main)/assign/page.tsx @@ -18,7 +18,11 @@ import { useSaveMonitoringAssignMutation, } from "@/query/assign"; import {filterPerformance, getCodeLabel} from "@/lib/gwcf/view"; -import {isAssignConfirmed, MONITORING_ASSIGN_TYPE} from "@/lib/gwcf/performance-status"; +import { + isAssignConfirmed, + isAssignRejected, isAssignRequested, + MONITORING_ASSIGN_TYPE +} from "@/lib/gwcf/performance-status"; import {PerformanceAssign, PerformanceFull} from "@/types/gwcf"; import {useDialog} from "@/hooks/useDialog"; import {useMounted} from "@/hooks/useMounted"; @@ -147,7 +151,8 @@ const AssignPage = () => { {id: "monitoringDate", header: PERFORMANCE_FIELD_LABELS.monitoringDate, accessorFn:(row) => row.performanceMonitoringSchedule?.monitoringDate ?? "", cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringDate ?? ""}, {id: "monitoringTime", header: PERFORMANCE_FIELD_LABELS.monitoringTimeInfo, cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringTimeInfo ?? ""}, {id: "applyCount", header: "신청자 수", accessorFn:((row) => applyCountMap.get(String(row.id)) ?? 0), cell: ({row}) => applyCountMap.get(String(row.original.id)) ?? 0}, - {id: "requestCount", header: "확정요청 수", accessorFn:((row) => getMonitoringAssigns(row).length), cell: ({row}) => getMonitoringAssigns(row.original).length}, + {id: "requestedCount", header: "확정요청 수", accessorFn:((row) => getMonitoringAssigns(row).filter(isAssignRequested).length), cell: ({row}) => getMonitoringAssigns(row.original).filter(isAssignRequested).length}, + {id: "rejectedCount", header: "포기인원 수", accessorFn:((row) => getMonitoringAssigns(row).filter(isAssignRejected).length), cell: ({row}) => getMonitoringAssigns(row.original).filter(isAssignRejected).length}, {id: "confirmedCount", header: "확정인원 수", accessorFn:((row) => getMonitoringAssigns(row).filter(isAssignConfirmed).length), cell: ({row}) => getMonitoringAssigns(row.original).filter(isAssignConfirmed).length}, ], [applyCountMap, codes]); diff --git a/src/lib/gwcf/performance-status.ts b/src/lib/gwcf/performance-status.ts index bad77e3..b2edaa8 100644 --- a/src/lib/gwcf/performance-status.ts +++ b/src/lib/gwcf/performance-status.ts @@ -50,6 +50,10 @@ export const STATUS_FILTER = { DONE: "-1007", } as const; +export const isAssignRequested = (assign?: Pick) => { + return assign?.assignStatus === ASSIGN_STATUS.REQUESTED; +}; + export const isAssignConfirmed = (assign?: Pick) => { return assign?.assignStatus === ASSIGN_STATUS.CONFIRMED; };