diff --git a/negodata/front/src/api/generated/model/index.ts b/negodata/front/src/api/generated/model/index.ts index 987f649..6501c93 100644 --- a/negodata/front/src/api/generated/model/index.ts +++ b/negodata/front/src/api/generated/model/index.ts @@ -5,7 +5,6 @@ * OpenAPI spec version: 0.1.0 */ -export * from './asyncJob'; export * from './bodyUploadItemImageV1ItemImagePost'; export * from './cardData'; export * from './cardDataCondition'; @@ -126,6 +125,7 @@ export * from './reqCreateSupplierManagerEmail'; export * from './reqCreateSupplierManagerName'; export * from './reqCreateSupplierPriority'; export * from './reqLogin'; +export * from './reqRegenerateQuotation'; export * from './reqUpdateCard'; export * from './reqUpdateCardCondition'; export * from './reqUpdateCardEditScript'; @@ -173,9 +173,8 @@ export * from './resCheckCodesMsg'; export * from './resCreateAccount'; export * from './resCreateAccountMsg'; export * from './resCreateQuotation'; -export * from './resCreateQuotationAsyncJob'; export * from './resCreateQuotationMsg'; -export * from './resCreateQuotationQuotation'; +export * from './resCreateQuotationQtId'; export * from './resDeleteCard'; export * from './resDeleteCardMsg'; export * from './resDeleteItem'; diff --git a/negodata/front/src/api/generated/model/reqCreateQuotation.ts b/negodata/front/src/api/generated/model/reqCreateQuotation.ts index bac460b..60dab99 100644 --- a/negodata/front/src/api/generated/model/reqCreateQuotation.ts +++ b/negodata/front/src/api/generated/model/reqCreateQuotation.ts @@ -15,7 +15,6 @@ export interface ReqCreateQuotation { qt_setting_id: string; version_id?: ReqCreateQuotationVersionId; name?: string; - number?: string; type?: number; status?: number; start_time?: ReqCreateQuotationStartTime; diff --git a/negodata/front/src/api/generated/model/asyncJob.ts b/negodata/front/src/api/generated/model/reqRegenerateQuotation.ts similarity index 64% rename from negodata/front/src/api/generated/model/asyncJob.ts rename to negodata/front/src/api/generated/model/reqRegenerateQuotation.ts index b073009..0b07eaa 100644 --- a/negodata/front/src/api/generated/model/asyncJob.ts +++ b/negodata/front/src/api/generated/model/reqRegenerateQuotation.ts @@ -5,7 +5,6 @@ * OpenAPI spec version: 0.1.0 */ -export interface AsyncJob { - status?: string; - message?: string; +export interface ReqRegenerateQuotation { + supplier_ids?: string[]; } diff --git a/negodata/front/src/api/generated/model/resCreateQuotation.ts b/negodata/front/src/api/generated/model/resCreateQuotation.ts index 76ba712..0c65650 100644 --- a/negodata/front/src/api/generated/model/resCreateQuotation.ts +++ b/negodata/front/src/api/generated/model/resCreateQuotation.ts @@ -6,14 +6,11 @@ */ import type { ErrorInfo } from './errorInfo'; import type { ResCreateQuotationMsg } from './resCreateQuotationMsg'; -import type { ResCreateQuotationQuotation } from './resCreateQuotationQuotation'; -import type { SessionData } from './sessionData'; -import type { ResCreateQuotationAsyncJob } from './resCreateQuotationAsyncJob'; +import type { ResCreateQuotationQtId } from './resCreateQuotationQtId'; export interface ResCreateQuotation { result?: ErrorInfo; msg?: ResCreateQuotationMsg; - quotation?: ResCreateQuotationQuotation; - sessions?: SessionData[]; - async_job?: ResCreateQuotationAsyncJob; + qt_id?: ResCreateQuotationQtId; + session_count?: number; } diff --git a/negodata/front/src/api/generated/model/resCreateQuotationAsyncJob.ts b/negodata/front/src/api/generated/model/resCreateQuotationQtId.ts similarity index 54% rename from negodata/front/src/api/generated/model/resCreateQuotationAsyncJob.ts rename to negodata/front/src/api/generated/model/resCreateQuotationQtId.ts index bc335b0..3e174d8 100644 --- a/negodata/front/src/api/generated/model/resCreateQuotationAsyncJob.ts +++ b/negodata/front/src/api/generated/model/resCreateQuotationQtId.ts @@ -4,6 +4,5 @@ * Negodata Api Server * OpenAPI spec version: 0.1.0 */ -import type { AsyncJob } from './asyncJob'; -export type ResCreateQuotationAsyncJob = AsyncJob | null; +export type ResCreateQuotationQtId = string | null; diff --git a/negodata/front/src/api/generated/model/resCreateQuotationQuotation.ts b/negodata/front/src/api/generated/model/resCreateQuotationQuotation.ts deleted file mode 100644 index ce4e28f..0000000 --- a/negodata/front/src/api/generated/model/resCreateQuotationQuotation.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated by orval v7.21.0 🍺 - * Do not edit manually. - * Negodata Api Server - * OpenAPI spec version: 0.1.0 - */ -import type { QuotationData } from './quotationData'; - -export type ResCreateQuotationQuotation = QuotationData | null; diff --git a/negodata/front/src/api/generated/quotation/quotation.ts b/negodata/front/src/api/generated/quotation/quotation.ts index bdfb53b..c20a974 100644 --- a/negodata/front/src/api/generated/quotation/quotation.ts +++ b/negodata/front/src/api/generated/quotation/quotation.ts @@ -27,6 +27,7 @@ import type { HTTPValidationError, ListQuotationsParams, ReqCreateQuotation, + ReqRegenerateQuotation, ResCreateQuotation, ResDeleteQuotation, ResQuotation, @@ -265,6 +266,71 @@ export const useStopQuotation = ,signal?: AbortSignal +) => { + + + return customFetch( + {url: `/v1/quotation/regenerate/${qtId}`, method: 'POST', + headers: {'Content-Type': 'application/json', }, + data: reqRegenerateQuotation, signal + }, + options); + } + + + +export const getRegenerateQuotationMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{qtId: string;data: ReqRegenerateQuotation}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{qtId: string;data: ReqRegenerateQuotation}, TContext> => { + +const mutationKey = ['regenerateQuotation']; +const {mutation: mutationOptions, request: requestOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, request: undefined}; + + + + + const mutationFn: MutationFunction>, {qtId: string;data: ReqRegenerateQuotation}> = (props) => { + const {qtId,data} = props ?? {}; + + return regenerateQuotation(qtId,data,requestOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type RegenerateQuotationMutationResult = NonNullable>> + export type RegenerateQuotationMutationBody = ReqRegenerateQuotation + export type RegenerateQuotationMutationError = void | HTTPValidationError + + /** + * @summary 견적 μž¬μƒμ„±(λ‹€μŒ λΌμš΄λ“œ) + */ +export const useRegenerateQuotation = (options?: { mutation?:UseMutationOptions>, TError,{qtId: string;data: ReqRegenerateQuotation}, TContext>, request?: SecondParameter} + , queryClient?: QueryClient): UseMutationResult< + Awaited>, + TError, + {qtId: string;data: ReqRegenerateQuotation}, + TContext + > => { + + const mutationOptions = getRegenerateQuotationMutationOptions(options); + + return useMutation(mutationOptions, queryClient); + } + /** * @summary 견적 μƒνƒœ 쑰회 */ export const getQuotationStatus = ( diff --git a/negodata/front/src/components/ui/sheet.tsx b/negodata/front/src/components/ui/sheet.tsx index db09d3c..5cb05a0 100644 --- a/negodata/front/src/components/ui/sheet.tsx +++ b/negodata/front/src/components/ui/sheet.tsx @@ -20,8 +20,8 @@ export function Sheet({ open, title, onClose, children }: SheetProps) { {/* λ°±λ“œλ‘­ */}
- {/* 우츑 λ“œλ‘œμ–΄ νŒ¨λ„ */} -
+ {/* 우츑 λ“œλ‘œμ–΄ νŒ¨λ„ (νŒ¨λ„ μžμ²΄κ°€ μ„Έλ‘œ 슀크둀 β€” justify-* λŠ” 슀크둀 μ‹œμž‘μ μ„ κ°€λ € μ•ˆ 씀) */} +
{/* 헀더 */}
diff --git a/negodata/front/src/features/quotations/components/QuotationCreateModal.tsx b/negodata/front/src/features/quotations/components/QuotationCreateModal.tsx index 4cc3db0..aacfa10 100644 --- a/negodata/front/src/features/quotations/components/QuotationCreateModal.tsx +++ b/negodata/front/src/features/quotations/components/QuotationCreateModal.tsx @@ -9,6 +9,13 @@ import type { CreateQuotationInput } from '../hooks/useQuotations'; import { QuotationType } from '@/api/generated/model'; import { QUOTATION_TYPE_OPTIONS } from '../types'; +// datetime-local λ””ν΄νŠΈκ°’: ν˜„μž¬ ν•œκ΅­μ‹œκ°„(Asia/Seoul)의 'YYYY-MM-DDTHH:mm'. +// sv-SE λ‘œμΌ€μΌμ΄ 'YYYY-MM-DD HH:mm:ss' λ₯Ό μ£Όκ³ , timeZone λͺ…μ‹œλ‘œ λΈŒλΌμš°μ € TZ 와 λ¬΄κ΄€ν•˜κ²Œ KST 둜 κ³ μ •ν•œλ‹€. +function nowKstLocalInput(): string { + const s = new Date().toLocaleString('sv-SE', { timeZone: 'Asia/Seoul' }); + return s.slice(0, 16).replace(' ', 'T'); +} + type QuotationCreateModalProps = { open: boolean; products: Product[]; @@ -33,9 +40,10 @@ export function QuotationCreateModal({ const [type, setType] = useState(QuotationType.REQUOTE); const [productId, setProductId] = useState(''); const [selectedPartnerIds, setSelectedPartnerIds] = useState([]); - const [dueDate, setDueDate] = useState('2026-06-15T18:00'); + const [dueDate, setDueDate] = useState(nowKstLocalInput); const [settingId, setSettingId] = useState(quotationSettings[0]?.qt_setting_id ?? ''); const [selectedCardIds, setSelectedCardIds] = useState([]); + const [memo, setMemo] = useState(''); const [submitting, setSubmitting] = useState(false); const typeOptions = QUOTATION_TYPE_OPTIONS; @@ -65,6 +73,7 @@ export function QuotationCreateModal({ dueDate, settingId, cardIds: selectedCardIds, + memo, }); if (ok) onClose(); } finally { @@ -277,6 +286,19 @@ export function QuotationCreateModal({ })}
+ +
+ λ©”λͺ¨ (선택) +