summaryrefslogtreecommitdiff
path: root/lib/techsales-rfq/table/rfq-table.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/techsales-rfq/table/rfq-table.tsx')
-rw-r--r--lib/techsales-rfq/table/rfq-table.tsx52
1 files changed, 40 insertions, 12 deletions
diff --git a/lib/techsales-rfq/table/rfq-table.tsx b/lib/techsales-rfq/table/rfq-table.tsx
index c79e2ecf..f1570577 100644
--- a/lib/techsales-rfq/table/rfq-table.tsx
+++ b/lib/techsales-rfq/table/rfq-table.tsx
@@ -51,8 +51,40 @@ interface TechSalesRfq {
updatedByName: string
sentBy: number | null
sentByName: string | null
- projectSnapshot: Record<string, unknown>
- seriesSnapshot: Record<string, unknown>
+ // 스키마와 일치하도록 타입 수정
+ projectSnapshot: {
+ pspid: string;
+ projNm?: string;
+ sector?: string;
+ projMsrm?: number;
+ kunnr?: string;
+ kunnrNm?: string;
+ cls1?: string;
+ cls1Nm?: string;
+ ptype?: string;
+ ptypeNm?: string;
+ pmodelCd?: string;
+ pmodelNm?: string;
+ pmodelSz?: string;
+ pmodelUom?: string;
+ txt04?: string;
+ txt30?: string;
+ estmPm?: string;
+ pspCreatedAt?: Date | string;
+ pspUpdatedAt?: Date | string;
+ } | Record<string, unknown> // legacy 호환성을 위해 유지
+ seriesSnapshot: Array<{
+ pspid: string;
+ sersNo: string;
+ scDt?: string;
+ klDt?: string;
+ lcDt?: string;
+ dlDt?: string;
+ dockNo?: string;
+ dockNm?: string;
+ projNo?: string;
+ post1?: string;
+ }> | Record<string, unknown> // legacy 호환성을 위해 유지
pspid: string
projNm: string
sector: string
@@ -61,7 +93,6 @@ interface TechSalesRfq {
attachmentCount: number
quotationCount: number
// 필요에 따라 다른 필드들 추가
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: unknown
}
@@ -279,7 +310,7 @@ export function RFQListTable({
setSelectedRfqForAttachments({
...rfq,
projectSnapshot: rfq.projectSnapshot || {},
- seriesSnapshot: rfq.seriesSnapshot || {},
+ seriesSnapshot: Array.isArray(rfq.seriesSnapshot) ? rfq.seriesSnapshot : {},
})
setAttachmentsOpen(true)
} catch (error) {
@@ -290,19 +321,15 @@ export function RFQListTable({
// 첨부파일 업데이트 콜백
const handleAttachmentsUpdated = React.useCallback((rfqId: number, newAttachmentCount: number) => {
- // TODO: 실제로는 테이블 데이터를 다시 조회하거나 상태를 업데이트해야 함
- // 현재는 로그만 출력하고 토스트 메시지로 피드백 제공
+ // Service에서 이미 revalidateTag와 revalidatePath로 캐시 무효화 처리됨
console.log(`RFQ ${rfqId}의 첨부파일 개수가 ${newAttachmentCount}개로 업데이트됨`)
- // 성공 피드백 (중복되지 않도록 짧은 지연 후 표시)
+ // 성공 피드백
setTimeout(() => {
toast.success(`첨부파일 개수가 업데이트되었습니다. (${newAttachmentCount}개)`, {
duration: 3000
})
}, 500)
-
- // TODO: 나중에 실제 테이블 데이터 업데이트 로직 구현
- // 예: setTableData() 또는 데이터 재조회
}, [])
const columns = React.useMemo(
@@ -518,7 +545,8 @@ export function RFQListTable({
shallow={false}
>
<div className="flex items-center gap-2">
- <TablePresetManager<TechSalesRfq>
+ {/* 아직 개발/테스트 전이라서 주석처리함. 지우지 말 것! 미사용 린터 에러는 무시. */}
+ {/* <TablePresetManager<TechSalesRfq>
presets={presets}
activePresetId={activePresetId}
currentSettings={currentSettings}
@@ -530,7 +558,7 @@ export function RFQListTable({
onApplyPreset={applyPreset}
onSetDefaultPreset={setDefaultPreset}
onRenamePreset={renamePreset}
- />
+ /> */}
<RFQTableToolbarActions
selection={table}