[as fr] 광역지자체 설치인가, 재원협의 반려 처리 restapi 추가및 알림처리 *액션 디스패처(executeAction)**와 **룩업 테이블(buttonActionHandlers)** 패턴

This commit is contained in:
2026-10-22 11:54:59 +09:00
parent 4f4f5112b5
commit 175964b652
7 changed files with 47 additions and 2 deletions
@@ -98,6 +98,10 @@ async function changePrgrsSttsComCd(body: DocPrgrsUpdateRequestDto): Promise<voi
await client.post<void>(`${BASE}/doc/updatePrgrsStts`, body);
}
async function rejectPrgrsStts(body: DocPrgrsUpdateRequestDto): Promise<void> {
await client.post<void>(`${BASE}/doc/rejectPrgrsStts`, body);
}
export const fnrsCnsltnMngService = {
findPage,
findById,
@@ -112,4 +116,5 @@ export const fnrsCnsltnMngService = {
remove,
findFileVrfcResults,
changePrgrsSttsComCd,
rejectPrgrsStts,
} satisfies FnrsCnsltnMngService;
@@ -145,4 +145,5 @@ export interface FnrsCnsltnMngService {
remove(fnrsCnsltnDocNo: string): Promise<void>;
findFileVrfcResults(fnrsCnsltnDocNo: string): Promise<FnrsCnsltnFileVrfcRsltResponseDto[]>;
changePrgrsSttsComCd(body: DocPrgrsUpdateRequestDto): Promise<void>;
rejectPrgrsStts(body: DocPrgrsUpdateRequestDto): Promise<void>;
}
@@ -91,6 +91,10 @@ async function changePrgrsSttsComCd(payload: DocPrgrsUpdateRequestDto): Promise<
await client.post(`${BASE}/doc/updatePrgrsStts`, payload);
}
async function rejectPrgrsStts(payload: DocPrgrsUpdateRequestDto): Promise<void> {
await client.post(`${BASE}/doc/rejectPrgrsStts`, payload);
}
export const instlSncnService = {
getPage,
getById,
@@ -102,6 +106,7 @@ export const instlSncnService = {
submitReqSupplement,
remove,
changePrgrsSttsComCd,
rejectPrgrsStts,
} satisfies InstlSncnMngService;
// TODO: st-anls-mst service 로 분리
@@ -131,4 +131,5 @@ export interface InstlSncnMngService {
submitReqSupplement: (id: string, payload: InstlSncnApplySaveRequestDto) => Promise<string>;
remove: (id: string) => Promise<void>;
changePrgrsSttsComCd: (payload: DocPrgrsUpdateRequestDto) => Promise<void>;
rejectPrgrsStts: (payload: DocPrgrsUpdateRequestDto) => Promise<void>;
}
@@ -462,6 +462,7 @@ function FloatingActionButtons({
docNo,
docSeComCd,
prgrsSttsComCd: "LE",
rgtrUuid: userInfo?.userUnqId,
};
await executeAction({
action: FNRS_CNSLTN_VIEW_BUTTON_ACTION.envoSbmsn,
@@ -471,10 +472,14 @@ function FloatingActionButtons({
}
async function handleRjctClick() {
if (!(await confirm("해당 신청 건을 반려하시겠습니까?"))) {
return;
}
const payload: DocPrgrsUpdateRequestDto = {
docNo,
docSeComCd,
prgrsSttsComCd: "SV",
rgtrUuid: userInfo?.userUnqId,
};
await executeAction({
action: FNRS_CNSLTN_VIEW_BUTTON_ACTION.rjct,
@@ -488,6 +493,7 @@ function FloatingActionButtons({
docNo,
docSeComCd,
prgrsSttsComCd: "TA",
rgtrUuid: userInfo?.userUnqId,
};
await executeAction({
action: FNRS_CNSLTN_VIEW_BUTTON_ACTION.sncnAprv,
@@ -1114,6 +1120,17 @@ async function handleChangePrgrsSttsComCd(
}
}
async function handleRejectPrgrsStts(
context: ActionHandlerContext<DocPrgrsUpdateRequestDto>,
): Promise<void> {
try {
await fnrsCnsltnMngService.rejectPrgrsStts(context.request);
context.onSuccess?.();
} catch (error) {
context.onError?.(error as Error);
}
}
async function handleTechReview(
context: ActionHandlerContext<FnrsCnsltnApplySaveRequestDto>,
): Promise<void> {
@@ -1200,7 +1217,7 @@ const buttonActionHandlers: Record<FnrsCnsltnViewButtonAction, ActionHandler> =
aply: handleSaveApply,
del: handleDel,
envoSbmsn: handleChangePrgrsSttsComCd,
rjct: handleChangePrgrsSttsComCd,
rjct: handleRejectPrgrsStts,
sncnAprv: handleChangePrgrsSttsComCd,
rvwRply: handleTechReview,
rvwOpnnRply: handleTechReview,
@@ -221,10 +221,13 @@ function FloatingActionButtons({
}
async function handleRjctClick() {
if (!(await confirm("해당 신청 건을 반려하시겠습니까?"))) return;
const payload: DocPrgrsUpdateRequestDto = {
docNo,
docSeComCd,
prgrsSttsComCd: "SV",
rgtrUuid: userInfo?.userUnqId,
};
await executeAction({
action: INSTL_SNCN_VIEW_BUTTON_ACTION.rjct,
@@ -516,6 +519,17 @@ async function handleChangePrgrsSttsComCd(
}
}
async function handleRejectPrgrsStts(
context: ActionHandlerContext<DocPrgrsUpdateRequestDto>,
): Promise<void> {
try {
await instlSncnService.rejectPrgrsStts(context.request);
context.onSuccess?.();
} catch (error) {
context.onError?.(error as Error);
}
}
async function handleTechReview(
context: ActionHandlerContext<InstlSncnApplySaveRequestDto>,
): Promise<void> {
@@ -566,7 +580,7 @@ const buttonActionHandlers: Record<InstlSncnViewButtonAction, ActionHandler> = {
aply: handleSaveApply,
del: handleDel,
instlSncnAncmnt: handleChangePrgrsSttsComCd,
rjct: handleChangePrgrsSttsComCd,
rjct: handleRejectPrgrsStts,
sncnAprv: handleChangePrgrsSttsComCd,
rvwRply: handleTechReview,
rqstTechRvw: handleChangePrgrsSttsComCd,
+2
View File
@@ -6,6 +6,8 @@ export interface DocPrgrsUpdateRequestDto {
docSeComCd: string;
/** 진행상태공통코드 */
prgrsSttsComCd: string;
/** 작성자 UUID */
rgtrUuid?: string;
}
/** 공종 트리와 사업규모(수량) 조합 DTO */