[refactor] negodata: 도메인 코드값 enum 정비 — 백엔드 정본 + 프론트 생성타입 사용
- 백엔드: 도메인 enum CodeEnum 상속(x-enum-varnames) → orval이 이름 있는 enum 생성. 응답 필드 enum 타입 지정(요청은 int 유지). ENUM_LABELS/DOMAIN_ENUMS·/v1/enums 제거 - 프론트: 생성 enum + 라벨맵으로 교체(매직넘버·발명 어휘 제거), 견적·세션 상태 코드화, role/delivery 라벨 프론트 소유 - 동반 정리: unwrap 캐스트·목업(buildSessions·데모)·死코드 제거, mapItem toMinPrice dedupe Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
6fa024137f
commit
eb6612af1c
47 files changed
+501
-581
No files matched your search
@@ -11,7 +11,7 @@ import { QuotationTable } from '@/features/quotations/components/QuotationTable'
|
||||
import { QuotationDetailSheet } from '@/features/quotations/components/QuotationDetailSheet';
|
||||
import { QuotationCreateModal } from '@/features/quotations/components/QuotationCreateModal';
|
||||
import { QuotationSettingsModal } from '@/features/quotations/components/QuotationSettingsModal';
|
||||
import { QUOTATION_STATUS_FILTERS, QUOTATION_STATUS_CODE, QUOTATION_TYPE_CODE } from '@/features/quotations/types';
|
||||
import { QUOTATION_STATUS_OPTIONS, QUOTATION_TYPE_OPTIONS } from '@/features/quotations/types';
|
||||
import type { ListQuotationsParams } from '@/api/generated/model/listQuotationsParams';
|
||||
|
||||
export default function QuotationPage() {
|
||||
@@ -19,10 +19,12 @@ export default function QuotationPage() {
|
||||
const list = useServerList({ pageSize: 10, initialFilters: { status: 'ALL', type: 'ALL' } });
|
||||
const statusFilter = list.filters.status;
|
||||
const typeFilter = list.filters.type;
|
||||
const statusOptions = QUOTATION_STATUS_OPTIONS;
|
||||
const typeOptions = QUOTATION_TYPE_OPTIONS;
|
||||
const params: ListQuotationsParams = {
|
||||
search: list.debouncedSearch || undefined,
|
||||
status: statusFilter !== 'ALL' ? String(QUOTATION_STATUS_CODE[statusFilter] ?? '') : undefined,
|
||||
type: typeFilter !== 'ALL' ? String(QUOTATION_TYPE_CODE[typeFilter] ?? '') : undefined,
|
||||
status: statusFilter !== 'ALL' ? statusFilter : undefined,
|
||||
type: typeFilter !== 'ALL' ? typeFilter : undefined,
|
||||
page: list.page,
|
||||
size: list.pageSize,
|
||||
};
|
||||
@@ -34,7 +36,7 @@ export default function QuotationPage() {
|
||||
quotations,
|
||||
total,
|
||||
quotationSettings,
|
||||
stopNegotiation,
|
||||
closeQuotation,
|
||||
addSetting,
|
||||
deleteSetting,
|
||||
createQuotation,
|
||||
@@ -67,10 +69,10 @@ export default function QuotationPage() {
|
||||
<button
|
||||
id="quotation-create-btn"
|
||||
onClick={() => overlay.open('create')}
|
||||
className="flex items-center gap-2 px-4 py-2.5 bg-primary text-primary-foreground text-xs font-bold rounded hover:opacity-95 cursor-pointer transition-colors animate-pulse"
|
||||
className="flex items-center gap-2 px-4 py-2.5 bg-primary text-primary-foreground text-xs font-bold rounded hover:opacity-95 cursor-pointer transition-colors"
|
||||
>
|
||||
<Plus size={15} />
|
||||
<span>신규 협상견적 등록</span>
|
||||
<span>신규 견적 등록</span>
|
||||
</button>
|
||||
</>
|
||||
}
|
||||
@@ -86,12 +88,18 @@ export default function QuotationPage() {
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<Select value={statusFilter} onValueChange={(v) => list.setFilter('status', v as string)}>
|
||||
<SelectTrigger id="quotation-status-filter" className="font-bold">
|
||||
<SelectValue />
|
||||
<SelectValue>
|
||||
{(value) =>
|
||||
value === 'ALL'
|
||||
? '전체 견적상태'
|
||||
: statusOptions.find((o) => String(o.value) === value)?.label ?? ''
|
||||
}
|
||||
</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ALL">전체 견적상태</SelectItem>
|
||||
{QUOTATION_STATUS_FILTERS.map((s) => (
|
||||
<SelectItem key={s} value={s}>{s}</SelectItem>
|
||||
{statusOptions.map((o) => (
|
||||
<SelectItem key={o.value} value={String(o.value)}>{o.label}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
@@ -99,13 +107,18 @@ export default function QuotationPage() {
|
||||
<Select value={typeFilter} onValueChange={(v) => list.setFilter('type', v as string)}>
|
||||
<SelectTrigger id="quotation-type-filter">
|
||||
<SelectValue>
|
||||
{(value) => (value === 'ALL' ? '전체 유형' : value === 'RE_NEGOTIATION' ? '재협상' : '재견적')}
|
||||
{(value) =>
|
||||
value === 'ALL'
|
||||
? '전체 유형'
|
||||
: typeOptions.find((o) => String(o.value) === value)?.label ?? ''
|
||||
}
|
||||
</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ALL">전체 유형</SelectItem>
|
||||
<SelectItem value="RE_NEGOTIATION">재협상</SelectItem>
|
||||
<SelectItem value="RE_ESTIMATE">재견적</SelectItem>
|
||||
{typeOptions.map((o) => (
|
||||
<SelectItem key={o.value} value={String(o.value)}>{o.label}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
@@ -132,7 +145,7 @@ export default function QuotationPage() {
|
||||
<QuotationDetailSheet
|
||||
key={activeQuotation.qt_id}
|
||||
quotation={activeQuotation}
|
||||
onStop={stopNegotiation}
|
||||
onCloseQuotation={closeQuotation}
|
||||
onClose={overlay.close}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user