Compare commits

..
Author SHA1 Message Date
chanii8 5b3aaa463d Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m27s
2026-09-21 11:03:48 +09:00
chanii8 947dba5934 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m43s
2026-09-18 17:38:37 +09:00
chanii8 4816a512bf Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m40s
2026-09-17 17:08:09 +09:00
chanii8 4fad163b14 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m4s
2026-09-14 17:56:23 +09:00
chanii8 da2191f365 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m43s
2026-09-11 10:38:12 +09:00
chanii8 55ab2b8562 Merge remote-tracking branch 'origin/main' into deploy
Deploy Frontend / deploy (push) Successful in 3m33s
2026-09-10 17:53:02 +09:00
chanii8 526392c370 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m39s
2026-09-10 15:44:08 +09:00
chanii8 6020c80a7a Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 10m6s
2026-09-09 18:09:33 +09:00
chanii8 32b778f961 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m47s
2026-09-08 17:14:51 +09:00
chanii8 3946fda013 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m42s
2026-09-07 17:27:45 +09:00
chanii8 db30b45267 Merge branch 'deploy' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into deploy 2026-09-07 17:27:38 +09:00
jcchoi 6cc2a02df4 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 1m9s
2026-09-03 18:31:48 +09:00
chanii8 0f107ff29d Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 6m16s
2026-09-02 16:32:42 +09:00
chanii8 5e69a9b6f0 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m44s
2026-09-01 17:20:52 +09:00
chanii8 ec9311c76b Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m36s
2026-08-31 17:23:27 +09:00
chanii8 4c85a7d249 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m37s
2026-08-28 17:45:20 +09:00
chanii8 09d4c2d26e Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m6s
2026-08-28 17:13:45 +09:00
chanii8 b8dac5dc72 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m47s
2026-08-28 17:08:08 +09:00
chanii8 73cafc9786 Merge remote-tracking branch 'origin/main' into deploy
Deploy Frontend / deploy (push) Successful in 3m40s
2026-08-28 14:34:02 +09:00
chanii8 c276ae0c5e Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m2s
2026-08-27 17:25:06 +09:00
chanii8 b4ed061a53 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m40s
2026-08-27 11:36:49 +09:00
chanii8 ddaaa8fc92 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m55s
2026-08-26 17:14:14 +09:00
chanii8 3a253df58a Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 7m10s
2026-08-25 17:11:23 +09:00
chanii8 21debe2f77 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m22s
2026-08-25 15:45:10 +09:00
chanii8 0e4f662dfd Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m19s
2026-08-25 10:34:34 +09:00
chanii8 4a797808c1 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m1s
2026-08-24 17:18:45 +09:00
chanii8 3a81b822f2 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m54s
2026-08-21 17:29:09 +09:00
chanii8 f5a7efb324 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m2s
2026-08-20 13:12:39 +09:00
chanii8 abc3ca184d Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m49s
2026-08-18 18:03:01 +09:00
chanii8 267c022d58 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m36s
2026-08-13 17:52:39 +09:00
chanii8 0fc2844928 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m56s
2026-08-13 17:22:37 +09:00
chanii8 7f1fe42ace Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into deploy
Deploy Frontend / deploy (push) Successful in 3m36s
2026-08-11 17:46:50 +09:00
chanii8 c83a13d680 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m7s
2026-08-10 18:06:03 +09:00
chanii8 3d7dcb6d0e Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m17s
2026-08-07 17:03:11 +09:00
chanii8 a46f24d6d7 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m44s
2026-08-06 17:12:47 +09:00
chanii8 2e4f2428f0 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m41s
2026-08-06 16:50:33 +09:00
chanii8 706cebfeae Merge branch 'main' into deploy 2026-08-06 16:22:09 +09:00
chanii8 ee7f5e3a07 Merge branch 'main' into deploy 2026-08-06 13:42:33 +09:00
chanii8 3d0160f21f Merge branch 'main' into deploy 2026-08-05 17:23:37 +09:00
chanii8 0aa0126caf Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 5m43s
2026-08-03 17:47:39 +09:00
chanii8 5ecdd37187 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m52s
2026-08-03 17:28:33 +09:00
chanii8 20cc2ca248 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m48s
2026-08-03 11:45:43 +09:00
chanii8 5cfd7d65ec Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 7m45s
2026-07-31 18:00:11 +09:00
chanii8 3b8307b674 Merge branch 'main' into deploy 2026-07-30 11:37:16 +09:00
chanii8 2f800c960d Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 10m24s
2026-07-24 16:59:38 +09:00
chanii8 2728b4058b Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m8s
2026-07-24 10:57:06 +09:00
chanii8 b842905572 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 4m28s
2026-07-23 11:44:35 +09:00
chanii8 85fa9a8658 Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into deploy
Deploy Frontend / deploy (push) Successful in 10m37s
2026-07-22 14:42:42 +09:00
chanii8 5ae56481c2 Merge remote-tracking branch 'origin/main' into deploy
Deploy Frontend / deploy (push) Successful in 7m23s
2026-07-22 11:44:50 +09:00
chanii8 8079d7d6af Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 7m20s
2026-07-21 11:51:55 +09:00
chanii8 7c8eef1715 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 6m51s
2026-07-20 18:44:05 +09:00
chanii8 f10b3179c2 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 10m25s
2026-07-20 17:11:46 +09:00
chanii8 2e0bb5aa84 Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into deploy
Deploy Frontend / deploy (push) Successful in 10m10s
2026-07-20 13:52:10 +09:00
chanii8 7ae8d42731 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 9m2s
2026-07-16 18:39:59 +09:00
chanii8 a9e65af77b Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 3m25s
2026-07-13 11:14:34 +09:00
chanii8 d21ecc975f Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 2m14s
2026-07-09 17:54:09 +09:00
chanii8 452509281a Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 5m8s
2026-07-09 17:40:25 +09:00
chanii8 2e3602eee6 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 11m12s
2026-07-08 18:55:17 +09:00
jcchoi 7dfd535841 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 2m54s
2026-07-06 16:54:57 +09:00
jcchoi 39d928b5b1 Merge remote-tracking branch 'origin/iipbs/st/dev' into deploy 2026-07-06 16:51:29 +09:00
jcchoi 525695072a Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 2m56s
2026-07-05 11:07:27 +09:00
jcchoi 972a4ce789 Merge branch 'main' into deploy
Deploy Frontend / deploy (push) Successful in 5m30s
2026-07-02 18:34:53 +09:00
jcchoi 879aadc068 Merge remote-tracking branch 'origin/iipbs/st/dev' into deploy
Deploy Frontend / deploy (push) Successful in 3m2s
2026-07-02 18:29:55 +09:00
338 changed files with 19641 additions and 13780 deletions
-1
View File
@@ -36,7 +36,6 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3", "@eslint/eslintrc": "^3",
"@hookform/devtools": "^4.4.0",
"@types/js-cookie": "^3.0.6", "@types/js-cookie": "^3.0.6",
"eslint": "^9.0.0", "eslint": "^9.0.0",
"eslint-config-next": "15.3.8", "eslint-config-next": "15.3.8",
@@ -1,24 +0,0 @@
import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config";
import type {
AiAutoPrcsLatestResponseDto,
AiAutoPrcsMngService,
} from "../model/ai-auto-prcs-mng-interface";
const BASE = ENDPOINT.AS_SERVICE.AI_AUTO_PRCS_MNG;
async function findLatestPerAutoSeByFnrsDocNo(
fnrsCnsltnDocNo: string,
atmtnSeComCd?: string,
): Promise<AiAutoPrcsLatestResponseDto[]> {
const response = await client.get<AiAutoPrcsLatestResponseDto[]>(
`${BASE}/fnrs/${fnrsCnsltnDocNo}/latest`,
{ params: atmtnSeComCd ? { atmtnSeComCd } : undefined },
);
return response.data;
}
export const aiAutoPrcsMngService = {
findLatestPerAutoSeByFnrsDocNo,
} satisfies AiAutoPrcsMngService;
@@ -1,30 +0,0 @@
import { useQuery } from "@tanstack/react-query";
import { ENDPOINT } from "@/shared/config";
import { aiAutoPrcsMngService } from "./ai-auto-prcs-mng-service";
export const aiAutoPrcsMngKeys = {
all: [ENDPOINT.AS_SERVICE.AI_AUTO_PRCS_MNG] as const,
latest: (fnrsCnsltnDocNo: string, atmtnSeComCd?: string) =>
[...aiAutoPrcsMngKeys.all, "latest", fnrsCnsltnDocNo, atmtnSeComCd ?? "all"] as const,
};
interface UseAiAutoPrcsLatestOptions {
enabled?: boolean;
atmtnSeComCd?: string;
}
export function useAiAutoPrcsLatest(
fnrsCnsltnDocNo: string | null | undefined,
options: UseAiAutoPrcsLatestOptions = {},
) {
const { enabled = true, atmtnSeComCd } = options;
return useQuery({
queryKey: aiAutoPrcsMngKeys.latest(fnrsCnsltnDocNo!, atmtnSeComCd),
queryFn: () =>
aiAutoPrcsMngService.findLatestPerAutoSeByFnrsDocNo(fnrsCnsltnDocNo!, atmtnSeComCd),
enabled: Boolean(fnrsCnsltnDocNo) && enabled,
});
}
@@ -1,8 +0,0 @@
export { aiAutoPrcsMngService } from "./api/ai-auto-prcs-mng-service";
export { aiAutoPrcsMngKeys, useAiAutoPrcsLatest } from "./api/queries";
export type {
AiAutoPrcsLatestResponseDto,
AiAutoPrcsMngService,
AiAutoSeComCd,
} from "./model/ai-auto-prcs-mng-interface";
export { AI_AUTO_SE } from "./model/ai-auto-prcs-mng-interface";
@@ -1,44 +0,0 @@
/** 자동화구분 공통코드 (AIAUTOSE) */
export const AI_AUTO_SE = {
FILE_VRFC: "FILE_VRFC",
DRAFT_GEN: "DRAFT_GEN",
COST_VRFC: "COST_VRFC",
} as const;
export type AiAutoSeComCd = (typeof AI_AUTO_SE)[keyof typeof AI_AUTO_SE];
/** 백엔드 AiAutoPrcsLatestResponseDto */
export interface AiAutoPrcsLatestResponseDto {
atmtnPrcsUuid?: string;
fnrsCnsltnDocNo?: string;
pwrkCnsltnDocNo?: string;
crtDmndUuid?: string;
atmtnSeComCd?: string;
atmtnSeComNm?: string;
bfrDocSttsComCd?: string;
bfrDocSttsComNm?: string;
aftrDocSttsComCd?: string;
aftrDocSttsComNm?: string;
atmtnPrcsSttsComCd?: string;
atmtnPrcsSttsComNm?: string;
dmndDt?: string;
dmndSysId?: string;
rplyDt?: string;
rplyRsltComCd?: string;
prcsErrCn?: string | null;
lastSttsInqDt?: string;
sttsInqRsltComCd?: string;
rtrsmCtpvNmtm?: number;
lastRtrsmDt?: string;
lastFrcSttsChgYn?: string;
isFailed?: boolean;
isRetryable?: boolean;
}
/** Controller public 메서드명·시그니처와 동일 */
export interface AiAutoPrcsMngService {
findLatestPerAutoSeByFnrsDocNo(
fnrsCnsltnDocNo: string,
atmtnSeComCd?: string,
): Promise<AiAutoPrcsLatestResponseDto[]>;
}
@@ -46,40 +46,9 @@ async function requestCostVerification(
return response.data; return response.data;
} }
async function reTransferDocument(
body: DcRagDocumentTransferRequestDto,
): Promise<DcRagCommonResponseDto> {
const response = await client.post<DcRagCommonResponseDto>(
`${BASE}/documents/re-transfer`,
body,
);
return response.data;
}
async function reGenerateDraft(
body: DcRagDraftGenerateRequestDto,
): Promise<DcRagDraftGenerateResponseDto> {
const response = await client.post<DcRagDraftGenerateResponseDto>(
`${BASE}/documents/draft/re-generate`,
body,
);
return response.data;
}
async function reVerifyCost(body: DcRagCostVerifyRequestDto): Promise<DcRagCommonResponseDto> {
const response = await client.post<DcRagCommonResponseDto>(
`${BASE}/documents/cost/re-verify`,
body,
);
return response.data;
}
export const dcRagApiToService = { export const dcRagApiToService = {
requestDocumentTransfer, requestDocumentTransfer,
requestDraftGeneration, requestDraftGeneration,
getDraftGenerationStatus, getDraftGenerationStatus,
requestCostVerification, requestCostVerification,
reTransferDocument,
reGenerateDraft,
reVerifyCost,
} satisfies DcRagApiToService; } satisfies DcRagApiToService;
@@ -1,9 +1,6 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { ENDPOINT } from "@/shared/config"; import { ENDPOINT } from "@/shared/config";
import { useMutationWrapper } from "@/shared/lib";
import { aiAutoPrcsMngKeys } from "@/entities/ai-auto-prcs-mng";
import { fnrsCnsltnKeys } from "@/entities/fnrs-cnsltn";
import type { DcRagDraftStatusResponseDto } from "../model/dcrag-to-interface"; import type { DcRagDraftStatusResponseDto } from "../model/dcrag-to-interface";
import type { import type {
@@ -24,18 +21,6 @@ function isDraftGenerationSettled(data: DcRagDraftStatusResponseDto | undefined)
return data.events?.some((event) => event.eventType === "COMPLETED") ?? false; return data.events?.some((event) => event.eventType === "COMPLETED") ?? false;
} }
function invalidateAfterAiRetry(
queryClient: ReturnType<typeof useQueryClient>,
fnrsCnsltnDocNo?: string,
) {
queryClient.invalidateQueries({ queryKey: dcRagApiToBaseKey });
queryClient.invalidateQueries({ queryKey: aiAutoPrcsMngKeys.all });
if (fnrsCnsltnDocNo) {
queryClient.invalidateQueries({ queryKey: fnrsCnsltnKeys.detail(fnrsCnsltnDocNo) });
queryClient.invalidateQueries({ queryKey: fnrsCnsltnKeys.all });
}
}
export function useDraftGenerationStatus(crtDmndUuid: string | null | undefined) { export function useDraftGenerationStatus(crtDmndUuid: string | null | undefined) {
return useQuery({ return useQuery({
queryKey: [...dcRagApiToBaseKey, "getDraftGenerationStatus", crtDmndUuid], queryKey: [...dcRagApiToBaseKey, "getDraftGenerationStatus", crtDmndUuid],
@@ -83,39 +68,3 @@ export function useRequestCostVerification() {
}, },
}); });
} }
export function useReTransferDocument() {
const queryClient = useQueryClient();
return useMutationWrapper({
mutationFn: (body: DcRagDocumentTransferRequestDto) =>
dcRagApiToService.reTransferDocument(body),
onSuccess: (_data, body) => {
invalidateAfterAiRetry(queryClient, body.fnrsCnsltnDocNo);
},
});
}
export function useReGenerateDraft() {
const queryClient = useQueryClient();
return useMutationWrapper({
mutationFn: (body: DcRagDraftGenerateRequestDto) => dcRagApiToService.reGenerateDraft(body),
onSuccess: (_data, body) => {
invalidateAfterAiRetry(queryClient, body.fnrsCnsltnDocNo);
if (body.crtDmndUuid) {
queryClient.invalidateQueries({
queryKey: [...dcRagApiToBaseKey, "getDraftGenerationStatus", body.crtDmndUuid],
});
}
},
});
}
export function useReVerifyCost() {
const queryClient = useQueryClient();
return useMutationWrapper({
mutationFn: (body: DcRagCostVerifyRequestDto) => dcRagApiToService.reVerifyCost(body),
onSuccess: (_data, body) => {
invalidateAfterAiRetry(queryClient, body.fnrsCnsltnDocNo);
},
});
}
-3
View File
@@ -2,12 +2,9 @@ export { dcRagApiToService } from "./api/dcrag-to-service";
export { dcRagApiToBaseKey } from "./api/queries"; export { dcRagApiToBaseKey } from "./api/queries";
export { export {
useDraftGenerationStatus, useDraftGenerationStatus,
useReGenerateDraft,
useRequestCostVerification, useRequestCostVerification,
useRequestDocumentTransfer, useRequestDocumentTransfer,
useRequestDraftGeneration, useRequestDraftGeneration,
useReTransferDocument,
useReVerifyCost,
} from "./api/queries"; } from "./api/queries";
export type { export type {
DcRagApiToService, DcRagApiToService,
@@ -49,7 +49,4 @@ export interface DcRagApiToService {
): Promise<DcRagDraftGenerateResponseDto>; ): Promise<DcRagDraftGenerateResponseDto>;
getDraftGenerationStatus(crtDmndUuid: string): Promise<DcRagDraftStatusResponseDto>; getDraftGenerationStatus(crtDmndUuid: string): Promise<DcRagDraftStatusResponseDto>;
requestCostVerification(body: DcRagCostVerifyRequestDto): Promise<DcRagCommonResponseDto>; requestCostVerification(body: DcRagCostVerifyRequestDto): Promise<DcRagCommonResponseDto>;
reTransferDocument(body: DcRagDocumentTransferRequestDto): Promise<DcRagCommonResponseDto>;
reGenerateDraft(body: DcRagDraftGenerateRequestDto): Promise<DcRagDraftGenerateResponseDto>;
reVerifyCost(body: DcRagCostVerifyRequestDto): Promise<DcRagCommonResponseDto>;
} }
@@ -2,35 +2,35 @@ import { z } from "zod";
/** 백엔드 DcRagFileInfoDto */ /** 백엔드 DcRagFileInfoDto */
export const dcRagFileInfoSchema = z.object({ export const dcRagFileInfoSchema = z.object({
fileId: z.string().nullish(), fileId: z.string().optional(),
fileGroupId: z.string().nullish(), fileGroupId: z.string().optional(),
fileName: z.string().nullish(), fileName: z.string().optional(),
physicalPath: z.string().nullish(), physicalPath: z.string().optional(),
downloadUrl: z.string().nullish(), downloadUrl: z.string().optional(),
fileSize: z.number().nullish(), fileSize: z.number().optional(),
esntlAtchFileId: z.string().nullish(), esntlAtchFileId: z.string().optional(),
esntlAtchFileNm: z.string().nullish(), esntlAtchFileNm: z.string().optional(),
}); });
/** 백엔드 DcRagDocumentTransferRequestDto */ /** 백엔드 DcRagDocumentTransferRequestDto */
export const dcRagDocumentTransferRequestSchema = z.object({ export const dcRagDocumentTransferRequestSchema = z.object({
fnrsCnsltnDocNo: z.string(), fnrsCnsltnDocNo: z.string(),
taskSeComCd: z.string().nullish(), taskSeComCd: z.string().optional(),
taskSeCdNm: z.string().nullish(), taskSeCdNm: z.string().optional(),
essentialFiles: z.array(dcRagFileInfoSchema).nullish(), essentialFiles: z.array(dcRagFileInfoSchema).optional(),
etcFiles: z.array(dcRagFileInfoSchema).nullish(), etcFiles: z.array(dcRagFileInfoSchema).optional(),
callbackUrl: z.string().nullish(), callbackUrl: z.string().optional(),
}); });
/** 백엔드 DcRagDraftGenerateRequestDto */ /** 백엔드 DcRagDraftGenerateRequestDto */
export const dcRagDraftGenerateRequestSchema = z.object({ export const dcRagDraftGenerateRequestSchema = z.object({
fnrsCnsltnDocNo: z.string(), fnrsCnsltnDocNo: z.string(),
pwrkCnsltnDocNo: z.string(), pwrkCnsltnDocNo: z.string(),
crtDmndUuid: z.string().nullish(), crtDmndUuid: z.string().optional(),
essentialFiles: z.array(dcRagFileInfoSchema).nullish(), essentialFiles: z.array(dcRagFileInfoSchema).optional(),
etcFiles: z.array(dcRagFileInfoSchema).nullish(), etcFiles: z.array(dcRagFileInfoSchema).optional(),
rqstrUuid: z.string().nullish(), rqstrUuid: z.string().optional(),
callbackUrl: z.string().nullish(), callbackUrl: z.string().optional(),
}); });
/** 백엔드 DcRagCostVerifyRequestDto */ /** 백엔드 DcRagCostVerifyRequestDto */
@@ -4,11 +4,9 @@ import type { PageResponse } from "@/shared/model";
import type { import type {
DesignCnstnApplySaveRequestDto, DesignCnstnApplySaveRequestDto,
DesignCnstnMngSaveRequestDto,
} from "../model/design-cnstn-apply-payload-schema";
import type {
DesignCnstnMngDetResponseDto, DesignCnstnMngDetResponseDto,
DesignCnstnMngResponseDto, DesignCnstnMngResponseDto,
DesignCnstnMngSaveRequestDto,
DesignCnstnMngSearchDto, DesignCnstnMngSearchDto,
DesignCnstnMngService, DesignCnstnMngService,
DesignCnstnMngUpdateRequestDto, DesignCnstnMngUpdateRequestDto,
@@ -2,10 +2,10 @@ import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config"; import { ENDPOINT } from "@/shared/config";
import type { PageResponse } from "@/shared/model"; import type { PageResponse } from "@/shared/model";
import type { DesignCnstnRvwOpnnSaveRequestDto } from "../model/design-cnstn-apply-payload-schema";
import type { import type {
DesignCnstnRvwOpnnId, DesignCnstnRvwOpnnId,
DesignCnstnRvwOpnnResponseDto, DesignCnstnRvwOpnnResponseDto,
DesignCnstnRvwOpnnSaveRequestDto,
DesignCnstnRvwOpnnSearchDto, DesignCnstnRvwOpnnSearchDto,
DesignCnstnRvwOpnnService, DesignCnstnRvwOpnnService,
DesignCnstnRvwOpnnUpdateRequestDto, DesignCnstnRvwOpnnUpdateRequestDto,
@@ -18,13 +18,11 @@ import type {
import type { import type {
DesignCnstnApplySaveRequestDto, DesignCnstnApplySaveRequestDto,
DesignCnstnMngSaveRequestDto, DesignCnstnMngSaveRequestDto,
DesignCnstnRvwOpnnSaveRequestDto,
} from "../model/design-cnstn-apply-payload-schema";
import type {
DesignCnstnMngSearchDto, DesignCnstnMngSearchDto,
DesignCnstnMngUpdateRequestDto, DesignCnstnMngUpdateRequestDto,
} from "../model/design-cnstn-mng-interface"; } from "../model/design-cnstn-mng-interface";
import type { import type {
DesignCnstnRvwOpnnSaveRequestDto,
DesignCnstnRvwOpnnSearchDto, DesignCnstnRvwOpnnSearchDto,
DesignCnstnRvwOpnnUpdateRequestDto, DesignCnstnRvwOpnnUpdateRequestDto,
} from "../model/design-cnstn-rvw-opnn-interface"; } from "../model/design-cnstn-rvw-opnn-interface";
+6 -16
View File
@@ -37,22 +37,6 @@ export {
useUpdateDesignCnstnMng, useUpdateDesignCnstnMng,
useUpdateDesignCnstnRvwOpnn, useUpdateDesignCnstnRvwOpnn,
} from "./api/queries"; } from "./api/queries";
export type {
BizCstItem,
BzScaleItem,
DesignCnstnApplySaveRequestDto,
DesignCnstnMngSaveRequestDto,
DesignCnstnRvwOpnnSaveRequestDto,
EsntlAtchFileItem,
} from "./model/design-cnstn-apply-payload-schema";
export {
designCnstnApplySaveSchema,
designCnstnBizCstItemSchema,
designCnstnBzScaleItemSchema,
designCnstnEsntlAtchFileItemSchema,
designCnstnMngSaveSchema,
designCnstnRvwOpnnSaveSchema,
} from "./model/design-cnstn-apply-payload-schema";
export type { export type {
DesignCnstnBizCstId, DesignCnstnBizCstId,
DesignCnstnBizCstResponseDto, DesignCnstnBizCstResponseDto,
@@ -79,15 +63,21 @@ export type {
} from "./model/design-cnstn-esntl-atch-file-interface"; } from "./model/design-cnstn-esntl-atch-file-interface";
export type { export type {
AtflMngClientResponseDto, AtflMngClientResponseDto,
BizCstItem,
BizCstTreeDto, BizCstTreeDto,
BizSclTreeDto, BizSclTreeDto,
BzScaleItem,
DesignCnstnApplySaveRequestDto,
DesignCnstnMngDetResponseDto, DesignCnstnMngDetResponseDto,
DesignCnstnMngResponseDto, DesignCnstnMngResponseDto,
DesignCnstnMngSaveRequestDto,
DesignCnstnMngSearchDto, DesignCnstnMngSearchDto,
DesignCnstnMngService, DesignCnstnMngService,
DesignCnstnMngUpdateRequestDto, DesignCnstnMngUpdateRequestDto,
DesignCnstnRvwOpnnResponseDto, DesignCnstnRvwOpnnResponseDto,
DesignCnstnRvwOpnnSaveRequestDto,
ElaprDocPrgrsClientResponseDto, ElaprDocPrgrsClientResponseDto,
EsntlAtchFileItem,
EsntlAtchFileMngTreeResponseDto, EsntlAtchFileMngTreeResponseDto,
} from "./model/design-cnstn-mng-interface"; } from "./model/design-cnstn-mng-interface";
export type { export type {
@@ -1,74 +0,0 @@
import { z } from "zod";
/** 백엔드 DesignCnstnMngSaveRequestDto */
export const designCnstnMngSaveSchema = z.object({
designCnstnDocNo: z.string().nullish(),
admdstCd: z.string().nullish(),
envoSeComCd: z.string().nullish(),
taskSeComCd: z.string().nullish(),
bizNm: z.string().nullish(),
bizBgngYr: z.string().nullish(),
bizEndYr: z.string().nullish(),
bizCn: z.string().nullish(),
aplcntNm: z.string().nullish(),
aplcntMblTelno: z.string().nullish(),
aplcntOgdpNm: z.string().nullish(),
aplcntEmlAddr: z.string().nullish(),
dsgnrNm: z.string().nullish(),
dsgnrTelno: z.string().nullish(),
dsgnrOgdpNm: z.string().nullish(),
dsgnrEmlAddr: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
prgrsSttsComCd: z.string().nullish(),
});
/** 백엔드 DesignCnstnApplySaveRequestDto.BzScaleItem */
export const designCnstnBzScaleItemSchema = z.object({
cnstpSeCd: z.string().nullish(),
bscPl: z.number().nullish(),
budgetReflct: z.number().nullish(),
thtiDsgn: z.number().nullish(),
});
/** 백엔드 DesignCnstnApplySaveRequestDto.BizCstItem */
export const designCnstnBizCstItemSchema = z.object({
acntgSeCd: z.string().nullish(),
bscPlanAmt: z.number().nullish(),
bgtRfltAmt: z.number().nullish(),
tstmDesignAmt: z.number().nullish(),
});
/** 백엔드 DesignCnstnApplySaveRequestDto.EsntlAtchFileItem */
export const designCnstnEsntlAtchFileItemSchema = z.object({
esntlAtchFileId: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
});
/** 백엔드 DesignCnstnRvwOpnnSaveRequestDto */
export const designCnstnRvwOpnnSaveSchema = z.object({
designCnstnDocNo: z.string(),
rvwOpnnSn: z.number().nullish(),
opnrSeComCd: z.string().nullish(),
opnrNm: z.string().nullish(),
rvwRsltCn: z.string().nullish(),
rvwRsltAnmlyYn: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
});
/** 백엔드 DesignCnstnApplySaveRequestDto */
export const designCnstnApplySaveSchema = z.object({
techReViewSaveCd: z.string().nullish(),
rvwStpCd: z.string().nullish(),
designCnstnMng: designCnstnMngSaveSchema,
bzScaleList: z.array(designCnstnBzScaleItemSchema).nullish(),
bizCstList: z.array(designCnstnBizCstItemSchema).nullish(),
esntlAtchFileList: z.array(designCnstnEsntlAtchFileItemSchema).nullish(),
rvwOpnnList: z.array(designCnstnRvwOpnnSaveSchema).nullish(),
});
export type DesignCnstnMngSaveRequestDto = z.infer<typeof designCnstnMngSaveSchema>;
export type BzScaleItem = z.infer<typeof designCnstnBzScaleItemSchema>;
export type BizCstItem = z.infer<typeof designCnstnBizCstItemSchema>;
export type EsntlAtchFileItem = z.infer<typeof designCnstnEsntlAtchFileItemSchema>;
export type DesignCnstnRvwOpnnSaveRequestDto = z.infer<typeof designCnstnRvwOpnnSaveSchema>;
export type DesignCnstnApplySaveRequestDto = z.infer<typeof designCnstnApplySaveSchema>;
@@ -1,12 +1,22 @@
import type { PageableParams, PageResponse, PbadmsMngDetResponseBase } from "@/shared/model"; import type {
BizCstSaveBase,
BzScaleSaveBase,
EsntlAtchFileSaveBase,
PageableParams,
PageResponse,
PbadmsApplySaveHeader,
PbadmsMngDetResponseBase,
} from "@/shared/model";
import type { import type {
DesignCnstnApplySaveRequestDto, DesignCnstnRvwOpnnResponseDto,
DesignCnstnMngSaveRequestDto, DesignCnstnRvwOpnnSaveRequestDto,
} from "./design-cnstn-apply-payload-schema"; } from "./design-cnstn-rvw-opnn-interface";
import type { DesignCnstnRvwOpnnResponseDto } from "./design-cnstn-rvw-opnn-interface";
export type { DesignCnstnRvwOpnnResponseDto } from "./design-cnstn-rvw-opnn-interface"; export type {
DesignCnstnRvwOpnnResponseDto,
DesignCnstnRvwOpnnSaveRequestDto,
} from "./design-cnstn-rvw-opnn-interface";
export type { export type {
AtflMngClientResponseDto, AtflMngClientResponseDto,
BizCstTreeDto, BizCstTreeDto,
@@ -15,6 +25,28 @@ export type {
EsntlAtchFileMngTreeResponseDto, EsntlAtchFileMngTreeResponseDto,
} from "@/shared/model"; } from "@/shared/model";
/** 백엔드 DesignCnstnMngSaveRequestDto */
export interface DesignCnstnMngSaveRequestDto {
designCnstnDocNo?: string;
admdstCd?: string;
envoSeComCd?: string;
taskSeComCd?: string;
bizNm?: string;
bizBgngYr?: string;
bizEndYr?: string;
bizCn?: string;
aplcntNm?: string;
aplcntMblTelno?: string;
aplcntOgdpNm?: string;
aplcntEmlAddr?: string;
dsgnrNm?: string;
dsgnrTelno?: string;
dsgnrOgdpNm?: string;
dsgnrEmlAddr?: string;
atchFileGroupId?: string;
prgrsSttsComCd?: string;
}
/** 백엔드 DesignCnstnMngUpdateRequestDto */ /** 백엔드 DesignCnstnMngUpdateRequestDto */
export type DesignCnstnMngUpdateRequestDto = Omit<DesignCnstnMngSaveRequestDto, "designCnstnDocNo">; export type DesignCnstnMngUpdateRequestDto = Omit<DesignCnstnMngSaveRequestDto, "designCnstnDocNo">;
@@ -56,12 +88,30 @@ interface DesignCnstnMngResponseExtension {
export type DesignCnstnMngResponseDto = Omit<DesignCnstnMngSaveRequestDto, "designCnstnDocNo"> & export type DesignCnstnMngResponseDto = Omit<DesignCnstnMngSaveRequestDto, "designCnstnDocNo"> &
DesignCnstnMngResponseExtension; DesignCnstnMngResponseExtension;
/** 백엔드 DesignCnstnApplySaveRequestDto.BzScaleItem */
export type BzScaleItem = BzScaleSaveBase;
/** 백엔드 DesignCnstnApplySaveRequestDto.BizCstItem */
export type BizCstItem = BizCstSaveBase;
/** 백엔드 DesignCnstnApplySaveRequestDto.EsntlAtchFileItem */
export type EsntlAtchFileItem = EsntlAtchFileSaveBase;
/** 백엔드 DesignCnstnMngDetResponseDto */ /** 백엔드 DesignCnstnMngDetResponseDto */
export type DesignCnstnMngDetResponseDto = PbadmsMngDetResponseBase< export type DesignCnstnMngDetResponseDto = PbadmsMngDetResponseBase<
DesignCnstnMngResponseDto, DesignCnstnMngResponseDto,
DesignCnstnRvwOpnnResponseDto DesignCnstnRvwOpnnResponseDto
>; >;
/** 백엔드 DesignCnstnApplySaveRequestDto */
export interface DesignCnstnApplySaveRequestDto extends PbadmsApplySaveHeader {
designCnstnMng: DesignCnstnMngSaveRequestDto;
bzScaleList?: BzScaleItem[];
bizCstList?: BizCstItem[];
esntlAtchFileList?: EsntlAtchFileItem[];
rvwOpnnList?: DesignCnstnRvwOpnnSaveRequestDto[];
}
/** Controller public 메서드명·시그니처와 동일 */ /** Controller public 메서드명·시그니처와 동일 */
export interface DesignCnstnMngService { export interface DesignCnstnMngService {
findPage(searchDto: DesignCnstnMngSearchDto): Promise<PageResponse<DesignCnstnMngResponseDto>>; findPage(searchDto: DesignCnstnMngSearchDto): Promise<PageResponse<DesignCnstnMngResponseDto>>;
@@ -1,13 +1,22 @@
import type { PageableParams, PageResponse, RvwOpnnResponseExtension } from "@/shared/model"; import type { PageableParams, PageResponse, RvwOpnnResponseExtension } from "@/shared/model";
import type { DesignCnstnRvwOpnnSaveRequestDto } from "./design-cnstn-apply-payload-schema";
/** 백엔드 DesignCnstnRvwOpnnId */ /** 백엔드 DesignCnstnRvwOpnnId */
export interface DesignCnstnRvwOpnnId { export interface DesignCnstnRvwOpnnId {
designCnstnMng: string; designCnstnMng: string;
rvwOpnnSn: number; rvwOpnnSn: number;
} }
/** 백엔드 DesignCnstnRvwOpnnSaveRequestDto */
export interface DesignCnstnRvwOpnnSaveRequestDto {
designCnstnDocNo: string;
rvwOpnnSn?: number;
opnrSeComCd?: string;
opnrNm?: string;
rvwRsltCn?: string;
rvwRsltAnmlyYn?: string;
atchFileGroupId?: string;
}
/** 백엔드 DesignCnstnRvwOpnnUpdateRequestDto */ /** 백엔드 DesignCnstnRvwOpnnUpdateRequestDto */
export interface DesignCnstnRvwOpnnUpdateRequestDto { export interface DesignCnstnRvwOpnnUpdateRequestDto {
opnrSeComCd?: string; opnrSeComCd?: string;
-1
View File
@@ -41,7 +41,6 @@ export {
validateAllRowsForSave, validateAllRowsForSave,
validateAplnRow, validateAplnRow,
validateAtrzOrder, validateAtrzOrder,
validateUniqueAtrzAprvr,
validateUniqueSeqNo, validateUniqueSeqNo,
} from "./lib/apln-validators"; } from "./lib/apln-validators";
export { export {
@@ -76,16 +76,3 @@ export function validateUniqueSeqNo(rows: ElaprAplnRow[]): string | null {
} }
return null; return null;
} }
export function validateUniqueAtrzAprvr(rows: ElaprAplnRow[]): string | null {
const pairSet = new Set<string>();
for (const row of getVisibleRows(rows)) {
const atrz = row.atrzSeComCd?.trim();
const aprvr = row.aprvrUuid?.trim();
if (!atrz || !aprvr) continue;
const key = `${atrz}::${aprvr}`;
if (pairSet.has(key)) return "동일한 결재구분과 결재자가 중복됩니다.";
pairSet.add(key);
}
return null;
}
@@ -7,8 +7,8 @@ export interface ElaprDmndSaveRequestDto {
elaprDocNo: string; elaprDocNo: string;
dmndTtl: string; dmndTtl: string;
dmndCn: string; dmndCn: string;
elaprCycl?: number | null; elaprCycl?: number;
docPrgrsSttsComCd?: string | null; docPrgrsSttsComCd?: string;
elaprPrgrsSttsList?: ElaprPrgrsSttsSaveRequestDto[]; elaprPrgrsSttsList?: ElaprPrgrsSttsSaveRequestDto[];
} }
@@ -17,7 +17,7 @@ import {
} from "@common/components"; } from "@common/components";
import { useElaprAplnPage } from "../api/queries"; import { useElaprAplnPage } from "../api/queries";
import { validateAplnRow, validateUniqueAtrzAprvr } from "../lib/apln-validators"; import { validateAplnRow } from "../lib/apln-validators";
import { useAplnRows } from "../lib/use-apln-rows"; import { useAplnRows } from "../lib/use-apln-rows";
import { useDndSensors } from "../lib/use-dnd-sensors"; import { useDndSensors } from "../lib/use-dnd-sensors";
import type { ElaprApln } from "../model/elapr-apln-interface"; import type { ElaprApln } from "../model/elapr-apln-interface";
@@ -110,12 +110,6 @@ function ElaprAplnPickerGrid({
return; return;
} }
const duplicateError = validateUniqueAtrzAprvr(rows);
if (duplicateError) {
alert(duplicateError);
return;
}
commitEdit(row.rowKey); commitEdit(row.rowKey);
} }
@@ -17,7 +17,6 @@ import {
getVisibleRows, getVisibleRows,
validateAllRowsForSave, validateAllRowsForSave,
validateAtrzOrder, validateAtrzOrder,
validateUniqueAtrzAprvr,
validateUniqueSeqNo, validateUniqueSeqNo,
} from "../lib/apln-validators"; } from "../lib/apln-validators";
import { mapDocPrgrsToAplnRows } from "../lib/doc-prgrs-to-apln-rows"; import { mapDocPrgrsToAplnRows } from "../lib/doc-prgrs-to-apln-rows";
@@ -91,12 +90,6 @@ function ElaprDocPrgrsPickerDialog({
return; return;
} }
const atrzAprvrError = validateUniqueAtrzAprvr(aplnRows);
if (atrzAprvrError) {
alert(atrzAprvrError);
return;
}
const visibleRows = getVisibleRows(aplnRows); const visibleRows = getVisibleRows(aplnRows);
onConfirm?.({ aplnRows: visibleRows }); onConfirm?.({ aplnRows: visibleRows });
@@ -17,7 +17,6 @@ import {
getVisibleRows, getVisibleRows,
validateAllRowsForSave, validateAllRowsForSave,
validateAtrzOrder, validateAtrzOrder,
validateUniqueAtrzAprvr,
validateUniqueSeqNo, validateUniqueSeqNo,
} from "../lib/apln-validators"; } from "../lib/apln-validators";
import type { ElaprAplnRow } from "../model/elapr-apln-row-types"; import type { ElaprAplnRow } from "../model/elapr-apln-row-types";
@@ -107,12 +106,6 @@ function ElaprTmpltPickerDialog({
return; return;
} }
const atrzAprvrError = validateUniqueAtrzAprvr(aplnRows);
if (atrzAprvrError) {
alert(atrzAprvrError);
return;
}
const visibleRows = getVisibleRows(aplnRows); const visibleRows = getVisibleRows(aplnRows);
const payload: ElaprTmpltPickerConfirmPayload = { const payload: ElaprTmpltPickerConfirmPayload = {
@@ -2,15 +2,13 @@ import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config"; import { ENDPOINT } from "@/shared/config";
import type { PageResponse } from "@/shared/model"; import type { PageResponse } from "@/shared/model";
import type {
FnrsCnsltnApplySaveRequestDto,
FnrsCnsltnMngSaveRequestDto,
} from "../model/fnrs-cnsltn-apply-payload-schema";
import type { import type {
DocPrgrsUpdateRequestDto, DocPrgrsUpdateRequestDto,
FnrsCnsltnApplySaveRequestDto,
FnrsCnsltnFileVrfcRsltResponseDto, FnrsCnsltnFileVrfcRsltResponseDto,
FnrsCnsltnMngDetResponseDto, FnrsCnsltnMngDetResponseDto,
FnrsCnsltnMngResponseDto, FnrsCnsltnMngResponseDto,
FnrsCnsltnMngSaveRequestDto,
FnrsCnsltnMngSearchDto, FnrsCnsltnMngSearchDto,
FnrsCnsltnMngService, FnrsCnsltnMngService,
FnrsCnsltnMngUpdateRequestDto, FnrsCnsltnMngUpdateRequestDto,
@@ -1,11 +1,9 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import type { import type {
DocPrgrsUpdateRequestDto,
FnrsCnsltnApplySaveRequestDto, FnrsCnsltnApplySaveRequestDto,
FnrsCnsltnMngSaveRequestDto, FnrsCnsltnMngSaveRequestDto,
} from "../model/fnrs-cnsltn-apply-payload-schema";
import type {
DocPrgrsUpdateRequestDto,
FnrsCnsltnMngSearchDto, FnrsCnsltnMngSearchDto,
FnrsCnsltnMngUpdateRequestDto, FnrsCnsltnMngUpdateRequestDto,
} from "../model/fnrs-cnsltn-interface"; } from "../model/fnrs-cnsltn-interface";
+9 -23
View File
@@ -15,45 +15,31 @@ export {
useTechReviewFnrsCnsltnMng, useTechReviewFnrsCnsltnMng,
useUpdateFnrsCnsltnMng, useUpdateFnrsCnsltnMng,
} from "./api/queries"; } from "./api/queries";
export type {
BizCstItem,
BzScaleItem,
CklstResultItem,
EsntlAtchFileItem,
FnrsCnsltnApplySaveRequestDto,
FnrsCnsltnMngSaveRequestDto,
FnrsCnsltnRvwOpnnSaveRequestDto,
FnrsCnsltnSplmntDmndItem,
FnrsSharItem,
} from "./model/fnrs-cnsltn-apply-payload-schema";
export {
fnrsCnsltnApplySaveSchema,
fnrsCnsltnBizCstItemSchema,
fnrsCnsltnBzScaleItemSchema,
fnrsCnsltnCklstResultItemSchema,
fnrsCnsltnEsntlAtchFileItemSchema,
fnrsCnsltnMngSaveSchema,
fnrsCnsltnRvwOpnnSaveSchema,
fnrsCnsltnSplmntDmndItemSchema,
fnrsSharItemSchema,
} from "./model/fnrs-cnsltn-apply-payload-schema";
export type { export type {
AtflMngClientResponseDto, AtflMngClientResponseDto,
BizCstItem,
BizCstTreeDto, BizCstTreeDto,
BizSclTreeDto, BizSclTreeDto,
BzScaleItem,
CklstResultItem,
CklstRvwRsltTreeDto, CklstRvwRsltTreeDto,
DocPrgrsUpdateRequestDto, DocPrgrsUpdateRequestDto,
ElaprDocPrgrsClientResponseDto, ElaprDocPrgrsClientResponseDto,
EsntlAtchFileItem,
EsntlAtchFileMngTreeResponseDto, EsntlAtchFileMngTreeResponseDto,
FnrsCnsltnApplySaveRequestDto,
FnrsCnsltnFileVrfcRsltResponseDto, FnrsCnsltnFileVrfcRsltResponseDto,
FnrsCnsltnMngDetResponseDto, FnrsCnsltnMngDetResponseDto,
FnrsCnsltnMngResponseDto, FnrsCnsltnMngResponseDto,
FnrsCnsltnMngSaveRequestDto,
FnrsCnsltnMngSearchDto, FnrsCnsltnMngSearchDto,
FnrsCnsltnMngService, FnrsCnsltnMngService,
FnrsCnsltnMngUpdateRequestDto, FnrsCnsltnMngUpdateRequestDto,
FnrsCnsltnRvwOpnnResponseDto, FnrsCnsltnRvwOpnnResponseDto,
FnrsCnsltnRvwOpnnSaveRequestDto,
FnrsCnsltnSplmntDmndItem,
FnrsCnsltnSplmntDmndResponseDto, FnrsCnsltnSplmntDmndResponseDto,
RagIndexingInfoDto, FnrsSharItem,
} from "./model/fnrs-cnsltn-interface"; } from "./model/fnrs-cnsltn-interface";
export type { export type {
EnvoActnReviewReqDto, EnvoActnReviewReqDto,
@@ -1,120 +0,0 @@
import { z } from "zod";
/** 백엔드 FnrsCnsltnMngSaveRequestDto */
export const fnrsCnsltnMngSaveSchema = z.object({
fnrsCnsltnDocNo: z.string().nullish(),
admdstCd: z.string().nullish(),
envoSeComCd: z.string().nullish(),
taskSeComCd: z.string().nullish(),
cfmtnBgtBizNo: z.string().nullish(),
bgtAplyYr: z.string().nullish(),
bizNm: z.string().nullish(),
bizBgngYr: z.string().nullish(),
bizEndYr: z.string().nullish(),
bizCn: z.string().nullish(),
aplcntNm: z.string().nullish(),
aplcntMblTelno: z.string().nullish(),
aplcntOgdpNm: z.string().nullish(),
aplcntEmlAddr: z.string().nullish(),
dsgnrNm: z.string().nullish(),
dsgnrTelno: z.string().nullish(),
dsgnrOgdpNm: z.string().nullish(),
dsgnrEmlAddr: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
sharAtchFileGroupId: z.string().nullish(),
prgrsSttsComCd: z.string().nullish(),
rtlztnFcltSeComCd: z.string().nullish(),
rtlztnUsgSeComCd: z.string().nullish(),
});
/** 백엔드 FnrsCnsltnApplySaveRequestDto.BzScaleItem */
export const fnrsCnsltnBzScaleItemSchema = z.object({
cnstpSeCd: z.string().nullish(),
bscPl: z.number().nullish(),
budgetReflct: z.number().nullish(),
thtiDsgn: z.number().nullish(),
});
/** 백엔드 FnrsCnsltnApplySaveRequestDto.BizCstItem */
export const fnrsCnsltnBizCstItemSchema = z.object({
acntgSeCd: z.string().nullish(),
bscPlanAmt: z.number().nullish(),
bgtRfltAmt: z.number().nullish(),
tstmDesignAmt: z.number().nullish(),
});
/** 백엔드 FnrsCnsltnApplySaveRequestDto.CklstResultItem */
export const fnrsCnsltnCklstResultItemSchema = z.object({
cklstRvwSn: z.number().nullish(),
cklstArtclSn: z.number().nullish(),
cklstSn: z.number().nullish(),
rvwStpComCd: z.string().nullish(),
selected: z.enum(["Y", "N"]).nullish(),
picRvwCn: z.string().nullish(),
});
/** 백엔드 FnrsCnsltnApplySaveRequestDto.EsntlAtchFileItem */
export const fnrsCnsltnEsntlAtchFileItemSchema = z.object({
esntlAtchFileId: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
});
/** 백엔드 FnrsCnsltnApplySaveRequestDto.FnrsCnsltnSplmntDmndItem */
export const fnrsCnsltnSplmntDmndItemSchema = z.object({
splmntDmndSn: z.number().nullish(),
splmntArtclComCd: z.string().nullish(),
splmntDmndCn: z.string().nullish(),
splmntDmndDt: z.string().nullish(),
splmntDmndAtchFileGroupId: z.string().nullish(),
splmntCn: z.string().nullish(),
splmntPicNm: z.string().nullish(),
splmntCmptnDt: z.string().nullish(),
splmntAtchFileGroupId: z.string().nullish(),
cmptnYn: z.string().nullish(),
});
/** 백엔드 FnrsCnsltnRvwOpnnSaveRequestDto */
export const fnrsCnsltnRvwOpnnSaveSchema = z.object({
fnrsCnsltnDocNo: z.string(),
rvwOpnnSn: z.number().nullish(),
opnrSeComCd: z.string().nullish(),
opnrNm: z.string().nullish(),
rvwRsltCn: z.string().nullish(),
rvwRsltAnmlyYn: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
});
/** 백엔드 FnrsCnsltnApplySaveRequestDto.FnrsSharItem */
export const fnrsSharItemSchema = z.object({
fnrsSharSeCd: z.string().nullish(),
exstnAmt: z.number().nullish(),
chgRqtAmt: z.number().nullish(),
ajmtAmt: z.number().nullish(),
rmrkCn: z.string().nullish(),
envoRmrkCn: z.string().nullish(),
});
/** 백엔드 FnrsCnsltnApplySaveRequestDto */
export const fnrsCnsltnApplySaveSchema = z.object({
techReViewSaveCd: z.string().nullish(),
rvwStpCd: z.string().nullish(),
fnrsCnsltnMng: fnrsCnsltnMngSaveSchema,
bzScaleList: z.array(fnrsCnsltnBzScaleItemSchema).nullish(),
bizCstList: z.array(fnrsCnsltnBizCstItemSchema).nullish(),
cklstResultList: z.array(fnrsCnsltnCklstResultItemSchema).nullish(),
cklstResultMap: z.record(z.array(fnrsCnsltnCklstResultItemSchema)).nullish(),
esntlAtchFileList: z.array(fnrsCnsltnEsntlAtchFileItemSchema).nullish(),
rvwOpnnList: z.array(fnrsCnsltnRvwOpnnSaveSchema).nullish(),
splmntDmndList: z.array(fnrsCnsltnSplmntDmndItemSchema).nullish(),
fnrsSharList: z.array(fnrsSharItemSchema).nullish(),
});
export type FnrsCnsltnMngSaveRequestDto = z.infer<typeof fnrsCnsltnMngSaveSchema>;
export type BzScaleItem = z.infer<typeof fnrsCnsltnBzScaleItemSchema>;
export type BizCstItem = z.infer<typeof fnrsCnsltnBizCstItemSchema>;
export type CklstResultItem = z.infer<typeof fnrsCnsltnCklstResultItemSchema>;
export type EsntlAtchFileItem = z.infer<typeof fnrsCnsltnEsntlAtchFileItemSchema>;
export type FnrsCnsltnSplmntDmndItem = z.infer<typeof fnrsCnsltnSplmntDmndItemSchema>;
export type FnrsCnsltnRvwOpnnSaveRequestDto = z.infer<typeof fnrsCnsltnRvwOpnnSaveSchema>;
export type FnrsSharItem = z.infer<typeof fnrsSharItemSchema>;
export type FnrsCnsltnApplySaveRequestDto = z.infer<typeof fnrsCnsltnApplySaveSchema>;
@@ -1,20 +1,21 @@
import type { import type {
AtflMngClientResponseDto, AtflMngClientResponseDto,
BizCstSaveBase,
BzScaleSaveBase,
CklstResultSaveBase,
DocPrgrsUpdateRequestDto, DocPrgrsUpdateRequestDto,
EsntlAtchFileSaveBase,
PageableParams, PageableParams,
PageResponse, PageResponse,
PbadmsApplySaveHeader,
PbadmsMngDetResponseBase, PbadmsMngDetResponseBase,
RvwOpnnResponseExtension, RvwOpnnResponseExtension,
RvwOpnnSaveBase,
SplmntDmndResponseExtension, SplmntDmndResponseExtension,
SplmntDmndSaveBase,
} from "@/shared/model"; } from "@/shared/model";
import type { FnrsSharBizCstTreeDto } from "@/entities/fnrs-shar-se"; import type { FnrsSharBizCstTreeDto } from "@/entities/fnrs-shar-se";
import type {
FnrsCnsltnApplySaveRequestDto,
FnrsCnsltnMngSaveRequestDto,
FnrsCnsltnRvwOpnnSaveRequestDto,
FnrsCnsltnSplmntDmndItem,
} from "./fnrs-cnsltn-apply-payload-schema";
import type { import type {
EnvoActnReviewReqDto, EnvoActnReviewReqDto,
FnrsExamineRequestDto, FnrsExamineRequestDto,
@@ -30,6 +31,33 @@ export type {
EsntlAtchFileMngTreeResponseDto, EsntlAtchFileMngTreeResponseDto,
} from "@/shared/model"; } from "@/shared/model";
/** 백엔드 FnrsCnsltnMngSaveRequestDto */
export interface FnrsCnsltnMngSaveRequestDto {
fnrsCnsltnDocNo?: string;
admdstCd?: string;
envoSeComCd?: string;
taskSeComCd?: string;
cfmtnBgtBizNo?: string;
bgtAplyYr?: string;
bizNm?: string;
bizBgngYr?: string;
bizEndYr?: string;
bizCn?: string;
aplcntNm?: string;
aplcntMblTelno?: string;
aplcntOgdpNm?: string;
aplcntEmlAddr?: string;
dsgnrNm?: string;
dsgnrTelno?: string;
dsgnrOgdpNm?: string;
dsgnrEmlAddr?: string;
atchFileGroupId?: string;
sharAtchFileGroupId?: string;
prgrsSttsComCd?: string;
rtlztnFcltSeComCd?: string;
rtlztnUsgSeComCd?: string;
}
/** 백엔드 FnrsCnsltnMngUpdateRequestDto */ /** 백엔드 FnrsCnsltnMngUpdateRequestDto */
export type FnrsCnsltnMngUpdateRequestDto = Omit<FnrsCnsltnMngSaveRequestDto, "fnrsCnsltnDocNo">; export type FnrsCnsltnMngUpdateRequestDto = Omit<FnrsCnsltnMngSaveRequestDto, "fnrsCnsltnDocNo">;
@@ -82,6 +110,34 @@ interface FnrsCnsltnMngResponseExtension {
export type FnrsCnsltnMngResponseDto = Omit<FnrsCnsltnMngSaveRequestDto, "fnrsCnsltnDocNo"> & export type FnrsCnsltnMngResponseDto = Omit<FnrsCnsltnMngSaveRequestDto, "fnrsCnsltnDocNo"> &
FnrsCnsltnMngResponseExtension; FnrsCnsltnMngResponseExtension;
export type BzScaleItem = BzScaleSaveBase;
export type BizCstItem = BizCstSaveBase;
export interface CklstResultItem extends CklstResultSaveBase {
selected?: string;
}
export type EsntlAtchFileItem = EsntlAtchFileSaveBase;
export type FnrsCnsltnSplmntDmndItem = SplmntDmndSaveBase;
/** 백엔드 FnrsCnsltnApplySaveRequestDto.FnrsSharItem */
export interface FnrsSharItem {
fnrsSharSeCd?: string;
exstnAmt?: number;
chgRqtAmt?: number;
ajmtAmt?: number;
rmrkCn?: string;
envoRmrkCn?: string;
}
/** 백엔드 FnrsCnsltnRvwOpnnSaveRequestDto */
export interface FnrsCnsltnRvwOpnnSaveRequestDto extends RvwOpnnSaveBase {
fnrsCnsltnDocNo: string;
rvwOpnnSn: number;
}
/** 백엔드 FnrsCnsltnRvwOpnnResponseDto */ /** 백엔드 FnrsCnsltnRvwOpnnResponseDto */
export type FnrsCnsltnRvwOpnnResponseDto = Partial< export type FnrsCnsltnRvwOpnnResponseDto = Partial<
Pick<FnrsCnsltnRvwOpnnSaveRequestDto, "fnrsCnsltnDocNo" | "rvwOpnnSn"> Pick<FnrsCnsltnRvwOpnnSaveRequestDto, "fnrsCnsltnDocNo" | "rvwOpnnSn">
@@ -95,14 +151,6 @@ export type FnrsCnsltnSplmntDmndResponseDto = FnrsCnsltnSplmntDmndItem &
fnrsCnsltnDocNo?: string; fnrsCnsltnDocNo?: string;
}; };
/** 백엔드 RagIndexingInfoDto */
export interface RagIndexingInfoDto {
isInProgress: boolean;
elapsedSeconds?: number;
estimatedRemainingSeconds?: number;
message?: string;
}
/** 백엔드 FnrsCnsltnMngDetResponseDto */ /** 백엔드 FnrsCnsltnMngDetResponseDto */
export type FnrsCnsltnMngDetResponseDto = PbadmsMngDetResponseBase< export type FnrsCnsltnMngDetResponseDto = PbadmsMngDetResponseBase<
FnrsCnsltnMngResponseDto, FnrsCnsltnMngResponseDto,
@@ -111,9 +159,21 @@ export type FnrsCnsltnMngDetResponseDto = PbadmsMngDetResponseBase<
> & { > & {
fnrsSharList?: FnrsSharBizCstTreeDto[]; fnrsSharList?: FnrsSharBizCstTreeDto[];
sharAtchFileList?: AtflMngClientResponseDto[]; sharAtchFileList?: AtflMngClientResponseDto[];
ragIndexingInfo?: RagIndexingInfoDto | null;
}; };
/** 백엔드 FnrsCnsltnApplySaveRequestDto */
export interface FnrsCnsltnApplySaveRequestDto extends PbadmsApplySaveHeader {
fnrsCnsltnMng: FnrsCnsltnMngSaveRequestDto;
bzScaleList?: BzScaleItem[];
bizCstList?: BizCstItem[];
cklstResultList?: CklstResultItem[];
cklstResultMap?: Record<string, CklstResultItem[]>;
esntlAtchFileList?: EsntlAtchFileItem[];
rvwOpnnList?: FnrsCnsltnRvwOpnnSaveRequestDto[];
splmntDmndList?: FnrsCnsltnSplmntDmndItem[];
fnrsSharList?: FnrsSharItem[];
}
/** 백엔드 FnrsCnsltnFileVrfcRsltResponseDto */ /** 백엔드 FnrsCnsltnFileVrfcRsltResponseDto */
export interface FnrsCnsltnFileVrfcRsltResponseDto { export interface FnrsCnsltnFileVrfcRsltResponseDto {
fileSeComCd?: string; fileSeComCd?: string;
@@ -2,12 +2,12 @@ import { z } from "zod";
/** 백엔드 FnrsExamineRequestDto */ /** 백엔드 FnrsExamineRequestDto */
export const fnrsExamineRequestSchema = z.object({ export const fnrsExamineRequestSchema = z.object({
prgrsSttsComCd: z.string().nullish(), prgrsSttsComCd: z.string().optional(),
}); });
/** 백엔드 EnvoActnReviewReqDto */ /** 백엔드 EnvoActnReviewReqDto */
export const envoActnReviewReqSchema = z.object({ export const envoActnReviewReqSchema = z.object({
specialRqstCn: z.string().nullish(), specialRqstCn: z.string().optional(),
}); });
export type FnrsExamineRequestDto = z.infer<typeof fnrsExamineRequestSchema>; export type FnrsExamineRequestDto = z.infer<typeof fnrsExamineRequestSchema>;
@@ -2,15 +2,13 @@ import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config"; import { ENDPOINT } from "@/shared/config";
import type { PageResponse } from "@/shared/model"; import type { PageResponse } from "@/shared/model";
import type {
InstlSncnApplySaveRequestDto,
InstlSncnMngSaveRequestDto,
} from "../model/instl-sncn-apply-payload-schema";
import type { import type {
AdstZoneResponseDto, AdstZoneResponseDto,
DocPrgrsUpdateRequestDto, DocPrgrsUpdateRequestDto,
InstlSncnApplySaveRequestDto,
InstlSncnMngDetResponse, InstlSncnMngDetResponse,
InstlSncnMngResponseDto, InstlSncnMngResponseDto,
InstlSncnMngSaveRequestDto,
InstlSncnMngSearchParams, InstlSncnMngSearchParams,
InstlSncnMngService, InstlSncnMngService,
InstlSncnMngUpdateRequestDto, InstlSncnMngUpdateRequestDto,
@@ -3,11 +3,9 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { ENDPOINT } from "@/shared/config"; import { ENDPOINT } from "@/shared/config";
import type { import type {
DocPrgrsUpdateRequestDto,
InstlSncnApplySaveRequestDto, InstlSncnApplySaveRequestDto,
InstlSncnMngSaveRequestDto, InstlSncnMngSaveRequestDto,
} from "../model/instl-sncn-apply-payload-schema";
import type {
DocPrgrsUpdateRequestDto,
InstlSncnMngSearchParams, InstlSncnMngSearchParams,
InstlSncnMngUpdateRequestDto, InstlSncnMngUpdateRequestDto,
} from "../model/instl-sncn-interface"; } from "../model/instl-sncn-interface";
+8 -20
View File
@@ -9,26 +9,6 @@ export {
useInstlSncnSubmitSupplement, useInstlSncnSubmitSupplement,
useInstlSncnTechReview, useInstlSncnTechReview,
} from "./api/queries"; } from "./api/queries";
export type {
InstlSncnApplySaveRequestDto,
InstlSncnBizCstSaveRequestDto,
InstlSncnBzScaleSaveDto,
InstlSncnCklstResultSaveDto,
InstlSncnEsntlAtchFileSaveDto,
InstlSncnMngSaveRequestDto,
InstlSncnRvwOpnnSaveRequestDto,
InstlSncnSplmntDmndSaveDto,
} from "./model/instl-sncn-apply-payload-schema";
export {
instlSncnApplySaveSchema,
instlSncnBizCstItemSchema,
instlSncnBzScaleItemSchema,
instlSncnCklstResultItemSchema,
instlSncnEsntlAtchFileItemSchema,
instlSncnMngSaveSchema,
instlSncnRvwOpnnSaveSchema,
instlSncnSplmntDmndItemSchema,
} from "./model/instl-sncn-apply-payload-schema";
export { export {
type AdstZoneResponseDto, type AdstZoneResponseDto,
type AtflMngClientResponseDto, type AtflMngClientResponseDto,
@@ -39,10 +19,18 @@ export {
type ElaprDocPrgrsClientResponseDto, type ElaprDocPrgrsClientResponseDto,
type EsntlAtchFileMngTreeResponseDto, type EsntlAtchFileMngTreeResponseDto,
INSTL_SNCN_REGISTER_SELECTION_KEY, INSTL_SNCN_REGISTER_SELECTION_KEY,
type InstlSncnApplySaveRequestDto,
type InstlSncnBizCstSaveRequestDto,
type InstlSncnBzScaleSaveDto,
type InstlSncnCklstResultSaveDto,
type InstlSncnEsntlAtchFileSaveDto,
type InstlSncnMngDetResponse, type InstlSncnMngDetResponse,
type InstlSncnMngResponseDto, type InstlSncnMngResponseDto,
type InstlSncnMngSaveRequestDto,
type InstlSncnMngSearchParams, type InstlSncnMngSearchParams,
type InstlSncnRvwOpnnResponseDto, type InstlSncnRvwOpnnResponseDto,
type InstlSncnRvwOpnnSaveRequestDto,
type InstlSncnSplmntDmndResponseDto, type InstlSncnSplmntDmndResponseDto,
type InstlSncnSplmntDmndSaveDto,
type ReviewStepCode, type ReviewStepCode,
} from "./model/instl-sncn-interface"; } from "./model/instl-sncn-interface";
@@ -1,108 +0,0 @@
import { z } from "zod";
/** 백엔드 InstlSncnMngSaveRequestDto */
export const instlSncnMngSaveSchema = z.object({
instlSncnDocNo: z.string().nullish(),
admdstCd: z.string().nullish(),
envoSeComCd: z.string().nullish(),
sncnSeComCd: z.string().nullish(),
taskSeComCd: z.string().nullish(),
bgtBizCd: z.string().nullish(),
bgtAplyYr: z.string().nullish(),
bizNm: z.string().nullish(),
bizBgngYr: z.string().nullish(),
bizEndYr: z.string().nullish(),
bizCn: z.string().nullish(),
aplcntNm: z.string().nullish(),
aplcntMblTelno: z.string().nullish(),
aplcntOgdpNm: z.string().nullish(),
aplcntEmlAddr: z.string().nullish(),
dsgnrNm: z.string().nullish(),
dsgnrTelno: z.string().nullish(),
dsgnrOgdpNm: z.string().nullish(),
dsgnrEmlAddr: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
prgrsSttsComCd: z.string().nullish(),
rtlztnFcltSeComCd: z.string().nullish(),
rtlztnUsgSeComCd: z.string().nullish(),
});
/** 백엔드 InstlSncnApplySaveRequestDto.BzScaleItem (diff는 API 미전송) */
export const instlSncnBzScaleItemSchema = z.object({
cnstpSeCd: z.string().nullish(),
bscPl: z.number().nullish(),
budgetReflct: z.number().nullish(),
thtiDsgn: z.number().nullish(),
});
/** 백엔드 InstlSncnApplySaveRequestDto.BizCstItem */
export const instlSncnBizCstItemSchema = z.object({
acntgSeCd: z.string().nullish(),
bscPlanAmt: z.number().nullish(),
bgtRfltAmt: z.number().nullish(),
tstmDesignAmt: z.number().nullish(),
});
/** 백엔드 InstlSncnApplySaveRequestDto.CklstResultItem */
export const instlSncnCklstResultItemSchema = z.object({
cklstRvwSn: z.number().nullish(),
cklstArtclSn: z.number().nullish(),
cklstSn: z.number().nullish(),
rvwStpComCd: z.string().nullish(),
selected: z.enum(["Y", "N"]).nullish(),
picRvwCn: z.string().nullish(),
});
/** 백엔드 InstlSncnApplySaveRequestDto.EsntlAtchFileItem */
export const instlSncnEsntlAtchFileItemSchema = z.object({
esntlAtchFileId: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
});
/** 백엔드 InstlSncnRvwOpnnSaveRequestDto */
export const instlSncnRvwOpnnSaveSchema = z.object({
instlSncnDocNo: z.string(),
rvwOpnnSn: z.number().nullish(),
opnrSeComCd: z.string().nullish(),
opnrNm: z.string().nullish(),
rvwRsltCn: z.string().nullish(),
rvwRsltAnmlyYn: z.string().nullish(),
atchFileGroupId: z.string().nullish(),
});
/** 백엔드 InstlSncnApplySaveRequestDto.InstlSncnSplmntDmndItem */
export const instlSncnSplmntDmndItemSchema = z.object({
splmntDmndSn: z.number().nullish(),
splmntArtclComCd: z.string().nullish(),
splmntDmndCn: z.string().nullish(),
splmntDmndDt: z.string().nullish(),
splmntDmndAtchFileGroupId: z.string().nullish(),
splmntCn: z.string().nullish(),
splmntPicNm: z.string().nullish(),
splmntCmptnDt: z.string().nullish(),
splmntAtchFileGroupId: z.string().nullish(),
cmptnYn: z.string().nullish(),
});
/** 백엔드 InstlSncnApplySaveRequestDto */
export const instlSncnApplySaveSchema = z.object({
techReViewSaveCd: z.string().nullish(),
rvwStpCd: z.string().nullish(),
instlSncnMng: instlSncnMngSaveSchema,
bzScaleList: z.array(instlSncnBzScaleItemSchema).nullish(),
bizCstList: z.array(instlSncnBizCstItemSchema).nullish(),
cklstResultList: z.array(instlSncnCklstResultItemSchema).nullish(),
cklstResultMap: z.record(z.array(instlSncnCklstResultItemSchema)).nullish(),
esntlAtchFileList: z.array(instlSncnEsntlAtchFileItemSchema).nullish(),
rvwOpnnList: z.array(instlSncnRvwOpnnSaveSchema).nullish(),
splmntDmndList: z.array(instlSncnSplmntDmndItemSchema).nullish(),
});
export type InstlSncnMngSaveRequestDto = z.infer<typeof instlSncnMngSaveSchema>;
export type InstlSncnBzScaleSaveDto = z.infer<typeof instlSncnBzScaleItemSchema>;
export type InstlSncnBizCstSaveRequestDto = z.infer<typeof instlSncnBizCstItemSchema>;
export type InstlSncnCklstResultSaveDto = z.infer<typeof instlSncnCklstResultItemSchema>;
export type InstlSncnEsntlAtchFileSaveDto = z.infer<typeof instlSncnEsntlAtchFileItemSchema>;
export type InstlSncnRvwOpnnSaveRequestDto = z.infer<typeof instlSncnRvwOpnnSaveSchema>;
export type InstlSncnSplmntDmndSaveDto = z.infer<typeof instlSncnSplmntDmndItemSchema>;
export type InstlSncnApplySaveRequestDto = z.infer<typeof instlSncnApplySaveSchema>;
@@ -1,24 +1,24 @@
import type { import type {
AtflMngClientResponseDto, AtflMngClientResponseDto,
BizCstSaveBase,
BizCstTreeDto, BizCstTreeDto,
BizSclTreeDto, BizSclTreeDto,
BzScaleSaveBase,
CklstResultSaveBase,
DocPrgrsUpdateRequestDto, DocPrgrsUpdateRequestDto,
ElaprDocPrgrsClientResponseDto, ElaprDocPrgrsClientResponseDto,
EsntlAtchFileMngTreeResponseDto, EsntlAtchFileMngTreeResponseDto,
EsntlAtchFileSaveBase,
PageableParams, PageableParams,
PageResponse, PageResponse,
PbadmsApplySaveHeader,
PbadmsMngDetResponseBase, PbadmsMngDetResponseBase,
RvwOpnnResponseExtension, RvwOpnnResponseExtension,
RvwOpnnSaveBase,
SplmntDmndResponseExtension, SplmntDmndResponseExtension,
SplmntDmndSaveBase,
} from "@/shared/model"; } from "@/shared/model";
import type {
InstlSncnApplySaveRequestDto,
InstlSncnMngSaveRequestDto,
InstlSncnRvwOpnnSaveRequestDto,
InstlSncnSplmntDmndSaveDto,
} from "./instl-sncn-apply-payload-schema";
export type { export type {
AtflMngClientResponseDto, AtflMngClientResponseDto,
BizCstTreeDto, BizCstTreeDto,
@@ -41,48 +41,189 @@ export const INSTL_SNCN_REGISTER_SELECTION_KEY = "instlSncnRegisterSelection";
/** 백엔드 InstlSncnMngSearchDto + Pageable */ /** 백엔드 InstlSncnMngSearchDto + Pageable */
export interface InstlSncnMngSearchParams extends PageableParams { export interface InstlSncnMngSearchParams extends PageableParams {
/** 설치인가문서번호 */
instlSncnDocNo?: string; instlSncnDocNo?: string;
/** 행정구역코드 */
admdstCd?: string; admdstCd?: string;
/** 환경청구분공통코드 */
envoSeComCd?: string; envoSeComCd?: string;
/** 업무구분공통코드 */
taskSeComCd?: string; taskSeComCd?: string;
/** 예산사업코드 */
bgtBizCd?: string; bgtBizCd?: string;
/** 예산신청연도 */
bgtAplyYr?: string; bgtAplyYr?: string;
/** 사업명 */
bizNm?: string; bizNm?: string;
/** 사업시작연도 */
bizBgngYr?: string; bizBgngYr?: string;
/** 사업종료연도 */
bizEndYr?: string; bizEndYr?: string;
/** 사업내용 */
bizCn?: string; bizCn?: string;
/** 신청자명 */
aplcntNm?: string; aplcntNm?: string;
/** 신청자휴대전화번호 */
aplcntMblTelno?: string; aplcntMblTelno?: string;
/** 신청자소속명 */
aplcntOgdpNm?: string; aplcntOgdpNm?: string;
/** 신청자이메일주소 */
aplcntEmlAddr?: string; aplcntEmlAddr?: string;
/** 설계자명 */
dsgnrNm?: string; dsgnrNm?: string;
/** 설계자전화번호 */
dsgnrTelno?: string; dsgnrTelno?: string;
/** 설계자소속명 */
dsgnrOgdpNm?: string; dsgnrOgdpNm?: string;
/** 설계자이메일주소 */
dsgnrEmlAddr?: string; dsgnrEmlAddr?: string;
/** 첨부파일그룹아이디 */
atchFileGroupId?: string; atchFileGroupId?: string;
/** 진행상태공통코드 */
prgrsSttsComCd?: string; prgrsSttsComCd?: string;
} }
/** 백엔드 InstlSncnMngUpdateRequestDto */ /** 설치인가관리 저장 요청 DTO */
export interface InstlSncnMngSaveRequestDto {
/** 설치인가문서번호 */
instlSncnDocNo?: string;
/** 행정구역코드 */
admdstCd?: string;
/** 환경청구분공통코드 */
envoSeComCd?: string;
/** 인가구분공통코드 */
sncnSeComCd: string;
/** 업무구분공통코드 */
taskSeComCd: string;
/** 예산사업코드 */
bgtBizCd?: string;
/** 예산신청연도 */
bgtAplyYr?: string;
/** 사업명 */
bizNm: string;
/** 사업시작연도 */
bizBgngYr: string;
/** 사업종료연도 */
bizEndYr: string;
/** 사업내용 */
bizCn: string;
/** 신청자명 */
aplcntNm?: string;
/** 신청자휴대전화번호 */
aplcntMblTelno?: string;
/** 신청자소속명 */
aplcntOgdpNm?: string;
/** 신청자이메일주소 */
aplcntEmlAddr?: string;
/** 설계자명 */
dsgnrNm: string;
/** 설계자전화번호 */
dsgnrTelno: string;
/** 설계자소속명 */
dsgnrOgdpNm: string;
/** 설계자이메일주소 */
dsgnrEmlAddr: string;
/** 첨부파일그룹아이디 */
atchFileGroupId?: string;
/** 진행상태공통코드 */
prgrsSttsComCd?: string;
/** 재이용시설구분공통코드 */
rtlztnFcltSeComCd?: string;
/** 재이용용도구분공통코드 */
rtlztnUsgSeComCd?: string;
}
/** 설치인가관리 수정 요청 DTO */
export type InstlSncnMngUpdateRequestDto = InstlSncnMngSaveRequestDto; export type InstlSncnMngUpdateRequestDto = InstlSncnMngSaveRequestDto;
/** 백엔드 InstlSncnMngResponseDto */ /** 설치인가관리 응답 DTO */
export type InstlSncnMngResponseDto = InstlSncnMngSaveRequestDto & { export interface InstlSncnMngResponseDto extends InstlSncnMngSaveRequestDto {
/** 설치인가문서번호 (필수로 재정의) */
instlSncnDocNo: string; instlSncnDocNo: string;
/** 환경청구분공통코드명 */
envoSeCdNm: string; envoSeCdNm: string;
/** 인가구분공통코드명 */
sncnSeCdNm: string; sncnSeCdNm: string;
/** 업무구분공통코드명 */
taskSeCdNm: string; taskSeCdNm: string;
/** 진행상태공통코드명 */
prgrsSttsCdNm: string; prgrsSttsCdNm: string;
/** 기술검토회신이력여부 */
techRplyHstryYn: "Y" | "N"; techRplyHstryYn: "Y" | "N";
/** 재이용시설구분공통코드명 */
rtlztnFcltSeComNm: string; rtlztnFcltSeComNm: string;
/** 재이용용도구분공통코드명 */
rtlztnUsgSeComNm: string; rtlztnUsgSeComNm: string;
/** 등록일시 */
regDt: string; regDt: string;
/** 등록자 UUID */
rgtr: string; rgtr: string;
/** 등록자명 */
rgtrNm: string; rgtrNm: string;
/** 수정 일시 */
mdfcnDt: string; mdfcnDt: string;
/** 시도 */
sido: string; sido: string;
/** 구군 */
gugun: string; gugun: string;
}; }
/** 설치인가 신청 - 사업규모 저장 DTO(배열 원소) */
export interface InstlSncnBzScaleSaveDto extends BzScaleSaveBase {
/** 공종구분코드 */
cnstpSeCd: string;
/** 기본계획수량 */
bscPl: number;
/** 예산반영수량 */
budgetReflct: number;
/** 금회설계수량 */
thtiDsgn: number;
/** 증감(C-B) — 클라이언트 계산용, API 미전송 */
diff?: number;
}
/** 설치인가 신청 - 총사업비 저장 DTO(배열 원소) */
export interface InstlSncnBizCstSaveRequestDto extends BizCstSaveBase {
/** 회계구분코드 */
acntgSeCd: string;
/** 기본계획금액 */
bscPlanAmt: number;
/** 예산반영금액 */
bgtRfltAmt: number;
/** 금회설계금액 */
tstmDesignAmt: number;
}
/** 설치인가 신청 - 체크리스트 결과 저장 DTO(배열 원소) */
export interface InstlSncnCklstResultSaveDto extends CklstResultSaveBase {
/** 점검표일련번호 */
cklstSn: number;
/** 점검표항목일련번호 */
cklstArtclSn: number;
/** 점검표검토일련번호 */
cklstRvwSn: number;
/** 선택값(Y/N/null) */
selected: "Y" | "N" | null;
/** 담당자검토내용(기술검토의견) */
picRvwCn?: string | null;
}
/** 설치인가 신청 - 필수첨부파일 저장 DTO(배열 원소) */
export interface InstlSncnEsntlAtchFileSaveDto extends EsntlAtchFileSaveBase {
/** 필수첨부파일아이디 */
esntlAtchFileId: string;
/** 첨부파일그룹아이디 */
atchFileGroupId: string;
}
/** 설치인가검토의견 저장 요청 DTO */
export interface InstlSncnRvwOpnnSaveRequestDto extends RvwOpnnSaveBase {
/** 설치인가문서번호 */
instlSncnDocNo: string;
}
/** 설치인가 보완요구 저장 DTO(배열 원소) */
export type InstlSncnSplmntDmndSaveDto = SplmntDmndSaveBase;
/** 설치인가 보완요구 응답 DTO */ /** 설치인가 보완요구 응답 DTO */
export type InstlSncnSplmntDmndResponseDto = InstlSncnSplmntDmndSaveDto & export type InstlSncnSplmntDmndResponseDto = InstlSncnSplmntDmndSaveDto &
@@ -90,6 +231,26 @@ export type InstlSncnSplmntDmndResponseDto = InstlSncnSplmntDmndSaveDto &
instlSncnDocNo?: string; instlSncnDocNo?: string;
}; };
/** 설치인가 신청 - 통합 저장 요청 DTO */
export interface InstlSncnApplySaveRequestDto extends PbadmsApplySaveHeader {
/** 설치인가관리 정보 */
instlSncnMng: InstlSncnMngSaveRequestDto;
/** 사업규모 목록 */
bzScaleList?: InstlSncnBzScaleSaveDto[];
/** 총사업비 목록 */
bizCstList?: InstlSncnBizCstSaveRequestDto[];
/** 체크리스트 검토결과 목록 */
cklstResultList?: InstlSncnCklstResultSaveDto[];
/** 체크리스트 검토결과 맵 (rvwStpComCd -> 목록) */
cklstResultMap?: Record<string, InstlSncnCklstResultSaveDto[]>;
/** 필수첨부파일 목록 */
esntlAtchFileList?: InstlSncnEsntlAtchFileSaveDto[];
/** 검토의견 목록 */
rvwOpnnList?: InstlSncnRvwOpnnSaveRequestDto[];
/** 보완요구 목록 */
splmntDmndList?: InstlSncnSplmntDmndSaveDto[];
}
export type ReviewStepCode = "LOCAL" | "ENV" | "KECO"; export type ReviewStepCode = "LOCAL" | "ENV" | "KECO";
/** 설치인가검토의견 응답 DTO */ /** 설치인가검토의견 응답 DTO */
@@ -4,7 +4,7 @@ import { z } from "zod";
export const pwrkCnsltnDocCrtRsltSaveRequestSchema = z.object({ export const pwrkCnsltnDocCrtRsltSaveRequestSchema = z.object({
crtDmndUuid: z.string().uuid(), crtDmndUuid: z.string().uuid(),
pwrkCnsltnDocNo: z.string().min(1).max(100), pwrkCnsltnDocNo: z.string().min(1).max(100),
atchFileGroupId: z.string().max(30).nullish(), atchFileGroupId: z.string().max(30).optional(),
}); });
export type PwrkCnsltnDocCrtRsltSaveRequestDto = z.infer< export type PwrkCnsltnDocCrtRsltSaveRequestDto = z.infer<
@@ -1,19 +0,0 @@
import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config";
import type {
PwrkCnsltnDocEvlId,
PwrkCnsltnDocEvlService,
} from "../model/pwrk-cnsltn-doc-evl-interface";
import type { PwrkCnsltnDocEvlSaveRequestDto } from "../model/pwrk-cnsltn-doc-evl-payload-schema";
const BASE = ENDPOINT.AS_SERVICE.PWRK_CNSLTN_DOC_EVL;
async function save(body: PwrkCnsltnDocEvlSaveRequestDto): Promise<PwrkCnsltnDocEvlId> {
const response = await client.post<PwrkCnsltnDocEvlId>(BASE, body);
return response.data;
}
export const pwrkCnsltnDocEvlService = {
save,
} satisfies PwrkCnsltnDocEvlService;
@@ -1,11 +0,0 @@
import { useMutation } from "@tanstack/react-query";
import type { PwrkCnsltnDocEvlSaveRequestDto } from "../model/pwrk-cnsltn-doc-evl-payload-schema";
import { pwrkCnsltnDocEvlService } from "./pwrk-cnsltn-doc-evl-service";
export function useSavePwrkCnsltnDocEvl() {
return useMutation({
mutationFn: (body: PwrkCnsltnDocEvlSaveRequestDto) => pwrkCnsltnDocEvlService.save(body),
});
}
@@ -1,10 +0,0 @@
export { pwrkCnsltnDocEvlService } from "./api/pwrk-cnsltn-doc-evl-service";
export { useSavePwrkCnsltnDocEvl } from "./api/queries";
export type {
PwrkCnsltnDocEvlId,
PwrkCnsltnDocEvlService,
} from "./model/pwrk-cnsltn-doc-evl-interface";
export {
type PwrkCnsltnDocEvlSaveRequestDto,
pwrkCnsltnDocEvlSaveRequestSchema,
} from "./model/pwrk-cnsltn-doc-evl-payload-schema";
@@ -1,12 +0,0 @@
import type { PwrkCnsltnDocEvlSaveRequestDto } from "./pwrk-cnsltn-doc-evl-payload-schema";
/** 백엔드 PwrkCnsltnDocEvlId (IdClass) */
export interface PwrkCnsltnDocEvlId {
pwrkCnsltnDocMng: string;
pwrkCnsltnDocEvlUuid: string;
}
/** Controller public 메서드명·시그니처와 동일 (save만) */
export interface PwrkCnsltnDocEvlService {
save(body: PwrkCnsltnDocEvlSaveRequestDto): Promise<PwrkCnsltnDocEvlId>;
}
@@ -1,12 +0,0 @@
import { z } from "zod";
/** 백엔드 PwrkCnsltnDocEvlSaveRequestDto */
export const pwrkCnsltnDocEvlSaveRequestSchema = z.object({
pwrkCnsltnDocNo: z.string().min(1),
pwrkCnsltnDocEvlUuid: z.string().uuid().nullish(),
pwrkCnsltnDocEvlCn: z.string().max(2000).nullish(),
pwrkCnsltnDocEvlScr: z.number().nullish(),
pwrkCnsltnDocEvlDt: z.string().nullish(),
});
export type PwrkCnsltnDocEvlSaveRequestDto = z.infer<typeof pwrkCnsltnDocEvlSaveRequestSchema>;
@@ -3,18 +3,18 @@ import { z } from "zod";
/** 백엔드 PwrkActnResultSubmitDto.ActnItemDto */ /** 백엔드 PwrkActnResultSubmitDto.ActnItemDto */
export const pwrkActnResultActnItemSchema = z.object({ export const pwrkActnResultActnItemSchema = z.object({
rvwOpnnSn: z.number(), rvwOpnnSn: z.number(),
actnRsltCn: z.string().nullish(), actnRsltCn: z.string().optional(),
rfltYn: z.string().nullish(), rfltYn: z.string().optional(),
atchFileGroupId: z.string().nullish(), atchFileGroupId: z.string().optional(),
}); });
/** 백엔드 PwrkActnResultSubmitDto */ /** 백엔드 PwrkActnResultSubmitDto */
export const pwrkActnResultSubmitSchema = z.object({ export const pwrkActnResultSubmitSchema = z.object({
isSubmit: z.boolean(), isSubmit: z.boolean(),
actnList: z.array(pwrkActnResultActnItemSchema).nullish(), actnList: z.array(pwrkActnResultActnItemSchema).optional(),
totActnSummary: z.string().nullish(), totActnSummary: z.string().optional(),
muniDocNo: z.string().nullish(), muniDocNo: z.string().optional(),
pwrkAtchFileGroupId: z.string().nullish(), pwrkAtchFileGroupId: z.string().optional(),
}); });
export type PwrkActnResultSubmitDto = z.infer<typeof pwrkActnResultSubmitSchema>; export type PwrkActnResultSubmitDto = z.infer<typeof pwrkActnResultSubmitSchema>;
@@ -2,160 +2,160 @@ import { z } from "zod";
/** 백엔드 SewerBscPlanSaveRequestDto */ /** 백엔드 SewerBscPlanSaveRequestDto */
export const sewerBscPlanSaveSchema = z.object({ export const sewerBscPlanSaveSchema = z.object({
sewerBscPlanDocNo: z.string().nullish(), sewerBscPlanDocNo: z.string().optional(),
admdstCd: z.string().nullish(), admdstCd: z.string().optional(),
envoSeComCd: z.string().nullish(), envoSeComCd: z.string().optional(),
sewerBscPlanSeComCd: z.string().nullish(), sewerBscPlanSeComCd: z.string().optional(),
sewerBscPlanNm: z.string().nullish(), sewerBscPlanNm: z.string().optional(),
taskSeComCd: z.string().nullish(), taskSeComCd: z.string().optional(),
prgrsSttsComCd: z.string().nullish(), prgrsSttsComCd: z.string().optional(),
}); });
/** 백엔드 SewerBscPlanDtlSaveRequestDto */ /** 백엔드 SewerBscPlanDtlSaveRequestDto */
export const sewerBscPlanDtlSaveSchema = z.object({ export const sewerBscPlanDtlSaveSchema = z.object({
sewerBscPlanDocNo: z.string().nullish(), sewerBscPlanDocNo: z.string().optional(),
chgCycl: z.number().nullish(), chgCycl: z.number().optional(),
aplcntNm: z.string().nullish(), aplcntNm: z.string().optional(),
aplcntMblTelno: z.string().nullish(), aplcntMblTelno: z.string().optional(),
aplcntOgdpNm: z.string().nullish(), aplcntOgdpNm: z.string().optional(),
aplcntEmlAddr: z.string().nullish(), aplcntEmlAddr: z.string().optional(),
dsgnrNm: z.string().nullish(), dsgnrNm: z.string().optional(),
dsgnrTelno: z.string().nullish(), dsgnrTelno: z.string().optional(),
dsgnrOgdpNm: z.string().nullish(), dsgnrOgdpNm: z.string().optional(),
dsgnrEmlAddr: z.string().nullish(), dsgnrEmlAddr: z.string().optional(),
planYr: z.string().nullish(), planYr: z.string().optional(),
crtrYr: z.string().nullish(), crtrYr: z.string().optional(),
bizOtlnCn: z.string().nullish(), bizOtlnCn: z.string().optional(),
frlvlGoalYr: z.string().nullish(), frlvlGoalYr: z.string().optional(),
sclvlGoalYr: z.string().nullish(), sclvlGoalYr: z.string().optional(),
thlvlGoalYr: z.string().nullish(), thlvlGoalYr: z.string().optional(),
folvlGoalYr: z.string().nullish(), folvlGoalYr: z.string().optional(),
atchFileGroupId: z.string().nullish(), atchFileGroupId: z.string().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanOtlnItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanOtlnItem */
export const sewerBscPlanOtlnItemSchema = z.object({ export const sewerBscPlanOtlnItemSchema = z.object({
planStpNo: z.number().nullish(), planStpNo: z.number().optional(),
sewerPlanPpltnCnt: z.number().nullish(), sewerPlanPpltnCnt: z.number().optional(),
sewerPrcsPpltnCnt: z.number().nullish(), sewerPrcsPpltnCnt: z.number().optional(),
sewerPsplyRt: z.number().nullish(), sewerPsplyRt: z.number().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.CklstResultItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.CklstResultItem */
export const sewerBscPlanCklstResultItemSchema = z.object({ export const sewerBscPlanCklstResultItemSchema = z.object({
cklstRvwSn: z.number().nullish(), cklstRvwSn: z.number().optional(),
cklstArtclSn: z.number().nullish(), cklstArtclSn: z.number().optional(),
cklstSn: z.number().nullish(), cklstSn: z.number().optional(),
rvwStpComCd: z.string(), rvwStpComCd: z.string(),
selected: z.enum(["Y", "N"]).nullish(), selected: z.string().optional(),
picRvwCn: z.string().nullish(), picRvwCn: z.string().nullish(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanFnrsCstItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanFnrsCstItem */
export const sewerBscPlanFnrsCstItemSchema = z.object({ export const sewerBscPlanFnrsCstItemSchema = z.object({
planStpNo: z.number().nullish(), planStpNo: z.number().optional(),
gvexpAmt: z.number().nullish(), gvexpAmt: z.number().optional(),
lcexpAmt: z.number().nullish(), lcexpAmt: z.number().optional(),
orgprBdchgAmt: z.number().nullish(), orgprBdchgAmt: z.number().optional(),
etcAmt: z.number().nullish(), etcAmt: z.number().optional(),
sumAmt: z.number().nullish(), sumAmt: z.number().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanSplmntDmndItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanSplmntDmndItem */
export const sewerBscPlanSplmntDmndItemSchema = z.object({ export const sewerBscPlanSplmntDmndItemSchema = z.object({
splmntDmndSn: z.number().nullish(), splmntDmndSn: z.number().nullish(),
splmntArtclComCd: z.string().nullish(), splmntArtclComCd: z.string().nullish(),
splmntDmndCn: z.string().nullish(), splmntDmndCn: z.string().optional(),
splmntDmndDt: z.string().nullish(), splmntDmndDt: z.string().optional(),
splmntDmndAtchFileGroupId: z.string().nullish(), splmntDmndAtchFileGroupId: z.string().optional(),
splmntCn: z.string().nullish(), splmntCn: z.string().optional(),
splmntPicNm: z.string().nullish(), splmntPicNm: z.string().optional(),
splmntCmptnDt: z.string().nullish(), splmntCmptnDt: z.string().optional(),
splmntAtchFileGroupId: z.string().nullish(), splmntAtchFileGroupId: z.string().optional(),
cmptnYn: z.string().nullish(), cmptnYn: z.string().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanRvwOpnnItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanRvwOpnnItem */
export const sewerBscPlanRvwOpnnItemSchema = z.object({ export const sewerBscPlanRvwOpnnItemSchema = z.object({
rvwOpnnSn: z.number().nullish(), rvwOpnnSn: z.number().optional(),
opnrSeComCd: z.string().nullish(), opnrSeComCd: z.string().optional(),
opnrNm: z.string().nullish(), opnrNm: z.string().optional(),
rvwRsltCn: z.string().nullish(), rvwRsltCn: z.string().optional(),
rvwRsltAnmlyYn: z.string().nullish(), rvwRsltAnmlyYn: z.string().optional(),
atchFileGroupId: z.string().nullish(), atchFileGroupId: z.string().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.EsntlAtchFileItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.EsntlAtchFileItem */
export const sewerBscPlanEsntlAtchFileItemSchema = z.object({ export const sewerBscPlanEsntlAtchFileItemSchema = z.object({
esntlAtchFileId: z.string().nullish(), esntlAtchFileId: z.string().optional(),
atchFileGroupId: z.string().nullish(), atchFileGroupId: z.string().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanBizCstItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanBizCstItem */
export const sewerBscPlanBizCstItemSchema = z.object({ export const sewerBscPlanBizCstItemSchema = z.object({
planStpNo: z.number().nullish(), planStpNo: z.number().optional(),
acntgSeCd: z.string().nullish(), acntgSeCd: z.string().optional(),
cstrnAmt: z.number().nullish(), cstrnAmt: z.number().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntDtlItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntDtlItem */
export const sewerBscPlanTmplntDtlItemSchema = z.object({ export const sewerBscPlanTmplntDtlItemSchema = z.object({
planStpNo: z.number().nullish(), planStpNo: z.number().optional(),
swtrmtFcltCd: z.string().nullish(), swtrmtFcltCd: z.string().optional(),
prcsZoneArea: z.number().nullish(), prcsZoneArea: z.number().optional(),
swtrmtPpltnCnt: z.number().nullish(), swtrmtPpltnCnt: z.number().optional(),
planSwqty: z.number().nullish(), planSwqty: z.number().optional(),
fcltCpct: z.number().nullish(), fcltCpct: z.number().optional(),
sprsysDrtwPplLen: z.number().nullish(), sprsysDrtwPplLen: z.number().optional(),
sprsysExlnPplLen: z.number().nullish(), sprsysExlnPplLen: z.number().optional(),
cbsysPplLen: z.number().nullish(), cbsysPplLen: z.number().optional(),
icptgPplLen: z.number().nullish(), icptgPplLen: z.number().optional(),
drgCnt: z.number().nullish(), drgCnt: z.number().optional(),
drtwRlyPumpCnt: z.number().nullish(), drtwRlyPumpCnt: z.number().optional(),
drtwPumpCnt: z.number().nullish(), drtwPumpCnt: z.number().optional(),
exlnPumpCnt: z.number().nullish(), exlnPumpCnt: z.number().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntItem */
export const sewerBscPlanTmplntItemSchema = z.object({ export const sewerBscPlanTmplntItemSchema = z.object({
swtrmtFcltCd: z.string().nullish(), swtrmtFcltCd: z.string().optional(),
atchFileGroupId: z.string().nullish(), atchFileGroupId: z.string().optional(),
sewerBscPlanTmplntDtlList: z.array(sewerBscPlanTmplntDtlItemSchema).nullish(), sewerBscPlanTmplntDtlList: z.array(sewerBscPlanTmplntDtlItemSchema).optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntTmprStrgItem */ /** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntTmprStrgItem */
export const sewerBscPlanTmplntTmprStrgItemSchema = z.object({ export const sewerBscPlanTmplntTmprStrgItemSchema = z.object({
dtStrgDt: z.string().nullish(), dtStrgDt: z.string().optional(),
swtrmtFcltCd: z.string().nullish(), swtrmtFcltCd: z.string().optional(),
prcsZoneArea: z.number().nullish(), prcsZoneArea: z.number().optional(),
swtrmtPpltnCnt: z.number().nullish(), swtrmtPpltnCnt: z.number().optional(),
planSwqty: z.number().nullish(), planSwqty: z.number().optional(),
fcltCpct: z.number().nullish(), fcltCpct: z.number().optional(),
sprsysDrtwPplLen: z.number().nullish(), sprsysDrtwPplLen: z.number().optional(),
sprsysExlnPplLen: z.number().nullish(), sprsysExlnPplLen: z.number().optional(),
cbsysPplLen: z.number().nullish(), cbsysPplLen: z.number().optional(),
icptgPplLen: z.number().nullish(), icptgPplLen: z.number().optional(),
drgCnt: z.number().nullish(), drgCnt: z.number().optional(),
drtwRlyPumpCnt: z.number().nullish(), drtwRlyPumpCnt: z.number().optional(),
drtwPumpCnt: z.number().nullish(), drtwPumpCnt: z.number().optional(),
exlnPumpCnt: z.number().nullish(), exlnPumpCnt: z.number().optional(),
}); });
/** 백엔드 SewerBscPlanApplySaveRequestDto */ /** 백엔드 SewerBscPlanApplySaveRequestDto */
export const sewerBscPlanApplySaveSchema = z.object({ export const sewerBscPlanApplySaveSchema = z.object({
techReViewSaveCd: z.string().nullish(), techReViewSaveCd: z.string().optional(),
rvwStpCd: z.string().nullish(), rvwStpCd: z.string().optional(),
sewerBscPlan: sewerBscPlanSaveSchema, sewerBscPlan: sewerBscPlanSaveSchema,
sewerBscPlanDtl: sewerBscPlanDtlSaveSchema, sewerBscPlanDtl: sewerBscPlanDtlSaveSchema,
sewerBscPlanOtlnList: z.array(sewerBscPlanOtlnItemSchema).nullish(), sewerBscPlanOtlnList: z.array(sewerBscPlanOtlnItemSchema).optional(),
cklstResultList: z.array(sewerBscPlanCklstResultItemSchema).nullish(), cklstResultList: z.array(sewerBscPlanCklstResultItemSchema).optional(),
fnrsCstList: z.array(sewerBscPlanFnrsCstItemSchema).nullish(), fnrsCstList: z.array(sewerBscPlanFnrsCstItemSchema).optional(),
splmntDmndList: z.array(sewerBscPlanSplmntDmndItemSchema).nullish(), splmntDmndList: z.array(sewerBscPlanSplmntDmndItemSchema).optional(),
rvwOpnnList: z.array(sewerBscPlanRvwOpnnItemSchema).nullish(), rvwOpnnList: z.array(sewerBscPlanRvwOpnnItemSchema).optional(),
esntlAtchFileList: z.array(sewerBscPlanEsntlAtchFileItemSchema).nullish(), esntlAtchFileList: z.array(sewerBscPlanEsntlAtchFileItemSchema).optional(),
bizCstList: z.array(sewerBscPlanBizCstItemSchema).nullish(), bizCstList: z.array(sewerBscPlanBizCstItemSchema).optional(),
sewerBscPlanTmplntList: z.array(sewerBscPlanTmplntItemSchema).nullish(), sewerBscPlanTmplntList: z.array(sewerBscPlanTmplntItemSchema).optional(),
tmplntTmprStrgList: z.array(sewerBscPlanTmplntTmprStrgItemSchema).nullish(), tmplntTmprStrgList: z.array(sewerBscPlanTmplntTmprStrgItemSchema).optional(),
}); });
export type SewerBscPlanSaveRequestDto = z.infer<typeof sewerBscPlanSaveSchema>; export type SewerBscPlanSaveRequestDto = z.infer<typeof sewerBscPlanSaveSchema>;
@@ -1,13 +1,7 @@
import { z } from "zod"; import { z } from "zod";
import {
designCnstnBzScaleItemSchema,
designCnstnEsntlAtchFileItemSchema,
designCnstnMngSaveSchema,
} from "@/entities/design-cnstn";
export const designCnstnRegistSchema = z.object({ export const designCnstnRegistSchema = z.object({
designCnstnMng: designCnstnMngSaveSchema.extend({ designCnstnMng: z.object({
bizNm: z.string().min(1, "사업명은 필수입니다"), bizNm: z.string().min(1, "사업명은 필수입니다"),
bizBgngYr: z.string().min(1, "사업시작연도는 필수입니다"), bizBgngYr: z.string().min(1, "사업시작연도는 필수입니다"),
bizEndYr: z.string().min(1, "사업종료연도는 필수입니다"), bizEndYr: z.string().min(1, "사업종료연도는 필수입니다"),
@@ -23,20 +17,36 @@ export const designCnstnRegistSchema = z.object({
.string() .string()
.min(1, "설계자 이메일은 필수입니다") .min(1, "설계자 이메일은 필수입니다")
.email("올바른 이메일 형식이 아닙니다"), .email("올바른 이메일 형식이 아닙니다"),
sido: z.string().nullish(), aplcntNm: z.string().optional(),
gugun: z.string().nullish(), aplcntMblTelno: z.string().optional(),
aplcntOgdpNm: z.string().optional(),
aplcntEmlAddr: z.string().optional(),
designCnstnDocNo: z.string().optional(),
admdstCd: z.string().optional(),
envoSeComCd: z.string().optional(),
prgrsSttsComCd: z.string().optional(),
atchFileGroupId: z.string().optional(),
envoSeCdNm: z.string().optional(),
taskSeCdNm: z.string().optional(),
prgrsSttsCdNm: z.string().optional(),
sido: z.string().optional(),
gugun: z.string().optional(),
regDt: z.string().optional(),
rgtr: z.string().optional(),
rgtrNm: z.string().optional(),
mdfcnDt: z.string().optional(),
}), }),
bzScaleList: z.array( bzScaleList: z.array(
designCnstnBzScaleItemSchema.extend({ z.object({
cnstpSeCd: z.string(), cnstpSeCd: z.string(),
bscPl: z.number(), bscPl: z.number(),
budgetReflct: z.number(), budgetReflct: z.number(),
thtiDsgn: z.number(), thtiDsgn: z.number(),
diff: z.number().nullish(), diff: z.number().optional(),
}), }),
), ),
esntlAtchFileList: z.array( esntlAtchFileList: z.array(
designCnstnEsntlAtchFileItemSchema.extend({ z.object({
esntlAtchFileId: z.string(), esntlAtchFileId: z.string(),
atchFileGroupId: z.string(), atchFileGroupId: z.string(),
}), }),
@@ -52,7 +62,7 @@ export function formatTaskSeComCdForApi(taskSeComCd: string[]): string {
return taskSeComCd.join(","); return taskSeComCd.join(",");
} }
export function parseTaskSeComCdFromApi(taskSeComCd?: string | null): string[] { export function parseTaskSeComCdFromApi(taskSeComCd?: string): string[] {
if (!taskSeComCd) return []; if (!taskSeComCd) return [];
return taskSeComCd.split(",").filter(Boolean); return taskSeComCd.split(",").filter(Boolean);
} }
@@ -1,13 +1,9 @@
import type { IUserInfo } from "@/shared/store"; import type { IUserInfo } from "@/shared/store";
import { import type { DesignCnstnMngDetResponseDto } from "@/entities/design-cnstn";
type DesignCnstnApplySaveRequestDto,
designCnstnApplySaveSchema,
type DesignCnstnMngDetResponseDto,
} from "@/entities/design-cnstn";
import { toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt"; import { toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt";
import type { DesignCnstnRegistFormData } from "./design-cnstn-regist-schema"; import type { DesignCnstnRegistFormData } from "./design-cnstn-regist-schema";
import { formatTaskSeComCdForApi, parseTaskSeComCdFromApi } from "./design-cnstn-regist-schema"; import { parseTaskSeComCdFromApi } from "./design-cnstn-regist-schema";
export function mapDetailToFormData(data: DesignCnstnMngDetResponseDto): DesignCnstnRegistFormData { export function mapDetailToFormData(data: DesignCnstnMngDetResponseDto): DesignCnstnRegistFormData {
const detDto = data.detDto; const detDto = data.detDto;
@@ -37,8 +33,15 @@ export function mapDetailToFormData(data: DesignCnstnMngDetResponseDto): DesignC
envoSeComCd: detDto.envoSeComCd, envoSeComCd: detDto.envoSeComCd,
prgrsSttsComCd: detDto.prgrsSttsComCd, prgrsSttsComCd: detDto.prgrsSttsComCd,
atchFileGroupId: detDto.atchFileGroupId ?? "", atchFileGroupId: detDto.atchFileGroupId ?? "",
envoSeCdNm: detDto.envoSeCdNm,
taskSeCdNm: detDto.taskSeCdNm,
prgrsSttsCdNm: detDto.prgrsSttsCdNm,
sido: detDto.sido, sido: detDto.sido,
gugun: detDto.gugun, gugun: detDto.gugun,
regDt: detDto.regDt,
rgtr: detDto.rgtr,
rgtrNm: detDto.rgtrNm,
mdfcnDt: detDto.mdfcnDt,
}, },
bzScaleList: bizSclList.map((item) => ({ bzScaleList: bizSclList.map((item) => ({
cnstpSeCd: item.cnstpSeCd, cnstpSeCd: item.cnstpSeCd,
@@ -87,20 +90,3 @@ export function getCreateDefaultValues(
privacyConsent: "N", privacyConsent: "N",
}; };
} }
export function buildFormPayload(
data: DesignCnstnRegistFormData,
prgrsSttsComCd: "CV" | "CT",
options: { isEditMode: boolean; docNo?: string },
): DesignCnstnApplySaveRequestDto {
return designCnstnApplySaveSchema.parse({
designCnstnMng: {
...data.designCnstnMng,
taskSeComCd: formatTaskSeComCdForApi(data.designCnstnMng.taskSeComCd),
designCnstnDocNo: options.isEditMode ? options.docNo : undefined,
prgrsSttsComCd,
},
bzScaleList: data.bzScaleList,
esntlAtchFileList: data.esntlAtchFileList,
});
}
@@ -4,7 +4,6 @@ import type {
DesignCnstnApplySaveRequestDto, DesignCnstnApplySaveRequestDto,
DesignCnstnMngDetResponseDto, DesignCnstnMngDetResponseDto,
} from "@/entities/design-cnstn"; } from "@/entities/design-cnstn";
import { designCnstnApplySaveSchema } from "@/entities/design-cnstn";
import { toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt"; import { toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt";
import type { ReviewStepCode } from "../model/view-types"; import type { ReviewStepCode } from "../model/view-types";
@@ -31,11 +30,11 @@ export function buildSavePayload(
throw new Error("상세 정보(detDto)가 없습니다."); throw new Error("상세 정보(detDto)가 없습니다.");
} }
return designCnstnApplySaveSchema.parse({ return {
designCnstnMng: { ...detDto, prgrsSttsComCd }, designCnstnMng: { ...detDto, prgrsSttsComCd },
bzScaleList: toBzScaleSaveDto(data.bizSclList ?? []), bzScaleList: toBzScaleSaveDto(data.bizSclList ?? []),
esntlAtchFileList: toEsntlAtchFileSaveList(data.esntlFileList), esntlAtchFileList: toEsntlAtchFileSaveList(data.esntlFileList),
}); };
} }
export function buildTechReviewPayload( export function buildTechReviewPayload(
@@ -46,10 +45,10 @@ export function buildTechReviewPayload(
reviewOpinionFormData?: ReviewOpinionGetFormDataResult | null, reviewOpinionFormData?: ReviewOpinionGetFormDataResult | null,
opnrNm?: string, opnrNm?: string,
): DesignCnstnApplySaveRequestDto { ): DesignCnstnApplySaveRequestDto {
return designCnstnApplySaveSchema.parse({ return {
...buildSavePayload(data, prgrsSttsComCd), ...buildSavePayload(data, prgrsSttsComCd),
techReViewSaveCd, techReViewSaveCd,
rvwStpCd: reviewStep, rvwStpCd: reviewStep,
rvwOpnnList: toRvwOpnnSaveDto(data, reviewOpinionFormData, opnrNm), rvwOpnnList: toRvwOpnnSaveDto(data, reviewOpinionFormData, opnrNm),
}); };
} }
@@ -72,7 +72,7 @@ function getBadgeColor(state: BadgeState) {
} }
} }
function formatOptional(value: string | null | undefined) { function formatOptional(value: string | undefined) {
return value?.trim() ? value : "-"; return value?.trim() ? value : "-";
} }
@@ -9,8 +9,9 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { useAlertStore, useUserStore } from "@/shared/lib"; import { useAlertStore, useUserStore } from "@/shared/lib";
import { RhfDevTool, SectionCollapsibleGroup, SectionCollapsibleToggle } from "@/shared/ui"; import { SectionCollapsibleGroup, SectionCollapsibleToggle } from "@/shared/ui";
import { import {
type DesignCnstnApplySaveRequestDto,
designCnstnKeys, designCnstnKeys,
type DesignCnstnMngDetResponseDto, type DesignCnstnMngDetResponseDto,
designCnstnMngService, designCnstnMngService,
@@ -26,12 +27,12 @@ import {
} from "@/widgets/pbadms-sprt"; } from "@/widgets/pbadms-sprt";
import { Button } from "@common/components"; import { Button } from "@common/components";
import { type DesignCnstnRegistFormData, designCnstnRegistSchema } from "../lib/design-cnstn-regist-schema";
import { import {
buildFormPayload, type DesignCnstnRegistFormData,
getCreateDefaultValues, designCnstnRegistSchema,
mapDetailToFormData, formatTaskSeComCdForApi,
} from "../lib/form-data-mapper"; } from "../lib/design-cnstn-regist-schema";
import { getCreateDefaultValues, mapDetailToFormData } from "../lib/form-data-mapper";
import { PROGRESS_STATUS_COLUMNS } from "../model/columns"; import { PROGRESS_STATUS_COLUMNS } from "../model/columns";
import { BasicInfoFormSection } from "./sections/basic-info-form-section"; import { BasicInfoFormSection } from "./sections/basic-info-form-section";
@@ -67,18 +68,29 @@ function DesignFormPage({ mode, initialData, createDefaults }: DesignFormPagePro
: getCreateDefaultValues(userInfo, createDefaults), : getCreateDefaultValues(userInfo, createDefaults),
}); });
function createFormPayload(data: DesignCnstnRegistFormData, prgrsSttsComCd: "CV" | "CT") { function buildFormPayload(
return buildFormPayload(data, prgrsSttsComCd, { data: DesignCnstnRegistFormData,
isEditMode, prgrsSttsComCd: "CV" | "CT",
docNo: initialData?.detDto?.designCnstnDocNo, ): DesignCnstnApplySaveRequestDto {
}); const { taskSeComCd: formTaskSeComCd, ...designCnstnMngRest } = data.designCnstnMng;
return {
designCnstnMng: {
...designCnstnMngRest,
taskSeComCd: formatTaskSeComCdForApi(formTaskSeComCd),
designCnstnDocNo: isEditMode ? initialData?.detDto?.designCnstnDocNo : undefined,
prgrsSttsComCd,
},
bzScaleList: data.bzScaleList,
esntlAtchFileList: data.esntlAtchFileList,
};
} }
async function submitForm( async function submitForm(
data: DesignCnstnRegistFormData, data: DesignCnstnRegistFormData,
prgrsSttsComCd: "CV" | "CT", prgrsSttsComCd: "CV" | "CT",
): Promise<string | undefined> { ): Promise<string | undefined> {
return designCnstnMngService.saveApply(createFormPayload(data, prgrsSttsComCd)); return designCnstnMngService.saveApply(buildFormPayload(data, prgrsSttsComCd));
} }
async function onSave(data: DesignCnstnRegistFormData) { async function onSave(data: DesignCnstnRegistFormData) {
@@ -217,7 +229,6 @@ function DesignFormPage({ mode, initialData, createDefaults }: DesignFormPagePro
</div> </div>
</SectionCollapsibleGroup> </SectionCollapsibleGroup>
</form> </form>
<RhfDevTool control={form.control} />
</FormProvider> </FormProvider>
); );
} }
@@ -1,5 +1,3 @@
import type { RagIndexingInfoDto } from "@/entities/fnrs-cnsltn";
const AI_PENDING_STATUS_CODES = ["FV", "AC", "AV"] as const; const AI_PENDING_STATUS_CODES = ["FV", "AC", "AV"] as const;
type AiPendingStatusCode = (typeof AI_PENDING_STATUS_CODES)[number]; type AiPendingStatusCode = (typeof AI_PENDING_STATUS_CODES)[number];
@@ -19,17 +17,5 @@ function getAiPendingMessage(prgrsSttsComCd: string): string {
return AI_PENDING_MESSAGES[prgrsSttsComCd as AiPendingStatusCode]; return AI_PENDING_MESSAGES[prgrsSttsComCd as AiPendingStatusCode];
} }
function isRagIndexingInProgress( export { AI_PENDING_STATUS_CODES, getAiPendingMessage, isAiPendingStatus };
prgrsSttsComCd: string,
ragIndexingInfo?: RagIndexingInfoDto | null,
): boolean {
return prgrsSttsComCd === "ER" && ragIndexingInfo?.isInProgress === true;
}
export {
AI_PENDING_STATUS_CODES,
getAiPendingMessage,
isAiPendingStatus,
isRagIndexingInProgress,
};
export type { AiPendingStatusCode }; export type { AiPendingStatusCode };
@@ -9,7 +9,6 @@ export const FNRS_CNSLTN_VIEW_BUTTON_ACTION = {
rvwOpnnRply: "rvwOpnnRply", rvwOpnnRply: "rvwOpnnRply",
rqstTechRvw: "rqstTechRvw", rqstTechRvw: "rqstTechRvw",
fileSplmnt: "fileSplmnt", fileSplmnt: "fileSplmnt",
fileVrfc: "fileVrfc",
dsgntRvwr: "dsgntRvwr", dsgntRvwr: "dsgntRvwr",
pwrkCnsltnDocCrt: "pwrkCnsltnDocCrt", pwrkCnsltnDocCrt: "pwrkCnsltnDocCrt",
pwrkCnsltnDocMng: "pwrkCnsltnDocMng", pwrkCnsltnDocMng: "pwrkCnsltnDocMng",
@@ -21,7 +20,6 @@ export const FNRS_CNSLTN_VIEW_BUTTON_ACTION = {
atrzRply: "atrzRply", atrzRply: "atrzRply",
actnCmptn: "actnCmptn", actnCmptn: "actnCmptn",
rqstActnRvw: "rqstActnRvw", rqstActnRvw: "rqstActnRvw",
costVrfc: "costVrfc",
} as const; } as const;
export type FnrsCnsltnViewButtonAction = export type FnrsCnsltnViewButtonAction =
@@ -51,19 +49,14 @@ const ROLE_STATUS_BUTTON_ACTIONS: Record<string, Record<string, FnrsCnsltnViewBu
LE: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstTechRvw], LE: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstTechRvw],
TP: [ TP: [
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwOpnnRply, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwOpnnRply,
], ],
RB: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
RA: [ RA: [
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstActnRvw, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstActnRvw,
], ],
AV: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
EV: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
RK: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
RR: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply], RR: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply],
EP: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
TA: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
}, },
}; };
@@ -87,11 +80,7 @@ const ROLE_USER01_ATRZ_STATUS_ACTIONS: Record<
Record<string, FnrsCnsltnViewButtonAction[]> Record<string, FnrsCnsltnViewButtonAction[]>
> = { > = {
ER: { ER: {
ATRZ01: [ ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.fileSplmnt, FNRS_CNSLTN_VIEW_BUTTON_ACTION.dsgntRvwr],
FNRS_CNSLTN_VIEW_BUTTON_ACTION.fileSplmnt,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.fileVrfc,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.dsgntRvwr,
],
}, },
SL: { SL: {
ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
@@ -146,7 +135,6 @@ const ROLE_USER01_ATRZ_STATUS_ACTIONS: Record<
ATRZ01: [ ATRZ01: [
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.dsgntRvwr, FNRS_CNSLTN_VIEW_BUTTON_ACTION.dsgntRvwr,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.costVrfc,
], ],
ATRZ02: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], ATRZ02: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ03: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], ATRZ03: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
@@ -195,9 +183,6 @@ function resolveButtonConfigs(actions: FnrsCnsltnViewButtonAction[]): FnrsCnsltn
interface GetButtonConfigsOptions { interface GetButtonConfigsOptions {
hasPendingApprovalRequest?: boolean; hasPendingApprovalRequest?: boolean;
hasCompletedDraft?: boolean; hasCompletedDraft?: boolean;
canRetryFileVrfc?: boolean;
canRetryDraftGen?: boolean;
canRetryCostVrfc?: boolean;
} }
const PENDING_APPROVAL_ACTIONS = new Set<FnrsCnsltnViewButtonAction>([ const PENDING_APPROVAL_ACTIONS = new Set<FnrsCnsltnViewButtonAction>([
@@ -235,19 +220,6 @@ function resolveRoleUser01AtrzButtonActions(
const needsPendingApproval = PENDING_APPROVAL_ACTIONS.has(action); const needsPendingApproval = PENDING_APPROVAL_ACTIONS.has(action);
if (needsPendingApproval && options?.hasPendingApprovalRequest === false) return false; if (needsPendingApproval && options?.hasPendingApprovalRequest === false) return false;
if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.fileVrfc) {
return options?.canRetryFileVrfc === true;
}
if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.fileSplmnt) {
return options?.canRetryFileVrfc !== true;
}
if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocCrt) {
return options?.canRetryDraftGen === true;
}
if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.costVrfc) {
return options?.canRetryCostVrfc === true;
}
if (options?.hasCompletedDraft != null) { if (options?.hasCompletedDraft != null) {
if (prgrsSttsComCd === "SL" || prgrsSttsComCd === "TE" || prgrsSttsComCd === "RK") { if (prgrsSttsComCd === "SL" || prgrsSttsComCd === "TE" || prgrsSttsComCd === "RK") {
if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng) { if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng) {
@@ -258,6 +230,9 @@ function resolveRoleUser01AtrzButtonActions(
if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRsltInq) { if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRsltInq) {
return options.hasCompletedDraft; return options.hasCompletedDraft;
} }
if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocCrt) {
return !options.hasCompletedDraft;
}
} }
} }
@@ -4,6 +4,7 @@ import {
type ChecklistFormState, type ChecklistFormState,
type ChecklistProgress, type ChecklistProgress,
type ChecklistRowKey, type ChecklistRowKey,
type ChecklistStepMap,
REVIEW_STEP_CODES, REVIEW_STEP_CODES,
type ReviewStepCode, type ReviewStepCode,
} from "../model/view-types"; } from "../model/view-types";
@@ -16,6 +17,15 @@ export function buildChecklistRowKey(
return `${row.taskSeComCd}_${row.cklstSn}_${row.cklstArtclSn}_${row.cklstRvwSn}_${step}`; return `${row.taskSeComCd}_${row.cklstSn}_${row.cklstArtclSn}_${row.cklstRvwSn}_${step}`;
} }
export function groupByReviewStep(rows: CklstRvwRsltTreeDto[]): ChecklistStepMap {
const base: ChecklistStepMap = { LOCAL: [], ENV: [], KECO: [] };
rows.forEach((row) => {
const step = (row.rvwStpComCd ?? "LOCAL") as ReviewStepCode;
if (REVIEW_STEP_CODES.includes(step)) base[step].push(row);
});
return base;
}
export function extractTaskCodes(rows: CklstRvwRsltTreeDto[]): string[] { export function extractTaskCodes(rows: CklstRvwRsltTreeDto[]): string[] {
return Array.from(new Set(rows.map((row) => row.taskSeComCd).filter(Boolean))); return Array.from(new Set(rows.map((row) => row.taskSeComCd).filter(Boolean)));
} }
@@ -60,6 +70,13 @@ export function computeChecklistProgress(
return { total, completed, percent }; return { total, completed, percent };
} }
export function filterChecklistRowsByReviewStep(
rows: CklstRvwRsltTreeDto[],
reviewStep: ReviewStepCode,
): CklstRvwRsltTreeDto[] {
return rows.filter((row) => row.rvwStpComCd === reviewStep);
}
export function computeReviewStepChecklistProgress( export function computeReviewStepChecklistProgress(
rows: CklstRvwRsltTreeDto[], rows: CklstRvwRsltTreeDto[],
results: ChecklistFormState["results"], results: ChecklistFormState["results"],
@@ -76,6 +93,23 @@ export function computeReviewStepChecklistProgress(
return { total, completed, percent }; return { total, completed, percent };
} }
export function buildChecklistFormState(rows: CklstRvwRsltTreeDto[]): ChecklistFormState {
const results: ChecklistFormState["results"] = {};
const comments: ChecklistFormState["comments"] = {};
rows.forEach((row) => {
const key = buildChecklistRowKey(row);
if (row.rvwRsltAnmlyYn === "Y" || row.rvwRsltAnmlyYn === "N") {
results[key] = row.rvwRsltAnmlyYn;
}
if (row.picRvwCn) comments[key] = row.picRvwCn;
});
return {
results,
comments,
progress: computeChecklistProgress(rows, results),
};
}
export function mergeChecklistFormStateFromServer( export function mergeChecklistFormStateFromServer(
prev: ChecklistFormState, prev: ChecklistFormState,
allRows: CklstRvwRsltTreeDto[], allRows: CklstRvwRsltTreeDto[],
@@ -1,22 +1,14 @@
import { z } from "zod"; import { z } from "zod";
import {
fnrsCnsltnBizCstItemSchema,
fnrsCnsltnBzScaleItemSchema,
fnrsCnsltnCklstResultItemSchema,
fnrsCnsltnEsntlAtchFileItemSchema,
fnrsCnsltnMngSaveSchema,
fnrsCnsltnSplmntDmndItemSchema,
fnrsSharItemSchema,
} from "@/entities/fnrs-cnsltn";
export const fnrsCnsltnRegistSchema = z.object({ export const fnrsCnsltnRegistSchema = z.object({
fnrsCnsltnMng: fnrsCnsltnMngSaveSchema.extend({ fnrsCnsltnMng: z.object({
bizNm: z.string().min(1, "사업명은 필수입니다"), bizNm: z.string().min(1, "사업명은 필수입니다"),
bizBgngYr: z.string().min(1, "사업시작연도는 필수입니다"), bizBgngYr: z.string().min(1, "사업시작연도는 필수입니다"),
bizEndYr: z.string().min(1, "사업종료연도는 필수입니다"), bizEndYr: z.string().min(1, "사업종료연도는 필수입니다"),
bizCn: z.string().min(1, "사업내용은 필수입니다"), bizCn: z.string().min(1, "사업내용은 필수입니다"),
taskSeComCd: z.array(z.string()).min(1, "구분은 필수입니다"), taskSeComCd: z.array(z.string()).min(1, "구분은 필수입니다"),
cfmtnBgtBizNo: z.string().optional(),
bgtAplyYr: z.string().optional(),
dsgnrNm: z.string().min(1, "설계자 이름은 필수입니다"), dsgnrNm: z.string().min(1, "설계자 이름은 필수입니다"),
dsgnrTelno: z dsgnrTelno: z
.string() .string()
@@ -27,20 +19,39 @@ export const fnrsCnsltnRegistSchema = z.object({
.string() .string()
.min(1, "설계자 이메일은 필수입니다") .min(1, "설계자 이메일은 필수입니다")
.email("올바른 이메일 형식이 아닙니다"), .email("올바른 이메일 형식이 아닙니다"),
sido: z.string().nullish(), aplcntNm: z.string().optional(),
gugun: z.string().nullish(), aplcntMblTelno: z.string().optional(),
aplcntOgdpNm: z.string().optional(),
aplcntEmlAddr: z.string().optional(),
fnrsCnsltnDocNo: z.string().optional(),
admdstCd: z.string().optional(),
envoSeComCd: z.string().optional(),
rtlztnFcltSeComCd: z.string().optional(),
rtlztnUsgSeComCd: z.string().optional(),
prgrsSttsComCd: z.string().optional(),
atchFileGroupId: z.string().optional(),
sharAtchFileGroupId: z.string().optional(),
envoSeCdNm: z.string().optional(),
taskSeCdNm: z.string().optional(),
prgrsSttsCdNm: z.string().optional(),
sido: z.string().optional(),
gugun: z.string().optional(),
regDt: z.string().optional(),
rgtr: z.string().optional(),
rgtrNm: z.string().optional(),
mdfcnDt: z.string().optional(),
}), }),
bzScaleList: z.array( bzScaleList: z.array(
fnrsCnsltnBzScaleItemSchema.extend({ z.object({
cnstpSeCd: z.string(), cnstpSeCd: z.string(),
bscPl: z.number(), bscPl: z.number(),
budgetReflct: z.number(), budgetReflct: z.number(),
thtiDsgn: z.number(), thtiDsgn: z.number(),
diff: z.number().nullish(), diff: z.number().optional(),
}), }),
), ),
bizCstList: z.array( bizCstList: z.array(
fnrsCnsltnBizCstItemSchema.extend({ z.object({
acntgSeCd: z.string(), acntgSeCd: z.string(),
bscPlanAmt: z.number(), bscPlanAmt: z.number(),
bgtRfltAmt: z.number(), bgtRfltAmt: z.number(),
@@ -48,33 +59,46 @@ export const fnrsCnsltnRegistSchema = z.object({
}), }),
), ),
fnrsSharList: z.array( fnrsSharList: z.array(
fnrsSharItemSchema.extend({ z.object({
fnrsSharSeCd: z.string(), fnrsSharSeCd: z.string(),
exstnAmt: z.number(), exstnAmt: z.number(),
chgRqtAmt: z.number(), chgRqtAmt: z.number(),
ajmtAmt: z.number().nullish(), ajmtAmt: z.number().optional(),
rmrkCn: z.string().nullish(), rmrkCn: z.string().optional(),
}), }),
), ),
cklstResultList: z.array( cklstResultList: z.array(
fnrsCnsltnCklstResultItemSchema.extend({ z.object({
cklstSn: z.number(), cklstSn: z.number(),
cklstArtclSn: z.number(), cklstArtclSn: z.number(),
cklstRvwSn: z.number(), cklstRvwSn: z.number(),
selected: z.enum(["Y", "N"]).nullish(), rvwStpComCd: z.string().nullish(),
selected: z.enum(["Y", "N"]).nullable(),
picRvwCn: z.string().nullish(), picRvwCn: z.string().nullish(),
}), }),
), ),
esntlAtchFileList: z.array( esntlAtchFileList: z.array(
fnrsCnsltnEsntlAtchFileItemSchema.extend({ z.object({
esntlAtchFileId: z.string(), esntlAtchFileId: z.string(),
atchFileGroupId: z.string(), atchFileGroupId: z.string(),
}), }),
), ),
splmntDmndList: z.array( splmntDmndList: z.array(
fnrsCnsltnSplmntDmndItemSchema.extend({ z.object({
splmntDmndSn: z.number().nullish(),
splmntArtclComCd: z.string().nullish(),
splmntArtclCdNm: z.string().nullish(), splmntArtclCdNm: z.string().nullish(),
splmntDmndAtchFileNm: z.string().nullish(), splmntDmndCn: z.string().optional(),
splmntDmndDt: z.string().optional(),
splmntDmndAtchFileGroupId: z.string().optional(),
splmntDmndAtchFileNm: z.string().optional(),
splmntCn: z.string().optional(),
splmntPicNm: z.string().optional(),
splmntCmptnDt: z.string().optional(),
splmntAtchFileGroupId: z.string().optional(),
splmntAtchFileNm: z.string().optional(),
splmntAtchFileAtflId: z.string().optional(),
cmptnYn: z.string().optional(),
}), }),
), ),
privacyConsent: z.enum(["Y", "N"], { privacyConsent: z.enum(["Y", "N"], {
@@ -88,7 +112,7 @@ export function formatTaskSeComCdForApi(taskSeComCd: string[]): string {
return taskSeComCd.join(","); return taskSeComCd.join(",");
} }
export function parseTaskSeComCdFromApi(taskSeComCd?: string | null): string[] { export function parseTaskSeComCdFromApi(taskSeComCd?: string): string[] {
if (!taskSeComCd) return []; if (!taskSeComCd) return [];
return taskSeComCd.split(",").filter(Boolean); return taskSeComCd.split(",").filter(Boolean);
} }
@@ -1,21 +1,9 @@
import type { IUserInfo } from "@/shared/store"; import type { IUserInfo } from "@/shared/store";
import { import type { FnrsCnsltnMngDetResponseDto } from "@/entities/fnrs-cnsltn";
type FnrsCnsltnApplySaveRequestDto, import { mapFnrsSharDetToFormList, toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt";
fnrsCnsltnApplySaveSchema,
type FnrsCnsltnMngDetResponseDto,
} from "@/entities/fnrs-cnsltn";
import {
type CostItemDef,
type FnrsSharItemDef,
mapFnrsSharDetToFormList,
recalculateFnrsSharTotals,
toEsntlAtchFileSaveList,
toFnrsSharSaveList,
validateBizCstSharBalance,
} from "@/widgets/pbadms-sprt";
import type { FnrsCnsltnRegistFormData } from "./fnrs-cnsltn-regist-schema"; import type { FnrsCnsltnRegistFormData } from "./fnrs-cnsltn-regist-schema";
import { formatTaskSeComCdForApi, parseTaskSeComCdFromApi } from "./fnrs-cnsltn-regist-schema"; import { parseTaskSeComCdFromApi } from "./fnrs-cnsltn-regist-schema";
function mapSelectedValue(value?: string | null): "Y" | "N" | null { function mapSelectedValue(value?: string | null): "Y" | "N" | null {
if (value === "Y" || value === "N") return value; if (value === "Y" || value === "N") return value;
@@ -59,8 +47,15 @@ export function mapDetailToFormData(data: FnrsCnsltnMngDetResponseDto): FnrsCnsl
prgrsSttsComCd: detDto.prgrsSttsComCd, prgrsSttsComCd: detDto.prgrsSttsComCd,
atchFileGroupId: detDto.atchFileGroupId ?? "", atchFileGroupId: detDto.atchFileGroupId ?? "",
sharAtchFileGroupId: detDto.sharAtchFileGroupId ?? "", sharAtchFileGroupId: detDto.sharAtchFileGroupId ?? "",
envoSeCdNm: detDto.envoSeCdNm,
taskSeCdNm: detDto.taskSeCdNm,
prgrsSttsCdNm: detDto.prgrsSttsCdNm,
sido: detDto.sido, sido: detDto.sido,
gugun: detDto.gugun, gugun: detDto.gugun,
regDt: detDto.regDt,
rgtr: detDto.rgtr,
rgtrNm: detDto.rgtrNm,
mdfcnDt: detDto.mdfcnDt,
}, },
bzScaleList: bizSclList.map((item) => ({ bzScaleList: bizSclList.map((item) => ({
cnstpSeCd: item.cnstpSeCd, cnstpSeCd: item.cnstpSeCd,
@@ -99,6 +94,8 @@ export function mapDetailToFormData(data: FnrsCnsltnMngDetResponseDto): FnrsCnsl
splmntPicNm: item.splmntPicNm ?? "", splmntPicNm: item.splmntPicNm ?? "",
splmntCmptnDt: item.splmntCmptnDt ?? "", splmntCmptnDt: item.splmntCmptnDt ?? "",
splmntAtchFileGroupId: item.splmntAtchFileGroupId ?? "", splmntAtchFileGroupId: item.splmntAtchFileGroupId ?? "",
splmntAtchFileNm: item.splmntAtchFileInfo?.orgnlFileNm ?? "",
splmntAtchFileAtflId: item.splmntAtchFileInfo?.atflId ?? "",
cmptnYn: item.cmptnYn, cmptnYn: item.cmptnYn,
})) ?? [], })) ?? [],
privacyConsent: "Y", privacyConsent: "Y",
@@ -149,46 +146,3 @@ export function getCreateDefaultValues(
privacyConsent: "N", privacyConsent: "N",
}; };
} }
export function buildFormPayload(
data: FnrsCnsltnRegistFormData,
prgrsSttsComCd: string,
options: {
isEditMode: boolean;
docNo?: string;
sharItems: FnrsSharItemDef[];
costItems: CostItemDef[];
},
): FnrsCnsltnApplySaveRequestDto | { validationMessage: string } {
const withTotals = recalculateFnrsSharTotals(data.fnrsSharList, options.sharItems);
const validationMessage = validateBizCstSharBalance(
data.bizCstList,
withTotals,
options.sharItems,
options.costItems,
);
if (validationMessage) {
return { validationMessage };
}
return fnrsCnsltnApplySaveSchema.parse({
fnrsCnsltnMng: {
...data.fnrsCnsltnMng,
taskSeComCd: formatTaskSeComCdForApi(data.fnrsCnsltnMng.taskSeComCd),
fnrsCnsltnDocNo: options.isEditMode ? options.docNo : undefined,
prgrsSttsComCd,
},
bzScaleList: data.bzScaleList,
bizCstList: data.bizCstList,
fnrsSharList: toFnrsSharSaveList(withTotals),
cklstResultList: data.cklstResultList.map((item) => ({
...item,
selected: item.selected ?? undefined,
})),
esntlAtchFileList: data.esntlAtchFileList,
splmntDmndList: data.splmntDmndList.map((item) => ({
...item,
...(prgrsSttsComCd !== "SV" && prgrsSttsComCd !== "ST" && { cmptnYn: "Y" }),
})),
});
}
@@ -1,32 +0,0 @@
import { z } from "zod";
import { pwrkCnsltnDocEvlSaveRequestSchema } from "@/entities/pwrk-cnsltn-doc-evl";
export const PWRK_CNSLTN_DOC_EVL_SCR_OPTIONS = [
{ value: "5", label: "매우 만족" },
{ value: "4", label: "만족" },
{ value: "3", label: "보통" },
{ value: "2", label: "불만족" },
{ value: "1", label: "매우 불만족" },
] as const;
export const pwrkCnsltnDocEvlFormSchema = z.object({
pwrkCnsltnDocEvlScr: z.enum(["1", "2", "3", "4", "5"], {
required_error: "만족도를 선택해 주세요.",
invalid_type_error: "만족도를 선택해 주세요.",
}),
pwrkCnsltnDocEvlCn: z.string().max(2000).nullish(),
});
export type PwrkCnsltnDocEvlFormValues = z.infer<typeof pwrkCnsltnDocEvlFormSchema>;
export function buildPwrkCnsltnDocEvlSavePayload(
pwrkCnsltnDocNo: string,
form: PwrkCnsltnDocEvlFormValues,
) {
return pwrkCnsltnDocEvlSaveRequestSchema.parse({
pwrkCnsltnDocNo,
pwrkCnsltnDocEvlScr: Number(form.pwrkCnsltnDocEvlScr),
pwrkCnsltnDocEvlCn: form.pwrkCnsltnDocEvlCn?.trim() || undefined,
});
}
@@ -1,5 +1,3 @@
import type { CklstRvwRsltTreeDto } from "@/entities/fnrs-cnsltn";
import { import {
PBADMS_PROGRESS_ORDER, PBADMS_PROGRESS_ORDER,
REVIEW_STEP_CODES, REVIEW_STEP_CODES,
@@ -30,25 +28,6 @@ export function getVisibleReviewSteps(
return REVIEW_STEP_CODES.slice(0, count); return REVIEW_STEP_CODES.slice(0, count);
} }
export function resolveVisibleReviewSteps(
prgrsSttsComCd: string,
userRoleCode: string | undefined,
cklstResultList: CklstRvwRsltTreeDto[],
): ReviewStepCode[] {
const byProgressAndRole = getVisibleReviewSteps(prgrsSttsComCd, userRoleCode);
const currentStep = byProgressAndRole.at(-1);
const stepsWithData = new Set<ReviewStepCode>();
for (const row of cklstResultList) {
const step = row.rvwStpComCd as ReviewStepCode | undefined;
if (step && REVIEW_STEP_CODES.includes(step)) stepsWithData.add(step);
}
return REVIEW_STEP_CODES.filter(
(step) => stepsWithData.has(step) || step === currentStep,
);
}
export function getEditableReviewStep( export function getEditableReviewStep(
dtlInstCd?: string, dtlInstCd?: string,
prgrsSttsComCd?: string, prgrsSttsComCd?: string,
@@ -10,7 +10,6 @@ import type {
FnrsCnsltnMngResponseDto, FnrsCnsltnMngResponseDto,
FnrsCnsltnSplmntDmndItem, FnrsCnsltnSplmntDmndItem,
} from "@/entities/fnrs-cnsltn"; } from "@/entities/fnrs-cnsltn";
import { fnrsCnsltnApplySaveSchema } from "@/entities/fnrs-cnsltn";
import type { PwrkCnsltnCnsltnResponseDto } from "@/entities/pwrk-cnsltn-mng"; import type { PwrkCnsltnCnsltnResponseDto } from "@/entities/pwrk-cnsltn-mng";
import { import {
mapFnrsSharDetToFormList, mapFnrsSharDetToFormList,
@@ -62,14 +61,14 @@ export function buildSavePayload(
const cklstResultList = data.cklstResultList ?? []; const cklstResultList = data.cklstResultList ?? [];
const esntlFileList = data.esntlFileList ?? []; const esntlFileList = data.esntlFileList ?? [];
return fnrsCnsltnApplySaveSchema.parse({ return {
fnrsCnsltnMng: { ...detDto, prgrsSttsComCd }, fnrsCnsltnMng: { ...detDto, prgrsSttsComCd },
bzScaleList: toBzScaleSaveDto(bizSclList), bzScaleList: toBzScaleSaveDto(bizSclList),
bizCstList: toBizCstSaveDto(bizCstList), bizCstList: toBizCstSaveDto(bizCstList),
cklstResultList: toCklstSaveDto(cklstResultList, checklistFormState, reviewStep), cklstResultList: toCklstSaveDto(cklstResultList, checklistFormState, reviewStep),
esntlAtchFileList: toEsntlAtchFileSaveList(esntlFileList), esntlAtchFileList: toEsntlAtchFileSaveList(esntlFileList),
fnrsSharList: toFnrsSharSaveList(mapFnrsSharDetToFormList(data.fnrsSharList ?? [])), fnrsSharList: toFnrsSharSaveList(mapFnrsSharDetToFormList(data.fnrsSharList ?? [])),
}); };
} }
export function buildTechReviewReplyPayload( export function buildTechReviewReplyPayload(
@@ -81,12 +80,12 @@ export function buildTechReviewReplyPayload(
reviewOpinionFormData?: ReviewOpinionGetFormDataResult | null, reviewOpinionFormData?: ReviewOpinionGetFormDataResult | null,
opnrNm?: string, opnrNm?: string,
): FnrsCnsltnApplySaveRequestDto { ): FnrsCnsltnApplySaveRequestDto {
return fnrsCnsltnApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, reviewStep, prgrsSttsComCd), ...buildSavePayload(data, checklistFormState, reviewStep, prgrsSttsComCd),
techReViewSaveCd, techReViewSaveCd,
rvwStpCd: reviewStep, rvwStpCd: reviewStep,
rvwOpnnList: toRvwOpnnSaveDto(data, reviewOpinionFormData, opnrNm), rvwOpnnList: toRvwOpnnSaveDto(data, reviewOpinionFormData, opnrNm),
}); };
} }
export function buildSupplementReqPayload( export function buildSupplementReqPayload(
@@ -108,10 +107,10 @@ export function buildSupplementReqPayload(
cmptnYn: "N", cmptnYn: "N",
})); }));
return fnrsCnsltnApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, "LOCAL", "SL"), ...buildSavePayload(data, checklistFormState, "LOCAL", "SL"),
splmntDmndList: [...existingItems, ...newItems], splmntDmndList: [...existingItems, ...newItems],
}); };
} }
export function buildFileSplmntReqPayload( export function buildFileSplmntReqPayload(
@@ -125,10 +124,10 @@ export function buildFileSplmntReqPayload(
cmptnYn: "N", cmptnYn: "N",
})); }));
return fnrsCnsltnApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, "LOCAL", "SL"), ...buildSavePayload(data, checklistFormState, "LOCAL", "SL"),
splmntDmndList: [...newItems], splmntDmndList: [...newItems],
}); };
} }
export function buildRvwRsltSplmntReqPayload( export function buildRvwRsltSplmntReqPayload(
@@ -145,10 +144,10 @@ export function buildRvwRsltSplmntReqPayload(
cmptnYn: "N", cmptnYn: "N",
})); }));
return fnrsCnsltnApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, "LOCAL", "SL"), ...buildSavePayload(data, checklistFormState, "LOCAL", "SL"),
splmntDmndList: [...existingItems, ...newItems], splmntDmndList: [...existingItems, ...newItems],
}); };
} }
export function toSplmntDmndSaveItem(item: FnrsCnsltnSplmntDmndItem): FnrsCnsltnSplmntDmndItem { export function toSplmntDmndSaveItem(item: FnrsCnsltnSplmntDmndItem): FnrsCnsltnSplmntDmndItem {
@@ -170,21 +169,21 @@ export function buildSupplementSubmitPayload(
data: FnrsCnsltnMngDetResponseDto, data: FnrsCnsltnMngDetResponseDto,
checklistFormState: ChecklistFormState, checklistFormState: ChecklistFormState,
): FnrsCnsltnApplySaveRequestDto { ): FnrsCnsltnApplySaveRequestDto {
return fnrsCnsltnApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, "LOCAL", "SL"), ...buildSavePayload(data, checklistFormState, "LOCAL", "SL"),
splmntDmndList: (data.splmntDmndList ?? []).map(toSplmntDmndSaveItem), splmntDmndList: data.splmntDmndList,
}); };
} }
export function buildTechReviewPayload( export function buildTechReviewPayload(
det: FnrsCnsltnMngResponseDto, det: FnrsCnsltnMngResponseDto,
cklstResultList: CklstResultItem[], cklstResultList: CklstResultItem[],
): FnrsCnsltnApplySaveRequestDto { ): FnrsCnsltnApplySaveRequestDto {
return fnrsCnsltnApplySaveSchema.parse({ return {
fnrsCnsltnMng: { ...det, prgrsSttsComCd: "ER" }, fnrsCnsltnMng: { ...det, prgrsSttsComCd: "ER" },
bzScaleList: [], bzScaleList: [],
bizCstList: [], bizCstList: [],
cklstResultList, cklstResultList,
esntlAtchFileList: [], esntlAtchFileList: [],
}); };
} }
@@ -113,7 +113,7 @@ function getBadgeColor(state: BadgeState) {
} }
} }
function formatOptional(value: string | null | undefined) { function formatOptional(value: string | undefined) {
return value?.trim() ? value : "-"; return value?.trim() ? value : "-";
} }
@@ -44,13 +44,9 @@ export interface ChecklistFormState {
progress: ChecklistProgress; progress: ChecklistProgress;
} }
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"]; export type ChecklistStepMap = Record<ReviewStepCode, CklstRvwRsltTreeDto[]>;
export const CHECKLIST_TAB_LABELS: Record<ReviewStepCode, string> = { export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
LOCAL: "자가체크",
ENV: "기술검토",
KECO: "환경청검토",
};
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = { export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
LOCAL: "지자체", LOCAL: "지자체",
@@ -9,12 +9,6 @@ import { AxiosError } from "axios";
import { ENDPOINT } from "@/shared/config"; import { ENDPOINT } from "@/shared/config";
import { useAlertStore, useUserStore } from "@/shared/lib"; import { useAlertStore, useUserStore } from "@/shared/lib";
import {
AI_AUTO_SE,
type AiAutoPrcsLatestResponseDto,
useAiAutoPrcsLatest,
} from "@/entities/ai-auto-prcs-mng";
import { useReGenerateDraft, useReTransferDocument, useReVerifyCost } from "@/entities/dcrag-to";
import { import {
buildElaprPrgrsSttsListFromAplnRows, buildElaprPrgrsSttsListFromAplnRows,
ElaprApprovalDialog, ElaprApprovalDialog,
@@ -47,7 +41,6 @@ import {
import { SplmntDmndDialog, type SplmntDmndDialogConfirmPayload } from "@/widgets/pbadms-sprt"; import { SplmntDmndDialog, type SplmntDmndDialogConfirmPayload } from "@/widgets/pbadms-sprt";
import { Button } from "@common/components"; import { Button } from "@common/components";
import { isRagIndexingInProgress } from "../../lib/ai-pending-utils";
import { import {
FNRS_CNSLTN_VIEW_BUTTON_ACTION, FNRS_CNSLTN_VIEW_BUTTON_ACTION,
type FnrsCnsltnViewButtonAction, type FnrsCnsltnViewButtonAction,
@@ -70,15 +63,6 @@ import { FileVrfcSplmntDialog } from "./file-vrfc-splmnt-dialog";
import { PwrkCnsltnDocMngDialog } from "./pwrk-cnsltn-doc-mng-dialog"; import { PwrkCnsltnDocMngDialog } from "./pwrk-cnsltn-doc-mng-dialog";
import { PwrkCnsltnRvwRsltInqDialog } from "./pwrk-cnsltn-rvw-rslt-inq-dialog"; import { PwrkCnsltnRvwRsltInqDialog } from "./pwrk-cnsltn-rvw-rslt-inq-dialog";
const AI_RETRY_PRGRS_STTS = new Set(["ER", "TE", "EV"]);
function findLatestByAutoSe(
list: AiAutoPrcsLatestResponseDto[] | undefined,
atmtnSeComCd: string,
): AiAutoPrcsLatestResponseDto | undefined {
return list?.find((item) => item.atmtnSeComCd === atmtnSeComCd);
}
interface FloatingActionButtonsProps { interface FloatingActionButtonsProps {
data: FnrsCnsltnMngDetResponseDto; data: FnrsCnsltnMngDetResponseDto;
docSeComCd: string; docSeComCd: string;
@@ -133,9 +117,7 @@ function FloatingActionButtons({
const needsPwrkDraftCheck = const needsPwrkDraftCheck =
dtlInstCd === "ROLE_USER01" && ["SL", "TE", "RK"].includes(prgrsSttsComCd); dtlInstCd === "ROLE_USER01" && ["SL", "TE", "RK"].includes(prgrsSttsComCd);
const needsPwrkForRb = dtlInstCd === "ROLE_USER05" && prgrsSttsComCd === "RB"; const needsPwrkForRb = dtlInstCd === "ROLE_USER05" && prgrsSttsComCd === "RB";
const needsPwrkForAiRetry = dtlInstCd === "ROLE_USER01" && ["TE", "EV"].includes(prgrsSttsComCd); const needsPwrkLookup = needsPwrkDraftCheck || needsPwrkForRb;
const needsPwrkLookup = needsPwrkDraftCheck || needsPwrkForRb || needsPwrkForAiRetry;
const needsAiAutoLatest = dtlInstCd === "ROLE_USER01" && AI_RETRY_PRGRS_STTS.has(prgrsSttsComCd);
const { data: elaprDocPrgrsList = [], isLoading: isElaprDocPrgrsLoading } = const { data: elaprDocPrgrsList = [], isLoading: isElaprDocPrgrsLoading } =
useElaprDocPrgrsByDocNo(needsElaprPrgrsCheck ? docNo : null); useElaprDocPrgrsByDocNo(needsElaprPrgrsCheck ? docNo : null);
@@ -145,31 +127,8 @@ function FloatingActionButtons({
needsPwrkLookup, needsPwrkLookup,
); );
const { data: aiAutoLatestList, isLoading: isAiAutoLatestLoading } = useAiAutoPrcsLatest(docNo, {
enabled: needsAiAutoLatest,
});
const fileVrfcLatest = findLatestByAutoSe(aiAutoLatestList, AI_AUTO_SE.FILE_VRFC);
const draftGenLatest = findLatestByAutoSe(aiAutoLatestList, AI_AUTO_SE.DRAFT_GEN);
const costVrfcLatest = findLatestByAutoSe(aiAutoLatestList, AI_AUTO_SE.COST_VRFC);
const canRetryFileVrfc = fileVrfcLatest?.isRetryable === true;
const canRetryDraftGen = draftGenLatest?.isRetryable === true;
const canRetryCostVrfc = costVrfcLatest?.isRetryable === true;
const reTransferDocument = useReTransferDocument();
const reGenerateDraft = useReGenerateDraft();
const reVerifyCost = useReVerifyCost();
const isBusy =
isProcessing ||
reTransferDocument.isPending ||
reGenerateDraft.isPending ||
reVerifyCost.isPending;
const hasCompletedDraft = Boolean(findCompletedPwrkDraft(pwrkCnsltnData)); const hasCompletedDraft = Boolean(findCompletedPwrkDraft(pwrkCnsltnData));
const pwrkCnsltnDocNo = const pwrkCnsltnDocNo = pwrkCnsltnData?.pwrkCnsltnDocNo;
pwrkCnsltnData?.pwrkCnsltnDocNo ??
draftGenLatest?.pwrkCnsltnDocNo ??
costVrfcLatest?.pwrkCnsltnDocNo;
const elaprPrgrsForPending = const elaprPrgrsForPending =
prgrsSttsComCd === "RK" prgrsSttsComCd === "RK"
@@ -180,35 +139,24 @@ function FloatingActionButtons({
userInfo?.userUnqId, userInfo?.userUnqId,
); );
const viewOnlyPwrkCnsltnDoc = const viewOnlyPwrkCnsltnDoc =
prgrsSttsComCd === "SL" || prgrsSttsComCd === "SL" || (prgrsSttsComCd === "RB" && dtlInstCd !== "ROLE_USER05");
(prgrsSttsComCd === "RB" && dtlInstCd !== "ROLE_USER05") ||
(prgrsSttsComCd === "RK" && dtlInstCd === "ROLE_USER03");
const actionButtons = useMemo(() => { const actionButtons = useMemo(() => {
if (needsAtrzResolve && isRvwLoginUserLoading) return []; if (needsAtrzResolve && isRvwLoginUserLoading) return [];
if (needsElaprPrgrsCheck && isElaprDocPrgrsLoading) return []; if (needsElaprPrgrsCheck && isElaprDocPrgrsLoading) return [];
if (needsPwrkDraftCheck && isPwrkCnsltnLoading) return []; if (needsPwrkDraftCheck && isPwrkCnsltnLoading) return [];
if (needsAiAutoLatest && isAiAutoLatestLoading) return [];
return getButtonConfigs(dtlInstCd, prgrsSttsComCd, atrzSeComCdList, { return getButtonConfigs(dtlInstCd, prgrsSttsComCd, atrzSeComCdList, {
hasPendingApprovalRequest: needsElaprPrgrsCheck ? hasPendingApprovalRequest : undefined, hasPendingApprovalRequest: needsElaprPrgrsCheck ? hasPendingApprovalRequest : undefined,
hasCompletedDraft: needsPwrkDraftCheck ? hasCompletedDraft : undefined, hasCompletedDraft: needsPwrkDraftCheck ? hasCompletedDraft : undefined,
canRetryFileVrfc: needsAiAutoLatest ? canRetryFileVrfc : undefined,
canRetryDraftGen: needsAiAutoLatest ? canRetryDraftGen : undefined,
canRetryCostVrfc: needsAiAutoLatest ? canRetryCostVrfc : undefined,
}); });
}, [ }, [
atrzSeComCdList, atrzSeComCdList,
canRetryCostVrfc,
canRetryDraftGen,
canRetryFileVrfc,
dtlInstCd, dtlInstCd,
hasCompletedDraft, hasCompletedDraft,
hasPendingApprovalRequest, hasPendingApprovalRequest,
isAiAutoLatestLoading,
isElaprDocPrgrsLoading, isElaprDocPrgrsLoading,
isPwrkCnsltnLoading, isPwrkCnsltnLoading,
isRvwLoginUserLoading, isRvwLoginUserLoading,
needsAiAutoLatest,
needsAtrzResolve, needsAtrzResolve,
needsElaprPrgrsCheck, needsElaprPrgrsCheck,
needsPwrkDraftCheck, needsPwrkDraftCheck,
@@ -421,6 +369,19 @@ function FloatingActionButtons({
} }
async function handleRqstTechRvwClick() { async function handleRqstTechRvwClick() {
if (prgrsSttsComCd === "LE") {
const { percent } = computeReviewStepChecklistProgress(
data.cklstResultList ?? [],
checklistFormState.results,
"ENV",
);
if (percent !== 100) {
alert("모든 체크리스트 항목을 체크해야 기술 검토 의뢰가 가능합니다.");
return;
}
}
const payload: FnrsExamineRequestDto = { const payload: FnrsExamineRequestDto = {
prgrsSttsComCd: "FV", prgrsSttsComCd: "FV",
}; };
@@ -582,60 +543,17 @@ function FloatingActionButtons({
}); });
} }
function handleFileVrfcClick() {
reTransferDocument.mutate(
{ fnrsCnsltnDocNo: docNo },
{ onSuccess: () => alert("파일 검증을 요청했습니다.") },
);
}
function handlePwrkCnsltnDocCrtClick() {
if (!pwrkCnsltnDocNo) {
alert("실무협의 문서번호를 찾을 수 없습니다.");
return;
}
reGenerateDraft.mutate(
{
fnrsCnsltnDocNo: docNo,
pwrkCnsltnDocNo,
crtDmndUuid: draftGenLatest?.crtDmndUuid,
},
{ onSuccess: () => alert("초안 생성을 요청했습니다.") },
);
}
function handleCostVrfcClick() {
if (!pwrkCnsltnDocNo) {
alert("실무협의 문서번호를 찾을 수 없습니다.");
return;
}
reVerifyCost.mutate(
{
fnrsCnsltnDocNo: docNo,
pwrkCnsltnDocNo,
},
{ onSuccess: () => alert("금액 검증을 요청했습니다.") },
);
}
return ( return (
<> <>
<div className="sticky bottom-0 z-40 !-mb-2 border-t bg-white pb-8 pt-6 shadow-[0_-4px_12px_rgba(0,0,0,0.06)]"> <div className="sticky bottom-0 z-40 !-mb-2 border-t bg-white pb-8 pt-6 shadow-[0_-4px_12px_rgba(0,0,0,0.06)]">
<div className="mx-4 flex flex-wrap justify-center gap-3 sm:gap-4"> <div className="mx-4 flex flex-wrap justify-center gap-3 sm:gap-4">
<Button color="white" type="button" onClick={handleGoToList} disabled={isBusy}> <Button color="white" type="button" onClick={handleGoToList} disabled={isProcessing}>
목록 목록
</Button> </Button>
{!isAiPending && ( {!isAiPending && (
<> <>
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocCrt) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocCrt) && (
<Button <Button color="orange" onClick={() => {}} disabled={isProcessing}>
color="orange"
onClick={handlePwrkCnsltnDocCrtClick}
disabled={isBusy}
title={draftGenLatest?.prcsErrCn ?? undefined}
>
실무협의서 초안 생성 실무협의서 초안 생성
</Button> </Button>
)} )}
@@ -643,120 +561,103 @@ function FloatingActionButtons({
<Button <Button
color="orange" color="orange"
onClick={() => setActiveDialog("pwrkCnsltnDocMng")} onClick={() => setActiveDialog("pwrkCnsltnDocMng")}
disabled={isBusy} disabled={isProcessing}
> >
실무협의서 관리 실무협의서 관리
</Button> </Button>
)} )}
{canEdit && ( {canEdit && (
<Button color="gray" onClick={handleEdit} disabled={isBusy}> <Button color="gray" onClick={handleEdit} disabled={isProcessing}>
수정 수정
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.strg) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.strg) && (
<Button onClick={handleStrgClick} disabled={isBusy}> <Button onClick={handleStrgClick} disabled={isProcessing}>
저장 저장
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.aply) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.aply) && (
<Button color="green" onClick={handleAplyClick} disabled={isBusy}> <Button color="green" onClick={handleAplyClick} disabled={isProcessing}>
신청 완료 신청 완료
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.del) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.del) && (
<Button color="red" onClick={handleDelClick} disabled={isBusy}> <Button color="red" onClick={handleDelClick} disabled={isProcessing}>
삭제 삭제
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.envoSbmsn) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.envoSbmsn) && (
<Button onClick={handleEnvoSbmsnClick} disabled={isBusy}> <Button onClick={handleEnvoSbmsnClick} disabled={isProcessing}>
환경청 제출 환경청 제출
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rjct) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rjct) && (
<Button color="red" onClick={handleRjctClick} disabled={isBusy}> <Button color="red" onClick={handleRjctClick} disabled={isProcessing}>
반려 반려
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.sncnAprv) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.sncnAprv) && (
<Button color="green" onClick={handleSncnAprvClick} disabled={isBusy}> <Button color="green" onClick={handleSncnAprvClick} disabled={isProcessing}>
결과 회신 결과 회신
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwOpnnRply) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwOpnnRply) && (
<Button onClick={handleRvwOpnnRplyClick} disabled={isBusy}> <Button onClick={handleRvwOpnnRplyClick} disabled={isProcessing}>
검토 의견 회신 검토 의견 회신
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply) && (
<Button color="green" onClick={handleRvwRplyClick} disabled={isBusy}> <Button color="green" onClick={handleRvwRplyClick} disabled={isProcessing}>
검토 결과 회신 검토 결과 회신
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstTechRvw) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstTechRvw) && (
<Button onClick={handleRqstTechRvwClick} disabled={isBusy}> <Button onClick={handleRqstTechRvwClick} disabled={isProcessing}>
기술 검토 의뢰 기술 검토 의뢰
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstActnRvw) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstActnRvw) && (
<Button onClick={handleRqstActnRvwClick} disabled={isBusy}> <Button onClick={handleRqstActnRvwClick} disabled={isProcessing}>
조치 결과 검토 의뢰 조치 결과 검토 의뢰
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.fileSplmnt) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.fileSplmnt) && (
<Button color="gray" onClick={handleFileSplmntClick} disabled={isBusy}> <Button color="gray" onClick={handleFileSplmntClick} disabled={isProcessing}>
파일 보완 요청 파일 보완 요청
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.fileVrfc) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.dsgntRvwr) && (
<Button <Button
color="gray" onClick={() =>
onClick={handleFileVrfcClick} setActiveDialog(prgrsSttsComCd === "EV" ? "elaprDocPrgrs" : "elaprTmplt")
disabled={isBusy} }
title={fileVrfcLatest?.prcsErrCn ?? undefined} disabled={isProcessing}
> >
파일 검증 검토자 지정
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.costVrfc) && (
<Button
color="gray"
onClick={handleCostVrfcClick}
disabled={isBusy}
title={costVrfcLatest?.prcsErrCn ?? undefined}
>
금액 검증
</Button>
)}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.dsgntRvwr) &&
!isRagIndexingInProgress(prgrsSttsComCd, data.ragIndexingInfo) && (
<Button
onClick={() =>
setActiveDialog(prgrsSttsComCd === "EV" ? "elaprDocPrgrs" : "elaprTmplt")
}
disabled={isBusy}
>
검토자 지정
</Button>
)}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.actnCmptn) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.actnCmptn) && (
<Button color="green" onClick={handleActnCmptnClick} disabled={isBusy}> <Button color="green" onClick={handleActnCmptnClick} disabled={isProcessing}>
조치 완료 조치 완료
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRsltInq) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRsltInq) && (
<Button color="sky" onClick={() => setActiveDialog("rvwRsltInq")} disabled={isBusy}> <Button
color="sky"
onClick={() => setActiveDialog("rvwRsltInq")}
disabled={isProcessing}
>
검토 결과 조회 검토 결과 조회
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwStrg) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwStrg) && (
<Button onClick={handleRvwStrgClick} disabled={isBusy}> <Button onClick={handleRvwStrgClick} disabled={isProcessing}>
저장 저장
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwCmptn) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwCmptn) && (
<Button color="green" onClick={handleRvwCmptnClick} disabled={isBusy}> <Button color="green" onClick={handleRvwCmptnClick} disabled={isProcessing}>
검토 완료 검토 완료
</Button> </Button>
)} )}
@@ -764,18 +665,18 @@ function FloatingActionButtons({
<Button <Button
color="gray" color="gray"
onClick={() => setActiveDialog("dmndSplmnt")} onClick={() => setActiveDialog("dmndSplmnt")}
disabled={isBusy} disabled={isProcessing}
> >
보완 요청 보완 요청
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzAprv) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzAprv) && (
<Button onClick={() => setActiveDialog("elaprApproval")} disabled={isBusy}> <Button onClick={() => setActiveDialog("elaprApproval")} disabled={isProcessing}>
결재(승인) 결재(승인)
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzRply) && ( {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzRply) && (
<Button onClick={() => setActiveDialog("elaprApproval")} disabled={isBusy}> <Button onClick={() => setActiveDialog("elaprApproval")} disabled={isProcessing}>
결재(회신) 결재(회신)
</Button> </Button>
)} )}
@@ -804,14 +705,14 @@ function FloatingActionButtons({
splmntArtclUpCd="SPLMNTARTCL" splmntArtclUpCd="SPLMNTARTCL"
open={activeDialog === "dmndSplmnt"} open={activeDialog === "dmndSplmnt"}
onOpenChange={() => setActiveDialog(null)} onOpenChange={() => setActiveDialog(null)}
isSubmitting={isBusy} isSubmitting={isProcessing}
onConfirm={handleDmndSplmntConfirm} onConfirm={handleDmndSplmntConfirm}
/> />
<FileVrfcSplmntDialog <FileVrfcSplmntDialog
open={activeDialog === "fileSplmnt"} open={activeDialog === "fileSplmnt"}
fnrsCnsltnDocNo={docNo} fnrsCnsltnDocNo={docNo}
isSubmitting={isBusy} isSubmitting={isProcessing}
onClose={() => setActiveDialog(null)} onClose={() => setActiveDialog(null)}
onConfirm={handleFileSplmntConfirm} onConfirm={handleFileSplmntConfirm}
/> />
@@ -845,7 +746,7 @@ function FloatingActionButtons({
<PwrkCnsltnRvwRsltInqDialog <PwrkCnsltnRvwRsltInqDialog
open={activeDialog === "rvwRsltInq"} open={activeDialog === "rvwRsltInq"}
fnrsCnsltnDocNo={docNo} fnrsCnsltnDocNo={docNo}
isSubmitting={isBusy} isSubmitting={isProcessing}
onClose={() => setActiveDialog(null)} onClose={() => setActiveDialog(null)}
onConfirm={handleRvwRsltSplmntConfirm} onConfirm={handleRvwRsltSplmntConfirm}
/> />
@@ -980,7 +881,6 @@ const buttonActionHandlers: Record<FnrsCnsltnViewButtonAction, ActionHandler> =
rvwOpnnRply: handleTechReview, rvwOpnnRply: handleTechReview,
rqstTechRvw: handleRequestExamine, rqstTechRvw: handleRequestExamine,
fileSplmnt: handleDmndSplmnt, fileSplmnt: handleDmndSplmnt,
fileVrfc: () => Promise.resolve(),
dsgntRvwr: handleDsgntRvwr, dsgntRvwr: handleDsgntRvwr,
pwrkCnsltnDocCrt: () => Promise.resolve(), pwrkCnsltnDocCrt: () => Promise.resolve(),
pwrkCnsltnDocMng: () => Promise.resolve(), pwrkCnsltnDocMng: () => Promise.resolve(),
@@ -992,7 +892,6 @@ const buttonActionHandlers: Record<FnrsCnsltnViewButtonAction, ActionHandler> =
atrzRply: () => Promise.resolve(), atrzRply: () => Promise.resolve(),
actnCmptn: handleActnCmptn, actnCmptn: handleActnCmptn,
rqstActnRvw: handleRequestActnReview, rqstActnRvw: handleRequestActnReview,
costVrfc: () => Promise.resolve(),
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,137 +0,0 @@
"use client";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { useAlertStore } from "@/shared/lib";
import { useSavePwrkCnsltnDocEvl } from "@/entities/pwrk-cnsltn-doc-evl";
import {
Button,
Dialog,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
Label,
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
Textarea,
} from "@common/components";
import {
buildPwrkCnsltnDocEvlSavePayload,
PWRK_CNSLTN_DOC_EVL_SCR_OPTIONS,
pwrkCnsltnDocEvlFormSchema,
type PwrkCnsltnDocEvlFormValues,
} from "../../lib/pwrk-cnsltn-doc-evl-schema";
interface PwrkCnsltnDocEvlDialogProps {
open: boolean;
pwrkCnsltnDocNo: string;
onClose: () => void;
}
const DEFAULT_VALUES: Partial<PwrkCnsltnDocEvlFormValues> = {
pwrkCnsltnDocEvlScr: undefined,
pwrkCnsltnDocEvlCn: "",
};
function PwrkCnsltnDocEvlDialog({ open, pwrkCnsltnDocNo, onClose }: PwrkCnsltnDocEvlDialogProps) {
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: saveEvl, isPending } = useSavePwrkCnsltnDocEvl();
const { handleSubmit, reset, setValue, watch, register } = useForm<PwrkCnsltnDocEvlFormValues>({
resolver: zodResolver(pwrkCnsltnDocEvlFormSchema),
defaultValues: DEFAULT_VALUES,
});
const pwrkCnsltnDocEvlScr = watch("pwrkCnsltnDocEvlScr");
useEffect(() => {
if (!open) return;
reset(DEFAULT_VALUES);
}, [open, reset]);
function handleOpenChange(nextOpen: boolean) {
if (!nextOpen) onClose();
}
async function onSubmit(values: PwrkCnsltnDocEvlFormValues) {
try {
const payload = buildPwrkCnsltnDocEvlSavePayload(pwrkCnsltnDocNo, values);
await saveEvl(payload);
alert("AI 초안 만족도 평가를 등록했습니다.");
onClose();
} catch (error) {
console.error("AI 초안 만족도 평가 등록 실패:", error);
alert("AI 초안 만족도 평가 등록에 실패했습니다.");
}
}
return (
<Dialog open={open} onOpenChange={handleOpenChange}>
<DialogContent className="max-w-[40rem]" aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>AI 초안 만족도 평가</DialogTitle>
</DialogHeader>
<form className="space-y-4" onSubmit={handleSubmit(onSubmit)}>
<div className="space-y-2">
<Label>만족도</Label>
<Select
value={pwrkCnsltnDocEvlScr || undefined}
onValueChange={(value) =>
setValue(
"pwrkCnsltnDocEvlScr",
value as PwrkCnsltnDocEvlFormValues["pwrkCnsltnDocEvlScr"],
{
shouldValidate: true,
},
)
}
>
<SelectTrigger className="w-full">
<SelectValue placeholder="만족도를 선택해 주세요" />
</SelectTrigger>
<SelectContent>
{PWRK_CNSLTN_DOC_EVL_SCR_OPTIONS.map((option) => (
<SelectItem key={option.value} value={option.value}>
{option.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<div className="space-y-2">
<Label htmlFor="pwrkCnsltnDocEvlCn">의견</Label>
<Textarea
id="pwrkCnsltnDocEvlCn"
rows={4}
placeholder="의견을 입력해 주세요"
className="!text-xl"
{...register("pwrkCnsltnDocEvlCn")}
/>
</div>
<DialogFooter>
<Button type="button" color="white" onClick={onClose} disabled={isPending}>
닫기
</Button>
<Button type="submit" disabled={isPending}>
제출
</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
);
}
export { PwrkCnsltnDocEvlDialog };
export type { PwrkCnsltnDocEvlDialogProps };
@@ -33,7 +33,6 @@ import {
Skeleton, Skeleton,
} from "@common/components"; } from "@common/components";
import { PwrkCnsltnDocEvlDialog } from "./pwrk-cnsltn-doc-evl-dialog";
import { PwrkCnsltnDocPjtcoAjmtTable } from "./pwrk-cnsltn-doc-pjtco-ajmt-table"; import { PwrkCnsltnDocPjtcoAjmtTable } from "./pwrk-cnsltn-doc-pjtco-ajmt-table";
const HangulGiangi = dynamic( const HangulGiangi = dynamic(
@@ -46,8 +45,6 @@ const HangulGiangi = dynamic(
const PWRK_ATCH_FILE_KEY_PREFIX = "pwrk-cnsltn-doc::"; const PWRK_ATCH_FILE_KEY_PREFIX = "pwrk-cnsltn-doc::";
const AI_DRAFT_EVL_MAX_VER_SN = 2;
const APPROVER_ATRZ_SE_COM_CDS = new Set(["ATRZ03", "ATRZ99"]); const APPROVER_ATRZ_SE_COM_CDS = new Set(["ATRZ03", "ATRZ99"]);
const VIEW_ONLY_PRGRS_STTS_COM_CDS = new Set(["TP", "RA", "AV", "EV", "RR", "EP", "TA"]); const VIEW_ONLY_PRGRS_STTS_COM_CDS = new Set(["TP", "RA", "AV", "EV", "RR", "EP", "TA"]);
@@ -85,7 +82,6 @@ function PwrkCnsltnDocMngDialog({
const [atchFileGroupId, setAtchFileGroupId] = useState(""); const [atchFileGroupId, setAtchFileGroupId] = useState("");
const [uploadedFiles, setUploadedFiles] = useState<UploadedAtchFile[]>([]); const [uploadedFiles, setUploadedFiles] = useState<UploadedAtchFile[]>([]);
const [isPjtcoAjmtTableOpen, setIsPjtcoAjmtTableOpen] = useState(false); const [isPjtcoAjmtTableOpen, setIsPjtcoAjmtTableOpen] = useState(false);
const [isEvlDialogOpen, setIsEvlDialogOpen] = useState(false);
const { mutate: downloadByAtflId } = useDownloadAttachmentByAtflId(); const { mutate: downloadByAtflId } = useDownloadAttachmentByAtflId();
const { const {
@@ -142,7 +138,6 @@ function PwrkCnsltnDocMngDialog({
if (!open) { if (!open) {
setAtchFileGroupId(""); setAtchFileGroupId("");
setUploadedFiles([]); setUploadedFiles([]);
setIsEvlDialogOpen(false);
return; return;
} }
@@ -199,10 +194,6 @@ function PwrkCnsltnDocMngDialog({
}), }),
]); ]);
alert(`실무협의서를 저장했습니다. (버전 ${savedDocument.verSn})`); alert(`실무협의서를 저장했습니다. (버전 ${savedDocument.verSn})`);
if (savedDocument.verSn <= AI_DRAFT_EVL_MAX_VER_SN) {
setIsEvlDialogOpen(true);
}
} }
async function handleDownload() { async function handleDownload() {
@@ -278,115 +269,105 @@ function PwrkCnsltnDocMngDialog({
const canSave = !viewOnly && (canSaveProp ?? canSaveByAtrz); const canSave = !viewOnly && (canSaveProp ?? canSaveByAtrz);
return ( return (
<> <Dialog open={open} onOpenChange={handleOpenChange}>
<Dialog open={open} onOpenChange={handleOpenChange}> <DialogContent
<DialogContent className="max-h-[96vh] max-w-[80vw] overflow-y-auto"
className="max-h-[96vh] max-w-[80vw] overflow-y-auto" aria-describedby={undefined}
aria-describedby={undefined} >
> <DialogHeader>
<DialogHeader> <DialogTitle>실무협의서 관리</DialogTitle>
<DialogTitle>실무협의서 관리</DialogTitle> </DialogHeader>
</DialogHeader>
{isLoading ? <Skeleton className="h-[70vh] min-h-[40rem] w-full" /> : null} {isLoading ? <Skeleton className="h-[70vh] min-h-[40rem] w-full" /> : null}
{isError ? ( {isError ? (
<p className="py-16 text-center text-lg text-muted-foreground"> <p className="py-16 text-center text-lg text-muted-foreground">
실무협의서 정보를 불러오지 못했습니다. 실무협의서 정보를 불러오지 못했습니다.
</p> </p>
) : null} ) : null}
{!isLoading && !isError && !completedDraft ? ( {!isLoading && !isError && !completedDraft ? (
<p className="py-16 text-center text-lg text-muted-foreground"> <p className="py-16 text-center text-lg text-muted-foreground">
생성 완료된 실무협의서 초안이 없습니다. 생성 완료된 실무협의서 초안이 없습니다.
</p> </p>
) : null} ) : null}
{completedDraft && documentBlob ? ( {completedDraft && documentBlob ? (
<div className="flex min-h-[40rem] items-stretch gap-2"> <div className="flex min-h-[40rem] items-stretch gap-2">
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<HangulGiangi <HangulGiangi
documentBlob={documentBlob} documentBlob={documentBlob}
documentKey={completedDraft.crtDmndUuid} documentKey={completedDraft.crtDmndUuid}
documentFileName={documentFileName} documentFileName={documentFileName}
canSave={canSave} canSave={canSave}
onSaveDocument={handleSaveDocument} onSaveDocument={handleSaveDocument}
onDownload={handleDownload} onDownload={handleDownload}
/>
</div>
{pjtcoAjmtPage?.content?.length ? (
isPjtcoAjmtTableOpen ? (
<section className="flex h-[calc(64vh+4rem)] w-0 flex-[0.4] flex-col overflow-hidden rounded-md border border-border">
<header className="flex items-center justify-between gap-2 border-b border-border px-3 py-2">
<h3 className="text-xl font-semibold">금액검증결과</h3>
<button
type="button"
className="rounded-sm border border-border p-2 hover:opacity-90"
onClick={() => setIsPjtcoAjmtTableOpen(false)}
aria-label="접기"
>
<PanelRightClose className="size-6" />
</button>
</header>
<div className="min-h-0 flex-1 overflow-y-auto">
<PwrkCnsltnDocPjtcoAjmtTable
rows={pjtcoAjmtPage?.content ?? []}
isLoading={isPjtcoAjmtLoading}
isError={isPjtcoAjmtError}
/>
</div>
</section>
) : (
<button
type="button"
className="flex items-center gap-1 self-start rounded-sm border border-border px-1 py-2 hover:opacity-90"
style={{ writingMode: "vertical-rl" }}
onClick={() => setIsPjtcoAjmtTableOpen(true)}
aria-label="펼치기"
>
<PanelRightOpen className="size-5" />
<span className="text-xl tracking-wide">금액검증결과</span>
</button>
)
) : null}
</div>
) : null}
{completedDraft ? (
<section className="space-y-2 rounded-md border border-border p-4">
<h3 className="text-xl font-semibold">첨부파일</h3>
{uploadedFiles.length === 0 ? (
<p className="text-lg text-muted-foreground">등록된 첨부파일이 없습니다.</p>
) : null}
<AttachmentFileField
files={uploadedFiles.map((item) => ({
fileKey: item.fileKey,
fileName: item.fileName,
onDownload: item.atflId ? () => downloadByAtflId(item.atflId!) : undefined,
}))}
inputId="pwrk-cnsltn-doc-atch-file-input"
isUploadingByKey={isUploading}
addDisabled={!canSave || isAnyAtchUploading}
showAddButton={canSave}
onAdd={(files) => void handleAtchFileUpload(files)}
onRemove={canSave ? (index) => void handleAtchFileRemove(index) : undefined}
/> />
</section> </div>
) : null} {pjtcoAjmtPage?.content?.length ? (
isPjtcoAjmtTableOpen ? (
<section className="flex h-[calc(64vh+4rem)] w-0 flex-[0.4] flex-col overflow-hidden rounded-md border border-border">
<header className="flex items-center justify-between gap-2 border-b border-border px-3 py-2">
<h3 className="text-xl font-semibold">금액검증결과</h3>
<button
type="button"
className="rounded-sm border border-border p-2 hover:opacity-90"
onClick={() => setIsPjtcoAjmtTableOpen(false)}
aria-label="접기"
>
<PanelRightClose className="size-6" />
</button>
</header>
<div className="min-h-0 flex-1 overflow-y-auto">
<PwrkCnsltnDocPjtcoAjmtTable
rows={pjtcoAjmtPage?.content ?? []}
isLoading={isPjtcoAjmtLoading}
isError={isPjtcoAjmtError}
/>
</div>
</section>
) : (
<button
type="button"
className="flex items-center gap-1 self-start rounded-sm border border-border px-1 py-2 hover:opacity-90"
style={{ writingMode: "vertical-rl" }}
onClick={() => setIsPjtcoAjmtTableOpen(true)}
aria-label="펼치기"
>
<PanelRightOpen className="size-5" />
<span className="text-xl tracking-wide">금액검증결과</span>
</button>
)
) : null}
</div>
) : null}
<DialogFooter> {completedDraft ? (
<Button type="button" color="white" onClick={onClose}> <section className="space-y-2 rounded-md border border-border p-4">
닫기 <h3 className="text-xl font-semibold">첨부파일</h3>
</Button> {uploadedFiles.length === 0 ? (
</DialogFooter> <p className="text-lg text-muted-foreground">등록된 첨부파일이 없습니다.</p>
</DialogContent> ) : null}
</Dialog> <AttachmentFileField
files={uploadedFiles.map((item) => ({
fileKey: item.fileKey,
fileName: item.fileName,
onDownload: item.atflId ? () => downloadByAtflId(item.atflId!) : undefined,
}))}
inputId="pwrk-cnsltn-doc-atch-file-input"
isUploadingByKey={isUploading}
addDisabled={!canSave || isAnyAtchUploading}
showAddButton={canSave}
onAdd={(files) => void handleAtchFileUpload(files)}
onRemove={canSave ? (index) => void handleAtchFileRemove(index) : undefined}
/>
</section>
) : null}
{completedDraft ? ( <DialogFooter>
<PwrkCnsltnDocEvlDialog <Button type="button" color="white" onClick={onClose}>
open={isEvlDialogOpen} 닫기
pwrkCnsltnDocNo={completedDraft.pwrkCnsltnDocNo} </Button>
onClose={() => setIsEvlDialogOpen(false)} </DialogFooter>
/> </DialogContent>
) : null} </Dialog>
</>
); );
} }
@@ -9,16 +9,16 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { useAlertStore, useUserStore } from "@/shared/lib"; import { useAlertStore, useUserStore } from "@/shared/lib";
import { RhfDevTool, SectionCollapsibleGroup, SectionCollapsibleToggle } from "@/shared/ui"; import { SectionCollapsibleGroup, SectionCollapsibleToggle } from "@/shared/ui";
import { useAcntgSeMngTree } from "@/entities/acntg"; import { useAcntgSeMngTree } from "@/entities/acntg";
import { useEsntlAtchFileMngTree } from "@/entities/esntl"; import { useEsntlAtchFileMngTree } from "@/entities/esntl";
import { import {
type FnrsCnsltnApplySaveRequestDto,
fnrsCnsltnKeys, fnrsCnsltnKeys,
type FnrsCnsltnMngDetResponseDto, type FnrsCnsltnMngDetResponseDto,
fnrsCnsltnMngService, fnrsCnsltnMngService,
} from "@/entities/fnrs-cnsltn"; } from "@/entities/fnrs-cnsltn";
import { useFnrsSharSeMngTree } from "@/entities/fnrs-shar-se"; import { useFnrsSharSeMngTree } from "@/entities/fnrs-shar-se";
import { findCompletedPwrkDraft, usePwrkCnsltnMngByUpDocNo } from "@/entities/pwrk-cnsltn-mng";
import { import {
AttachmentsFormSection, AttachmentsFormSection,
buildAcntgCostItems, buildAcntgCostItems,
@@ -32,19 +32,19 @@ import {
isFormEsntlAtchComplete, isFormEsntlAtchComplete,
PrivacyConsentSection, PrivacyConsentSection,
ProgressStatusSection, ProgressStatusSection,
recalculateFnrsSharTotals,
SplmntDmndFormSection, SplmntDmndFormSection,
toFnrsSharSaveList,
validateBizCstSharBalance,
} from "@/widgets/pbadms-sprt"; } from "@/widgets/pbadms-sprt";
import { Button } from "@common/components"; import { Button } from "@common/components";
import { import {
type FnrsCnsltnRegistFormData, type FnrsCnsltnRegistFormData,
fnrsCnsltnRegistSchema, fnrsCnsltnRegistSchema,
formatTaskSeComCdForApi,
} from "../lib/fnrs-cnsltn-regist-schema"; } from "../lib/fnrs-cnsltn-regist-schema";
import { import { getCreateDefaultValues, mapDetailToFormData } from "../lib/form-data-mapper";
buildFormPayload,
getCreateDefaultValues,
mapDetailToFormData,
} from "../lib/form-data-mapper";
import { PROGRESS_STATUS_COLUMNS } from "../model/columns"; import { PROGRESS_STATUS_COLUMNS } from "../model/columns";
import { PwrkCnsltnDocMngDialog } from "./components/pwrk-cnsltn-doc-mng-dialog"; import { PwrkCnsltnDocMngDialog } from "./components/pwrk-cnsltn-doc-mng-dialog";
@@ -72,12 +72,6 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
const isSplmntPrgrsStts = initialData?.detDto?.prgrsSttsComCd === "SL"; const isSplmntPrgrsStts = initialData?.detDto?.prgrsSttsComCd === "SL";
const fnrsCnsltnDocNo = initialData?.detDto?.fnrsCnsltnDocNo; const fnrsCnsltnDocNo = initialData?.detDto?.fnrsCnsltnDocNo;
const { data: pwrkCnsltnData } = usePwrkCnsltnMngByUpDocNo(
fnrsCnsltnDocNo,
isSplmntPrgrsStts && Boolean(fnrsCnsltnDocNo),
);
const hasCompletedDraft = Boolean(findCompletedPwrkDraft(pwrkCnsltnData));
const { data: masterSharTree = [] } = useFnrsSharSeMngTree(); const { data: masterSharTree = [] } = useFnrsSharSeMngTree();
const { data: acntgTree = [] } = useAcntgSeMngTree(); const { data: acntgTree = [] } = useAcntgSeMngTree();
const { data: essentialFiles = [] } = useEsntlAtchFileMngTree({ docSeComCd: "FNRS" }); const { data: essentialFiles = [] } = useEsntlAtchFileMngTree({ docSeComCd: "FNRS" });
@@ -95,25 +89,54 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
: getCreateDefaultValues(userInfo, createDefaults), : getCreateDefaultValues(userInfo, createDefaults),
}); });
function createFormPayload(data: FnrsCnsltnRegistFormData, prgrsSttsComCd: string) { function buildFormPayload(
const result = buildFormPayload(data, prgrsSttsComCd, { data: FnrsCnsltnRegistFormData,
isEditMode, prgrsSttsComCd: string,
docNo: initialData?.detDto?.fnrsCnsltnDocNo, ): FnrsCnsltnApplySaveRequestDto | undefined {
const withTotals = recalculateFnrsSharTotals(data.fnrsSharList, sharItems);
const validationMessage = validateBizCstSharBalance(
data.bizCstList,
withTotals,
sharItems, sharItems,
costItems, costItems,
}); );
if ("validationMessage" in result) { if (validationMessage) {
alert(result.validationMessage); alert(validationMessage);
return undefined; return undefined;
} }
return result;
const { taskSeComCd: formTaskSeComCd, ...fnrsCnsltnMngRest } = data.fnrsCnsltnMng;
return {
fnrsCnsltnMng: {
...fnrsCnsltnMngRest,
taskSeComCd: formatTaskSeComCdForApi(formTaskSeComCd),
fnrsCnsltnDocNo: isEditMode ? initialData?.detDto?.fnrsCnsltnDocNo : undefined,
prgrsSttsComCd,
},
bzScaleList: data.bzScaleList,
bizCstList: data.bizCstList,
fnrsSharList: toFnrsSharSaveList(withTotals),
cklstResultList: data.cklstResultList.map((item) => ({
...item,
selected: item.selected ?? undefined,
})),
esntlAtchFileList: data.esntlAtchFileList,
splmntDmndList: data.splmntDmndList.map(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
({ splmntAtchFileNm, splmntAtchFileAtflId, splmntDmndAtchFileNm, ...item }) => ({
...item,
...(prgrsSttsComCd !== "SV" && prgrsSttsComCd !== "ST" && { cmptnYn: "Y" }),
}),
),
};
} }
async function submitForm( async function submitForm(
data: FnrsCnsltnRegistFormData, data: FnrsCnsltnRegistFormData,
prgrsSttsComCd: "SV" | "ST", prgrsSttsComCd: "SV" | "ST",
): Promise<string | undefined> { ): Promise<string | undefined> {
const payload = createFormPayload(data, prgrsSttsComCd); const payload = buildFormPayload(data, prgrsSttsComCd);
if (!payload) return undefined; if (!payload) return undefined;
return fnrsCnsltnMngService.saveApply(payload); return fnrsCnsltnMngService.saveApply(payload);
} }
@@ -123,7 +146,7 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
if (!beforePrgrsSttsComCd) return undefined; if (!beforePrgrsSttsComCd) return undefined;
const docNo = initialData?.detDto?.fnrsCnsltnDocNo; const docNo = initialData?.detDto?.fnrsCnsltnDocNo;
const payload = createFormPayload(data, beforePrgrsSttsComCd); const payload = buildFormPayload(data, beforePrgrsSttsComCd);
if (!docNo || !payload) return undefined; if (!docNo || !payload) return undefined;
return fnrsCnsltnMngService.submitSupplement(docNo, payload); return fnrsCnsltnMngService.submitSupplement(docNo, payload);
@@ -136,7 +159,7 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
(item) => !item.splmntCn || !item.splmntCn.trim(), (item) => !item.splmntCn || !item.splmntCn.trim(),
); );
if (hasEmptySplmntCn) { if (hasEmptySplmntCn) {
alert("보완 요청 내용이 있습니다.\n보완 완료 내용을 입력해 주세요."); alert("보완요청내용이 있습니다. 보완 완료내용을 입력해 주세요.");
return; return;
} }
@@ -184,11 +207,6 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
async function onApply(data: FnrsCnsltnRegistFormData) { async function onApply(data: FnrsCnsltnRegistFormData) {
if (isSubmitting) return; if (isSubmitting) return;
if (data.privacyConsent !== "Y") {
alert("개인정보 수집/이용에 동의해야 신청이 가능합니다.");
return;
}
if (!isFormChecklistComplete(data.cklstResultList)) { if (!isFormChecklistComplete(data.cklstResultList)) {
alert("모든 체크리스트 항목을 체크해야 신청이 가능합니다."); alert("모든 체크리스트 항목을 체크해야 신청이 가능합니다.");
return; return;
@@ -275,10 +293,7 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
initialEsntlFiles={isEditMode ? initialData?.esntlFileList : undefined} initialEsntlFiles={isEditMode ? initialData?.esntlFileList : undefined}
initialEtcFiles={isEditMode ? initialData?.etcFileList : undefined} initialEtcFiles={isEditMode ? initialData?.etcFileList : undefined}
/> />
<SplmntDmndFormSection <SplmntDmndFormSection readOnly={!isSplmntPrgrsStts} />
initialData={initialData?.splmntDmndList}
readOnly={!isSplmntPrgrsStts}
/>
<div className="sticky bottom-0 z-40 !-mb-2 border-t bg-white pb-8 pt-6 shadow-[0_-4px_12px_rgba(0,0,0,0.06)]"> <div className="sticky bottom-0 z-40 !-mb-2 border-t bg-white pb-8 pt-6 shadow-[0_-4px_12px_rgba(0,0,0,0.06)]">
<div className="mx-4 flex flex-wrap justify-center gap-3 sm:gap-4"> <div className="mx-4 flex flex-wrap justify-center gap-3 sm:gap-4">
@@ -318,7 +333,7 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
</> </>
) : ( ) : (
<> <>
{hasCompletedDraft ? ( {fnrsCnsltnDocNo ? (
<Button <Button
color="orange" color="orange"
type="button" type="button"
@@ -342,7 +357,7 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
</div> </div>
</SectionCollapsibleGroup> </SectionCollapsibleGroup>
</form> </form>
{hasCompletedDraft && fnrsCnsltnDocNo ? ( {fnrsCnsltnDocNo ? (
<PwrkCnsltnDocMngDialog <PwrkCnsltnDocMngDialog
open={isPwrkCnsltnDocMngOpen} open={isPwrkCnsltnDocMngOpen}
fnrsCnsltnDocNo={fnrsCnsltnDocNo} fnrsCnsltnDocNo={fnrsCnsltnDocNo}
@@ -350,7 +365,6 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
onClose={() => setIsPwrkCnsltnDocMngOpen(false)} onClose={() => setIsPwrkCnsltnDocMngOpen(false)}
/> />
) : null} ) : null}
<RhfDevTool control={form.control} />
</FormProvider> </FormProvider>
); );
} }
@@ -14,11 +14,7 @@ import {
} from "@/widgets/pbadms-sprt"; } from "@/widgets/pbadms-sprt";
import { Skeleton } from "@common/components"; import { Skeleton } from "@common/components";
import { import { getAiPendingMessage, isAiPendingStatus } from "../lib/ai-pending-utils";
getAiPendingMessage,
isAiPendingStatus,
isRagIndexingInProgress,
} from "../lib/ai-pending-utils";
import { needsRoleUser01AtrzResolve } from "../lib/button-config"; import { needsRoleUser01AtrzResolve } from "../lib/button-config";
import { getEditableReviewStep } from "../lib/review-step-utils"; import { getEditableReviewStep } from "../lib/review-step-utils";
import { EMPTY_CKLST_RESULT_LIST, useChecklistFormState } from "../lib/use-checklist-form-state"; import { EMPTY_CKLST_RESULT_LIST, useChecklistFormState } from "../lib/use-checklist-form-state";
@@ -99,25 +95,20 @@ function FnrsViewPage({ id }: FnrsViewPageProps) {
detDto.prgrsSttsComCd || "", detDto.prgrsSttsComCd || "",
); );
const isAiPending = isAiPendingStatus(detDto.prgrsSttsComCd || ""); const isAiPending = isAiPendingStatus(detDto.prgrsSttsComCd || "");
const isRagIndexing = isRagIndexingInProgress(detDto.prgrsSttsComCd || "", data.ragIndexingInfo);
const showPendingBanner = isAiPending || isRagIndexing;
const pendingMessage = isRagIndexing
? (data.ragIndexingInfo?.message ?? "")
: getAiPendingMessage(detDto.prgrsSttsComCd || "");
return ( return (
<div className="mt-4"> <div className="mt-4">
<SectionCollapsibleGroup> <SectionCollapsibleGroup>
<div className="sticky top-[6rem] z-30 flex items-center gap-4 bg-container px-4 py-2"> <div className="sticky top-[6rem] z-30 flex items-center gap-4 bg-container px-4 py-2">
<SectionCollapsibleToggle /> <SectionCollapsibleToggle />
{showPendingBanner && ( {isAiPending && (
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<span className="relative flex size-3"> <span className="relative flex size-3">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-primary opacity-75"></span> <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-primary opacity-75"></span>
<span className="relative inline-flex size-3 rounded-full bg-primary"></span> <span className="relative inline-flex size-3 rounded-full bg-primary"></span>
</span> </span>
<TextShimmer active className="text-xl"> <TextShimmer active className="text-xl">
{pendingMessage} {getAiPendingMessage(detDto.prgrsSttsComCd || "")}
</TextShimmer> </TextShimmer>
</div> </div>
)} )}
@@ -11,11 +11,11 @@ import {
extractTaskCodes, extractTaskCodes,
getChecklistDisplayRows, getChecklistDisplayRows,
} from "../../lib/checklist-utils"; } from "../../lib/checklist-utils";
import { resolveVisibleReviewSteps } from "../../lib/review-step-utils"; import { getVisibleReviewSteps } from "../../lib/review-step-utils";
import type { ReviewStepCode } from "../../model/view-types"; import type { ReviewStepCode } from "../../model/view-types";
import { import {
CHECKLIST_TAB_LABELS,
type ChecklistFormState, type ChecklistFormState,
REVIEW_STEP_LABELS,
ROLE_TO_REVIEW_STEP, ROLE_TO_REVIEW_STEP,
TASK_CODE_LABELS, TASK_CODE_LABELS,
} from "../../model/view-types"; } from "../../model/view-types";
@@ -37,8 +37,8 @@ function ChecklistSection({
setFormState, setFormState,
}: ChecklistSectionProps) { }: ChecklistSectionProps) {
const visibleReviewSteps = useMemo( const visibleReviewSteps = useMemo(
() => resolveVisibleReviewSteps(prgrsSttsComCd, userRoleCode, cklstResultList), () => getVisibleReviewSteps(prgrsSttsComCd, userRoleCode),
[prgrsSttsComCd, userRoleCode, cklstResultList], [prgrsSttsComCd, userRoleCode],
); );
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]); const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
@@ -87,7 +87,7 @@ function ChecklistSection({
<TabsList> <TabsList>
{visibleReviewSteps.map((stepCode) => ( {visibleReviewSteps.map((stepCode) => (
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl"> <TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
{CHECKLIST_TAB_LABELS[stepCode]} {REVIEW_STEP_LABELS[stepCode]}
</TabsTrigger> </TabsTrigger>
))} ))}
</TabsList> </TabsList>
@@ -1,13 +1,9 @@
import type { IUserInfo } from "@/shared/store/user-store"; import type { IUserInfo } from "@/shared/store/user-store";
import { import type { InstlSncnMngDetResponse } from "@/entities/instl-sncn";
type InstlSncnApplySaveRequestDto,
instlSncnApplySaveSchema,
type InstlSncnMngDetResponse,
} from "@/entities/instl-sncn";
import { toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt"; import { toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt";
import type { InstlSncnRegistFormData } from "./instl-sncn-regist-schema"; import type { InstlSncnRegistFormData } from "./instl-sncn-regist-schema";
import { formatTaskSeComCdForApi, parseTaskSeComCdFromApi } from "./instl-sncn-regist-schema"; import { parseTaskSeComCdFromApi } from "./instl-sncn-regist-schema";
function mapSelectedValue(value?: string | null): "Y" | "N" | null { function mapSelectedValue(value?: string | null): "Y" | "N" | null {
if (value === "Y" || value === "N") return value; if (value === "Y" || value === "N") return value;
@@ -20,12 +16,12 @@ export function mapDetailToFormData(data: InstlSncnMngDetResponse): InstlSncnReg
return { return {
instlSncnMng: { instlSncnMng: {
instlSncnDocNo: detDto.instlSncnDocNo, instlSncnDocNo: detDto.instlSncnDocNo,
bizNm: detDto.bizNm ?? "", bizNm: detDto.bizNm,
bizBgngYr: detDto.bizBgngYr ?? "", bizBgngYr: detDto.bizBgngYr,
bizEndYr: detDto.bizEndYr ?? "", bizEndYr: detDto.bizEndYr,
bizCn: detDto.bizCn ?? "", bizCn: detDto.bizCn,
taskSeComCd: parseTaskSeComCdFromApi(detDto.taskSeComCd), taskSeComCd: parseTaskSeComCdFromApi(detDto.taskSeComCd),
sncnSeComCd: detDto.sncnSeComCd ?? "", sncnSeComCd: detDto.sncnSeComCd,
dsgnrNm: detDto.dsgnrNm ?? "", dsgnrNm: detDto.dsgnrNm ?? "",
dsgnrTelno: detDto.dsgnrTelno ?? "", dsgnrTelno: detDto.dsgnrTelno ?? "",
dsgnrOgdpNm: detDto.dsgnrOgdpNm ?? "", dsgnrOgdpNm: detDto.dsgnrOgdpNm ?? "",
@@ -42,8 +38,16 @@ export function mapDetailToFormData(data: InstlSncnMngDetResponse): InstlSncnReg
atchFileGroupId: detDto.atchFileGroupId ?? "", atchFileGroupId: detDto.atchFileGroupId ?? "",
rtlztnFcltSeComCd: detDto.rtlztnFcltSeComCd ?? "", rtlztnFcltSeComCd: detDto.rtlztnFcltSeComCd ?? "",
rtlztnUsgSeComCd: detDto.rtlztnUsgSeComCd ?? "", rtlztnUsgSeComCd: detDto.rtlztnUsgSeComCd ?? "",
envoSeCdNm: detDto.envoSeCdNm,
sncnSeCdNm: detDto.sncnSeCdNm,
taskSeCdNm: detDto.taskSeCdNm,
prgrsSttsCdNm: detDto.prgrsSttsCdNm,
sido: detDto.sido, sido: detDto.sido,
gugun: detDto.gugun, gugun: detDto.gugun,
regDt: detDto.regDt,
rgtr: detDto.rgtr,
rgtrNm: detDto.rgtrNm,
mdfcnDt: detDto.mdfcnDt,
}, },
bzScaleList: bizSclList.map((item) => ({ bzScaleList: bizSclList.map((item) => ({
cnstpSeCd: item.cnstpSeCd, cnstpSeCd: item.cnstpSeCd,
@@ -81,6 +85,8 @@ export function mapDetailToFormData(data: InstlSncnMngDetResponse): InstlSncnReg
splmntPicNm: item.splmntPicNm ?? "", splmntPicNm: item.splmntPicNm ?? "",
splmntCmptnDt: item.splmntCmptnDt ?? "", splmntCmptnDt: item.splmntCmptnDt ?? "",
splmntAtchFileGroupId: item.splmntAtchFileGroupId ?? "", splmntAtchFileGroupId: item.splmntAtchFileGroupId ?? "",
splmntAtchFileNm: item.splmntAtchFileInfo?.orgnlFileNm ?? "",
splmntAtchFileAtflId: item.splmntAtchFileInfo?.atflId ?? "",
cmptnYn: item.cmptnYn, cmptnYn: item.cmptnYn,
})) ?? [], })) ?? [],
privacyConsent: "Y", privacyConsent: "Y",
@@ -126,29 +132,3 @@ export function getCreateDefaultValues(
privacyConsent: "N", privacyConsent: "N",
}; };
} }
export function buildFormPayload(
data: InstlSncnRegistFormData,
prgrsSttsComCd: "SV" | "ST" | "TE",
options: { isEditMode: boolean; docNo?: string },
): InstlSncnApplySaveRequestDto {
return instlSncnApplySaveSchema.parse({
instlSncnMng: {
...data.instlSncnMng,
instlSncnDocNo: options.isEditMode ? options.docNo : undefined,
taskSeComCd: formatTaskSeComCdForApi(data.instlSncnMng.taskSeComCd),
prgrsSttsComCd,
},
bzScaleList: data.bzScaleList,
bizCstList: data.bizCstList,
cklstResultList: data.cklstResultList.map((item) => ({
...item,
selected: item.selected ?? undefined,
})),
esntlAtchFileList: data.esntlAtchFileList,
splmntDmndList: data.splmntDmndList.map((item) => ({
...item,
...(prgrsSttsComCd === "TE" ? { cmptnYn: "Y" } : null),
})),
});
}
@@ -1,16 +1,7 @@
import { z } from "zod"; import { z } from "zod";
import {
instlSncnBizCstItemSchema,
instlSncnBzScaleItemSchema,
instlSncnCklstResultItemSchema,
instlSncnEsntlAtchFileItemSchema,
instlSncnMngSaveSchema,
instlSncnSplmntDmndItemSchema,
} from "@/entities/instl-sncn";
export const instlSncnRegistSchema = z.object({ export const instlSncnRegistSchema = z.object({
instlSncnMng: instlSncnMngSaveSchema.extend({ instlSncnMng: z.object({
bizNm: z.string().min(1, "사업명은 필수입니다"), bizNm: z.string().min(1, "사업명은 필수입니다"),
bizBgngYr: z.string().min(1, "사업시작연도는 필수입니다"), bizBgngYr: z.string().min(1, "사업시작연도는 필수입니다"),
bizEndYr: z.string().min(1, "사업종료연도는 필수입니다"), bizEndYr: z.string().min(1, "사업종료연도는 필수입니다"),
@@ -27,13 +18,32 @@ export const instlSncnRegistSchema = z.object({
.string() .string()
.min(1, "설계자 이메일은 필수입니다") .min(1, "설계자 이메일은 필수입니다")
.email("올바른 이메일 형식이 아닙니다"), .email("올바른 이메일 형식이 아닙니다"),
bgtBizCd: z.string().optional(),
bgtAplyYr: z.string().optional(),
aplcntNm: z.string().optional(),
aplcntMblTelno: z.string().optional(),
aplcntOgdpNm: z.string().optional(),
aplcntEmlAddr: z.string().optional(),
instlSncnDocNo: z.string().nullish(), instlSncnDocNo: z.string().nullish(),
admdstCd: z.string().optional(),
envoSeComCd: z.string().optional(),
prgrsSttsComCd: z.string().nullish(), prgrsSttsComCd: z.string().nullish(),
atchFileGroupId: z.string().optional(),
rtlztnFcltSeComCd: z.string().optional(),
rtlztnUsgSeComCd: z.string().optional(),
envoSeCdNm: z.string().nullish(),
sncnSeCdNm: z.string().nullish(),
taskSeCdNm: z.string().nullish(),
prgrsSttsCdNm: z.string().nullish(),
sido: z.string().nullish(), sido: z.string().nullish(),
gugun: z.string().nullish(), gugun: z.string().nullish(),
regDt: z.string().nullish(),
rgtr: z.string().nullish(),
rgtrNm: z.string().nullish(),
mdfcnDt: z.string().nullish(),
}), }),
bzScaleList: z.array( bzScaleList: z.array(
instlSncnBzScaleItemSchema.extend({ z.object({
cnstpSeCd: z.string(), cnstpSeCd: z.string(),
bscPl: z.number(), bscPl: z.number(),
budgetReflct: z.number(), budgetReflct: z.number(),
@@ -42,7 +52,7 @@ export const instlSncnRegistSchema = z.object({
}), }),
), ),
bizCstList: z.array( bizCstList: z.array(
instlSncnBizCstItemSchema.extend({ z.object({
acntgSeCd: z.string(), acntgSeCd: z.string(),
bscPlanAmt: z.number(), bscPlanAmt: z.number(),
bgtRfltAmt: z.number(), bgtRfltAmt: z.number(),
@@ -50,25 +60,37 @@ export const instlSncnRegistSchema = z.object({
}), }),
), ),
cklstResultList: z.array( cklstResultList: z.array(
instlSncnCklstResultItemSchema.extend({ z.object({
cklstSn: z.number(), cklstSn: z.number(),
cklstArtclSn: z.number(), cklstArtclSn: z.number(),
cklstRvwSn: z.number(), cklstRvwSn: z.number(),
rvwStpComCd: z.string(), rvwStpComCd: z.string(),
selected: z.enum(["Y", "N"]).nullish(), selected: z.enum(["Y", "N"]).nullable(),
picRvwCn: z.string().nullish(), picRvwCn: z.string().nullish(),
}), }),
), ),
esntlAtchFileList: z.array( esntlAtchFileList: z.array(
instlSncnEsntlAtchFileItemSchema.extend({ z.object({
esntlAtchFileId: z.string(), esntlAtchFileId: z.string(),
atchFileGroupId: z.string(), atchFileGroupId: z.string(),
}), }),
), ),
splmntDmndList: z.array( splmntDmndList: z.array(
instlSncnSplmntDmndItemSchema.extend({ z.object({
splmntDmndSn: z.number().nullish(),
splmntArtclComCd: z.string().nullish(),
splmntArtclCdNm: z.string().nullish(), splmntArtclCdNm: z.string().nullish(),
splmntDmndAtchFileNm: z.string().nullish(), splmntDmndCn: z.string().optional(),
splmntDmndDt: z.string().optional(),
splmntDmndAtchFileGroupId: z.string().optional(),
splmntDmndAtchFileNm: z.string().optional(),
splmntCn: z.string().optional(),
splmntPicNm: z.string().optional(),
splmntCmptnDt: z.string().optional(),
splmntAtchFileGroupId: z.string().optional(),
splmntAtchFileNm: z.string().optional(),
splmntAtchFileAtflId: z.string().optional(),
cmptnYn: z.string().optional(),
}), }),
), ),
privacyConsent: z.enum(["Y", "N"], { privacyConsent: z.enum(["Y", "N"], {
@@ -82,7 +104,7 @@ export function formatTaskSeComCdForApi(taskSeComCd: string[]): string {
return taskSeComCd.join(","); return taskSeComCd.join(",");
} }
export function parseTaskSeComCdFromApi(taskSeComCd?: string | null): string[] { export function parseTaskSeComCdFromApi(taskSeComCd?: string): string[] {
if (!taskSeComCd) return []; if (!taskSeComCd) return [];
return taskSeComCd.split(",").filter(Boolean); return taskSeComCd.split(",").filter(Boolean);
} }
@@ -1,4 +1,4 @@
import type { CklstRvwRsltTreeDto, ReviewStepCode } from "@/entities/instl-sncn"; import type { ReviewStepCode } from "@/entities/instl-sncn";
import { import {
INSTL_PROGRESS_ORDER, INSTL_PROGRESS_ORDER,
@@ -27,25 +27,6 @@ export function getVisibleReviewSteps(
return REVIEW_STEP_CODES.slice(0, count); return REVIEW_STEP_CODES.slice(0, count);
} }
export function resolveVisibleReviewSteps(
prgrsSttsComCd: string,
userRoleCode: string | undefined,
cklstResultList: CklstRvwRsltTreeDto[],
): ReviewStepCode[] {
const byProgressAndRole = getVisibleReviewSteps(prgrsSttsComCd, userRoleCode);
const currentStep = byProgressAndRole.at(-1);
const stepsWithData = new Set<ReviewStepCode>();
for (const row of cklstResultList) {
const step = row.rvwStpComCd as ReviewStepCode | undefined;
if (step && REVIEW_STEP_CODES.includes(step)) stepsWithData.add(step);
}
return REVIEW_STEP_CODES.filter(
(step) => stepsWithData.has(step) || step === currentStep,
);
}
export function getEditableReviewStep( export function getEditableReviewStep(
dtlInstCd?: string, dtlInstCd?: string,
prgrsSttsComCd?: string, prgrsSttsComCd?: string,
@@ -8,11 +8,7 @@ import type {
InstlSncnSplmntDmndSaveDto, InstlSncnSplmntDmndSaveDto,
ReviewStepCode, ReviewStepCode,
} from "@/entities/instl-sncn"; } from "@/entities/instl-sncn";
import { instlSncnApplySaveSchema } from "@/entities/instl-sncn"; import { type SplmntDmndDialogConfirmPayload, toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt";
import {
type SplmntDmndDialogConfirmPayload,
toEsntlAtchFileSaveList,
} from "@/widgets/pbadms-sprt";
import type { ChecklistFormState } from "../model/view-types"; import type { ChecklistFormState } from "../model/view-types";
@@ -27,6 +23,7 @@ export function toBzScaleSaveDto(bizSclList: BizSclTreeDto[]): InstlSncnBzScaleS
bscPl: node.bscPlanQty, bscPl: node.bscPlanQty,
budgetReflct: node.bgtRfltQty, budgetReflct: node.bgtRfltQty,
thtiDsgn: node.tstmDesignQty, thtiDsgn: node.tstmDesignQty,
diff: node.tstmDesignQty - node.bgtRfltQty,
})); }));
} }
@@ -49,13 +46,13 @@ export function buildSavePayload(
): InstlSncnApplySaveRequestDto { ): InstlSncnApplySaveRequestDto {
const { detDto, bizSclList, bizCstList, cklstResultList = [], esntlFileList } = data; const { detDto, bizSclList, bizCstList, cklstResultList = [], esntlFileList } = data;
return instlSncnApplySaveSchema.parse({ return {
instlSncnMng: { ...detDto, prgrsSttsComCd }, instlSncnMng: { ...detDto, prgrsSttsComCd },
bzScaleList: toBzScaleSaveDto(bizSclList), bzScaleList: toBzScaleSaveDto(bizSclList),
bizCstList: toBizCstSaveDto(bizCstList), bizCstList: toBizCstSaveDto(bizCstList),
cklstResultList: toCklstSaveDto(cklstResultList, checklistFormState, reviewStep), cklstResultList: toCklstSaveDto(cklstResultList, checklistFormState, reviewStep),
esntlAtchFileList: toEsntlAtchFileSaveList(esntlFileList), esntlAtchFileList: toEsntlAtchFileSaveList(esntlFileList),
}); };
} }
export function buildTechReviewReplyPayload( export function buildTechReviewReplyPayload(
@@ -67,12 +64,12 @@ export function buildTechReviewReplyPayload(
reviewOpinionFormData?: ReviewOpinionFormData | null, reviewOpinionFormData?: ReviewOpinionFormData | null,
opnrNm?: string, opnrNm?: string,
): InstlSncnApplySaveRequestDto { ): InstlSncnApplySaveRequestDto {
return instlSncnApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, reviewStep, prgrsSttsComCd), ...buildSavePayload(data, checklistFormState, reviewStep, prgrsSttsComCd),
techReViewSaveCd, techReViewSaveCd,
rvwStpCd: reviewStep, rvwStpCd: reviewStep,
rvwOpnnList: toRvwOpnnSaveDto(data, reviewOpinionFormData, opnrNm), rvwOpnnList: toRvwOpnnSaveDto(data, reviewOpinionFormData, opnrNm),
}); };
} }
export function buildSupplementReqPayload( export function buildSupplementReqPayload(
@@ -94,10 +91,10 @@ export function buildSupplementReqPayload(
cmptnYn: "N", cmptnYn: "N",
})); }));
return instlSncnApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, "LOCAL", "SL"), ...buildSavePayload(data, checklistFormState, "LOCAL", "SL"),
splmntDmndList: [...existingItems, ...newItems], splmntDmndList: [...existingItems, ...newItems],
}); };
} }
export function toSplmntDmndSaveItem(item: InstlSncnSplmntDmndSaveDto): InstlSncnSplmntDmndSaveDto { export function toSplmntDmndSaveItem(item: InstlSncnSplmntDmndSaveDto): InstlSncnSplmntDmndSaveDto {
@@ -114,7 +114,7 @@ function getBadgeColor(state: BadgeState) {
} }
} }
function formatOptional(value: string | null | undefined) { function formatOptional(value: string | undefined) {
return value?.trim() ? value : "-"; return value?.trim() ? value : "-";
} }
@@ -48,12 +48,6 @@ export type ChecklistStepMap = Record<ReviewStepCode, CklstRvwRsltTreeDto[]>;
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"]; export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
export const CHECKLIST_TAB_LABELS: Record<ReviewStepCode, string> = {
LOCAL: "자가체크",
ENV: "기술검토",
KECO: "환경청검토",
};
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = { export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
LOCAL: "지자체", LOCAL: "지자체",
ENV: "환경청", ENV: "환경청",
@@ -9,9 +9,10 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { useAlertStore, useUserStore } from "@/shared/lib"; import { useAlertStore, useUserStore } from "@/shared/lib";
import { RhfDevTool, SectionCollapsibleGroup, SectionCollapsibleToggle } from "@/shared/ui"; import { SectionCollapsibleGroup, SectionCollapsibleToggle } from "@/shared/ui";
import { useEsntlAtchFileMngTree } from "@/entities/esntl"; import { useEsntlAtchFileMngTree } from "@/entities/esntl";
import { import {
type InstlSncnApplySaveRequestDto,
instlSncnKeys, instlSncnKeys,
type InstlSncnMngDetResponse, type InstlSncnMngDetResponse,
instlSncnService, instlSncnService,
@@ -30,8 +31,12 @@ import {
} from "@/widgets/pbadms-sprt"; } from "@/widgets/pbadms-sprt";
import { Button } from "@common/components"; import { Button } from "@common/components";
import { buildFormPayload, getCreateDefaultValues, mapDetailToFormData } from "../lib/form-data-mapper"; import { getCreateDefaultValues, mapDetailToFormData } from "../lib/form-data-mapper";
import { type InstlSncnRegistFormData, instlSncnRegistSchema } from "../lib/instl-sncn-regist-schema"; import {
formatTaskSeComCdForApi,
type InstlSncnRegistFormData,
instlSncnRegistSchema,
} from "../lib/instl-sncn-regist-schema";
import { PROGRESS_STATUS_COLUMNS } from "../model/columns"; import { PROGRESS_STATUS_COLUMNS } from "../model/columns";
import { BasicInfoFormSection } from "./sections/basic-info-form-section"; import { BasicInfoFormSection } from "./sections/basic-info-form-section";
@@ -67,24 +72,47 @@ function InstlFormPage({ mode, initialData, createDefaults }: InstlFormPageProps
: getCreateDefaultValues(userInfo, createDefaults), : getCreateDefaultValues(userInfo, createDefaults),
}); });
function createFormPayload(data: InstlSncnRegistFormData, prgrsSttsComCd: "SV" | "ST" | "TE") { function buildFormPayload(
return buildFormPayload(data, prgrsSttsComCd, { data: InstlSncnRegistFormData,
isEditMode, prgrsSttsComCd: "SV" | "ST" | "TE",
docNo: initialData?.detDto.instlSncnDocNo, ): InstlSncnApplySaveRequestDto {
}); const { taskSeComCd: formTaskSeComCd, ...instlSncnMngRest } = data.instlSncnMng;
return {
instlSncnMng: {
...instlSncnMngRest,
instlSncnDocNo: isEditMode ? initialData?.detDto.instlSncnDocNo : undefined,
taskSeComCd: formatTaskSeComCdForApi(formTaskSeComCd),
prgrsSttsComCd,
},
bzScaleList: data.bzScaleList,
bizCstList: data.bizCstList,
cklstResultList: data.cklstResultList.map((item) => ({
...item,
selected: item.selected,
})),
esntlAtchFileList: data.esntlAtchFileList,
splmntDmndList: data.splmntDmndList.map(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
({ splmntAtchFileNm, splmntAtchFileAtflId, splmntDmndAtchFileNm, ...item }) => ({
...item,
...(prgrsSttsComCd === "TE" ? { cmptnYn: "Y" } : null),
}),
),
};
} }
async function submitForm( async function submitForm(
data: InstlSncnRegistFormData, data: InstlSncnRegistFormData,
prgrsSttsComCd: "SV" | "ST", prgrsSttsComCd: "SV" | "ST",
): Promise<string | undefined> { ): Promise<string | undefined> {
return instlSncnService.saveApply(createFormPayload(data, prgrsSttsComCd)); return instlSncnService.saveApply(buildFormPayload(data, prgrsSttsComCd));
} }
async function submitSupplementForm(data: InstlSncnRegistFormData): Promise<string | undefined> { async function submitSupplementForm(data: InstlSncnRegistFormData): Promise<string | undefined> {
const docNo = initialData?.detDto.instlSncnDocNo; const docNo = initialData?.detDto.instlSncnDocNo;
if (!docNo) return undefined; if (!docNo) return undefined;
return instlSncnService.submitSupplement(docNo, createFormPayload(data, "TE")); return instlSncnService.submitSupplement(docNo, buildFormPayload(data, "TE"));
} }
async function onSplmntCmptn(data: InstlSncnRegistFormData) { async function onSplmntCmptn(data: InstlSncnRegistFormData) {
@@ -272,7 +300,6 @@ function InstlFormPage({ mode, initialData, createDefaults }: InstlFormPageProps
</div> </div>
</SectionCollapsibleGroup> </SectionCollapsibleGroup>
</form> </form>
<RhfDevTool control={form.control} />
</FormProvider> </FormProvider>
); );
} }
@@ -11,10 +11,10 @@ import {
extractTaskCodes, extractTaskCodes,
getChecklistDisplayRows, getChecklistDisplayRows,
} from "../../lib/checklist-utils"; } from "../../lib/checklist-utils";
import { resolveVisibleReviewSteps } from "../../lib/review-step-utils"; import { getVisibleReviewSteps } from "../../lib/review-step-utils";
import { import {
CHECKLIST_TAB_LABELS,
type ChecklistFormState, type ChecklistFormState,
REVIEW_STEP_LABELS,
ROLE_TO_REVIEW_STEP, ROLE_TO_REVIEW_STEP,
TASK_CODE_LABELS, TASK_CODE_LABELS,
} from "../../model/view-types"; } from "../../model/view-types";
@@ -36,8 +36,8 @@ function ChecklistSection({
setFormState, setFormState,
}: ChecklistSectionProps) { }: ChecklistSectionProps) {
const visibleReviewSteps = useMemo( const visibleReviewSteps = useMemo(
() => resolveVisibleReviewSteps(prgrsSttsComCd, userRoleCode, cklstResultList), () => getVisibleReviewSteps(prgrsSttsComCd, userRoleCode),
[prgrsSttsComCd, userRoleCode, cklstResultList], [prgrsSttsComCd, userRoleCode],
); );
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]); const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
@@ -86,7 +86,7 @@ function ChecklistSection({
<TabsList> <TabsList>
{visibleReviewSteps.map((stepCode) => ( {visibleReviewSteps.map((stepCode) => (
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl"> <TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
{CHECKLIST_TAB_LABELS[stepCode]} {REVIEW_STEP_LABELS[stepCode]}
</TabsTrigger> </TabsTrigger>
))} ))}
</TabsList> </TabsList>
@@ -1,14 +1,14 @@
import { type CostItemDef, roundAmount } from "@/widgets/pbadms-sprt"; import { type CostItemDef, roundAmount } from "@/widgets/pbadms-sprt";
import { type BizCstMatrixItem, getAmt, PLAN_STEPS } from "./biz-cst-matrix-utils"; import { type BizCstMatrixItem,getAmt, PLAN_STEPS } from "./biz-cst-matrix-utils";
export interface FnrsCstItem { export interface FnrsCstItem {
planStpNo: number; planStpNo: number;
gvexpAmt?: number | null; gvexpAmt?: number;
lcexpAmt?: number | null; lcexpAmt?: number;
orgprBdchgAmt?: number | null; orgprBdchgAmt?: number;
etcAmt?: number | null; etcAmt?: number;
sumAmt?: number | null; sumAmt?: number;
} }
export interface FnrsCstStepRemaining { export interface FnrsCstStepRemaining {
@@ -32,7 +32,10 @@ function getBizCstStepTotal(
function sumFnrsCstLeaf(item: FnrsCstItem): number { function sumFnrsCstLeaf(item: FnrsCstItem): number {
return roundAmount( return roundAmount(
(item.gvexpAmt ?? 0) + (item.lcexpAmt ?? 0) + (item.orgprBdchgAmt ?? 0) + (item.etcAmt ?? 0), (item.gvexpAmt ?? 0) +
(item.lcexpAmt ?? 0) +
(item.orgprBdchgAmt ?? 0) +
(item.etcAmt ?? 0),
); );
} }
@@ -3,7 +3,6 @@ import type {
SewerBscPlanDetResponseDto, SewerBscPlanDetResponseDto,
SewerBscPlanSplmntDmndItem, SewerBscPlanSplmntDmndItem,
} from "@/entities/sewer-bsc-plan"; } from "@/entities/sewer-bsc-plan";
import { sewerBscPlanApplySaveSchema } from "@/entities/sewer-bsc-plan";
import { type SplmntDmndDialogConfirmPayload, toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt"; import { type SplmntDmndDialogConfirmPayload, toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt";
import type { ChecklistFormState, ReviewStepCode } from "../model/view-types"; import type { ChecklistFormState, ReviewStepCode } from "../model/view-types";
@@ -27,7 +26,7 @@ export function buildSavePayload(
const cklstResultRows = data.cklstResultRows ?? []; const cklstResultRows = data.cklstResultRows ?? [];
const esntlFileList = data.esntlFileList ?? []; const esntlFileList = data.esntlFileList ?? [];
return sewerBscPlanApplySaveSchema.parse({ return {
sewerBscPlan: { sewerBscPlan: {
sewerBscPlanDocNo: detDto.sewerBscPlanDocNo, sewerBscPlanDocNo: detDto.sewerBscPlanDocNo,
admdstCd: detDto.admdstCd, admdstCd: detDto.admdstCd,
@@ -100,7 +99,7 @@ export function buildSavePayload(
})), })),
cklstResultList: toCklstSaveDto(cklstResultRows, checklistFormState, reviewStep), cklstResultList: toCklstSaveDto(cklstResultRows, checklistFormState, reviewStep),
esntlAtchFileList: toEsntlAtchFileSaveList(esntlFileList), esntlAtchFileList: toEsntlAtchFileSaveList(esntlFileList),
}); };
} }
export function buildTechReviewReplyPayload( export function buildTechReviewReplyPayload(
@@ -112,12 +111,12 @@ export function buildTechReviewReplyPayload(
reviewOpinionFormData?: ReviewOpinionGetFormDataResult | null, reviewOpinionFormData?: ReviewOpinionGetFormDataResult | null,
opnrNm?: string, opnrNm?: string,
): SewerBscPlanApplySaveRequestDto { ): SewerBscPlanApplySaveRequestDto {
return sewerBscPlanApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, reviewStep, prgrsSttsComCd), ...buildSavePayload(data, checklistFormState, reviewStep, prgrsSttsComCd),
techReViewSaveCd, techReViewSaveCd,
rvwStpCd: reviewStep, rvwStpCd: reviewStep,
rvwOpnnList: toRvwOpnnSaveDto(data, reviewOpinionFormData, opnrNm), rvwOpnnList: toRvwOpnnSaveDto(data, reviewOpinionFormData, opnrNm),
}); };
} }
export function buildSupplementReqPayload( export function buildSupplementReqPayload(
@@ -137,10 +136,10 @@ export function buildSupplementReqPayload(
cmptnYn: "N", cmptnYn: "N",
})); }));
return sewerBscPlanApplySaveSchema.parse({ return {
...buildSavePayload(data, checklistFormState, "LOCAL", "SL"), ...buildSavePayload(data, checklistFormState, "LOCAL", "SL"),
splmntDmndList: [...existingItems, ...newItems], splmntDmndList: [...existingItems, ...newItems],
}); };
} }
export function toSplmntDmndSaveItem(item: SewerBscPlanSplmntDmndItem): SewerBscPlanSplmntDmndItem { export function toSplmntDmndSaveItem(item: SewerBscPlanSplmntDmndItem): SewerBscPlanSplmntDmndItem {
@@ -1,5 +1,3 @@
import type { CklstRvwRsltTreeDto } from "@/entities/sewer-bsc-plan";
import { import {
PBADMS_PROGRESS_ORDER, PBADMS_PROGRESS_ORDER,
REVIEW_STEP_CODES, REVIEW_STEP_CODES,
@@ -30,25 +28,6 @@ export function getVisibleReviewSteps(
return REVIEW_STEP_CODES.slice(0, count); return REVIEW_STEP_CODES.slice(0, count);
} }
export function resolveVisibleReviewSteps(
prgrsSttsComCd: string,
userRoleCode: string | undefined,
cklstResultList: CklstRvwRsltTreeDto[],
): ReviewStepCode[] {
const byProgressAndRole = getVisibleReviewSteps(prgrsSttsComCd, userRoleCode);
const currentStep = byProgressAndRole.at(-1);
const stepsWithData = new Set<ReviewStepCode>();
for (const row of cklstResultList) {
const step = row.rvwStpComCd as ReviewStepCode | undefined;
if (step && REVIEW_STEP_CODES.includes(step)) stepsWithData.add(step);
}
return REVIEW_STEP_CODES.filter(
(step) => stepsWithData.has(step) || step === currentStep,
);
}
export function getEditableReviewStep( export function getEditableReviewStep(
dtlInstCd?: string, dtlInstCd?: string,
prgrsSttsComCd?: string, prgrsSttsComCd?: string,
@@ -16,9 +16,9 @@ import {
export const sewerBscPlanRegistSchema = z.object({ export const sewerBscPlanRegistSchema = z.object({
sewerBscPlan: sewerBscPlanSaveSchema.extend({ sewerBscPlan: sewerBscPlanSaveSchema.extend({
sewerBscPlanNm: z.string().min(1, "기본계획명은 필수입니다"), sewerBscPlanNm: z.string().min(1, "기본계획명은 필수입니다"),
sewerBscPlanSeCdNm: z.string().nullish(), sewerBscPlanSeCdNm: z.string().optional(),
taskSeCdNm: z.string().nullish(), taskSeCdNm: z.string().optional(),
sido: z.string().nullish(), sido: z.string().optional(),
gugun: z.string().nullish(), gugun: z.string().nullish(),
}), }),
sewerBscPlanDtl: sewerBscPlanDtlSaveSchema.extend({ sewerBscPlanDtl: sewerBscPlanDtlSaveSchema.extend({
@@ -61,7 +61,7 @@ export const sewerBscPlanRegistSchema = z.object({
sewerBscPlanTmplntItemSchema.extend({ sewerBscPlanTmplntItemSchema.extend({
swtrmtFcltCd: z.string(), swtrmtFcltCd: z.string(),
swtrmtFcltNm: z.string().nullish(), swtrmtFcltNm: z.string().nullish(),
atchFileNm: z.string().nullish(), atchFileNm: z.string().optional(),
sewerBscPlanTmplntDtlList: z sewerBscPlanTmplntDtlList: z
.array( .array(
sewerBscPlanTmplntDtlItemSchema.extend({ sewerBscPlanTmplntDtlItemSchema.extend({
@@ -69,7 +69,7 @@ export const sewerBscPlanRegistSchema = z.object({
swtrmtFcltCd: z.string(), swtrmtFcltCd: z.string(),
}), }),
) )
.nullish(), .optional(),
}), }),
), ),
cklstResultList: z.array( cklstResultList: z.array(
@@ -77,8 +77,8 @@ export const sewerBscPlanRegistSchema = z.object({
cklstSn: z.number(), cklstSn: z.number(),
cklstArtclSn: z.number(), cklstArtclSn: z.number(),
cklstRvwSn: z.number(), cklstRvwSn: z.number(),
selected: z.enum(["Y", "N"]).nullish(), selected: z.enum(["Y", "N"]).nullable(),
picRvwCn: z.string().nullish(), picRvwCn: z.string().nullable().optional(),
}), }),
), ),
esntlAtchFileList: z.array( esntlAtchFileList: z.array(
@@ -90,9 +90,9 @@ export const sewerBscPlanRegistSchema = z.object({
splmntDmndList: z.array( splmntDmndList: z.array(
sewerBscPlanSplmntDmndItemSchema.extend({ sewerBscPlanSplmntDmndItemSchema.extend({
splmntArtclCdNm: z.string().nullish(), splmntArtclCdNm: z.string().nullish(),
splmntDmndAtchFileNm: z.string().nullish(), splmntDmndAtchFileNm: z.string().optional(),
splmntAtchFileNm: z.string().nullish(), splmntAtchFileNm: z.string().optional(),
splmntAtchFileAtflId: z.string().nullish(), splmntAtchFileAtflId: z.string().optional(),
}), }),
), ),
privacyConsent: z.enum(["Y", "N"], { privacyConsent: z.enum(["Y", "N"], {
@@ -42,12 +42,6 @@ export type ChecklistStepMap = Record<ReviewStepCode, CklstRvwRsltTreeDto[]>;
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"]; export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
export const CHECKLIST_TAB_LABELS: Record<ReviewStepCode, string> = {
LOCAL: "자가체크",
ENV: "기술검토",
KECO: "환경청검토",
};
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = { export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
LOCAL: "지자체", LOCAL: "지자체",
ENV: "환경청", ENV: "환경청",
@@ -31,7 +31,7 @@ interface PreviousPlanLookupDialogProps {
open: boolean; open: boolean;
onOpenChange: (open: boolean) => void; onOpenChange: (open: boolean) => void;
/** 부모 폼 `sewerBscPlan.sido` 표시명 */ /** 부모 폼 `sewerBscPlan.sido` 표시명 */
initialSidoNm?: string | null; initialSidoNm?: string;
/** 부모 폼 `sewerBscPlan.gugun` 표시명 */ /** 부모 폼 `sewerBscPlan.gugun` 표시명 */
initialGugunNm?: string | null; initialGugunNm?: string | null;
} }
@@ -11,11 +11,11 @@ import {
extractTaskCodes, extractTaskCodes,
getChecklistDisplayRows, getChecklistDisplayRows,
} from "../../lib/checklist-utils"; } from "../../lib/checklist-utils";
import { resolveVisibleReviewSteps } from "../../lib/review-step-utils"; import { getVisibleReviewSteps } from "../../lib/review-step-utils";
import type { ReviewStepCode } from "../../model/view-types"; import type { ReviewStepCode } from "../../model/view-types";
import { import {
CHECKLIST_TAB_LABELS,
type ChecklistFormState, type ChecklistFormState,
REVIEW_STEP_LABELS,
ROLE_TO_REVIEW_STEP, ROLE_TO_REVIEW_STEP,
TASK_CODE_LABELS, TASK_CODE_LABELS,
} from "../../model/view-types"; } from "../../model/view-types";
@@ -37,8 +37,8 @@ function ChecklistSection({
setFormState, setFormState,
}: ChecklistSectionProps) { }: ChecklistSectionProps) {
const visibleReviewSteps = useMemo( const visibleReviewSteps = useMemo(
() => resolveVisibleReviewSteps(prgrsSttsComCd, userRoleCode, cklstResultList), () => getVisibleReviewSteps(prgrsSttsComCd, userRoleCode),
[prgrsSttsComCd, userRoleCode, cklstResultList], [prgrsSttsComCd, userRoleCode],
); );
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]); const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
@@ -87,7 +87,7 @@ function ChecklistSection({
<TabsList> <TabsList>
{visibleReviewSteps.map((stepCode) => ( {visibleReviewSteps.map((stepCode) => (
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl"> <TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
{CHECKLIST_TAB_LABELS[stepCode]} {REVIEW_STEP_LABELS[stepCode]}
</TabsTrigger> </TabsTrigger>
))} ))}
</TabsList> </TabsList>
@@ -214,8 +214,8 @@ function TmplntFacilityMatrix({
interface TmplntFacilityAttachmentsProps { interface TmplntFacilityAttachmentsProps {
facilityIndex: number; facilityIndex: number;
facilityName?: string; facilityName?: string;
atchFileGroupId?: string | null; atchFileGroupId?: string;
atchFileNm?: string | null; atchFileNm?: string;
} }
function TmplntFacilityAttachments({ function TmplntFacilityAttachments({
@@ -9,7 +9,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { useAlertStore, useUserStore } from "@/shared/lib"; import { useAlertStore, useUserStore } from "@/shared/lib";
import { RhfDevTool, SectionCollapsibleGroup, SectionCollapsibleToggle } from "@/shared/ui"; import { SectionCollapsibleGroup, SectionCollapsibleToggle } from "@/shared/ui";
import { useAcntgSeMngTree } from "@/entities/acntg"; import { useAcntgSeMngTree } from "@/entities/acntg";
import { useEsntlAtchFileMngTree } from "@/entities/esntl"; import { useEsntlAtchFileMngTree } from "@/entities/esntl";
import { import {
@@ -319,7 +319,6 @@ function SewerBscPlanFormPage({
</div> </div>
</SectionCollapsibleGroup> </SectionCollapsibleGroup>
</form> </form>
<RhfDevTool control={form.control} />
</FormProvider> </FormProvider>
); );
} }
-2
View File
@@ -26,11 +26,9 @@ export const ENDPOINT = {
SEWER_BSC_PLAN: "/as-service/api/v1/sewer-bsc-plans", SEWER_BSC_PLAN: "/as-service/api/v1/sewer-bsc-plans",
DASHBOARD: "/as-service/api/v1/dashboard", DASHBOARD: "/as-service/api/v1/dashboard",
DCRAG_TO: "/as-service/api/v1/dcrag-to", DCRAG_TO: "/as-service/api/v1/dcrag-to",
AI_AUTO_PRCS_MNG: "/as-service/api/v1/ai-auto-prcs-mng",
PWRK_CNSLTN_MNG: "/as-service/api/v1/pwrk-cnsltn-mng", PWRK_CNSLTN_MNG: "/as-service/api/v1/pwrk-cnsltn-mng",
PWRK_CNSLTN_DOC_CRT_RSLT: "/as-service/api/v1/pwrk-cnsltn-doc-crt-rslt", PWRK_CNSLTN_DOC_CRT_RSLT: "/as-service/api/v1/pwrk-cnsltn-doc-crt-rslt",
PWRK_CNSLTN_DOC_PJTCO_AJMT_MNG: "/as-service/api/v1/pwrk-cnsltn-doc-pjtco-ajmt-mng", PWRK_CNSLTN_DOC_PJTCO_AJMT_MNG: "/as-service/api/v1/pwrk-cnsltn-doc-pjtco-ajmt-mng",
PWRK_CNSLTN_DOC_EVL: "/as-service/api/v1/pwrk-cnsltn-doc-evl",
}, },
USER_SERVICE: { USER_SERVICE: {
LOGIN: "/user-service/login", LOGIN: "/user-service/login",
@@ -1,5 +1,3 @@
"use client";
import type { HTMLAttributes } from "react"; import type { HTMLAttributes } from "react";
import type { UseQueryResult } from "@tanstack/react-query"; import type { UseQueryResult } from "@tanstack/react-query";
-2
View File
@@ -1,5 +1,3 @@
"use client";
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
import { type Upload } from "tus-js-client"; import { type Upload } from "tus-js-client";
+8 -8
View File
@@ -205,14 +205,14 @@ export interface EsntlAtchFileSaveBase {
export interface SplmntDmndSaveBase { export interface SplmntDmndSaveBase {
splmntDmndSn?: number | null; splmntDmndSn?: number | null;
splmntArtclComCd?: string | null; splmntArtclComCd?: string | null;
splmntDmndCn?: string | null; splmntDmndCn?: string;
splmntDmndDt?: string | null; splmntDmndDt?: string;
splmntDmndAtchFileGroupId?: string | null; splmntDmndAtchFileGroupId?: string;
splmntCn?: string | null; splmntCn?: string;
splmntPicNm?: string | null; splmntPicNm?: string;
splmntCmptnDt?: string | null; splmntCmptnDt?: string;
splmntAtchFileGroupId?: string | null; splmntAtchFileGroupId?: string;
cmptnYn?: string | null; cmptnYn?: string;
} }
/** 검토의견 저장 공통 필드 (문서번호 제외) */ /** 검토의견 저장 공통 필드 (문서번호 제외) */
+1 -2
View File
@@ -4,7 +4,6 @@ export type { FileAddButtonProps } from "./file-add-button";
export { FileAddButton } from "./file-add-button"; export { FileAddButton } from "./file-add-button";
export { NoData } from "./no-data"; export { NoData } from "./no-data";
export { PageLayout } from "./page-layout"; export { PageLayout } from "./page-layout";
export { RhfDevTool } from "./rhf-devtool";
export { SectionCollapsible } from "./section-collapsible"; export { SectionCollapsible } from "./section-collapsible";
export { export {
SectionCollapsibleGroup, SectionCollapsibleGroup,
@@ -13,4 +12,4 @@ export {
export type { TextShimmerProps } from "./text-shimmer"; export type { TextShimmerProps } from "./text-shimmer";
export { TEXT_SHIMMER_CLASS, TextShimmer } from "./text-shimmer"; export { TEXT_SHIMMER_CLASS, TextShimmer } from "./text-shimmer";
export type { UploadedFileChipProps } from "./uploaded-file-chip"; export type { UploadedFileChipProps } from "./uploaded-file-chip";
export { UploadedFileChip } from "./uploaded-file-chip"; export { UploadedFileChip } from "./uploaded-file-chip";
-23
View File
@@ -1,23 +0,0 @@
"use client";
import type { Control, FieldValues } from "react-hook-form";
import dynamic from "next/dynamic";
const DevTool = dynamic(() => import("@hookform/devtools").then((mod) => mod.DevTool), {
ssr: false,
});
interface RhfDevToolProps<T extends FieldValues> {
control: Control<T>;
}
export function RhfDevTool<T extends FieldValues>({ control }: RhfDevToolProps<T>) {
if (process.env.NODE_ENV !== "development") return null;
return (
<DevTool
control={control as Control<FieldValues>}
placement="bottom-right"
styles={{ button: { right: "80px", bottom: "22px", scale: 2.5 } }}
/>
);
}
@@ -1,8 +1,8 @@
interface CanEditPbadmsDocParams { interface CanEditPbadmsDocParams {
docSeComCd: string; docSeComCd: string;
prgrsSttsComCd?: string | null; prgrsSttsComCd: string | undefined;
rgtr?: string | null; rgtr: string | undefined;
loggedInUserUnqId?: string | null; loggedInUserUnqId: string | undefined;
} }
function canEditPbadmsDoc({ function canEditPbadmsDoc({
@@ -22,7 +22,7 @@ interface CklstResultListItem {
cklstArtclSn: number; cklstArtclSn: number;
cklstRvwSn: number; cklstRvwSn: number;
rvwStpComCd?: string | null; rvwStpComCd?: string | null;
selected?: "Y" | "N" | null; selected: "Y" | "N" | null;
picRvwCn?: string | null; picRvwCn?: string | null;
} }
@@ -17,8 +17,8 @@ export interface FnrsSharListItem {
fnrsSharSeCd: string; fnrsSharSeCd: string;
exstnAmt: number; exstnAmt: number;
chgRqtAmt: number; chgRqtAmt: number;
ajmtAmt?: number | null; ajmtAmt?: number;
rmrkCn?: string | null; rmrkCn?: string;
} }
export type FnrsSharTreeNode = FnrsSharSeMngTreeDto | FnrsSharBizCstTreeDto; export type FnrsSharTreeNode = FnrsSharSeMngTreeDto | FnrsSharBizCstTreeDto;
@@ -1,7 +1,7 @@
"use client"; "use client";
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { Download } from "lucide-react"; import { Download } from "lucide-react";
@@ -78,7 +78,7 @@ function AttachmentsFormSection({
initialEsntlFiles, initialEsntlFiles,
initialEtcFiles, initialEtcFiles,
}: AttachmentsFormSectionProps) { }: AttachmentsFormSectionProps) {
const { getValues, setValue } = useFormContext<AttachmentsFormData>(); const { control, getValues, setValue } = useFormContext<AttachmentsFormData>();
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const [uploadedFiles, setUploadedFiles] = useState<Record<string, UploadedFileItem[]>>({}); const [uploadedFiles, setUploadedFiles] = useState<Record<string, UploadedFileItem[]>>({});
const [etcFiles, setEtcFiles] = useState<EtcFileItem[]>([]); const [etcFiles, setEtcFiles] = useState<EtcFileItem[]>([]);
@@ -373,83 +373,89 @@ function AttachmentsFormSection({
return ( return (
<SectionCollapsible title="첨부파일"> <SectionCollapsible title="첨부파일">
<div className="space-y-6"> <div className="space-y-6">
<div className="px-2"> <Controller
<h3 className="mb-4 text-xl font-semibold">필수 첨부파일</h3> name="esntlAtchFileList"
<Table variant="secondary" className="table-fixed"> control={control}
<colgroup> render={() => (
<col width="44%" /> <div className="px-2">
<col width="12%" /> <h3 className="mb-4 text-xl font-semibold">필수 첨부파일</h3>
<col width="44%" /> <Table variant="secondary" className="table-fixed">
</colgroup> <colgroup>
<TableHeader> <col width="44%" />
<TableRow> <col width="12%" />
<TableHead className="w-[30rem]" align="left"> <col width="44%" />
파일명 </colgroup>
</TableHead> <TableHeader>
<TableHead>파일 확장자</TableHead> <TableRow>
<TableHead>파일첨부</TableHead> <TableHead className="w-[30rem]" align="left">
</TableRow> 파일명
</TableHeader> </TableHead>
<TableBody> <TableHead>파일 확장자</TableHead>
{essentialFiles.length === 0 ? ( <TableHead>파일첨부</TableHead>
<TableRow> </TableRow>
<TableCell colSpan={4} className="py-12 text-center text-muted-foreground"> </TableHeader>
조회된 필수 첨부파일 항목이 없습니다. <TableBody>
</TableCell> {essentialFiles.length === 0 ? (
</TableRow> <TableRow>
) : ( <TableCell colSpan={4} className="py-12 text-center text-muted-foreground">
essentialFiles.map((file) => { 조회된 필수 첨부파일 항목이 없습니다.
const atflCd = file.atchFileGroupId ?? "";
return (
<TableRow key={file.esntlAtchFileId}>
<TableHead
className="group break-keep font-medium"
data-required={file.esntlAtchYn === "Y"}
align="left"
>
<div className="inline-flex w-[calc(100%-1rem)] items-center justify-between gap-10">
{file.esntlAtchFileNm}
{atflCd ? (
<Button
size="sm"
color="white"
onClick={() => downloadTemplate(atflCd)}
>
<Download className="!size-5 shrink-0" />
양식내려받기
</Button>
) : null}
</div>
</TableHead>
<TableCell align="center">{file.esntlAtchFileRmrk}</TableCell>
<TableCell className="space-y-2">
<AttachmentFileField
files={(uploadedFiles[file.esntlAtchFileId] ?? []).map((item) => ({
fileKey: item.fileKey,
fileName: item.file?.name ?? item.fileName,
onDownload: item.atflId
? () => downloadByAtflId(item.atflId!)
: undefined,
}))}
inputId={`${file.esntlAtchFileId}-file-input`}
isUploadingByKey={isUploading}
accept={toFileAccept(file.esntlAtchFileRmrk) || undefined}
onAdd={(fileList) =>
void handleEssentialFileUpload(file.esntlAtchFileId, fileList)
}
onRemove={(index) =>
void removeEssentialFile(file.esntlAtchFileId, index)
}
/>
</TableCell> </TableCell>
</TableRow> </TableRow>
); ) : (
}) essentialFiles.map((file) => {
)} const atflCd = file.atchFileGroupId ?? "";
</TableBody>
</Table> return (
</div> <TableRow key={file.esntlAtchFileId}>
<TableHead
className="group break-keep font-medium"
data-required={file.esntlAtchYn === "Y"}
align="left"
>
<div className="inline-flex w-[calc(100%-1rem)] items-center justify-between gap-10">
{file.esntlAtchFileNm}
{atflCd ? (
<Button
size="sm"
color="white"
onClick={() => downloadTemplate(atflCd)}
>
<Download className="!size-5 shrink-0" />
양식내려받기
</Button>
) : null}
</div>
</TableHead>
<TableCell align="center">{file.esntlAtchFileRmrk}</TableCell>
<TableCell className="space-y-2">
<AttachmentFileField
files={(uploadedFiles[file.esntlAtchFileId] ?? []).map((item) => ({
fileKey: item.fileKey,
fileName: item.file?.name ?? item.fileName,
onDownload: item.atflId
? () => downloadByAtflId(item.atflId!)
: undefined,
}))}
inputId={`${file.esntlAtchFileId}-file-input`}
isUploadingByKey={isUploading}
accept={toFileAccept(file.esntlAtchFileRmrk) || undefined}
onAdd={(fileList) =>
void handleEssentialFileUpload(file.esntlAtchFileId, fileList)
}
onRemove={(index) =>
void removeEssentialFile(file.esntlAtchFileId, index)
}
/>
</TableCell>
</TableRow>
);
})
)}
</TableBody>
</Table>
</div>
)}
/>
<div className="px-2"> <div className="px-2">
<div className="mb-4 flex items-center justify-between"> <div className="mb-4 flex items-center justify-between">
@@ -43,13 +43,12 @@ function AttachmentsViewSection({ esntlFileList, etcFileList }: AttachmentsViewS
) : ( ) : (
<div className="space-y-2"> <div className="space-y-2">
{files.map((file) => ( {files.map((file) => (
<div key={file.atflId}> <AttachmentDownloadLink
<AttachmentDownloadLink key={file.atflId}
atflId={file.atflId} atflId={file.atflId}
fileName={file.orgnlFileNm || "다운로드"} fileName={file.orgnlFileNm || "다운로드"}
className="items-center" className="items-center"
/> />
</div>
))} ))}
</div> </div>
)} )}
@@ -1,7 +1,7 @@
"use client"; "use client";
import { useEffect, useMemo } from "react"; import { useEffect, useMemo } from "react";
import { useFormContext, useWatch } from "react-hook-form"; import { Controller, useFormContext, useWatch } from "react-hook-form";
import { SectionCollapsible } from "@/shared/ui"; import { SectionCollapsible } from "@/shared/ui";
import { Field } from "@/shared/ui/field"; import { Field } from "@/shared/ui/field";
@@ -31,16 +31,6 @@ interface BusinessCostFormData {
type CostFieldKey = "bscPlanAmt" | "bgtRfltAmt" | "tstmDesignAmt"; type CostFieldKey = "bscPlanAmt" | "bgtRfltAmt" | "tstmDesignAmt";
function isSameBizCstCodes(
current: BusinessCostFormData["bizCstList"],
next: BusinessCostFormData["bizCstList"],
) {
return (
current.length === next.length &&
current.every((item, index) => item.acntgSeCd === next[index]?.acntgSeCd)
);
}
function BusinessCostFormSection() { function BusinessCostFormSection() {
const { control, setValue, getValues } = useFormContext<BusinessCostFormData>(); const { control, setValue, getValues } = useFormContext<BusinessCostFormData>();
const bizCstList = useWatch({ control, name: "bizCstList" }) ?? []; const bizCstList = useWatch({ control, name: "bizCstList" }) ?? [];
@@ -52,22 +42,22 @@ function BusinessCostFormSection() {
useEffect(() => { useEffect(() => {
if (costItems.length === 0) return; if (costItems.length === 0) return;
const current = getValues("bizCstList") ?? []; const existingMap = new Map(getValues("bizCstList").map((item) => [item.acntgSeCd, item]));
const existingMap = new Map(current.map((item) => [item.acntgSeCd, item]));
const next = costItems.map((item) => {
const existing = existingMap.get(item.code);
if (existing) return existing;
return { setValue(
acntgSeCd: item.code, "bizCstList",
bscPlanAmt: 0, costItems.map((item) => {
bgtRfltAmt: 0, const existing = existingMap.get(item.code);
tstmDesignAmt: 0, if (existing) return existing;
};
});
if (isSameBizCstCodes(current, next)) return; return {
setValue("bizCstList", next); acntgSeCd: item.code,
bscPlanAmt: 0,
bgtRfltAmt: 0,
tstmDesignAmt: 0,
};
}),
);
}, [costItems, getValues, setValue]); }, [costItems, getValues, setValue]);
function handleCostChange(index: number, fieldKey: CostFieldKey, value: string) { function handleCostChange(index: number, fieldKey: CostFieldKey, value: string) {
@@ -129,37 +119,58 @@ function BusinessCostFormSection() {
</div> </div>
</TableHead> </TableHead>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`bizCstList.${idx}.bgtRfltAmt`}
type="number" control={control}
value={data.bgtRfltAmt ?? ""} render={({ field, fieldState }) => (
onChange={(e) => handleCostChange(idx, "bgtRfltAmt", e.target.value)} <Field data-invalid={fieldState.invalid}>
readOnly={item.readonly} <Input
className={`text-right ${item.readonly ? "bg-muted" : ""}`} type="number"
/> value={field.value || ""}
</Field> onChange={(e) => handleCostChange(idx, "bgtRfltAmt", e.target.value)}
readOnly={item.readonly}
aria-invalid={fieldState.invalid}
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
/>
</Field>
)}
/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`bizCstList.${idx}.bscPlanAmt`}
type="number" control={control}
value={data.bscPlanAmt ?? ""} render={({ field, fieldState }) => (
onChange={(e) => handleCostChange(idx, "bscPlanAmt", e.target.value)} <Field data-invalid={fieldState.invalid}>
readOnly={item.readonly} <Input
className={`text-right ${item.readonly ? "bg-muted" : ""}`} type="number"
/> value={field.value || ""}
</Field> onChange={(e) => handleCostChange(idx, "bscPlanAmt", e.target.value)}
readOnly={item.readonly}
aria-invalid={fieldState.invalid}
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
/>
</Field>
)}
/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`bizCstList.${idx}.tstmDesignAmt`}
type="number" control={control}
value={data.tstmDesignAmt ?? ""} render={({ field, fieldState }) => (
onChange={(e) => handleCostChange(idx, "tstmDesignAmt", e.target.value)} <Field data-invalid={fieldState.invalid}>
readOnly={item.readonly} <Input
className={`text-right ${item.readonly ? "bg-muted" : ""}`} type="number"
/> value={field.value || ""}
</Field> onChange={(e) => handleCostChange(idx, "tstmDesignAmt", e.target.value)}
readOnly={item.readonly}
aria-invalid={fieldState.invalid}
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
/>
</Field>
)}
/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<div className="text-right"> <div className="text-right">
@@ -1,7 +1,7 @@
"use client"; "use client";
import { useEffect, useMemo } from "react"; import { useEffect, useMemo } from "react";
import { useFormContext, useWatch } from "react-hook-form"; import { Controller, useFormContext, useWatch } from "react-hook-form";
import { SectionCollapsible } from "@/shared/ui"; import { SectionCollapsible } from "@/shared/ui";
import { Field } from "@/shared/ui/field"; import { Field } from "@/shared/ui/field";
@@ -17,7 +17,7 @@ import {
TableRow, TableRow,
} from "@common/components"; } from "@common/components";
import { buildCnstpScaleItems, recalculateBzScaleTotals } from "../lib/business-scale-form-utils"; import { buildCnstpScaleItems, recalculateBzScaleTotals } from "../lib/business-scale-form-utils";
interface BusinessScaleFormData { interface BusinessScaleFormData {
bzScaleList: Array<{ bzScaleList: Array<{
@@ -31,16 +31,6 @@ interface BusinessScaleFormData {
type ScaleFieldKey = "bscPl" | "budgetReflct" | "thtiDsgn"; type ScaleFieldKey = "bscPl" | "budgetReflct" | "thtiDsgn";
function isSameBzScaleCodes(
current: BusinessScaleFormData["bzScaleList"],
next: BusinessScaleFormData["bzScaleList"],
) {
return (
current.length === next.length &&
current.every((item, index) => item.cnstpSeCd === next[index]?.cnstpSeCd)
);
}
function BusinessScaleFormSection() { function BusinessScaleFormSection() {
const { control, setValue, getValues } = useFormContext<BusinessScaleFormData>(); const { control, setValue, getValues } = useFormContext<BusinessScaleFormData>();
const bzScaleList = useWatch({ control, name: "bzScaleList" }) ?? []; const bzScaleList = useWatch({ control, name: "bzScaleList" }) ?? [];
@@ -52,8 +42,7 @@ function BusinessScaleFormSection() {
useEffect(() => { useEffect(() => {
if (scaleItems.length === 0) return; if (scaleItems.length === 0) return;
const current = getValues("bzScaleList") ?? []; const existingMap = new Map(getValues("bzScaleList").map((item) => [item.cnstpSeCd, item]));
const existingMap = new Map(current.map((item) => [item.cnstpSeCd, item]));
const next = scaleItems.map((item) => { const next = scaleItems.map((item) => {
const existing = existingMap.get(item.code); const existing = existingMap.get(item.code);
@@ -68,7 +57,6 @@ function BusinessScaleFormSection() {
}; };
}); });
if (isSameBzScaleCodes(current, next)) return;
setValue("bzScaleList", recalculateBzScaleTotals(next, scaleItems)); setValue("bzScaleList", recalculateBzScaleTotals(next, scaleItems));
}, [scaleItems, getValues, setValue]); }, [scaleItems, getValues, setValue]);
@@ -124,37 +112,58 @@ function BusinessScaleFormSection() {
</div> </div>
</TableHead> </TableHead>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`bzScaleList.${idx}.bscPl`}
type="number" control={control}
value={data.bscPl ?? ""} render={({ field, fieldState }) => (
onChange={(e) => handleScaleChange(idx, "bscPl", e.target.value)} <Field data-invalid={fieldState.invalid}>
readOnly={item.readonly} <Input
className={`text-right ${item.readonly ? "bg-muted" : ""}`} type="number"
/> value={field.value || ""}
</Field> onChange={(e) => handleScaleChange(idx, "bscPl", e.target.value)}
readOnly={item.readonly}
aria-invalid={fieldState.invalid}
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
/>
</Field>
)}
/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`bzScaleList.${idx}.budgetReflct`}
type="number" control={control}
value={data.budgetReflct ?? ""} render={({ field, fieldState }) => (
onChange={(e) => handleScaleChange(idx, "budgetReflct", e.target.value)} <Field data-invalid={fieldState.invalid}>
readOnly={item.readonly} <Input
className={`text-right ${item.readonly ? "bg-muted" : ""}`} type="number"
/> value={field.value || ""}
</Field> onChange={(e) => handleScaleChange(idx, "budgetReflct", e.target.value)}
readOnly={item.readonly}
aria-invalid={fieldState.invalid}
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
/>
</Field>
)}
/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`bzScaleList.${idx}.thtiDsgn`}
type="number" control={control}
value={data.thtiDsgn ?? ""} render={({ field, fieldState }) => (
onChange={(e) => handleScaleChange(idx, "thtiDsgn", e.target.value)} <Field data-invalid={fieldState.invalid}>
readOnly={item.readonly} <Input
className={`text-right ${item.readonly ? "bg-muted" : ""}`} type="number"
/> value={field.value || ""}
</Field> onChange={(e) => handleScaleChange(idx, "thtiDsgn", e.target.value)}
readOnly={item.readonly}
aria-invalid={fieldState.invalid}
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
/>
</Field>
)}
/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<div className="text-right"> <div className="text-right">
@@ -1,15 +1,18 @@
"use client"; "use client";
import { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { useFormContext, useWatch } from "react-hook-form"; import { Controller, useFormContext, useWatch } from "react-hook-form";
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
import { SectionCollapsible } from "@/shared/ui"; import { SectionCollapsible } from "@/shared/ui";
import { Field, FieldLabel } from "@/shared/ui/field";
import { cklstMngService, type CklstTreeNode } from "@/entities/cklst"; import { cklstMngService, type CklstTreeNode } from "@/entities/cklst";
import { useCodeList } from "@/entities/code"; import { useCodeList } from "@/entities/code";
import { import {
Button, Button,
RadioGroup,
RadioGroupItem,
Skeleton, Skeleton,
Table, Table,
TableBody, TableBody,
@@ -27,7 +30,7 @@ import {
buildChecklistTabs, buildChecklistTabs,
normalizeTaskSeComCdArray, normalizeTaskSeComCdArray,
syncCklstResultListFromTree, syncCklstResultListFromTree,
} from "../lib/checklist-form-utils"; } from "../lib/checklist-form-utils";
type FieldPrefix = "fnrsCnsltnMng" | "instlSncnMng" | "designCnstnMng" | "sewerBscPlan"; type FieldPrefix = "fnrsCnsltnMng" | "instlSncnMng" | "designCnstnMng" | "sewerBscPlan";
@@ -36,7 +39,7 @@ interface CklstResultListItem {
cklstArtclSn: number; cklstArtclSn: number;
cklstRvwSn: number; cklstRvwSn: number;
rvwStpComCd: string; rvwStpComCd: string;
selected?: "Y" | "N" | null; selected: "Y" | "N" | null;
picRvwCn?: string | null; picRvwCn?: string | null;
} }
@@ -122,21 +125,11 @@ function ChecklistFormSection({ docSeComCd, fieldPrefix }: ChecklistFormSectionP
} }
}, [checklistTabs, activeTab]); }, [checklistTabs, activeTab]);
function handleSelectChange(resultIdx: number, value: "Y" | "N") {
const currentList = getValues("cklstResultList") as CklstResultListItem[];
const row = currentList[resultIdx];
if (!row) return;
const newList = [...currentList];
newList[resultIdx] = { ...row, selected: value };
setValue("cklstResultList", newList, { shouldDirty: true });
}
function handleSelectAll(tabCode: string, value: "Y" | "N") { function handleSelectAll(tabCode: string, value: "Y" | "N") {
const tab = checklistTabs.find((t) => t.code === tabCode); const tab = checklistTabs.find((t) => t.code === tabCode);
if (!tab) return; if (!tab) return;
const currentList = getValues("cklstResultList") as CklstResultListItem[]; const currentList = getValues("cklstResultList");
const newList = [...currentList]; const newList = [...currentList];
tab.items tab.items
@@ -148,7 +141,7 @@ function ChecklistFormSection({ docSeComCd, fieldPrefix }: ChecklistFormSectionP
} }
}); });
setValue("cklstResultList", newList, { shouldDirty: true }); setValue("cklstResultList", newList);
} }
const hasSelectedTaskCodes = Boolean(taskSeComCdArray?.length); const hasSelectedTaskCodes = Boolean(taskSeComCdArray?.length);
@@ -241,8 +234,6 @@ function ChecklistFormSection({ docSeComCd, fieldPrefix }: ChecklistFormSectionP
{tab.items.map((item) => { {tab.items.map((item) => {
const resultIdx = cklstRvwSnIndexMap.get(item.cklstRvwSn) ?? -1; const resultIdx = cklstRvwSnIndexMap.get(item.cklstRvwSn) ?? -1;
const showRadios = item.bchckUseYn === "Y"; const showRadios = item.bchckUseYn === "Y";
const selected = cklstResultList[resultIdx]?.selected;
const radioName = `check-${item.cklstRvwSn}`;
return ( return (
<TableRow key={item.cklstRvwSn}> <TableRow key={item.cklstRvwSn}>
@@ -257,30 +248,66 @@ function ChecklistFormSection({ docSeComCd, fieldPrefix }: ChecklistFormSectionP
{item.content} {item.content}
</TableCell> </TableCell>
{showRadios && resultIdx >= 0 ? ( {showRadios && resultIdx >= 0 ? (
<> <Controller
<TableCell className="text-center"> name={`cklstResultList.${resultIdx}.selected`}
<input control={control}
type="radio" render={({ field, fieldState }) => (
name={radioName} <>
value="Y" <TableCell className="text-center">
checked={selected === "Y"} <RadioGroup
onChange={() => handleSelectChange(resultIdx, "Y")} name={field.name}
aria-label="예" value={field.value === "Y" ? "Y" : undefined}
className="cursor-pointer" onValueChange={field.onChange}
/> className="flex justify-center"
</TableCell> >
<TableCell className="text-center"> <FieldLabel
<input htmlFor={`check-${item.cklstRvwSn}-Y`}
type="radio" className="!w-auto justify-center border-none"
name={radioName} >
value="N" <Field
checked={selected === "N"} orientation="horizontal"
onChange={() => handleSelectChange(resultIdx, "N")} data-invalid={fieldState.invalid}
aria-label="아니오" className="w-auto"
className="cursor-pointer" >
/> <RadioGroupItem
</TableCell> value="Y"
</> id={`check-${item.cklstRvwSn}-Y`}
aria-invalid={fieldState.invalid}
aria-label="예"
/>
</Field>
</FieldLabel>
</RadioGroup>
</TableCell>
<TableCell className="text-center">
<RadioGroup
name={field.name}
value={field.value === "N" ? "N" : undefined}
onValueChange={field.onChange}
className="flex justify-center"
>
<FieldLabel
htmlFor={`check-${item.cklstRvwSn}-N`}
className="!w-auto justify-center border-none"
>
<Field
orientation="horizontal"
data-invalid={fieldState.invalid}
className="w-auto"
>
<RadioGroupItem
value="N"
id={`check-${item.cklstRvwSn}-N`}
aria-invalid={fieldState.invalid}
aria-label="아니오"
/>
</Field>
</FieldLabel>
</RadioGroup>
</TableCell>
</>
)}
/>
) : null} ) : null}
</TableRow> </TableRow>
); );
@@ -1,17 +1,18 @@
"use client"; "use client";
import { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { useFormContext, useWatch } from "react-hook-form"; import { Controller, useFormContext, useWatch } from "react-hook-form";
import { getDefaultFileKey, useTus } from "@/shared/lib"; import { getDefaultFileKey, useTus } from "@/shared/lib";
import { AttachmentFileField, SectionCollapsible } from "@/shared/ui"; import { TextShimmer } from "@/shared/ui";
import { SectionCollapsible } from "@/shared/ui";
import { Field } from "@/shared/ui/field"; import { Field } from "@/shared/ui/field";
import { useAcntgSeMngTree } from "@/entities/acntg"; import { useAcntgSeMngTree } from "@/entities/acntg";
import { useDownloadAttachmentByAtflId } from "@/entities/attach";
import type { AtflMngClientResponseDto } from "@/entities/fnrs-cnsltn"; import type { AtflMngClientResponseDto } from "@/entities/fnrs-cnsltn";
import type { FnrsSharBizCstTreeDto } from "@/entities/fnrs-shar-se"; import type { FnrsSharBizCstTreeDto } from "@/entities/fnrs-shar-se";
import { useFnrsSharSeMngTree } from "@/entities/fnrs-shar-se"; import { useFnrsSharSeMngTree } from "@/entities/fnrs-shar-se";
import { import {
Button,
cn, cn,
Input, Input,
Skeleton, Skeleton,
@@ -36,7 +37,6 @@ import { calcDiffPercent } from "../lib/format-utils";
import { BizCstTotalDisplayTable } from "./biz-cst-total-display-table"; import { BizCstTotalDisplayTable } from "./biz-cst-total-display-table";
const SHAR_FILE_KEY_PREFIX = "fnrs-shar::"; const SHAR_FILE_KEY_PREFIX = "fnrs-shar::";
const SHAR_FILE_ACCEPT = ".hwp,.hwpx";
interface FnrsSharFormData { interface FnrsSharFormData {
fnrsSharList: FnrsSharListItem[]; fnrsSharList: FnrsSharListItem[];
@@ -53,12 +53,6 @@ interface FnrsSharFormData {
type SharFieldKey = "exstnAmt" | "chgRqtAmt" | "rmrkCn"; type SharFieldKey = "exstnAmt" | "chgRqtAmt" | "rmrkCn";
interface SharUploadedFile {
fileKey: string;
fileName: string;
atflId?: string;
}
interface FnrsSharFormSectionProps { interface FnrsSharFormSectionProps {
initialSharTree?: FnrsSharBizCstTreeDto[]; initialSharTree?: FnrsSharBizCstTreeDto[];
initialSharAtchFiles?: AtflMngClientResponseDto[]; initialSharAtchFiles?: AtflMngClientResponseDto[];
@@ -68,30 +62,12 @@ function createSharUploadKey(file: File) {
return `${SHAR_FILE_KEY_PREFIX}${getDefaultFileKey(file)}`; return `${SHAR_FILE_KEY_PREFIX}${getDefaultFileKey(file)}`;
} }
function toInitialSharFile(file?: AtflMngClientResponseDto): SharUploadedFile | null {
if (!file?.orgnlFileNm) return null;
return {
fileKey: file.atflId ? `server::${file.atflId}` : `${SHAR_FILE_KEY_PREFIX}${file.atflCd}`,
fileName: file.orgnlFileNm,
atflId: file.atflId,
};
}
function isSameFnrsSharCodes(current: FnrsSharListItem[], next: FnrsSharListItem[]) {
return (
current.length === next.length &&
current.every((item, index) => item.fnrsSharSeCd === next[index]?.fnrsSharSeCd)
);
}
function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsSharFormSectionProps) { function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsSharFormSectionProps) {
const { control, setValue, getValues } = useFormContext<FnrsSharFormData>(); const { control, setValue, getValues } = useFormContext<FnrsSharFormData>();
const fnrsSharList = useWatch({ control, name: "fnrsSharList" }) ?? []; const fnrsSharList = useWatch({ control, name: "fnrsSharList" }) ?? [];
const [uploadedFile, setUploadedFile] = useState<SharUploadedFile | null>(() => const [uploadedFileName, setUploadedFileName] = useState(
toInitialSharFile(initialSharAtchFiles?.[0]), () => initialSharAtchFiles?.[0]?.orgnlFileNm ?? "",
); );
const { mutate: downloadByAtflId } = useDownloadAttachmentByAtflId();
const { data: masterTree = [], isLoading: isMasterLoading } = useFnrsSharSeMngTree(); const { data: masterTree = [], isLoading: isMasterLoading } = useFnrsSharSeMngTree();
const { data: acntgTree = [] } = useAcntgSeMngTree(); const { data: acntgTree = [] } = useAcntgSeMngTree();
@@ -102,13 +78,9 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
const isLoading = initialSharTree?.length ? false : isMasterLoading; const isLoading = initialSharTree?.length ? false : isMasterLoading;
const { uploadFileAsync, isUploading } = useTus({ const { uploadFileAsync, isUploading } = useTus({
onSuccess: (atflCd, atflId, _file, fileKey) => { onSuccess: (atflCd) => {
if (!atflCd) return; if (!atflCd) return;
setValue("fnrsCnsltnMng.sharAtchFileGroupId", atflCd, { shouldDirty: true }); setValue("fnrsCnsltnMng.sharAtchFileGroupId", atflCd, { shouldDirty: true });
setUploadedFile((prev) => (prev?.fileKey === fileKey ? { ...prev, atflId } : prev));
},
onError: (_error, _file, fileKey) => {
setUploadedFile((prev) => (prev?.fileKey === fileKey ? null : prev));
}, },
}); });
const isSharUploading = Object.values(isUploading).some(Boolean); const isSharUploading = Object.values(isUploading).some(Boolean);
@@ -124,7 +96,6 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
: mergeFnrsSharTreeWithForm(sharTree, []); : mergeFnrsSharTreeWithForm(sharTree, []);
const withTotals = recalculateFnrsSharTotals(merged, sharItems); const withTotals = recalculateFnrsSharTotals(merged, sharItems);
if (isSameFnrsSharCodes(existing, withTotals)) return;
setValue("fnrsSharList", withTotals); setValue("fnrsSharList", withTotals);
}, [sharItems, sharTree, initialSharTree, getValues, setValue]); }, [sharItems, sharTree, initialSharTree, getValues, setValue]);
@@ -149,32 +120,16 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
applySharList(draft); applySharList(draft);
} }
async function handleSharFileAdd(files: FileList | null) { async function handleSharFileChange(event: React.ChangeEvent<HTMLInputElement>) {
const file = files?.[0]; const file = event.target.files?.[0];
if (!file) return; if (!file) return;
const fileKey = createSharUploadKey(file); const fileKey = createSharUploadKey(file);
setUploadedFile({ fileName: file.name, fileKey }); setUploadedFileName(file.name);
await uploadFileAsync(file, { fileKey });
try { event.target.value = "";
await uploadFileAsync(file, { fileKey });
} catch {
// onError callback handles cleanup
}
} }
const sharAtchFiles = uploadedFile
? [
{
fileKey: uploadedFile.fileKey,
fileName: uploadedFile.fileName,
onDownload: uploadedFile.atflId
? () => downloadByAtflId(uploadedFile.atflId!)
: undefined,
},
]
: [];
if (isLoading) { if (isLoading) {
return ( return (
<SectionCollapsible title="재원분담"> <SectionCollapsible title="재원분담">
@@ -234,26 +189,40 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
{item.label} {item.label}
</TableHead> </TableHead>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`fnrsSharList.${idx}.exstnAmt`}
type="number" control={control}
value={data.exstnAmt ?? ""} render={({ field, fieldState }) => (
onChange={(e) => handleSharChange(idx, "exstnAmt", e.target.value)} <Field data-invalid={fieldState.invalid}>
readOnly={item.readonly} <Input
className={cn("text-right", item.readonly && "bg-muted")} type="number"
/> value={field.value ?? ""}
</Field> onChange={(e) => handleSharChange(idx, "exstnAmt", e.target.value)}
readOnly={item.readonly}
aria-invalid={fieldState.invalid}
className={cn("text-right", item.readonly && "bg-muted")}
/>
</Field>
)}
/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`fnrsSharList.${idx}.chgRqtAmt`}
type="number" control={control}
value={data.chgRqtAmt ?? ""} render={({ field, fieldState }) => (
onChange={(e) => handleSharChange(idx, "chgRqtAmt", e.target.value)} <Field data-invalid={fieldState.invalid}>
readOnly={item.readonly} <Input
className={cn("text-right", item.readonly && "bg-muted")} type="number"
/> value={field.value ?? ""}
</Field> onChange={(e) => handleSharChange(idx, "chgRqtAmt", e.target.value)}
readOnly={item.readonly}
aria-invalid={fieldState.invalid}
className={cn("text-right", item.readonly && "bg-muted")}
/>
</Field>
)}
/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<div className="text-right"> <div className="text-right">
@@ -264,12 +233,19 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
<div className="text-right">{calcDiffPercent(diff, data.exstnAmt || 0)}</div> <div className="text-right">{calcDiffPercent(diff, data.exstnAmt || 0)}</div>
</TableCell> </TableCell>
<TableCell> <TableCell>
<Field> <Controller
<Input name={`fnrsSharList.${idx}.rmrkCn`}
value={data.rmrkCn ?? ""} control={control}
onChange={(e) => handleSharChange(idx, "rmrkCn", e.target.value)} render={({ field, fieldState }) => (
/> <Field data-invalid={fieldState.invalid}>
</Field> <Input
value={field.value ?? ""}
onChange={(e) => handleSharChange(idx, "rmrkCn", e.target.value)}
aria-invalid={fieldState.invalid}
/>
</Field>
)}
/>
</TableCell> </TableCell>
</TableRow> </TableRow>
); );
@@ -281,20 +257,31 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
<div className="mt-6 px-2 pb-2"> <div className="mt-6 px-2 pb-2">
<h3 className="mb-2 text-xl font-semibold">첨부파일</h3> <h3 className="mb-2 text-xl font-semibold">첨부파일</h3>
{!uploadedFile ? ( <div className="flex flex-wrap items-center gap-2">
<p className="mb-2 px-1 text-xl text-muted-foreground"> {isSharUploading && uploadedFileName ? (
총사업비 신청서(.hwp) 파일을 등록해주세요. <TextShimmer className="max-w-lg text-xl" active>
</p> {uploadedFileName}
) : null} </TextShimmer>
<AttachmentFileField ) : (
files={sharAtchFiles} <Input
inputId="fnrs-shar-atch-file-input" value={uploadedFileName}
isUploadingByKey={isUploading} readOnly
accept={SHAR_FILE_ACCEPT} placeholder="총사업비 신청서(.hwp) 파일을 등록해주세요."
multiple={false} className="max-w-lg rounded-sm"
addDisabled={isSharUploading} />
onAdd={(fileList) => void handleSharFileAdd(fileList)} )}
/> <Button type="button" color="white" disabled={isSharUploading} asChild>
<label className="cursor-pointer">
첨부파일
<input
type="file"
accept=".hwp,.hwpx"
className="hidden"
onChange={handleSharFileChange}
/>
</label>
</Button>
</div>
</div> </div>
</SectionCollapsible> </SectionCollapsible>
); );
@@ -5,12 +5,7 @@ import { Controller, useFormContext, useWatch } from "react-hook-form";
import { dayjs, getDefaultFileKey, useTus } from "@/shared/lib"; import { dayjs, getDefaultFileKey, useTus } from "@/shared/lib";
import { AttachmentFileField, SectionCollapsible } from "@/shared/ui"; import { AttachmentFileField, SectionCollapsible } from "@/shared/ui";
import { import { AttachmentDownloadLink, attachService, useDownloadAttachmentByAtflId } from "@/entities/attach";
AttachmentDownloadLink,
attachService,
useDownloadAttachmentByAtflId,
} from "@/entities/attach";
import { FnrsCnsltnSplmntDmndResponseDto } from "@/entities/fnrs-cnsltn";
import { import {
Badge, Badge,
Table, Table,
@@ -51,7 +46,6 @@ interface SplmntDmndFormData {
} }
interface SplmntDmndFormSectionProps { interface SplmntDmndFormSectionProps {
initialData?: FnrsCnsltnSplmntDmndResponseDto[];
readOnly?: boolean; readOnly?: boolean;
} }
@@ -71,7 +65,7 @@ function getRowKey(item: SplmntDmndFormItem, index: number) {
return item.splmntDmndSn != null ? String(item.splmntDmndSn) : `idx-${index}`; return item.splmntDmndSn != null ? String(item.splmntDmndSn) : `idx-${index}`;
} }
function SplmntDmndFormSection({ initialData, readOnly = false }: SplmntDmndFormSectionProps) { function SplmntDmndFormSection({ readOnly = false }: SplmntDmndFormSectionProps) {
const formId = useId(); const formId = useId();
const { control, setValue, getValues } = useFormContext<SplmntDmndFormData>(); const { control, setValue, getValues } = useFormContext<SplmntDmndFormData>();
const splmntDmndList = useWatch({ control, name: "splmntDmndList" }) ?? []; const splmntDmndList = useWatch({ control, name: "splmntDmndList" }) ?? [];
@@ -266,7 +260,6 @@ function SplmntDmndFormSection({ initialData, readOnly = false }: SplmntDmndForm
const isRowUploading = rowFiles.some((file) => isUploading[file.fileKey] ?? false); const isRowUploading = rowFiles.some((file) => isUploading[file.fileKey] ?? false);
const fileInputId = `${formId}-${rowKey}-file`; const fileInputId = `${formId}-${rowKey}-file`;
const isRowReadOnly = readOnly || item.cmptnYn === "Y"; const isRowReadOnly = readOnly || item.cmptnYn === "Y";
const splmntAtchFileInfo = initialData?.[index]?.splmntAtchFileInfo;
return ( return (
<TableRow key={rowKey}> <TableRow key={rowKey}>
@@ -289,15 +282,7 @@ function SplmntDmndFormSection({ initialData, readOnly = false }: SplmntDmndForm
</TableCell> </TableCell>
<TableCell className="align-top"> <TableCell className="align-top">
{isRowReadOnly ? ( {isRowReadOnly ? (
<div className="space-y-2"> <span className="whitespace-pre-wrap">{item.splmntCn || "-"}</span>
<div className="whitespace-pre-wrap">{item.splmntCn || "-"}</div>
{splmntAtchFileInfo?.atflCd ? (
<AttachmentDownloadLink
atflCd={splmntAtchFileInfo?.atflCd}
fileName={splmntAtchFileInfo?.orgnlFileNm}
/>
) : null}
</div>
) : ( ) : (
<Controller <Controller
control={control} control={control}
@@ -307,7 +292,7 @@ function SplmntDmndFormSection({ initialData, readOnly = false }: SplmntDmndForm
value={field.value ?? ""} value={field.value ?? ""}
onChange={field.onChange} onChange={field.onChange}
onBlur={field.onBlur} onBlur={field.onBlur}
placeholder="보완 완료 내용을 입력하세요." placeholder="보완완료 내용을 입력하세요."
className="min-h-[6rem] !text-xl" className="min-h-[6rem] !text-xl"
/> />
)} )}
@@ -276,9 +276,7 @@ function Post({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
)} )}
</div> </div>
</PostAction> </PostAction>
{bbsInfo?.cmntUseYn === "Y" && ( <PostComment bbsId={parseInt(bbsId)} pstNo={parseInt(pstNo)} />
<PostComment bbsId={parseInt(bbsId)} pstNo={parseInt(pstNo)} />
)}
</> </>
); );
} }
@@ -31,7 +31,7 @@ export interface LinkLog {
err_cn: string; err_cn: string;
link_err_nm: string; link_err_nm: string;
log_crt_dt: string; log_crt_dt: string;
link_excn_stp_nm: string; link_exec_step: string;
} }
export interface LinkInfo extends LinkFormData { export interface LinkInfo extends LinkFormData {
@@ -114,7 +114,7 @@ export const linkFormSchema = z.object({
link_db_nm: z.string().max(10).nullable().optional(), link_db_nm: z.string().max(10).nullable().optional(),
link_api_no: z.string().max(100, { message: '연계 KEY는 100자 이하로 입력해 주세요.' }).nonempty({ message: '연계 KEY는 필수입니다.' }), link_api_no: z.string().max(100, { message: '연계 KEY는 100자 이하로 입력해 주세요.' }).nonempty({ message: '연계 KEY는 필수입니다.' }),
link_cntn_nm: z.string().max(20).nullable().optional(), link_cntn_nm: z.string().max(20).nullable().optional(),
link_cntn_tkn_no: z.string().max(25, { message: '연계 접속 토큰은 25자 이하로 입력해 주세요.' }).nullable().optional(), link_cntn_tkn_no: z.string().max(128).nullable().optional(),
srvc_usg_nm: z.string().max(40).nullable().optional(), srvc_usg_nm: z.string().max(40).nullable().optional(),
last_link_rslt_nm: z.string().max(4).nullable().optional(), last_link_rslt_nm: z.string().max(4).nullable().optional(),
last_link_excn_dt: z.string().max(40).nullable().optional(), last_link_excn_dt: z.string().max(40).nullable().optional(),
@@ -17,8 +17,8 @@ const columns = [
id: 'link_nm', id: 'link_nm',
header: '연계 명', header: '연계 명',
}), }),
columnHelper.accessor('link_excn_stp_nm', { columnHelper.accessor('link_exec_step', {
id: 'link_excn_stp_nm', id: 'link_exec_step',
header: '연계실행단계', header: '연계실행단계',
cell: (info) => (info.getValue() ? info.getValue() : '-'), cell: (info) => (info.getValue() ? info.getValue() : '-'),
}), }),
@@ -185,9 +185,7 @@ export default function DemandStatusPage() {
const userData = JSON.parse(user) as SessionUser; const userData = JSON.parse(user) as SessionUser;
const dmdInfoId = userData.dmdInfoId?.trim(); const dmdInfoId = userData.dmdInfoId?.trim();
if (dmdInfoId) { if (dmdInfoId) {
void getSdmInfoStatusList(dmdInfoId).then((active) => { getSdmInfoStatusList(dmdInfoId);
if (!active) window.location.href = "/";
});
} }
} catch (error) { } catch (error) {
console.error("Error parsing user data:", error); console.error("Error parsing user data:", error);
@@ -343,9 +341,7 @@ export default function DemandStatusPage() {
if (res) { if (res) {
const user = JSON.parse(sessionStorage.getItem("user") || "{}"); const user = JSON.parse(sessionStorage.getItem("user") || "{}");
if (user?.dmdInfoId) { if (user?.dmdInfoId) {
void getSdmInfoStatusList(user.dmdInfoId).then((active) => { getSdmInfoStatusList(user.dmdInfoId);
if (!active) window.location.href = "/";
});
} }
setIsEditMode(false); setIsEditMode(false);
} }

Some files were not shown because too many files have changed in this diff Show More