From 2470183e0f11124e9bc6a14c793be7c3608ee614 Mon Sep 17 00:00:00 2001 From: Mina Choi Date: Wed, 17 Jun 2026 15:58:57 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20negodata/front:=20=EC=83=81=ED=92=88?= =?UTF-8?q?=C2=B7=ED=98=91=EB=A0=A5=EC=82=AC=C2=B7=EA=B2=AC=EC=A0=81=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=EC=97=B0=EB=8F=99=20+=20=EB=B0=B0?= =?UTF-8?q?=EC=86=A1=ED=98=95=ED=83=9C=20=EC=84=9C=EB=B2=84=20enum=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A0=84=EC=86=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - orval 실제 타입(ItemData/SupplierData/QuotationData/QuotationSettingData) 사용, 응답 봉투 과중첩(.data.data) 제거 → 목록 정상 렌더 - 배송형태(delivery_type) 자유텍스트 → 서버 /v1/enums 코드 select 로 전환 - orval 클라이언트 재생성 (enums 훅, companyData 등) Co-Authored-By: Claude Opus 4.8 (1M context) --- negodata/front/src/api/generated/auth/auth.ts | 104 +++----- .../src/api/generated/default/default.ts | 21 +- .../front/src/api/generated/enums/enums.ts | 145 +++++++++++ negodata/front/src/api/generated/item/item.ts | 200 ++++++--------- .../model/{companyBrief.ts => companyData.ts} | 2 +- .../src/api/generated/model/enumOption.ts | 12 + .../front/src/api/generated/model/index.ts | 6 +- .../generated/model/itemDataDeliveryType.ts | 2 +- .../generated/model/itemDataQuantityUnit.ts | 2 +- .../model/reqCreateItemDeliveryType.ts | 2 +- .../model/reqCreateItemQuantityUnit.ts | 2 +- .../model/reqUpdateItemDeliveryType.ts | 2 +- .../model/reqUpdateItemQuantityUnit.ts | 2 +- .../front/src/api/generated/model/resEnums.ts | 15 ++ .../src/api/generated/model/resEnumsEnums.ts | 9 + .../src/api/generated/model/resEnumsMsg.ts | 8 + .../src/api/generated/model/resMeCompany.ts | 4 +- .../quotation-setting/quotation-setting.ts | 96 +++---- .../src/api/generated/quotation/quotation.ts | 236 ++++++------------ .../src/api/generated/supplier/supplier.ts | 143 ++++------- .../partners/components/ExcelUploadModal.tsx | 2 +- .../partners/components/PartnerFormSheet.tsx | 4 +- .../features/partners/hooks/usePartners.ts | 18 +- negodata/front/src/features/partners/types.ts | 6 +- .../products/components/ExcelUploadModal.tsx | 4 +- .../products/components/ProductFormSheet.tsx | 37 ++- .../features/products/hooks/useProducts.ts | 18 +- negodata/front/src/features/products/types.ts | 6 +- .../quotations/hooks/useQuotations.ts | 16 +- .../front/src/features/quotations/types.ts | 32 +-- 30 files changed, 564 insertions(+), 592 deletions(-) create mode 100644 negodata/front/src/api/generated/enums/enums.ts rename negodata/front/src/api/generated/model/{companyBrief.ts => companyData.ts} (83%) create mode 100644 negodata/front/src/api/generated/model/enumOption.ts create mode 100644 negodata/front/src/api/generated/model/resEnums.ts create mode 100644 negodata/front/src/api/generated/model/resEnumsEnums.ts create mode 100644 negodata/front/src/api/generated/model/resEnumsMsg.ts diff --git a/negodata/front/src/api/generated/auth/auth.ts b/negodata/front/src/api/generated/auth/auth.ts index 5422cfe..17948a4 100644 --- a/negodata/front/src/api/generated/auth/auth.ts +++ b/negodata/front/src/api/generated/auth/auth.ts @@ -32,27 +32,18 @@ import type { import { customFetch } from "../../mutator/custom-fetch"; -type SecondParameter unknown> = Parameters[1]; - /** * id/pw 로 로그인하고 JWT 토큰을 발급한다. * @summary 로그인 */ -export const login = ( - reqLogin: ReqLogin, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { - url: `/v1/auth/login`, - method: "POST", - headers: { "Content-Type": "application/json" }, - data: reqLogin, - signal, - }, - options, - ); +export const login = (reqLogin: ReqLogin, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/auth/login`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqLogin, + signal, + }); }; export const getLoginMutationOptions = < @@ -65,7 +56,6 @@ export const getLoginMutationOptions = < { data: ReqLogin }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -73,13 +63,13 @@ export const getLoginMutationOptions = < TContext > => { const mutationKey = ["login"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -87,7 +77,7 @@ export const getLoginMutationOptions = < > = (props) => { const { data } = props ?? {}; - return login(data, requestOptions); + return login(data); }; return { mutationFn, ...mutationOptions }; @@ -113,7 +103,6 @@ export const useLogin = < { data: ReqLogin }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -127,24 +116,20 @@ export const useLogin = < return useMutation(mutationOptions, queryClient); }; /** - * company_id 하위로 유저를 생성한다(시드/관리자용). + * 새 계정을 생성한다. * @summary 계정 생성 */ export const createAccount = ( reqCreateAccount: ReqCreateAccount, - options?: SecondParameter, signal?: AbortSignal, ) => { - return customFetch( - { - url: `/v1/auth/create`, - method: "POST", - headers: { "Content-Type": "application/json" }, - data: reqCreateAccount, - signal, - }, - options, - ); + return customFetch({ + url: `/v1/auth/create`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqCreateAccount, + signal, + }); }; export const getCreateAccountMutationOptions = < @@ -157,7 +142,6 @@ export const getCreateAccountMutationOptions = < { data: ReqCreateAccount }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -165,13 +149,13 @@ export const getCreateAccountMutationOptions = < TContext > => { const mutationKey = ["createAccount"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -179,7 +163,7 @@ export const getCreateAccountMutationOptions = < > = (props) => { const { data } = props ?? {}; - return createAccount(data, requestOptions); + return createAccount(data); }; return { mutationFn, ...mutationOptions }; @@ -205,7 +189,6 @@ export const useCreateAccount = < { data: ReqCreateAccount }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -222,14 +205,12 @@ export const useCreateAccount = < * refresh 토큰으로 access 토큰을 재발급한다. * @summary 액세스 토큰 갱신 */ -export const refreshToken = ( - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/auth/refresh_token`, method: "POST", signal }, - options, - ); +export const refreshToken = (signal?: AbortSignal) => { + return customFetch({ + url: `/v1/auth/refresh_token`, + method: "POST", + signal, + }); }; export const getRefreshTokenMutationOptions = < @@ -242,7 +223,6 @@ export const getRefreshTokenMutationOptions = < void, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -250,19 +230,19 @@ export const getRefreshTokenMutationOptions = < TContext > => { const mutationKey = ["refreshToken"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, void > = () => { - return refreshToken(requestOptions); + return refreshToken(); }; return { mutationFn, ...mutationOptions }; @@ -285,7 +265,6 @@ export const useRefreshToken = ( void, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -299,17 +278,11 @@ export const useRefreshToken = ( return useMutation(mutationOptions, queryClient); }; /** - * 유효한 access 토큰이 있어야 호출 가능. 토큰의 유저+소속사 정보를 반환한다. + * 유효한 access 토큰이 있어야 호출 가능. 토큰의 유저+회사 정보를 반환한다. * @summary 내 정보 */ -export const me = ( - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/auth/me`, method: "GET", signal }, - options, - ); +export const me = (signal?: AbortSignal) => { + return customFetch({ url: `/v1/auth/me`, method: "GET", signal }); }; export const getMeQueryKey = () => { @@ -323,14 +296,13 @@ export const getMeQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getMeQueryKey(); const queryFn: QueryFunction>> = ({ signal }) => - me(requestOptions, signal); + me(signal); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, @@ -355,7 +327,6 @@ export function useMe>, TError = void>( >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -374,7 +345,6 @@ export function useMe>, TError = void>( >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -385,7 +355,6 @@ export function useMe>, TError = void>( query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -400,7 +369,6 @@ export function useMe>, TError = void>( query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { diff --git a/negodata/front/src/api/generated/default/default.ts b/negodata/front/src/api/generated/default/default.ts index 35a01f7..349773f 100644 --- a/negodata/front/src/api/generated/default/default.ts +++ b/negodata/front/src/api/generated/default/default.ts @@ -19,19 +19,11 @@ import type { import { customFetch } from "../../mutator/custom-fetch"; -type SecondParameter unknown> = Parameters[1]; - /** * @summary Healthz */ -export const healthzHealthzGet = ( - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/healthz`, method: "GET", signal }, - options, - ); +export const healthzHealthzGet = (signal?: AbortSignal) => { + return customFetch({ url: `/healthz`, method: "GET", signal }); }; export const getHealthzHealthzGetQueryKey = () => { @@ -49,15 +41,14 @@ export const getHealthzHealthzGetQueryOptions = < TData > >; - request?: SecondParameter; }) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHealthzHealthzGetQueryKey(); const queryFn: QueryFunction< Awaited> - > = ({ signal }) => healthzHealthzGet(requestOptions, signal); + > = ({ signal }) => healthzHealthzGet(signal); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, @@ -91,7 +82,6 @@ export function useHealthzHealthzGet< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -117,7 +107,6 @@ export function useHealthzHealthzGet< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -135,7 +124,6 @@ export function useHealthzHealthzGet< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -157,7 +145,6 @@ export function useHealthzHealthzGet< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { diff --git a/negodata/front/src/api/generated/enums/enums.ts b/negodata/front/src/api/generated/enums/enums.ts new file mode 100644 index 0000000..41850d4 --- /dev/null +++ b/negodata/front/src/api/generated/enums/enums.ts @@ -0,0 +1,145 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ +import { useQuery } from "@tanstack/react-query"; +import type { + DataTag, + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryClient, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; + +import type { ResEnums } from ".././model"; + +import { customFetch } from "../../mutator/custom-fetch"; + +/** + * @summary 도메인 코드 enum 전체 + */ +export const listEnums = (signal?: AbortSignal) => { + return customFetch({ url: `/v1/enums`, method: "GET", signal }); +}; + +export const getListEnumsQueryKey = () => { + return [`/v1/enums`] as const; +}; + +export const getListEnumsQueryOptions = < + TData = Awaited>, + TError = void, +>(options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; +}) => { + const { query: queryOptions } = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getListEnumsQueryKey(); + + const queryFn: QueryFunction>> = ({ + signal, + }) => listEnums(signal); + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type ListEnumsQueryResult = NonNullable< + Awaited> +>; +export type ListEnumsQueryError = void; + +export function useListEnums< + TData = Awaited>, + TError = void, +>( + options: { + query: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useListEnums< + TData = Awaited>, + TError = void, +>( + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useListEnums< + TData = Awaited>, + TError = void, +>( + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary 도메인 코드 enum 전체 + */ + +export function useListEnums< + TData = Awaited>, + TError = void, +>( + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getListEnumsQueryOptions(options); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey; + + return query; +} diff --git a/negodata/front/src/api/generated/item/item.ts b/negodata/front/src/api/generated/item/item.ts index 11c6c19..6f9a7a7 100644 --- a/negodata/front/src/api/generated/item/item.ts +++ b/negodata/front/src/api/generated/item/item.ts @@ -36,20 +36,16 @@ import type { import { customFetch } from "../../mutator/custom-fetch"; -type SecondParameter unknown> = Parameters[1]; - /** * @summary 상품 목록 */ -export const listItems = ( - params?: ListItemsParams, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/item/list`, method: "GET", params, signal }, - options, - ); +export const listItems = (params?: ListItemsParams, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/item/list`, + method: "GET", + params, + signal, + }); }; export const getListItemsQueryKey = (params?: ListItemsParams) => { @@ -65,16 +61,15 @@ export const getListItemsQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getListItemsQueryKey(params); const queryFn: QueryFunction>> = ({ signal, - }) => listItems(params, requestOptions, signal); + }) => listItems(params, signal); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, @@ -105,7 +100,6 @@ export function useListItems< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -128,7 +122,6 @@ export function useListItems< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -143,7 +136,6 @@ export function useListItems< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -162,7 +154,6 @@ export function useListItems< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -185,19 +176,15 @@ export function useListItems< */ export const createItem = ( reqCreateItem: ReqCreateItem, - options?: SecondParameter, signal?: AbortSignal, ) => { - return customFetch( - { - url: `/v1/item/create`, - method: "POST", - headers: { "Content-Type": "application/json" }, - data: reqCreateItem, - signal, - }, - options, - ); + return customFetch({ + url: `/v1/item/create`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqCreateItem, + signal, + }); }; export const getCreateItemMutationOptions = < @@ -210,7 +197,6 @@ export const getCreateItemMutationOptions = < { data: ReqCreateItem }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -218,13 +204,13 @@ export const getCreateItemMutationOptions = < TContext > => { const mutationKey = ["createItem"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -232,7 +218,7 @@ export const getCreateItemMutationOptions = < > = (props) => { const { data } = props ?? {}; - return createItem(data, requestOptions); + return createItem(data); }; return { mutationFn, ...mutationOptions }; @@ -258,7 +244,6 @@ export const useCreateItem = < { data: ReqCreateItem }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -276,22 +261,18 @@ export const useCreateItem = < */ export const uploadItemsExcel = ( bodyUploadItemsExcelV1ItemUploadExcelPost: BodyUploadItemsExcelV1ItemUploadExcelPost, - options?: SecondParameter, signal?: AbortSignal, ) => { const formData = new FormData(); formData.append(`file`, bodyUploadItemsExcelV1ItemUploadExcelPost.file); - return customFetch( - { - url: `/v1/item/upload-excel`, - method: "POST", - headers: { "Content-Type": "multipart/form-data" }, - data: formData, - signal, - }, - options, - ); + return customFetch({ + url: `/v1/item/upload-excel`, + method: "POST", + headers: { "Content-Type": "multipart/form-data" }, + data: formData, + signal, + }); }; export const getUploadItemsExcelMutationOptions = < @@ -304,7 +285,6 @@ export const getUploadItemsExcelMutationOptions = < { data: BodyUploadItemsExcelV1ItemUploadExcelPost }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -312,13 +292,13 @@ export const getUploadItemsExcelMutationOptions = < TContext > => { const mutationKey = ["uploadItemsExcel"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -326,7 +306,7 @@ export const getUploadItemsExcelMutationOptions = < > = (props) => { const { data } = props ?? {}; - return uploadItemsExcel(data, requestOptions); + return uploadItemsExcel(data); }; return { mutationFn, ...mutationOptions }; @@ -353,7 +333,6 @@ export const useUploadItemsExcel = < { data: BodyUploadItemsExcelV1ItemUploadExcelPost }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -369,15 +348,12 @@ export const useUploadItemsExcel = < /** * @summary 상품 조회 */ -export const getItem = ( - itemId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/item/${itemId}`, method: "GET", signal }, - options, - ); +export const getItem = (itemId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/item/${itemId}`, + method: "GET", + signal, + }); }; export const getGetItemQueryKey = (itemId?: string) => { @@ -393,16 +369,15 @@ export const getGetItemQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetItemQueryKey(itemId); const queryFn: QueryFunction>> = ({ signal, - }) => getItem(itemId, requestOptions, signal); + }) => getItem(itemId, signal); return { queryKey, @@ -436,7 +411,6 @@ export function useGetItem< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -459,7 +433,6 @@ export function useGetItem< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -474,7 +447,6 @@ export function useGetItem< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -493,7 +465,6 @@ export function useGetItem< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -514,20 +485,13 @@ export function useGetItem< /** * @summary 상품 수정 */ -export const updateItem = ( - itemId: string, - reqUpdateItem: ReqUpdateItem, - options?: SecondParameter, -) => { - return customFetch( - { - url: `/v1/item/update/${itemId}`, - method: "PATCH", - headers: { "Content-Type": "application/json" }, - data: reqUpdateItem, - }, - options, - ); +export const updateItem = (itemId: string, reqUpdateItem: ReqUpdateItem) => { + return customFetch({ + url: `/v1/item/update/${itemId}`, + method: "PATCH", + headers: { "Content-Type": "application/json" }, + data: reqUpdateItem, + }); }; export const getUpdateItemMutationOptions = < @@ -540,7 +504,6 @@ export const getUpdateItemMutationOptions = < { itemId: string; data: ReqUpdateItem }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -548,13 +511,13 @@ export const getUpdateItemMutationOptions = < TContext > => { const mutationKey = ["updateItem"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -562,7 +525,7 @@ export const getUpdateItemMutationOptions = < > = (props) => { const { itemId, data } = props ?? {}; - return updateItem(itemId, data, requestOptions); + return updateItem(itemId, data); }; return { mutationFn, ...mutationOptions }; @@ -588,7 +551,6 @@ export const useUpdateItem = < { itemId: string; data: ReqUpdateItem }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -604,14 +566,11 @@ export const useUpdateItem = < /** * @summary 상품 삭제 */ -export const deleteItem = ( - itemId: string, - options?: SecondParameter, -) => { - return customFetch( - { url: `/v1/item/delete/${itemId}`, method: "DELETE" }, - options, - ); +export const deleteItem = (itemId: string) => { + return customFetch({ + url: `/v1/item/delete/${itemId}`, + method: "DELETE", + }); }; export const getDeleteItemMutationOptions = < @@ -624,7 +583,6 @@ export const getDeleteItemMutationOptions = < { itemId: string }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -632,13 +590,13 @@ export const getDeleteItemMutationOptions = < TContext > => { const mutationKey = ["deleteItem"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -646,7 +604,7 @@ export const getDeleteItemMutationOptions = < > = (props) => { const { itemId } = props ?? {}; - return deleteItem(itemId, requestOptions); + return deleteItem(itemId); }; return { mutationFn, ...mutationOptions }; @@ -672,7 +630,6 @@ export const useDeleteItem = < { itemId: string }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -688,15 +645,12 @@ export const useDeleteItem = < /** * @summary 최저가 수집 요청(스텁) */ -export const triggerLowestPrice = ( - itemId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/item/${itemId}/lowest-price`, method: "POST", signal }, - options, - ); +export const triggerLowestPrice = (itemId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/item/${itemId}/lowest-price`, + method: "POST", + signal, + }); }; export const getTriggerLowestPriceMutationOptions = < @@ -709,7 +663,6 @@ export const getTriggerLowestPriceMutationOptions = < { itemId: string }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -717,13 +670,13 @@ export const getTriggerLowestPriceMutationOptions = < TContext > => { const mutationKey = ["triggerLowestPrice"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -731,7 +684,7 @@ export const getTriggerLowestPriceMutationOptions = < > = (props) => { const { itemId } = props ?? {}; - return triggerLowestPrice(itemId, requestOptions); + return triggerLowestPrice(itemId); }; return { mutationFn, ...mutationOptions }; @@ -757,7 +710,6 @@ export const useTriggerLowestPrice = < { itemId: string }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -773,15 +725,12 @@ export const useTriggerLowestPrice = < /** * @summary 최저가 수집 결과(스텁) */ -export const getLowestPrice = ( - itemId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/item/${itemId}/lowest-price`, method: "GET", signal }, - options, - ); +export const getLowestPrice = (itemId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/item/${itemId}/lowest-price`, + method: "GET", + signal, + }); }; export const getGetLowestPriceQueryKey = (itemId?: string) => { @@ -797,16 +746,15 @@ export const getGetLowestPriceQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetLowestPriceQueryKey(itemId); const queryFn: QueryFunction>> = ({ signal, - }) => getLowestPrice(itemId, requestOptions, signal); + }) => getLowestPrice(itemId, signal); return { queryKey, @@ -842,7 +790,6 @@ export function useGetLowestPrice< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -865,7 +812,6 @@ export function useGetLowestPrice< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -880,7 +826,6 @@ export function useGetLowestPrice< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -899,7 +844,6 @@ export function useGetLowestPrice< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { diff --git a/negodata/front/src/api/generated/model/companyBrief.ts b/negodata/front/src/api/generated/model/companyData.ts similarity index 83% rename from negodata/front/src/api/generated/model/companyBrief.ts rename to negodata/front/src/api/generated/model/companyData.ts index 80e4960..1f6c575 100644 --- a/negodata/front/src/api/generated/model/companyBrief.ts +++ b/negodata/front/src/api/generated/model/companyData.ts @@ -5,7 +5,7 @@ * OpenAPI spec version: 0.1.0 */ -export interface CompanyBrief { +export interface CompanyData { company_id?: string; name?: string; } diff --git a/negodata/front/src/api/generated/model/enumOption.ts b/negodata/front/src/api/generated/model/enumOption.ts new file mode 100644 index 0000000..3b1b7e1 --- /dev/null +++ b/negodata/front/src/api/generated/model/enumOption.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ + +export interface EnumOption { + value: number; + name: string; + label: string; +} diff --git a/negodata/front/src/api/generated/model/index.ts b/negodata/front/src/api/generated/model/index.ts index 1241ae7..3eff534 100644 --- a/negodata/front/src/api/generated/model/index.ts +++ b/negodata/front/src/api/generated/model/index.ts @@ -13,7 +13,8 @@ export * from "./chatMessageDataCardId"; export * from "./chatMessageDataCardType"; export * from "./chatMessageDataCardUsedYn"; export * from "./chatMessageDataIndicatorValue"; -export * from "./companyBrief"; +export * from "./companyData"; +export * from "./enumOption"; export * from "./errorInfo"; export * from "./errorInfoCode"; export * from "./errorInfoDesc"; @@ -134,6 +135,9 @@ export * from "./resDeleteQuotationSetting"; export * from "./resDeleteQuotationSettingMsg"; export * from "./resDeleteSupplier"; export * from "./resDeleteSupplierMsg"; +export * from "./resEnums"; +export * from "./resEnumsEnums"; +export * from "./resEnumsMsg"; export * from "./resExcelUpload"; export * from "./resExcelUploadMsg"; export * from "./resExcelUploadReceivedFilename"; diff --git a/negodata/front/src/api/generated/model/itemDataDeliveryType.ts b/negodata/front/src/api/generated/model/itemDataDeliveryType.ts index 1c141fd..df68667 100644 --- a/negodata/front/src/api/generated/model/itemDataDeliveryType.ts +++ b/negodata/front/src/api/generated/model/itemDataDeliveryType.ts @@ -5,4 +5,4 @@ * OpenAPI spec version: 0.1.0 */ -export type ItemDataDeliveryType = string | null; +export type ItemDataDeliveryType = number | null; diff --git a/negodata/front/src/api/generated/model/itemDataQuantityUnit.ts b/negodata/front/src/api/generated/model/itemDataQuantityUnit.ts index 1122a9a..f4a4a0b 100644 --- a/negodata/front/src/api/generated/model/itemDataQuantityUnit.ts +++ b/negodata/front/src/api/generated/model/itemDataQuantityUnit.ts @@ -5,4 +5,4 @@ * OpenAPI spec version: 0.1.0 */ -export type ItemDataQuantityUnit = number | null; +export type ItemDataQuantityUnit = string | null; diff --git a/negodata/front/src/api/generated/model/reqCreateItemDeliveryType.ts b/negodata/front/src/api/generated/model/reqCreateItemDeliveryType.ts index 52e30af..d6b79b7 100644 --- a/negodata/front/src/api/generated/model/reqCreateItemDeliveryType.ts +++ b/negodata/front/src/api/generated/model/reqCreateItemDeliveryType.ts @@ -5,4 +5,4 @@ * OpenAPI spec version: 0.1.0 */ -export type ReqCreateItemDeliveryType = string | null; +export type ReqCreateItemDeliveryType = number | null; diff --git a/negodata/front/src/api/generated/model/reqCreateItemQuantityUnit.ts b/negodata/front/src/api/generated/model/reqCreateItemQuantityUnit.ts index 51ca367..8ff931f 100644 --- a/negodata/front/src/api/generated/model/reqCreateItemQuantityUnit.ts +++ b/negodata/front/src/api/generated/model/reqCreateItemQuantityUnit.ts @@ -5,4 +5,4 @@ * OpenAPI spec version: 0.1.0 */ -export type ReqCreateItemQuantityUnit = number | null; +export type ReqCreateItemQuantityUnit = string | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateItemDeliveryType.ts b/negodata/front/src/api/generated/model/reqUpdateItemDeliveryType.ts index 241a59e..079c6ca 100644 --- a/negodata/front/src/api/generated/model/reqUpdateItemDeliveryType.ts +++ b/negodata/front/src/api/generated/model/reqUpdateItemDeliveryType.ts @@ -5,4 +5,4 @@ * OpenAPI spec version: 0.1.0 */ -export type ReqUpdateItemDeliveryType = string | null; +export type ReqUpdateItemDeliveryType = number | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateItemQuantityUnit.ts b/negodata/front/src/api/generated/model/reqUpdateItemQuantityUnit.ts index 5c6bb78..9d36af1 100644 --- a/negodata/front/src/api/generated/model/reqUpdateItemQuantityUnit.ts +++ b/negodata/front/src/api/generated/model/reqUpdateItemQuantityUnit.ts @@ -5,4 +5,4 @@ * OpenAPI spec version: 0.1.0 */ -export type ReqUpdateItemQuantityUnit = number | null; +export type ReqUpdateItemQuantityUnit = string | null; diff --git a/negodata/front/src/api/generated/model/resEnums.ts b/negodata/front/src/api/generated/model/resEnums.ts new file mode 100644 index 0000000..47afe1c --- /dev/null +++ b/negodata/front/src/api/generated/model/resEnums.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ +import type { ErrorInfo } from "./errorInfo"; +import type { ResEnumsMsg } from "./resEnumsMsg"; +import type { ResEnumsEnums } from "./resEnumsEnums"; + +export interface ResEnums { + result?: ErrorInfo; + msg?: ResEnumsMsg; + enums?: ResEnumsEnums; +} diff --git a/negodata/front/src/api/generated/model/resEnumsEnums.ts b/negodata/front/src/api/generated/model/resEnumsEnums.ts new file mode 100644 index 0000000..bfd4e6a --- /dev/null +++ b/negodata/front/src/api/generated/model/resEnumsEnums.ts @@ -0,0 +1,9 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ +import type { EnumOption } from "./enumOption"; + +export type ResEnumsEnums = { [key: string]: EnumOption[] }; diff --git a/negodata/front/src/api/generated/model/resEnumsMsg.ts b/negodata/front/src/api/generated/model/resEnumsMsg.ts new file mode 100644 index 0000000..f2ddea5 --- /dev/null +++ b/negodata/front/src/api/generated/model/resEnumsMsg.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ + +export type ResEnumsMsg = string | null; diff --git a/negodata/front/src/api/generated/model/resMeCompany.ts b/negodata/front/src/api/generated/model/resMeCompany.ts index aa239b5..2270cb1 100644 --- a/negodata/front/src/api/generated/model/resMeCompany.ts +++ b/negodata/front/src/api/generated/model/resMeCompany.ts @@ -4,6 +4,6 @@ * Negodata Api Server * OpenAPI spec version: 0.1.0 */ -import type { CompanyBrief } from "./companyBrief"; +import type { CompanyData } from "./companyData"; -export type ResMeCompany = CompanyBrief | null; +export type ResMeCompany = CompanyData | null; diff --git a/negodata/front/src/api/generated/quotation-setting/quotation-setting.ts b/negodata/front/src/api/generated/quotation-setting/quotation-setting.ts index 81d75a6..7ae9557 100644 --- a/negodata/front/src/api/generated/quotation-setting/quotation-setting.ts +++ b/negodata/front/src/api/generated/quotation-setting/quotation-setting.ts @@ -31,19 +31,15 @@ import type { import { customFetch } from "../../mutator/custom-fetch"; -type SecondParameter unknown> = Parameters[1]; - /** * @summary 견적 설정 목록 */ -export const listSettings = ( - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/quotation-setting/list`, method: "GET", signal }, - options, - ); +export const listSettings = (signal?: AbortSignal) => { + return customFetch({ + url: `/v1/quotation-setting/list`, + method: "GET", + signal, + }); }; export const getListSettingsQueryKey = () => { @@ -57,15 +53,14 @@ export const getListSettingsQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getListSettingsQueryKey(); const queryFn: QueryFunction>> = ({ signal, - }) => listSettings(requestOptions, signal); + }) => listSettings(signal); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, @@ -95,7 +90,6 @@ export function useListSettings< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -117,7 +111,6 @@ export function useListSettings< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -131,7 +124,6 @@ export function useListSettings< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -149,7 +141,6 @@ export function useListSettings< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -172,19 +163,15 @@ export function useListSettings< */ export const createSetting = ( reqCreateQuotationSetting: ReqCreateQuotationSetting, - options?: SecondParameter, signal?: AbortSignal, ) => { - return customFetch( - { - url: `/v1/quotation-setting/create`, - method: "POST", - headers: { "Content-Type": "application/json" }, - data: reqCreateQuotationSetting, - signal, - }, - options, - ); + return customFetch({ + url: `/v1/quotation-setting/create`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqCreateQuotationSetting, + signal, + }); }; export const getCreateSettingMutationOptions = < @@ -197,7 +184,6 @@ export const getCreateSettingMutationOptions = < { data: ReqCreateQuotationSetting }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -205,13 +191,13 @@ export const getCreateSettingMutationOptions = < TContext > => { const mutationKey = ["createSetting"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -219,7 +205,7 @@ export const getCreateSettingMutationOptions = < > = (props) => { const { data } = props ?? {}; - return createSetting(data, requestOptions); + return createSetting(data); }; return { mutationFn, ...mutationOptions }; @@ -245,7 +231,6 @@ export const useCreateSetting = < { data: ReqCreateQuotationSetting }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -264,17 +249,13 @@ export const useCreateSetting = < export const updateSetting = ( qtSettingId: string, reqUpdateQuotationSetting: ReqUpdateQuotationSetting, - options?: SecondParameter, ) => { - return customFetch( - { - url: `/v1/quotation-setting/update/${qtSettingId}`, - method: "PATCH", - headers: { "Content-Type": "application/json" }, - data: reqUpdateQuotationSetting, - }, - options, - ); + return customFetch({ + url: `/v1/quotation-setting/update/${qtSettingId}`, + method: "PATCH", + headers: { "Content-Type": "application/json" }, + data: reqUpdateQuotationSetting, + }); }; export const getUpdateSettingMutationOptions = < @@ -287,7 +268,6 @@ export const getUpdateSettingMutationOptions = < { qtSettingId: string; data: ReqUpdateQuotationSetting }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -295,13 +275,13 @@ export const getUpdateSettingMutationOptions = < TContext > => { const mutationKey = ["updateSetting"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -309,7 +289,7 @@ export const getUpdateSettingMutationOptions = < > = (props) => { const { qtSettingId, data } = props ?? {}; - return updateSetting(qtSettingId, data, requestOptions); + return updateSetting(qtSettingId, data); }; return { mutationFn, ...mutationOptions }; @@ -335,7 +315,6 @@ export const useUpdateSetting = < { qtSettingId: string; data: ReqUpdateQuotationSetting }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -351,14 +330,11 @@ export const useUpdateSetting = < /** * @summary 견적 설정 삭제 */ -export const deleteSetting = ( - qtSettingId: string, - options?: SecondParameter, -) => { - return customFetch( - { url: `/v1/quotation-setting/delete/${qtSettingId}`, method: "DELETE" }, - options, - ); +export const deleteSetting = (qtSettingId: string) => { + return customFetch({ + url: `/v1/quotation-setting/delete/${qtSettingId}`, + method: "DELETE", + }); }; export const getDeleteSettingMutationOptions = < @@ -371,7 +347,6 @@ export const getDeleteSettingMutationOptions = < { qtSettingId: string }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -379,13 +354,13 @@ export const getDeleteSettingMutationOptions = < TContext > => { const mutationKey = ["deleteSetting"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -393,7 +368,7 @@ export const getDeleteSettingMutationOptions = < > = (props) => { const { qtSettingId } = props ?? {}; - return deleteSetting(qtSettingId, requestOptions); + return deleteSetting(qtSettingId); }; return { mutationFn, ...mutationOptions }; @@ -419,7 +394,6 @@ export const useDeleteSetting = < { qtSettingId: string }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< diff --git a/negodata/front/src/api/generated/quotation/quotation.ts b/negodata/front/src/api/generated/quotation/quotation.ts index e325118..a3750ba 100644 --- a/negodata/front/src/api/generated/quotation/quotation.ts +++ b/negodata/front/src/api/generated/quotation/quotation.ts @@ -37,20 +37,19 @@ import type { import { customFetch } from "../../mutator/custom-fetch"; -type SecondParameter unknown> = Parameters[1]; - /** * @summary 견적 목록 */ export const listQuotations = ( params?: ListQuotationsParams, - options?: SecondParameter, signal?: AbortSignal, ) => { - return customFetch( - { url: `/v1/quotation/list`, method: "GET", params, signal }, - options, - ); + return customFetch({ + url: `/v1/quotation/list`, + method: "GET", + params, + signal, + }); }; export const getListQuotationsQueryKey = (params?: ListQuotationsParams) => { @@ -66,16 +65,15 @@ export const getListQuotationsQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getListQuotationsQueryKey(params); const queryFn: QueryFunction>> = ({ signal, - }) => listQuotations(params, requestOptions, signal); + }) => listQuotations(params, signal); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, @@ -106,7 +104,6 @@ export function useListQuotations< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -129,7 +126,6 @@ export function useListQuotations< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -144,7 +140,6 @@ export function useListQuotations< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -163,7 +158,6 @@ export function useListQuotations< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -186,19 +180,15 @@ export function useListQuotations< */ export const createQuotation = ( reqCreateQuotation: ReqCreateQuotation, - options?: SecondParameter, signal?: AbortSignal, ) => { - return customFetch( - { - url: `/v1/quotation/create`, - method: "POST", - headers: { "Content-Type": "application/json" }, - data: reqCreateQuotation, - signal, - }, - options, - ); + return customFetch({ + url: `/v1/quotation/create`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqCreateQuotation, + signal, + }); }; export const getCreateQuotationMutationOptions = < @@ -211,7 +201,6 @@ export const getCreateQuotationMutationOptions = < { data: ReqCreateQuotation }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -219,13 +208,13 @@ export const getCreateQuotationMutationOptions = < TContext > => { const mutationKey = ["createQuotation"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -233,7 +222,7 @@ export const getCreateQuotationMutationOptions = < > = (props) => { const { data } = props ?? {}; - return createQuotation(data, requestOptions); + return createQuotation(data); }; return { mutationFn, ...mutationOptions }; @@ -259,7 +248,6 @@ export const useCreateQuotation = < { data: ReqCreateQuotation }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -275,15 +263,12 @@ export const useCreateQuotation = < /** * @summary 견적 마감 */ -export const stopQuotation = ( - qtId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/quotation/stop/${qtId}`, method: "POST", signal }, - options, - ); +export const stopQuotation = (qtId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/quotation/stop/${qtId}`, + method: "POST", + signal, + }); }; export const getStopQuotationMutationOptions = < @@ -296,7 +281,6 @@ export const getStopQuotationMutationOptions = < { qtId: string }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -304,13 +288,13 @@ export const getStopQuotationMutationOptions = < TContext > => { const mutationKey = ["stopQuotation"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -318,7 +302,7 @@ export const getStopQuotationMutationOptions = < > = (props) => { const { qtId } = props ?? {}; - return stopQuotation(qtId, requestOptions); + return stopQuotation(qtId); }; return { mutationFn, ...mutationOptions }; @@ -344,7 +328,6 @@ export const useStopQuotation = < { qtId: string }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -360,15 +343,12 @@ export const useStopQuotation = < /** * @summary 견적 상태 조회 */ -export const getQuotationStatus = ( - qtId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/quotation/${qtId}/status`, method: "GET", signal }, - options, - ); +export const getQuotationStatus = (qtId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/quotation/${qtId}/status`, + method: "GET", + signal, + }); }; export const getGetQuotationStatusQueryKey = (qtId?: string) => { @@ -388,17 +368,16 @@ export const getGetQuotationStatusQueryOptions = < TData > >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetQuotationStatusQueryKey(qtId); const queryFn: QueryFunction< Awaited> - > = ({ signal }) => getQuotationStatus(qtId, requestOptions, signal); + > = ({ signal }) => getQuotationStatus(qtId, signal); return { queryKey, @@ -438,7 +417,6 @@ export function useGetQuotationStatus< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -465,7 +443,6 @@ export function useGetQuotationStatus< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -484,7 +461,6 @@ export function useGetQuotationStatus< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -507,7 +483,6 @@ export function useGetQuotationStatus< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -528,15 +503,12 @@ export function useGetQuotationStatus< /** * @summary 참여현황 */ -export const getQuotationSessions = ( - qtId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/quotation/${qtId}/sessions`, method: "GET", signal }, - options, - ); +export const getQuotationSessions = (qtId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/quotation/${qtId}/sessions`, + method: "GET", + signal, + }); }; export const getGetQuotationSessionsQueryKey = (qtId?: string) => { @@ -556,17 +528,16 @@ export const getGetQuotationSessionsQueryOptions = < TData > >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetQuotationSessionsQueryKey(qtId); const queryFn: QueryFunction< Awaited> - > = ({ signal }) => getQuotationSessions(qtId, requestOptions, signal); + > = ({ signal }) => getQuotationSessions(qtId, signal); return { queryKey, @@ -606,7 +577,6 @@ export function useGetQuotationSessions< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -633,7 +603,6 @@ export function useGetQuotationSessions< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -652,7 +621,6 @@ export function useGetQuotationSessions< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -675,7 +643,6 @@ export function useGetQuotationSessions< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -696,15 +663,12 @@ export function useGetQuotationSessions< /** * @summary 채팅 상세 */ -export const getSessionChat = ( - sessionId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/quotation/session/${sessionId}/chat`, method: "GET", signal }, - options, - ); +export const getSessionChat = (sessionId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/quotation/session/${sessionId}/chat`, + method: "GET", + signal, + }); }; export const getGetSessionChatQueryKey = (sessionId?: string) => { @@ -720,17 +684,16 @@ export const getGetSessionChatQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetSessionChatQueryKey(sessionId); const queryFn: QueryFunction>> = ({ signal, - }) => getSessionChat(sessionId, requestOptions, signal); + }) => getSessionChat(sessionId, signal); return { queryKey, @@ -766,7 +729,6 @@ export function useGetSessionChat< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -789,7 +751,6 @@ export function useGetSessionChat< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -804,7 +765,6 @@ export function useGetSessionChat< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -823,7 +783,6 @@ export function useGetSessionChat< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -844,15 +803,12 @@ export function useGetSessionChat< /** * @summary 낙찰 결과 */ -export const getQuotationResult = ( - qtId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/quotation/${qtId}/result`, method: "GET", signal }, - options, - ); +export const getQuotationResult = (qtId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/quotation/${qtId}/result`, + method: "GET", + signal, + }); }; export const getGetQuotationResultQueryKey = (qtId?: string) => { @@ -872,17 +828,16 @@ export const getGetQuotationResultQueryOptions = < TData > >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetQuotationResultQueryKey(qtId); const queryFn: QueryFunction< Awaited> - > = ({ signal }) => getQuotationResult(qtId, requestOptions, signal); + > = ({ signal }) => getQuotationResult(qtId, signal); return { queryKey, @@ -922,7 +877,6 @@ export function useGetQuotationResult< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -949,7 +903,6 @@ export function useGetQuotationResult< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -968,7 +921,6 @@ export function useGetQuotationResult< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -991,7 +943,6 @@ export function useGetQuotationResult< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -1012,15 +963,12 @@ export function useGetQuotationResult< /** * @summary 견적 사용 카드 */ -export const getQuotationCards = ( - qtId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/quotation/${qtId}/cards`, method: "GET", signal }, - options, - ); +export const getQuotationCards = (qtId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/quotation/${qtId}/cards`, + method: "GET", + signal, + }); }; export const getGetQuotationCardsQueryKey = (qtId?: string) => { @@ -1040,16 +988,15 @@ export const getGetQuotationCardsQueryOptions = < TData > >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetQuotationCardsQueryKey(qtId); const queryFn: QueryFunction< Awaited> - > = ({ signal }) => getQuotationCards(qtId, requestOptions, signal); + > = ({ signal }) => getQuotationCards(qtId, signal); return { queryKey, @@ -1089,7 +1036,6 @@ export function useGetQuotationCards< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -1116,7 +1062,6 @@ export function useGetQuotationCards< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -1135,7 +1080,6 @@ export function useGetQuotationCards< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -1158,7 +1102,6 @@ export function useGetQuotationCards< TData > >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -1179,14 +1122,11 @@ export function useGetQuotationCards< /** * @summary 견적 삭제 */ -export const deleteQuotation = ( - qtId: string, - options?: SecondParameter, -) => { - return customFetch( - { url: `/v1/quotation/delete/${qtId}`, method: "DELETE" }, - options, - ); +export const deleteQuotation = (qtId: string) => { + return customFetch({ + url: `/v1/quotation/delete/${qtId}`, + method: "DELETE", + }); }; export const getDeleteQuotationMutationOptions = < @@ -1199,7 +1139,6 @@ export const getDeleteQuotationMutationOptions = < { qtId: string }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -1207,13 +1146,13 @@ export const getDeleteQuotationMutationOptions = < TContext > => { const mutationKey = ["deleteQuotation"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -1221,7 +1160,7 @@ export const getDeleteQuotationMutationOptions = < > = (props) => { const { qtId } = props ?? {}; - return deleteQuotation(qtId, requestOptions); + return deleteQuotation(qtId); }; return { mutationFn, ...mutationOptions }; @@ -1247,7 +1186,6 @@ export const useDeleteQuotation = < { qtId: string }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -1263,15 +1201,12 @@ export const useDeleteQuotation = < /** * @summary 견적 조회 */ -export const getQuotation = ( - qtId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/quotation/${qtId}`, method: "GET", signal }, - options, - ); +export const getQuotation = (qtId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/quotation/${qtId}`, + method: "GET", + signal, + }); }; export const getGetQuotationQueryKey = (qtId?: string) => { @@ -1287,16 +1222,15 @@ export const getGetQuotationQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetQuotationQueryKey(qtId); const queryFn: QueryFunction>> = ({ signal, - }) => getQuotation(qtId, requestOptions, signal); + }) => getQuotation(qtId, signal); return { queryKey, @@ -1332,7 +1266,6 @@ export function useGetQuotation< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -1355,7 +1288,6 @@ export function useGetQuotation< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -1370,7 +1302,6 @@ export function useGetQuotation< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -1389,7 +1320,6 @@ export function useGetQuotation< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { diff --git a/negodata/front/src/api/generated/supplier/supplier.ts b/negodata/front/src/api/generated/supplier/supplier.ts index 7f8d184..70c507a 100644 --- a/negodata/front/src/api/generated/supplier/supplier.ts +++ b/negodata/front/src/api/generated/supplier/supplier.ts @@ -34,20 +34,19 @@ import type { import { customFetch } from "../../mutator/custom-fetch"; -type SecondParameter unknown> = Parameters[1]; - /** * @summary 협력사 목록 */ export const listSuppliers = ( params?: ListSuppliersParams, - options?: SecondParameter, signal?: AbortSignal, ) => { - return customFetch( - { url: `/v1/supplier/list`, method: "GET", params, signal }, - options, - ); + return customFetch({ + url: `/v1/supplier/list`, + method: "GET", + params, + signal, + }); }; export const getListSuppliersQueryKey = (params?: ListSuppliersParams) => { @@ -63,16 +62,15 @@ export const getListSuppliersQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getListSuppliersQueryKey(params); const queryFn: QueryFunction>> = ({ signal, - }) => listSuppliers(params, requestOptions, signal); + }) => listSuppliers(params, signal); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, @@ -103,7 +101,6 @@ export function useListSuppliers< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -126,7 +123,6 @@ export function useListSuppliers< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -141,7 +137,6 @@ export function useListSuppliers< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -160,7 +155,6 @@ export function useListSuppliers< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -183,19 +177,15 @@ export function useListSuppliers< */ export const createSupplier = ( reqCreateSupplier: ReqCreateSupplier, - options?: SecondParameter, signal?: AbortSignal, ) => { - return customFetch( - { - url: `/v1/supplier/create`, - method: "POST", - headers: { "Content-Type": "application/json" }, - data: reqCreateSupplier, - signal, - }, - options, - ); + return customFetch({ + url: `/v1/supplier/create`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqCreateSupplier, + signal, + }); }; export const getCreateSupplierMutationOptions = < @@ -208,7 +198,6 @@ export const getCreateSupplierMutationOptions = < { data: ReqCreateSupplier }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -216,13 +205,13 @@ export const getCreateSupplierMutationOptions = < TContext > => { const mutationKey = ["createSupplier"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -230,7 +219,7 @@ export const getCreateSupplierMutationOptions = < > = (props) => { const { data } = props ?? {}; - return createSupplier(data, requestOptions); + return createSupplier(data); }; return { mutationFn, ...mutationOptions }; @@ -256,7 +245,6 @@ export const useCreateSupplier = < { data: ReqCreateSupplier }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -274,7 +262,6 @@ export const useCreateSupplier = < */ export const uploadSuppliersExcel = ( bodyUploadSuppliersExcelV1SupplierUploadExcelPost: BodyUploadSuppliersExcelV1SupplierUploadExcelPost, - options?: SecondParameter, signal?: AbortSignal, ) => { const formData = new FormData(); @@ -283,16 +270,13 @@ export const uploadSuppliersExcel = ( bodyUploadSuppliersExcelV1SupplierUploadExcelPost.file, ); - return customFetch( - { - url: `/v1/supplier/upload-excel`, - method: "POST", - headers: { "Content-Type": "multipart/form-data" }, - data: formData, - signal, - }, - options, - ); + return customFetch({ + url: `/v1/supplier/upload-excel`, + method: "POST", + headers: { "Content-Type": "multipart/form-data" }, + data: formData, + signal, + }); }; export const getUploadSuppliersExcelMutationOptions = < @@ -305,7 +289,6 @@ export const getUploadSuppliersExcelMutationOptions = < { data: BodyUploadSuppliersExcelV1SupplierUploadExcelPost }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -313,13 +296,13 @@ export const getUploadSuppliersExcelMutationOptions = < TContext > => { const mutationKey = ["uploadSuppliersExcel"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -327,7 +310,7 @@ export const getUploadSuppliersExcelMutationOptions = < > = (props) => { const { data } = props ?? {}; - return uploadSuppliersExcel(data, requestOptions); + return uploadSuppliersExcel(data); }; return { mutationFn, ...mutationOptions }; @@ -354,7 +337,6 @@ export const useUploadSuppliersExcel = < { data: BodyUploadSuppliersExcelV1SupplierUploadExcelPost }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -370,15 +352,12 @@ export const useUploadSuppliersExcel = < /** * @summary 협력사 조회 */ -export const getSupplier = ( - supplierId: string, - options?: SecondParameter, - signal?: AbortSignal, -) => { - return customFetch( - { url: `/v1/supplier/${supplierId}`, method: "GET", signal }, - options, - ); +export const getSupplier = (supplierId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/supplier/${supplierId}`, + method: "GET", + signal, + }); }; export const getGetSupplierQueryKey = (supplierId?: string) => { @@ -394,16 +373,15 @@ export const getGetSupplierQueryOptions = < query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; + const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetSupplierQueryKey(supplierId); const queryFn: QueryFunction>> = ({ signal, - }) => getSupplier(supplierId, requestOptions, signal); + }) => getSupplier(supplierId, signal); return { queryKey, @@ -439,7 +417,6 @@ export function useGetSupplier< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { @@ -462,7 +439,6 @@ export function useGetSupplier< >, "initialData" >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -477,7 +453,6 @@ export function useGetSupplier< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -496,7 +471,6 @@ export function useGetSupplier< query?: Partial< UseQueryOptions>, TError, TData> >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { @@ -520,17 +494,13 @@ export function useGetSupplier< export const updateSupplier = ( supplierId: string, reqUpdateSupplier: ReqUpdateSupplier, - options?: SecondParameter, ) => { - return customFetch( - { - url: `/v1/supplier/update/${supplierId}`, - method: "PATCH", - headers: { "Content-Type": "application/json" }, - data: reqUpdateSupplier, - }, - options, - ); + return customFetch({ + url: `/v1/supplier/update/${supplierId}`, + method: "PATCH", + headers: { "Content-Type": "application/json" }, + data: reqUpdateSupplier, + }); }; export const getUpdateSupplierMutationOptions = < @@ -543,7 +513,6 @@ export const getUpdateSupplierMutationOptions = < { supplierId: string; data: ReqUpdateSupplier }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -551,13 +520,13 @@ export const getUpdateSupplierMutationOptions = < TContext > => { const mutationKey = ["updateSupplier"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -565,7 +534,7 @@ export const getUpdateSupplierMutationOptions = < > = (props) => { const { supplierId, data } = props ?? {}; - return updateSupplier(supplierId, data, requestOptions); + return updateSupplier(supplierId, data); }; return { mutationFn, ...mutationOptions }; @@ -591,7 +560,6 @@ export const useUpdateSupplier = < { supplierId: string; data: ReqUpdateSupplier }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< @@ -607,14 +575,11 @@ export const useUpdateSupplier = < /** * @summary 협력사 삭제 */ -export const deleteSupplier = ( - supplierId: string, - options?: SecondParameter, -) => { - return customFetch( - { url: `/v1/supplier/delete/${supplierId}`, method: "DELETE" }, - options, - ); +export const deleteSupplier = (supplierId: string) => { + return customFetch({ + url: `/v1/supplier/delete/${supplierId}`, + method: "DELETE", + }); }; export const getDeleteSupplierMutationOptions = < @@ -627,7 +592,6 @@ export const getDeleteSupplierMutationOptions = < { supplierId: string }, TContext >; - request?: SecondParameter; }): UseMutationOptions< Awaited>, TError, @@ -635,13 +599,13 @@ export const getDeleteSupplierMutationOptions = < TContext > => { const mutationKey = ["deleteSupplier"]; - const { mutation: mutationOptions, request: requestOptions } = options + const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } - : { mutation: { mutationKey }, request: undefined }; + : { mutation: { mutationKey } }; const mutationFn: MutationFunction< Awaited>, @@ -649,7 +613,7 @@ export const getDeleteSupplierMutationOptions = < > = (props) => { const { supplierId } = props ?? {}; - return deleteSupplier(supplierId, requestOptions); + return deleteSupplier(supplierId); }; return { mutationFn, ...mutationOptions }; @@ -675,7 +639,6 @@ export const useDeleteSupplier = < { supplierId: string }, TContext >; - request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< diff --git a/negodata/front/src/features/partners/components/ExcelUploadModal.tsx b/negodata/front/src/features/partners/components/ExcelUploadModal.tsx index 645c06d..89d09bb 100644 --- a/negodata/front/src/features/partners/components/ExcelUploadModal.tsx +++ b/negodata/front/src/features/partners/components/ExcelUploadModal.tsx @@ -1,6 +1,6 @@ import { useMemo, useRef, useState } from 'react'; import { Upload, X, FileSpreadsheet, CheckCircle2, Download } from 'lucide-react'; -import type { SupplierCreate } from '@/api/generated/model/supplierCreate'; +import type { ReqCreateSupplier as SupplierCreate } from '@/api/generated/model/reqCreateSupplier'; import { showToast } from '@/lib/notify'; import { downloadExcel, parseCsv } from '@/lib/excel'; import { Typography } from '@/components/ui/typography'; diff --git a/negodata/front/src/features/partners/components/PartnerFormSheet.tsx b/negodata/front/src/features/partners/components/PartnerFormSheet.tsx index a19f9e6..c27d651 100644 --- a/negodata/front/src/features/partners/components/PartnerFormSheet.tsx +++ b/negodata/front/src/features/partners/components/PartnerFormSheet.tsx @@ -2,8 +2,8 @@ import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; import { Trash2 } from 'lucide-react'; -import type { SupplierCreate } from '@/api/generated/model/supplierCreate'; -import type { SupplierUpdate } from '@/api/generated/model/supplierUpdate'; +import type { ReqCreateSupplier as SupplierCreate } from '@/api/generated/model/reqCreateSupplier'; +import type { ReqUpdateSupplier as SupplierUpdate } from '@/api/generated/model/reqUpdateSupplier'; import { showToast } from '@/lib/notify'; import { Typography } from '@/components/ui/typography'; import { Button } from '@/components/ui/button'; diff --git a/negodata/front/src/features/partners/hooks/usePartners.ts b/negodata/front/src/features/partners/hooks/usePartners.ts index ba298da..55600c7 100644 --- a/negodata/front/src/features/partners/hooks/usePartners.ts +++ b/negodata/front/src/features/partners/hooks/usePartners.ts @@ -6,9 +6,8 @@ import { deleteSupplier, getListSuppliersQueryKey, } from '@/api/generated/supplier/supplier'; -import type { SupplierResponse } from '@/api/generated/model/supplierResponse'; -import type { SupplierCreate } from '@/api/generated/model/supplierCreate'; -import type { SupplierUpdate } from '@/api/generated/model/supplierUpdate'; +import type { ReqCreateSupplier } from '@/api/generated/model/reqCreateSupplier'; +import type { ReqUpdateSupplier } from '@/api/generated/model/reqUpdateSupplier'; import type { Partner } from '../types'; const LIST_PARAMS = { size: 100 }; @@ -22,11 +21,11 @@ export function usePartners() { const refresh = () => queryClient.invalidateQueries({ queryKey: getListSuppliersQueryKey(LIST_PARAMS) }); - const createPartner = async (data: SupplierCreate) => { + const createPartner = async (data: ReqCreateSupplier) => { await createSupplier(data); await refresh(); }; - const updatePartner = async (supplierId: string, data: SupplierUpdate) => { + const updatePartner = async (supplierId: string, data: ReqUpdateSupplier) => { await updateSupplier(supplierId, data); await refresh(); }; @@ -35,17 +34,16 @@ export function usePartners() { await refresh(); }; // 엑셀 일괄 등록 — 검증된 행들을 순차 생성 후 한 번만 재조회. - const bulkCreate = async (rows: SupplierCreate[]) => { + const bulkCreate = async (rows: ReqCreateSupplier[]) => { for (const row of rows) { await createSupplier(row); } await refresh(); }; - // 서버 SupplierResponse → UI Partner (그대로 + id 별칭만) - const suppliers = - (suppliersQuery.data as { data?: { data?: { suppliers?: SupplierResponse[] } } } | undefined) - ?.data?.data?.suppliers ?? []; + // 서버 SupplierData → UI Partner (그대로 + id 별칭만). + // customFetch 가 본문을 그대로 주므로 suppliersQuery.data 가 곧 ResSupplierList → .suppliers. + const suppliers = suppliersQuery.data?.suppliers ?? []; const partners: Partner[] = suppliers.map((sp) => ({ ...sp, id: sp.supplier_id })); return { partners, createPartner, updatePartner, deletePartner, bulkCreate, refresh, suppliersQuery }; diff --git a/negodata/front/src/features/partners/types.ts b/negodata/front/src/features/partners/types.ts index 98e75d9..539e01f 100644 --- a/negodata/front/src/features/partners/types.ts +++ b/negodata/front/src/features/partners/types.ts @@ -1,8 +1,8 @@ -import type { SupplierResponse } from '@/api/generated/model/supplierResponse'; +import type { SupplierData } from '@/api/generated/model/supplierData'; -// UI에서 쓰는 협력사 타입. 서버 SupplierResponse에 화면 전용 파생 필드만 얹는다. +// UI에서 쓰는 협력사 타입. 서버 SupplierData에 화면 전용 파생 필드만 얹는다. // (level/rank/status 등 서버 미연동 가짜 필드는 두지 않는다 — 표시 가능한 건 priority뿐.) -export type Partner = SupplierResponse & { +export type Partner = SupplierData & { deleted?: boolean; id?: string; }; diff --git a/negodata/front/src/features/products/components/ExcelUploadModal.tsx b/negodata/front/src/features/products/components/ExcelUploadModal.tsx index fc51f4c..37a5e7d 100644 --- a/negodata/front/src/features/products/components/ExcelUploadModal.tsx +++ b/negodata/front/src/features/products/components/ExcelUploadModal.tsx @@ -1,6 +1,6 @@ import { useMemo, useRef, useState } from 'react'; import { Upload, X, FileSpreadsheet, CheckCircle2, Download } from 'lucide-react'; -import type { ItemCreate } from '@/api/generated/model/itemCreate'; +import type { ReqCreateItem as ItemCreate } from '@/api/generated/model/reqCreateItem'; import { showToast } from '@/lib/notify'; import { downloadExcel, parseCsv } from '@/lib/excel'; import { Typography } from '@/components/ui/typography'; @@ -62,7 +62,7 @@ function toItemCreate(row: RawRow): ItemCreate { manufacturer: '벌크 대리 수급처', made_in: '미지정', quantity_unit: 'EA', - delivery_type: '벌크 대중 물류', + delivery_type: 1, // 협력사배송 (delivery_type 코드) moq: '10 EA', lead_time: 14, vat_yn: true, diff --git a/negodata/front/src/features/products/components/ProductFormSheet.tsx b/negodata/front/src/features/products/components/ProductFormSheet.tsx index 7aa8eda..87f8f62 100644 --- a/negodata/front/src/features/products/components/ProductFormSheet.tsx +++ b/negodata/front/src/features/products/components/ProductFormSheet.tsx @@ -1,8 +1,9 @@ import { useForm, Controller } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; -import type { ItemCreate } from '@/api/generated/model/itemCreate'; -import type { ItemUpdate } from '@/api/generated/model/itemUpdate'; +import type { ReqCreateItem as ItemCreate } from '@/api/generated/model/reqCreateItem'; +import type { ReqUpdateItem as ItemUpdate } from '@/api/generated/model/reqUpdateItem'; +import { useListEnums } from '@/api/generated/enums/enums'; import { showToast } from '@/lib/notify'; import ImageDropzone from '@/components/ImageDropzone'; import { Typography } from '@/components/ui/typography'; @@ -23,7 +24,7 @@ const schema = z.object({ manufacturer: z.string(), origin: z.string(), unit: z.string(), - shippingType: z.string(), + shippingType: z.number({ message: '배송 형태를 선택해 주십시오.' }), // delivery_type 코드 imageUrl: z.string(), moq: z.string(), leadTime: z.number({ message: '숫자를 입력해 주십시오.' }).min(0), @@ -58,7 +59,7 @@ function buildDefaults(mode: 'create' | 'edit', product: Product | null): FormVa manufacturer: product.manufacturer || '', origin: product.made_in || '', unit: product.quantity_unit || 'EA', - shippingType: product.delivery_type || '벌크 물류 배송', + shippingType: product.delivery_type ?? 1, imageUrl: product.image_url || '', moq: product.moq || '10 EA', leadTime: product.lead_time || 14, @@ -78,7 +79,7 @@ function buildDefaults(mode: 'create' | 'edit', product: Product | null): FormVa manufacturer: '', origin: '대한민국', unit: 'EA', - shippingType: '벌크 물류 배송', + shippingType: 1, imageUrl: '', moq: '10 EA', leadTime: 14, @@ -112,6 +113,10 @@ export function ProductFormSheet({ defaultValues: buildDefaults(mode, product), }); + // 배송 형태 코드(delivery_type) 선택지는 서버 enum 에서 가져온다. + const { data: enumsData } = useListEnums(); + const deliveryTypes = enumsData?.enums?.delivery_type ?? []; + // minPrice는 화면 전용(서버 미전송). 검증된 값만 payload로. const onValid = async (v: FormValues) => { const common = { @@ -307,14 +312,26 @@ export function ProductFormSheet({ - {/* Shipping Type */} + {/* Shipping Type — 서버 enum(delivery_type) 코드 전송 */}
배송 형태 - ( + + )} /> + {errors.shippingType &&

{errors.shippingType.message}

}
{/* DB Schema Booleans (vat_yn, delivery_fee_yn) using Switches */} diff --git a/negodata/front/src/features/products/hooks/useProducts.ts b/negodata/front/src/features/products/hooks/useProducts.ts index 29e6be7..a84f6ae 100644 --- a/negodata/front/src/features/products/hooks/useProducts.ts +++ b/negodata/front/src/features/products/hooks/useProducts.ts @@ -6,9 +6,8 @@ import { deleteItem, getListItemsQueryKey, } from '@/api/generated/item/item'; -import type { ItemResponse } from '@/api/generated/model/itemResponse'; -import type { ItemCreate } from '@/api/generated/model/itemCreate'; -import type { ItemUpdate } from '@/api/generated/model/itemUpdate'; +import type { ReqCreateItem } from '@/api/generated/model/reqCreateItem'; +import type { ReqUpdateItem } from '@/api/generated/model/reqUpdateItem'; import { type Product, toMinPrice } from '../types'; const LIST_PARAMS = { size: 100 }; @@ -22,11 +21,11 @@ export function useProducts() { const refresh = () => queryClient.invalidateQueries({ queryKey: getListItemsQueryKey(LIST_PARAMS) }); - const createProduct = async (data: ItemCreate) => { + const createProduct = async (data: ReqCreateItem) => { await createItem(data); await refresh(); }; - const updateProduct = async (itemId: string, data: ItemUpdate) => { + const updateProduct = async (itemId: string, data: ReqUpdateItem) => { await updateItem(itemId, data); await refresh(); }; @@ -35,17 +34,16 @@ export function useProducts() { await refresh(); }; // 엑셀 일괄 등록 — 검증된 행들을 순차 생성 후 한 번만 재조회. - const bulkCreate = async (rows: ItemCreate[]) => { + const bulkCreate = async (rows: ReqCreateItem[]) => { for (const row of rows) { await createItem(row); } await refresh(); }; - // 서버 ItemResponse → UI Product (화면 전용 파생 필드 부여) - const items = - (itemsQuery.data as { data?: { data?: { items?: ItemResponse[] } } } | undefined) - ?.data?.data?.items ?? []; + // 서버 ItemData → UI Product (화면 전용 파생 필드 부여). + // customFetch 가 본문을 그대로 주므로 itemsQuery.data 가 곧 ResItemList → .items. + const items = itemsQuery.data?.items ?? []; const products: Product[] = items.map((it) => ({ ...it, id: it.item_id, diff --git a/negodata/front/src/features/products/types.ts b/negodata/front/src/features/products/types.ts index 31c5eaf..9b5d9f3 100644 --- a/negodata/front/src/features/products/types.ts +++ b/negodata/front/src/features/products/types.ts @@ -1,7 +1,7 @@ -import type { ItemResponse } from '@/api/generated/model/itemResponse'; +import type { ItemData } from '@/api/generated/model/itemData'; -// UI에서 쓰는 상품 타입. 서버 ItemResponse에 화면 전용 파생 필드를 얹는다. -export type Product = ItemResponse & { +// UI에서 쓰는 상품 타입. 서버 ItemData에 화면 전용 파생 필드를 얹는다. +export type Product = ItemData & { deleted?: boolean; id?: string; minPrice?: number; diff --git a/negodata/front/src/features/quotations/hooks/useQuotations.ts b/negodata/front/src/features/quotations/hooks/useQuotations.ts index e156cf8..8d6a519 100644 --- a/negodata/front/src/features/quotations/hooks/useQuotations.ts +++ b/negodata/front/src/features/quotations/hooks/useQuotations.ts @@ -3,10 +3,10 @@ import { useListItems } from '@/api/generated/item/item'; import { useListSuppliers } from '@/api/generated/supplier/supplier'; import { useListSettings } from '@/api/generated/quotation-setting/quotation-setting'; import { useListQuotations } from '@/api/generated/quotation/quotation'; -import type { ItemResponse } from '@/api/generated/model/itemResponse'; -import type { SupplierResponse } from '@/api/generated/model/supplierResponse'; -import type { QuotationSettingResponse } from '@/api/generated/model/quotationSettingResponse'; -import type { QuotationResponse } from '@/api/generated/model/quotationResponse'; +import type { ItemData } from '@/api/generated/model/itemData'; +import type { SupplierData } from '@/api/generated/model/supplierData'; +import type { QuotationSettingData } from '@/api/generated/model/quotationSettingData'; +import type { QuotationData } from '@/api/generated/model/quotationData'; import { showToast } from '@/lib/notify'; import type { Estimate, QuotationSetting, ChatSession, NegotiationCard, Product } from '@/types'; import { unwrap, mapItem, mapSupplier, mapSetting, mapQuotation } from '../types'; @@ -36,18 +36,18 @@ export function useQuotations() { const settingsQuery = useListSettings(); const quotationsQuery = useListQuotations(undefined); - const products = (unwrap<{ items?: ItemResponse[] }>(itemsQuery.data)?.items ?? []).map(mapItem); - const partners = (unwrap<{ suppliers?: SupplierResponse[] }>(suppliersQuery.data)?.suppliers ?? []).map(mapSupplier); + const products = (unwrap<{ items?: ItemData[] }>(itemsQuery.data)?.items ?? []).map(mapItem); + const partners = (unwrap<{ suppliers?: SupplierData[] }>(suppliersQuery.data)?.suppliers ?? []).map(mapSupplier); const [quotationSettings, setQuotationSettings] = useState([]); useEffect(() => { - const s = unwrap<{ settings?: QuotationSettingResponse[] }>(settingsQuery.data)?.settings; + const s = unwrap<{ settings?: QuotationSettingData[] }>(settingsQuery.data)?.settings; if (s) setQuotationSettings(s.map(mapSetting)); }, [settingsQuery.data]); const [quotations, setQuotations] = useState([]); useEffect(() => { - const qs = unwrap<{ quotations?: QuotationResponse[] }>(quotationsQuery.data)?.quotations; + const qs = unwrap<{ quotations?: QuotationData[] }>(quotationsQuery.data)?.quotations; if (qs) setQuotations(qs.map(mapQuotation)); }, [quotationsQuery.data]); diff --git a/negodata/front/src/features/quotations/types.ts b/negodata/front/src/features/quotations/types.ts index daad291..0d5cc87 100644 --- a/negodata/front/src/features/quotations/types.ts +++ b/negodata/front/src/features/quotations/types.ts @@ -1,7 +1,7 @@ -import type { ItemResponse } from '@/api/generated/model/itemResponse'; -import type { SupplierResponse } from '@/api/generated/model/supplierResponse'; -import type { QuotationSettingResponse } from '@/api/generated/model/quotationSettingResponse'; -import type { QuotationResponse } from '@/api/generated/model/quotationResponse'; +import type { ItemData } from '@/api/generated/model/itemData'; +import type { SupplierData } from '@/api/generated/model/supplierData'; +import type { QuotationSettingData } from '@/api/generated/model/quotationSettingData'; +import type { QuotationData } from '@/api/generated/model/quotationData'; import type { Product, Partner, @@ -15,16 +15,16 @@ export type { Product, Partner, QuotationSetting, Estimate, ChatSession, Negotia // ── 서버 응답 → UI 모델 매퍼 ───────────────────────────────────────────── -// BaseRestApiResponse 봉투에서 내부 payload만 꺼낸다. +// customFetch 가 응답 본문을 그대로 반환하므로 query.data 가 곧 봉투(ResXxxList) — 추가 언랩 불필요. export function unwrap(env: unknown): T | undefined { - return (env as { data?: { data?: T | null } } | undefined)?.data?.data ?? undefined; + return (env as T | undefined) ?? undefined; } -export function mapItem(it: ItemResponse): Product { - return { ...it, id: it.item_id, minPrice: Math.round((it.price || 0) * 0.83), status: 'ACTIVE' }; +export function mapItem(it: ItemData): Product { + return { ...it, id: it.item_id, minPrice: Math.round((it.price || 0) * 0.83), status: 'ACTIVE' } as Product; } -export function mapSupplier(sp: SupplierResponse): Partner { +export function mapSupplier(sp: SupplierData): Partner { return { supplier_id: sp.supplier_id, company_id: sp.company_id, @@ -33,8 +33,8 @@ export function mapSupplier(sp: SupplierResponse): Partner { manager_name: sp.manager_name ?? null, manager_email: sp.manager_email ?? null, priority: sp.priority ?? null, - created_at: sp.created_at, - updated_at: sp.updated_at, + created_at: sp.created_at ?? undefined, + updated_at: sp.updated_at ?? undefined, id: sp.supplier_id, managerName: sp.manager_name || '', managerEmail: sp.manager_email || '', @@ -44,22 +44,22 @@ export function mapSupplier(sp: SupplierResponse): Partner { }; } -export function mapSetting(s: QuotationSettingResponse): QuotationSetting { +export function mapSetting(s: QuotationSettingData): QuotationSetting { return { qt_setting_id: s.qt_setting_id, user_id: s.user_id || '', target_margin: String(s.target_margin_rate ?? ''), anchoring_value: String(s.anchoring_value ?? ''), card_use_count: String(s.card_count ?? ''), - created_at: s.created_at, - updated_at: s.updated_at, + created_at: s.created_at ?? '', + updated_at: s.updated_at ?? '', deleted: false, }; } -export function mapQuotation(q: QuotationResponse): Estimate { +export function mapQuotation(q: QuotationData): Estimate { return { - ...(q as Partial), + ...(q as unknown as Partial), id: q.qt_id, title: q.name, dueDate: q.end_time,