[as] feat: 재원협의 기술검토 로직 작업
This commit is contained in:
@@ -8,11 +8,17 @@ import type {
|
||||
|
||||
const BASE = ENDPOINT.AS_SERVICE.PWRK_CNSLTN_MNG;
|
||||
|
||||
async function findById(pwrkCnsltnDocNo: string): Promise<PwrkCnsltnMngDetResponseDto> {
|
||||
const response = await client.get<PwrkCnsltnMngDetResponseDto>(`${BASE}/${pwrkCnsltnDocNo}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async function findByUpDocNo(upDocNo: string): Promise<PwrkCnsltnMngDetResponseDto> {
|
||||
const response = await client.get<PwrkCnsltnMngDetResponseDto>(`${BASE}/updocno/${upDocNo}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export const pwrkCnsltnMngService = {
|
||||
findById,
|
||||
findByUpDocNo,
|
||||
} satisfies PwrkCnsltnMngService;
|
||||
|
||||
@@ -4,9 +4,21 @@ import { pwrkCnsltnMngService } from "./pwrk-cnsltn-mng-service";
|
||||
|
||||
export const pwrkCnsltnMngKeys = {
|
||||
all: ["pwrk-cnsltn-mng"] as const,
|
||||
byId: (pwrkCnsltnDocNo: string) => [...pwrkCnsltnMngKeys.all, "by-id", pwrkCnsltnDocNo] as const,
|
||||
byUpDocNo: (upDocNo: string) => [...pwrkCnsltnMngKeys.all, "by-up-doc-no", upDocNo] as const,
|
||||
};
|
||||
|
||||
export function usePwrkCnsltnMng(
|
||||
pwrkCnsltnDocNo: string | null | undefined,
|
||||
isEnabled = true,
|
||||
) {
|
||||
return useQuery({
|
||||
queryKey: pwrkCnsltnMngKeys.byId(pwrkCnsltnDocNo!),
|
||||
queryFn: () => pwrkCnsltnMngService.findById(pwrkCnsltnDocNo!),
|
||||
enabled: Boolean(pwrkCnsltnDocNo) && isEnabled,
|
||||
});
|
||||
}
|
||||
|
||||
export function usePwrkCnsltnMngByUpDocNo(upDocNo: string | null | undefined, isEnabled = true) {
|
||||
return useQuery({
|
||||
queryKey: pwrkCnsltnMngKeys.byUpDocNo(upDocNo!),
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
export { pwrkCnsltnMngService } from "./api/pwrk-cnsltn-mng-service";
|
||||
export { pwrkCnsltnMngKeys, usePwrkCnsltnMngByUpDocNo } from "./api/queries";
|
||||
export {
|
||||
pwrkCnsltnMngKeys,
|
||||
usePwrkCnsltnMng,
|
||||
usePwrkCnsltnMngByUpDocNo,
|
||||
} from "./api/queries";
|
||||
export { findCompletedPwrkDraft } from "./lib/find-completed-draft";
|
||||
export type {
|
||||
PwrkCnsltnCnsltnResponseDto,
|
||||
PwrkCnsltnDocCrtDmndResponseDto,
|
||||
PwrkCnsltnDocCrtRsltResponseDto,
|
||||
PwrkCnsltnMngDetResponseDto,
|
||||
PwrkCnsltnMngService,
|
||||
PwrkCnsltnPjtcoAjmtResponseDto,
|
||||
} from "./model/pwrk-cnsltn-mng-interface";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { AtflMngClientResponseDto } from "@/shared/model";
|
||||
|
||||
export interface PwrkCnsltnDocCrtRsltResponseDto {
|
||||
crtDmndUuid: string;
|
||||
verSn: number;
|
||||
@@ -10,25 +12,80 @@ export interface PwrkCnsltnDocCrtRsltResponseDto {
|
||||
export interface PwrkCnsltnDocCrtDmndResponseDto {
|
||||
crtDmndUuid: string;
|
||||
pwrkCnsltnDocNo: string;
|
||||
orgnlDocNo?: string;
|
||||
orgnlDocSeComCd?: string;
|
||||
orgnlDocSeComCdNm?: string;
|
||||
crtSysDmndId?: string;
|
||||
crtSttsComCd?: string;
|
||||
crtSttsComCdNm?: string;
|
||||
failRsn?: string;
|
||||
dmndDt?: string;
|
||||
cmptnDt?: string;
|
||||
rqstrUuid?: string;
|
||||
rqstrNm?: string;
|
||||
crtRslt?: PwrkCnsltnDocCrtRsltResponseDto | null;
|
||||
}
|
||||
|
||||
/** 백엔드 PwrkCnsltnMngDetResponseDto.CnsltnResponseDto */
|
||||
export interface PwrkCnsltnCnsltnResponseDto {
|
||||
pwrkCnsltnDocNo?: string;
|
||||
rvwOpnnSn?: number;
|
||||
rvwOpnnClsfComCd?: string;
|
||||
rvwOpnnClsfComCdNm?: string;
|
||||
rvwOpnn?: string;
|
||||
cnsltnCn?: string;
|
||||
rfltYn?: string;
|
||||
rmrk?: string;
|
||||
atchFileGroupId?: string;
|
||||
atchFileInfo?: AtflMngClientResponseDto;
|
||||
rvwrNm?: string;
|
||||
rvwrMblTelno?: string;
|
||||
rvwrOgdpNm?: string;
|
||||
rvwrEmlAddr?: string;
|
||||
lclgvPicNm?: string;
|
||||
lclgvPicTelno?: string;
|
||||
lclgvPicOgdpNm?: string;
|
||||
lclgvPicEmlAddr?: string;
|
||||
crtDmndUuid?: string;
|
||||
crtYn?: string;
|
||||
hwrtChgYn?: string;
|
||||
verSn?: number;
|
||||
dtlSn?: number;
|
||||
}
|
||||
|
||||
/** 백엔드 PwrkCnsltnMngDetResponseDto.PjtcoAjmtResponseDto */
|
||||
export interface PwrkCnsltnPjtcoAjmtResponseDto {
|
||||
pwrkCnsltnDocNo?: string;
|
||||
rvwOpnnSn?: number;
|
||||
cnstpSeCd?: string;
|
||||
rvwOpnnClsfComCd?: string;
|
||||
rvwOpnnClsfComCdNm?: string;
|
||||
ognTpcoAmt?: number;
|
||||
ognGvexpAmt?: number;
|
||||
ognLcexpAmt?: number;
|
||||
chgTpcoAmt?: number;
|
||||
chgGvexpAmt?: number;
|
||||
chgLcexpAmt?: number;
|
||||
}
|
||||
|
||||
export interface PwrkCnsltnMngDetResponseDto {
|
||||
pwrkCnsltnDocNo: string;
|
||||
upDocNo: string;
|
||||
upDocSeComCd?: string;
|
||||
upDocSeComCdNm?: string;
|
||||
prgrsSttsComCd?: string;
|
||||
prgrsSttsComCdNm?: string;
|
||||
bizNm?: string;
|
||||
atchFileGroupId?: string;
|
||||
regDt?: string;
|
||||
rgtrNm?: string;
|
||||
cnsltnList?: PwrkCnsltnCnsltnResponseDto[];
|
||||
pjtcoAjmtList?: PwrkCnsltnPjtcoAjmtResponseDto[];
|
||||
crtDmndList?: PwrkCnsltnDocCrtDmndResponseDto[];
|
||||
crtRsltList?: PwrkCnsltnDocCrtRsltResponseDto[];
|
||||
}
|
||||
|
||||
export interface PwrkCnsltnMngService {
|
||||
findById(pwrkCnsltnDocNo: string): Promise<PwrkCnsltnMngDetResponseDto>;
|
||||
findByUpDocNo(upDocNo: string): Promise<PwrkCnsltnMngDetResponseDto>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user