diff --git a/negodata/front/src/api/generated/card/card.ts b/negodata/front/src/api/generated/card/card.ts new file mode 100644 index 0000000..f8ffcd3 --- /dev/null +++ b/negodata/front/src/api/generated/card/card.ts @@ -0,0 +1,551 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ +import { useMutation, useQuery } from "@tanstack/react-query"; +import type { + DataTag, + DefinedInitialDataOptions, + DefinedUseQueryResult, + MutationFunction, + QueryClient, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseMutationOptions, + UseMutationResult, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; + +import type { + HTTPValidationError, + ListCardsParams, + ReqCreateCard, + ReqUpdateCard, + ResCard, + ResCardList, + ResDeleteCard, +} from ".././model"; + +import { customFetch } from "../../mutator/custom-fetch"; + +/** + * @summary ν˜‘μƒμΉ΄λ“œ λͺ©λ‘ + */ +export const listCards = (params?: ListCardsParams, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/card/list`, + method: "GET", + params, + signal, + }); +}; + +export const getListCardsQueryKey = (params?: ListCardsParams) => { + return [`/v1/card/list`, ...(params ? [params] : [])] as const; +}; + +export const getListCardsQueryOptions = < + TData = Awaited>, + TError = void | HTTPValidationError, +>( + params?: ListCardsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + }, +) => { + const { query: queryOptions } = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getListCardsQueryKey(params); + + const queryFn: QueryFunction>> = ({ + signal, + }) => listCards(params, signal); + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type ListCardsQueryResult = NonNullable< + Awaited> +>; +export type ListCardsQueryError = void | HTTPValidationError; + +export function useListCards< + TData = Awaited>, + TError = void | HTTPValidationError, +>( + params: undefined | ListCardsParams, + options: { + query: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useListCards< + TData = Awaited>, + TError = void | HTTPValidationError, +>( + params?: ListCardsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useListCards< + TData = Awaited>, + TError = void | HTTPValidationError, +>( + params?: ListCardsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary ν˜‘μƒμΉ΄λ“œ λͺ©λ‘ + */ + +export function useListCards< + TData = Awaited>, + TError = void | HTTPValidationError, +>( + params?: ListCardsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getListCardsQueryOptions(params, options); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey; + + return query; +} + +/** + * @summary ν˜‘μƒμΉ΄λ“œ 등둝 + */ +export const createCard = ( + reqCreateCard: ReqCreateCard, + signal?: AbortSignal, +) => { + return customFetch({ + url: `/v1/card/create`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqCreateCard, + signal, + }); +}; + +export const getCreateCardMutationOptions = < + TError = void | HTTPValidationError, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: ReqCreateCard }, + TContext + >; +}): UseMutationOptions< + Awaited>, + TError, + { data: ReqCreateCard }, + TContext +> => { + const mutationKey = ["createCard"]; + const { mutation: mutationOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey } }; + + const mutationFn: MutationFunction< + Awaited>, + { data: ReqCreateCard } + > = (props) => { + const { data } = props ?? {}; + + return createCard(data); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type CreateCardMutationResult = NonNullable< + Awaited> +>; +export type CreateCardMutationBody = ReqCreateCard; +export type CreateCardMutationError = void | HTTPValidationError; + +/** + * @summary ν˜‘μƒμΉ΄λ“œ 등둝 + */ +export const useCreateCard = < + TError = void | HTTPValidationError, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: ReqCreateCard }, + TContext + >; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + { data: ReqCreateCard }, + TContext +> => { + const mutationOptions = getCreateCardMutationOptions(options); + + return useMutation(mutationOptions, queryClient); +}; +/** + * @summary ν˜‘μƒμΉ΄λ“œ 쑰회 + */ +export const getCard = (cardId: string, signal?: AbortSignal) => { + return customFetch({ + url: `/v1/card/${cardId}`, + method: "GET", + signal, + }); +}; + +export const getGetCardQueryKey = (cardId?: string) => { + return [`/v1/card/${cardId}`] as const; +}; + +export const getGetCardQueryOptions = < + TData = Awaited>, + TError = void | HTTPValidationError, +>( + cardId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + }, +) => { + const { query: queryOptions } = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetCardQueryKey(cardId); + + const queryFn: QueryFunction>> = ({ + signal, + }) => getCard(cardId, signal); + + return { + queryKey, + queryFn, + enabled: !!cardId, + ...queryOptions, + } as UseQueryOptions>, TError, TData> & { + queryKey: DataTag; + }; +}; + +export type GetCardQueryResult = NonNullable< + Awaited> +>; +export type GetCardQueryError = void | HTTPValidationError; + +export function useGetCard< + TData = Awaited>, + TError = void | HTTPValidationError, +>( + cardId: string, + options: { + query: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useGetCard< + TData = Awaited>, + TError = void | HTTPValidationError, +>( + cardId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useGetCard< + TData = Awaited>, + TError = void | HTTPValidationError, +>( + cardId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary ν˜‘μƒμΉ΄λ“œ 쑰회 + */ + +export function useGetCard< + TData = Awaited>, + TError = void | HTTPValidationError, +>( + cardId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getGetCardQueryOptions(cardId, options); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey; + + return query; +} + +/** + * @summary ν˜‘μƒμΉ΄λ“œ μˆ˜μ • + */ +export const updateCard = (cardId: string, reqUpdateCard: ReqUpdateCard) => { + return customFetch({ + url: `/v1/card/update/${cardId}`, + method: "PATCH", + headers: { "Content-Type": "application/json" }, + data: reqUpdateCard, + }); +}; + +export const getUpdateCardMutationOptions = < + TError = void | HTTPValidationError, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { cardId: string; data: ReqUpdateCard }, + TContext + >; +}): UseMutationOptions< + Awaited>, + TError, + { cardId: string; data: ReqUpdateCard }, + TContext +> => { + const mutationKey = ["updateCard"]; + const { mutation: mutationOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey } }; + + const mutationFn: MutationFunction< + Awaited>, + { cardId: string; data: ReqUpdateCard } + > = (props) => { + const { cardId, data } = props ?? {}; + + return updateCard(cardId, data); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type UpdateCardMutationResult = NonNullable< + Awaited> +>; +export type UpdateCardMutationBody = ReqUpdateCard; +export type UpdateCardMutationError = void | HTTPValidationError; + +/** + * @summary ν˜‘μƒμΉ΄λ“œ μˆ˜μ • + */ +export const useUpdateCard = < + TError = void | HTTPValidationError, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { cardId: string; data: ReqUpdateCard }, + TContext + >; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + { cardId: string; data: ReqUpdateCard }, + TContext +> => { + const mutationOptions = getUpdateCardMutationOptions(options); + + return useMutation(mutationOptions, queryClient); +}; +/** + * @summary ν˜‘μƒμΉ΄λ“œ μ‚­μ œ + */ +export const deleteCard = (cardId: string) => { + return customFetch({ + url: `/v1/card/delete/${cardId}`, + method: "DELETE", + }); +}; + +export const getDeleteCardMutationOptions = < + TError = void | HTTPValidationError, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { cardId: string }, + TContext + >; +}): UseMutationOptions< + Awaited>, + TError, + { cardId: string }, + TContext +> => { + const mutationKey = ["deleteCard"]; + const { mutation: mutationOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey } }; + + const mutationFn: MutationFunction< + Awaited>, + { cardId: string } + > = (props) => { + const { cardId } = props ?? {}; + + return deleteCard(cardId); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type DeleteCardMutationResult = NonNullable< + Awaited> +>; + +export type DeleteCardMutationError = void | HTTPValidationError; + +/** + * @summary ν˜‘μƒμΉ΄λ“œ μ‚­μ œ + */ +export const useDeleteCard = < + TError = void | HTTPValidationError, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { cardId: string }, + TContext + >; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + { cardId: string }, + TContext +> => { + const mutationOptions = getDeleteCardMutationOptions(options); + + return useMutation(mutationOptions, queryClient); +}; diff --git a/negodata/front/src/api/generated/item/item.ts b/negodata/front/src/api/generated/item/item.ts index 6f9a7a7..e732c89 100644 --- a/negodata/front/src/api/generated/item/item.ts +++ b/negodata/front/src/api/generated/item/item.ts @@ -24,11 +24,14 @@ import type { BodyUploadItemsExcelV1ItemUploadExcelPost, HTTPValidationError, ListItemsParams, + ReqCheckCodes, ReqCreateItem, ReqUpdateItem, + ResCheckCodes, ResDeleteItem, ResExcelUpload, ResItem, + ResItemCategories, ResItemList, ResLowestPriceResult, ResLowestPriceTrigger, @@ -171,6 +174,153 @@ export function useListItems< return query; } +/** + * @summary μƒν’ˆ μΉ΄ν…Œκ³ λ¦¬ λͺ©λ‘(distinct) + */ +export const listItemCategories = (signal?: AbortSignal) => { + return customFetch({ + url: `/v1/item/categories`, + method: "GET", + signal, + }); +}; + +export const getListItemCategoriesQueryKey = () => { + return [`/v1/item/categories`] as const; +}; + +export const getListItemCategoriesQueryOptions = < + TData = Awaited>, + TError = void, +>(options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; +}) => { + const { query: queryOptions } = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getListItemCategoriesQueryKey(); + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => listItemCategories(signal); + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type ListItemCategoriesQueryResult = NonNullable< + Awaited> +>; +export type ListItemCategoriesQueryError = void; + +export function useListItemCategories< + TData = Awaited>, + TError = void, +>( + options: { + query: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useListItemCategories< + TData = Awaited>, + TError = void, +>( + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useListItemCategories< + TData = Awaited>, + TError = void, +>( + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary μƒν’ˆ μΉ΄ν…Œκ³ λ¦¬ λͺ©λ‘(distinct) + */ + +export function useListItemCategories< + TData = Awaited>, + TError = void, +>( + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getListItemCategoriesQueryOptions(options); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey; + + return query; +} + /** * @summary μƒν’ˆ 등둝 */ @@ -256,6 +406,91 @@ export const useCreateItem = < return useMutation(mutationOptions, queryClient); }; +/** + * @summary μ½”λ“œ 쀑볡 사전검사(μ—…λ‘œλ“œ μ¦‰μ‹œ) + */ +export const checkItemCodes = ( + reqCheckCodes: ReqCheckCodes, + signal?: AbortSignal, +) => { + return customFetch({ + url: `/v1/item/check-codes`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqCheckCodes, + signal, + }); +}; + +export const getCheckItemCodesMutationOptions = < + TError = void | HTTPValidationError, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: ReqCheckCodes }, + TContext + >; +}): UseMutationOptions< + Awaited>, + TError, + { data: ReqCheckCodes }, + TContext +> => { + const mutationKey = ["checkItemCodes"]; + const { mutation: mutationOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey } }; + + const mutationFn: MutationFunction< + Awaited>, + { data: ReqCheckCodes } + > = (props) => { + const { data } = props ?? {}; + + return checkItemCodes(data); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type CheckItemCodesMutationResult = NonNullable< + Awaited> +>; +export type CheckItemCodesMutationBody = ReqCheckCodes; +export type CheckItemCodesMutationError = void | HTTPValidationError; + +/** + * @summary μ½”λ“œ 쀑볡 사전검사(μ—…λ‘œλ“œ μ¦‰μ‹œ) + */ +export const useCheckItemCodes = < + TError = void | HTTPValidationError, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: ReqCheckCodes }, + TContext + >; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + { data: ReqCheckCodes }, + TContext +> => { + const mutationOptions = getCheckItemCodesMutationOptions(options); + + return useMutation(mutationOptions, queryClient); +}; /** * @summary μ—‘μ…€ 일괄 등둝(μŠ€ν…) */ diff --git a/negodata/front/src/api/generated/model/cardData.ts b/negodata/front/src/api/generated/model/cardData.ts new file mode 100644 index 0000000..0d2562c --- /dev/null +++ b/negodata/front/src/api/generated/model/cardData.ts @@ -0,0 +1,30 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ +import type { CardDataUserId } from "./cardDataUserId"; +import type { CardDataName } from "./cardDataName"; +import type { CardDataNumber } from "./cardDataNumber"; +import type { CardDataScript } from "./cardDataScript"; +import type { CardDataEditScript } from "./cardDataEditScript"; +import type { CardDataCondition } from "./cardDataCondition"; +import type { CardDataMemo } from "./cardDataMemo"; +import type { CardDataCreatedAt } from "./cardDataCreatedAt"; +import type { CardDataUpdatedAt } from "./cardDataUpdatedAt"; + +export interface CardData { + nego_card_id: string; + user_id?: CardDataUserId; + is_wildcard?: boolean; + name?: CardDataName; + number?: CardDataNumber; + script?: CardDataScript; + edit_script?: CardDataEditScript; + status?: number; + condition?: CardDataCondition; + memo?: CardDataMemo; + created_at?: CardDataCreatedAt; + updated_at?: CardDataUpdatedAt; +} diff --git a/negodata/front/src/api/generated/model/cardDataCondition.ts b/negodata/front/src/api/generated/model/cardDataCondition.ts new file mode 100644 index 0000000..e9cdbbb --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataCondition.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 CardDataCondition = string | null; diff --git a/negodata/front/src/api/generated/model/cardDataCreatedAt.ts b/negodata/front/src/api/generated/model/cardDataCreatedAt.ts new file mode 100644 index 0000000..05c880e --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataCreatedAt.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 CardDataCreatedAt = string | null; diff --git a/negodata/front/src/api/generated/model/cardDataEditScript.ts b/negodata/front/src/api/generated/model/cardDataEditScript.ts new file mode 100644 index 0000000..5db88eb --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataEditScript.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 CardDataEditScript = unknown | null; diff --git a/negodata/front/src/api/generated/model/cardDataMemo.ts b/negodata/front/src/api/generated/model/cardDataMemo.ts new file mode 100644 index 0000000..c4204a3 --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataMemo.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 CardDataMemo = string | null; diff --git a/negodata/front/src/api/generated/model/cardDataName.ts b/negodata/front/src/api/generated/model/cardDataName.ts new file mode 100644 index 0000000..b9afb49 --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataName.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 CardDataName = string | null; diff --git a/negodata/front/src/api/generated/model/cardDataNumber.ts b/negodata/front/src/api/generated/model/cardDataNumber.ts new file mode 100644 index 0000000..1ffca42 --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataNumber.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 CardDataNumber = string | null; diff --git a/negodata/front/src/api/generated/model/cardDataScript.ts b/negodata/front/src/api/generated/model/cardDataScript.ts new file mode 100644 index 0000000..04d40d3 --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataScript.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 CardDataScript = string | null; diff --git a/negodata/front/src/api/generated/model/cardDataUpdatedAt.ts b/negodata/front/src/api/generated/model/cardDataUpdatedAt.ts new file mode 100644 index 0000000..d20573a --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataUpdatedAt.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 CardDataUpdatedAt = string | null; diff --git a/negodata/front/src/api/generated/model/cardDataUserId.ts b/negodata/front/src/api/generated/model/cardDataUserId.ts new file mode 100644 index 0000000..6246deb --- /dev/null +++ b/negodata/front/src/api/generated/model/cardDataUserId.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 CardDataUserId = string | null; diff --git a/negodata/front/src/api/generated/model/index.ts b/negodata/front/src/api/generated/model/index.ts index 3eff534..01ae6f3 100644 --- a/negodata/front/src/api/generated/model/index.ts +++ b/negodata/front/src/api/generated/model/index.ts @@ -8,6 +8,16 @@ export * from "./asyncJob"; export * from "./bodyUploadItemsExcelV1ItemUploadExcelPost"; export * from "./bodyUploadSuppliersExcelV1SupplierUploadExcelPost"; +export * from "./cardData"; +export * from "./cardDataCondition"; +export * from "./cardDataCreatedAt"; +export * from "./cardDataEditScript"; +export * from "./cardDataMemo"; +export * from "./cardDataName"; +export * from "./cardDataNumber"; +export * from "./cardDataScript"; +export * from "./cardDataUpdatedAt"; +export * from "./cardDataUserId"; export * from "./chatMessageData"; export * from "./chatMessageDataCardId"; export * from "./chatMessageDataCardType"; @@ -20,6 +30,7 @@ export * from "./errorInfoCode"; export * from "./errorInfoDesc"; export * from "./errorInfoSuccess"; export * from "./hTTPValidationError"; +export * from "./itemCategory"; export * from "./itemData"; export * from "./itemDataCategory"; export * from "./itemDataCode"; @@ -37,6 +48,7 @@ export * from "./itemDataQuantityUnit"; export * from "./itemDataSpec"; export * from "./itemDataUpdatedAt"; export * from "./itemDataVatYn"; +export * from "./listCardsParams"; export * from "./listItemsParams"; export * from "./listQuotationsParams"; export * from "./listSuppliersParams"; @@ -63,7 +75,15 @@ export * from "./quotationSettingData"; export * from "./quotationSettingDataCreatedAt"; export * from "./quotationSettingDataUpdatedAt"; export * from "./quotationSettingDataUserId"; +export * from "./reqCheckCodes"; export * from "./reqCreateAccount"; +export * from "./reqCreateCard"; +export * from "./reqCreateCardCondition"; +export * from "./reqCreateCardEditScript"; +export * from "./reqCreateCardMemo"; +export * from "./reqCreateCardName"; +export * from "./reqCreateCardNumber"; +export * from "./reqCreateCardScript"; export * from "./reqCreateItem"; export * from "./reqCreateItemCategory"; export * from "./reqCreateItemCode"; @@ -92,6 +112,14 @@ export * from "./reqCreateSupplierManagerEmail"; export * from "./reqCreateSupplierManagerName"; export * from "./reqCreateSupplierPriority"; export * from "./reqLogin"; +export * from "./reqUpdateCard"; +export * from "./reqUpdateCardCondition"; +export * from "./reqUpdateCardEditScript"; +export * from "./reqUpdateCardMemo"; +export * from "./reqUpdateCardName"; +export * from "./reqUpdateCardNumber"; +export * from "./reqUpdateCardScript"; +export * from "./reqUpdateCardStatus"; export * from "./reqUpdateItem"; export * from "./reqUpdateItemCategory"; export * from "./reqUpdateItemCategoryType"; @@ -121,12 +149,21 @@ export * from "./reqUpdateSupplierManagerEmail"; export * from "./reqUpdateSupplierManagerName"; export * from "./reqUpdateSupplierName"; export * from "./reqUpdateSupplierPriority"; +export * from "./resCard"; +export * from "./resCardCard"; +export * from "./resCardList"; +export * from "./resCardListMsg"; +export * from "./resCardMsg"; +export * from "./resCheckCodes"; +export * from "./resCheckCodesMsg"; export * from "./resCreateAccount"; export * from "./resCreateAccountMsg"; export * from "./resCreateQuotation"; export * from "./resCreateQuotationAsyncJob"; export * from "./resCreateQuotationMsg"; export * from "./resCreateQuotationQuotation"; +export * from "./resDeleteCard"; +export * from "./resDeleteCardMsg"; export * from "./resDeleteItem"; export * from "./resDeleteItemMsg"; export * from "./resDeleteQuotation"; @@ -142,6 +179,8 @@ export * from "./resExcelUpload"; export * from "./resExcelUploadMsg"; export * from "./resExcelUploadReceivedFilename"; export * from "./resItem"; +export * from "./resItemCategories"; +export * from "./resItemCategoriesMsg"; export * from "./resItemItem"; export * from "./resItemList"; export * from "./resItemListMsg"; diff --git a/negodata/front/src/api/generated/model/itemCategory.ts b/negodata/front/src/api/generated/model/itemCategory.ts new file mode 100644 index 0000000..a7c2357 --- /dev/null +++ b/negodata/front/src/api/generated/model/itemCategory.ts @@ -0,0 +1,11 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ + +export interface ItemCategory { + name: string; + category_type?: number; +} diff --git a/negodata/front/src/api/generated/model/listCardsParams.ts b/negodata/front/src/api/generated/model/listCardsParams.ts new file mode 100644 index 0000000..9bf1168 --- /dev/null +++ b/negodata/front/src/api/generated/model/listCardsParams.ts @@ -0,0 +1,22 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ + +export type ListCardsParams = { + /** + * μΉ΄λ“œλͺ…/μΉ΄λ“œλ²ˆν˜Έ/슀크립트 검색 + */ + search?: string | null; + /** + * @minimum 1 + */ + page?: number; + /** + * @minimum 1 + * @maximum 100 + */ + size?: number; +}; diff --git a/negodata/front/src/api/generated/model/listSuppliersParams.ts b/negodata/front/src/api/generated/model/listSuppliersParams.ts index c577f77..c6afa66 100644 --- a/negodata/front/src/api/generated/model/listSuppliersParams.ts +++ b/negodata/front/src/api/generated/model/listSuppliersParams.ts @@ -10,6 +10,10 @@ export type ListSuppliersParams = { * ν˜‘λ ₯사λͺ…/μ½”λ“œ/λ‹΄λ‹Ήμžλͺ… 검색 */ search?: string | null; + /** + * μš°μ„ μˆœμœ„ ν•„ν„°(HIGH/MEDIUM/LOW) + */ + priority?: string | null; /** * @minimum 1 */ diff --git a/negodata/front/src/api/generated/model/reqCheckCodes.ts b/negodata/front/src/api/generated/model/reqCheckCodes.ts new file mode 100644 index 0000000..bf39a7c --- /dev/null +++ b/negodata/front/src/api/generated/model/reqCheckCodes.ts @@ -0,0 +1,10 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ + +export interface ReqCheckCodes { + codes?: string[]; +} diff --git a/negodata/front/src/api/generated/model/reqCreateCard.ts b/negodata/front/src/api/generated/model/reqCreateCard.ts new file mode 100644 index 0000000..b67c791 --- /dev/null +++ b/negodata/front/src/api/generated/model/reqCreateCard.ts @@ -0,0 +1,23 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ +import type { ReqCreateCardName } from "./reqCreateCardName"; +import type { ReqCreateCardNumber } from "./reqCreateCardNumber"; +import type { ReqCreateCardScript } from "./reqCreateCardScript"; +import type { ReqCreateCardEditScript } from "./reqCreateCardEditScript"; +import type { ReqCreateCardCondition } from "./reqCreateCardCondition"; +import type { ReqCreateCardMemo } from "./reqCreateCardMemo"; + +export interface ReqCreateCard { + is_wildcard?: boolean; + name?: ReqCreateCardName; + number?: ReqCreateCardNumber; + script?: ReqCreateCardScript; + edit_script?: ReqCreateCardEditScript; + status?: number; + condition?: ReqCreateCardCondition; + memo?: ReqCreateCardMemo; +} diff --git a/negodata/front/src/api/generated/model/reqCreateCardCondition.ts b/negodata/front/src/api/generated/model/reqCreateCardCondition.ts new file mode 100644 index 0000000..13e6f09 --- /dev/null +++ b/negodata/front/src/api/generated/model/reqCreateCardCondition.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 ReqCreateCardCondition = string | null; diff --git a/negodata/front/src/api/generated/model/reqCreateCardEditScript.ts b/negodata/front/src/api/generated/model/reqCreateCardEditScript.ts new file mode 100644 index 0000000..336697b --- /dev/null +++ b/negodata/front/src/api/generated/model/reqCreateCardEditScript.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 ReqCreateCardEditScript = unknown | null; diff --git a/negodata/front/src/api/generated/model/reqCreateCardMemo.ts b/negodata/front/src/api/generated/model/reqCreateCardMemo.ts new file mode 100644 index 0000000..d29f826 --- /dev/null +++ b/negodata/front/src/api/generated/model/reqCreateCardMemo.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 ReqCreateCardMemo = string | null; diff --git a/negodata/front/src/api/generated/model/reqCreateCardName.ts b/negodata/front/src/api/generated/model/reqCreateCardName.ts new file mode 100644 index 0000000..45fd31b --- /dev/null +++ b/negodata/front/src/api/generated/model/reqCreateCardName.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 ReqCreateCardName = string | null; diff --git a/negodata/front/src/api/generated/model/reqCreateCardNumber.ts b/negodata/front/src/api/generated/model/reqCreateCardNumber.ts new file mode 100644 index 0000000..b256396 --- /dev/null +++ b/negodata/front/src/api/generated/model/reqCreateCardNumber.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 ReqCreateCardNumber = string | null; diff --git a/negodata/front/src/api/generated/model/reqCreateCardScript.ts b/negodata/front/src/api/generated/model/reqCreateCardScript.ts new file mode 100644 index 0000000..ea9872a --- /dev/null +++ b/negodata/front/src/api/generated/model/reqCreateCardScript.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 ReqCreateCardScript = string | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateCard.ts b/negodata/front/src/api/generated/model/reqUpdateCard.ts new file mode 100644 index 0000000..18b397e --- /dev/null +++ b/negodata/front/src/api/generated/model/reqUpdateCard.ts @@ -0,0 +1,23 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Negodata Api Server + * OpenAPI spec version: 0.1.0 + */ +import type { ReqUpdateCardName } from "./reqUpdateCardName"; +import type { ReqUpdateCardNumber } from "./reqUpdateCardNumber"; +import type { ReqUpdateCardScript } from "./reqUpdateCardScript"; +import type { ReqUpdateCardEditScript } from "./reqUpdateCardEditScript"; +import type { ReqUpdateCardStatus } from "./reqUpdateCardStatus"; +import type { ReqUpdateCardCondition } from "./reqUpdateCardCondition"; +import type { ReqUpdateCardMemo } from "./reqUpdateCardMemo"; + +export interface ReqUpdateCard { + name?: ReqUpdateCardName; + number?: ReqUpdateCardNumber; + script?: ReqUpdateCardScript; + edit_script?: ReqUpdateCardEditScript; + status?: ReqUpdateCardStatus; + condition?: ReqUpdateCardCondition; + memo?: ReqUpdateCardMemo; +} diff --git a/negodata/front/src/api/generated/model/reqUpdateCardCondition.ts b/negodata/front/src/api/generated/model/reqUpdateCardCondition.ts new file mode 100644 index 0000000..b5d34bb --- /dev/null +++ b/negodata/front/src/api/generated/model/reqUpdateCardCondition.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 ReqUpdateCardCondition = string | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateCardEditScript.ts b/negodata/front/src/api/generated/model/reqUpdateCardEditScript.ts new file mode 100644 index 0000000..d2c55df --- /dev/null +++ b/negodata/front/src/api/generated/model/reqUpdateCardEditScript.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 ReqUpdateCardEditScript = unknown | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateCardMemo.ts b/negodata/front/src/api/generated/model/reqUpdateCardMemo.ts new file mode 100644 index 0000000..a5b995e --- /dev/null +++ b/negodata/front/src/api/generated/model/reqUpdateCardMemo.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 ReqUpdateCardMemo = string | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateCardName.ts b/negodata/front/src/api/generated/model/reqUpdateCardName.ts new file mode 100644 index 0000000..2cff992 --- /dev/null +++ b/negodata/front/src/api/generated/model/reqUpdateCardName.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 ReqUpdateCardName = string | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateCardNumber.ts b/negodata/front/src/api/generated/model/reqUpdateCardNumber.ts new file mode 100644 index 0000000..7b30f29 --- /dev/null +++ b/negodata/front/src/api/generated/model/reqUpdateCardNumber.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 ReqUpdateCardNumber = string | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateCardScript.ts b/negodata/front/src/api/generated/model/reqUpdateCardScript.ts new file mode 100644 index 0000000..e8ca692 --- /dev/null +++ b/negodata/front/src/api/generated/model/reqUpdateCardScript.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 ReqUpdateCardScript = string | null; diff --git a/negodata/front/src/api/generated/model/reqUpdateCardStatus.ts b/negodata/front/src/api/generated/model/reqUpdateCardStatus.ts new file mode 100644 index 0000000..4b1d001 --- /dev/null +++ b/negodata/front/src/api/generated/model/reqUpdateCardStatus.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 ReqUpdateCardStatus = number | null; diff --git a/negodata/front/src/api/generated/model/resCard.ts b/negodata/front/src/api/generated/model/resCard.ts new file mode 100644 index 0000000..8ed8f0e --- /dev/null +++ b/negodata/front/src/api/generated/model/resCard.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 { ResCardMsg } from "./resCardMsg"; +import type { ResCardCard } from "./resCardCard"; + +export interface ResCard { + result?: ErrorInfo; + msg?: ResCardMsg; + card?: ResCardCard; +} diff --git a/negodata/front/src/api/generated/model/resCardCard.ts b/negodata/front/src/api/generated/model/resCardCard.ts new file mode 100644 index 0000000..40bd3c8 --- /dev/null +++ b/negodata/front/src/api/generated/model/resCardCard.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 { CardData } from "./cardData"; + +export type ResCardCard = CardData | null; diff --git a/negodata/front/src/api/generated/model/resCardList.ts b/negodata/front/src/api/generated/model/resCardList.ts new file mode 100644 index 0000000..cff383b --- /dev/null +++ b/negodata/front/src/api/generated/model/resCardList.ts @@ -0,0 +1,18 @@ +/** + * 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 { ResCardListMsg } from "./resCardListMsg"; +import type { CardData } from "./cardData"; + +export interface ResCardList { + result?: ErrorInfo; + msg?: ResCardListMsg; + cards?: CardData[]; + total?: number; + page?: number; + size?: number; +} diff --git a/negodata/front/src/api/generated/model/resCardListMsg.ts b/negodata/front/src/api/generated/model/resCardListMsg.ts new file mode 100644 index 0000000..41e5de2 --- /dev/null +++ b/negodata/front/src/api/generated/model/resCardListMsg.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 ResCardListMsg = string | null; diff --git a/negodata/front/src/api/generated/model/resCardMsg.ts b/negodata/front/src/api/generated/model/resCardMsg.ts new file mode 100644 index 0000000..e651e2c --- /dev/null +++ b/negodata/front/src/api/generated/model/resCardMsg.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 ResCardMsg = string | null; diff --git a/negodata/front/src/api/generated/model/resCheckCodes.ts b/negodata/front/src/api/generated/model/resCheckCodes.ts new file mode 100644 index 0000000..0d79010 --- /dev/null +++ b/negodata/front/src/api/generated/model/resCheckCodes.ts @@ -0,0 +1,14 @@ +/** + * 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 { ResCheckCodesMsg } from "./resCheckCodesMsg"; + +export interface ResCheckCodes { + result?: ErrorInfo; + msg?: ResCheckCodesMsg; + existing?: string[]; +} diff --git a/negodata/front/src/api/generated/model/resCheckCodesMsg.ts b/negodata/front/src/api/generated/model/resCheckCodesMsg.ts new file mode 100644 index 0000000..759258e --- /dev/null +++ b/negodata/front/src/api/generated/model/resCheckCodesMsg.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 ResCheckCodesMsg = string | null; diff --git a/negodata/front/src/api/generated/model/resDeleteCard.ts b/negodata/front/src/api/generated/model/resDeleteCard.ts new file mode 100644 index 0000000..c95d877 --- /dev/null +++ b/negodata/front/src/api/generated/model/resDeleteCard.ts @@ -0,0 +1,13 @@ +/** + * 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 { ResDeleteCardMsg } from "./resDeleteCardMsg"; + +export interface ResDeleteCard { + result?: ErrorInfo; + msg?: ResDeleteCardMsg; +} diff --git a/negodata/front/src/api/generated/model/resDeleteCardMsg.ts b/negodata/front/src/api/generated/model/resDeleteCardMsg.ts new file mode 100644 index 0000000..b1bcc6c --- /dev/null +++ b/negodata/front/src/api/generated/model/resDeleteCardMsg.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 ResDeleteCardMsg = string | null; diff --git a/negodata/front/src/api/generated/model/resItemCategories.ts b/negodata/front/src/api/generated/model/resItemCategories.ts new file mode 100644 index 0000000..367dca0 --- /dev/null +++ b/negodata/front/src/api/generated/model/resItemCategories.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 { ResItemCategoriesMsg } from "./resItemCategoriesMsg"; +import type { ItemCategory } from "./itemCategory"; + +export interface ResItemCategories { + result?: ErrorInfo; + msg?: ResItemCategoriesMsg; + categories?: ItemCategory[]; +} diff --git a/negodata/front/src/api/generated/model/resItemCategoriesMsg.ts b/negodata/front/src/api/generated/model/resItemCategoriesMsg.ts new file mode 100644 index 0000000..d522568 --- /dev/null +++ b/negodata/front/src/api/generated/model/resItemCategoriesMsg.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 ResItemCategoriesMsg = string | null; diff --git a/negodata/front/src/api/generated/model/resMe.ts b/negodata/front/src/api/generated/model/resMe.ts index c5e900f..aef9374 100644 --- a/negodata/front/src/api/generated/model/resMe.ts +++ b/negodata/front/src/api/generated/model/resMe.ts @@ -20,5 +20,6 @@ export interface ResMe { email?: ResMeEmail; contact_number?: ResMeContactNumber; role?: number; + role_label?: string; company?: ResMeCompany; } diff --git a/negodata/front/src/api/generated/supplier/supplier.ts b/negodata/front/src/api/generated/supplier/supplier.ts index 70c507a..98c87eb 100644 --- a/negodata/front/src/api/generated/supplier/supplier.ts +++ b/negodata/front/src/api/generated/supplier/supplier.ts @@ -24,8 +24,10 @@ import type { BodyUploadSuppliersExcelV1SupplierUploadExcelPost, HTTPValidationError, ListSuppliersParams, + ReqCheckCodes, ReqCreateSupplier, ReqUpdateSupplier, + ResCheckCodes, ResDeleteSupplier, ResExcelUpload, ResSupplier, @@ -257,6 +259,91 @@ export const useCreateSupplier = < return useMutation(mutationOptions, queryClient); }; +/** + * @summary μ½”λ“œ 쀑볡 사전검사(μ—…λ‘œλ“œ μ¦‰μ‹œ) + */ +export const checkSupplierCodes = ( + reqCheckCodes: ReqCheckCodes, + signal?: AbortSignal, +) => { + return customFetch({ + url: `/v1/supplier/check-codes`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: reqCheckCodes, + signal, + }); +}; + +export const getCheckSupplierCodesMutationOptions = < + TError = void | HTTPValidationError, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: ReqCheckCodes }, + TContext + >; +}): UseMutationOptions< + Awaited>, + TError, + { data: ReqCheckCodes }, + TContext +> => { + const mutationKey = ["checkSupplierCodes"]; + const { mutation: mutationOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey } }; + + const mutationFn: MutationFunction< + Awaited>, + { data: ReqCheckCodes } + > = (props) => { + const { data } = props ?? {}; + + return checkSupplierCodes(data); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type CheckSupplierCodesMutationResult = NonNullable< + Awaited> +>; +export type CheckSupplierCodesMutationBody = ReqCheckCodes; +export type CheckSupplierCodesMutationError = void | HTTPValidationError; + +/** + * @summary μ½”λ“œ 쀑볡 사전검사(μ—…λ‘œλ“œ μ¦‰μ‹œ) + */ +export const useCheckSupplierCodes = < + TError = void | HTTPValidationError, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: ReqCheckCodes }, + TContext + >; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + { data: ReqCheckCodes }, + TContext +> => { + const mutationOptions = getCheckSupplierCodesMutationOptions(options); + + return useMutation(mutationOptions, queryClient); +}; /** * @summary ν˜‘λ ₯사 μ—‘μ…€ 일괄 등둝(μŠ€ν…) */