[chore] negodata/front: orval 생성 클라이언트 재생성 (카드 도메인 + 상품 카테고리·협력사 priority 파라미터)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mina Choi 2026-06-18 11:03:11 +09:00
parent 01e80281d1
commit 7c244bca27
45 changed files with 1336 additions and 0 deletions

View File

@ -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<ResCardList>({
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<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError,
>(
params?: ListCardsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
>;
},
) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getListCardsQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof listCards>>> = ({
signal,
}) => listCards(params, signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof listCards>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type ListCardsQueryResult = NonNullable<
Awaited<ReturnType<typeof listCards>>
>;
export type ListCardsQueryError = void | HTTPValidationError;
export function useListCards<
TData = Awaited<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError,
>(
params: undefined | ListCardsParams,
options: {
query: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof listCards>>,
TError,
Awaited<ReturnType<typeof listCards>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListCards<
TData = Awaited<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError,
>(
params?: ListCardsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof listCards>>,
TError,
Awaited<ReturnType<typeof listCards>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListCards<
TData = Awaited<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError,
>(
params?: ListCardsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary
*/
export function useListCards<
TData = Awaited<ReturnType<typeof listCards>>,
TError = void | HTTPValidationError,
>(
params?: ListCardsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof listCards>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getListCardsQueryOptions(params, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary
*/
export const createCard = (
reqCreateCard: ReqCreateCard,
signal?: AbortSignal,
) => {
return customFetch<ResCard>({
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<ReturnType<typeof createCard>>,
TError,
{ data: ReqCreateCard },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof createCard>>,
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<ReturnType<typeof createCard>>,
{ data: ReqCreateCard }
> = (props) => {
const { data } = props ?? {};
return createCard(data);
};
return { mutationFn, ...mutationOptions };
};
export type CreateCardMutationResult = NonNullable<
Awaited<ReturnType<typeof createCard>>
>;
export type CreateCardMutationBody = ReqCreateCard;
export type CreateCardMutationError = void | HTTPValidationError;
/**
* @summary
*/
export const useCreateCard = <
TError = void | HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof createCard>>,
TError,
{ data: ReqCreateCard },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof createCard>>,
TError,
{ data: ReqCreateCard },
TContext
> => {
const mutationOptions = getCreateCardMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary
*/
export const getCard = (cardId: string, signal?: AbortSignal) => {
return customFetch<ResCard>({
url: `/v1/card/${cardId}`,
method: "GET",
signal,
});
};
export const getGetCardQueryKey = (cardId?: string) => {
return [`/v1/card/${cardId}`] as const;
};
export const getGetCardQueryOptions = <
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError,
>(
cardId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
>;
},
) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetCardQueryKey(cardId);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCard>>> = ({
signal,
}) => getCard(cardId, signal);
return {
queryKey,
queryFn,
enabled: !!cardId,
...queryOptions,
} as UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
};
export type GetCardQueryResult = NonNullable<
Awaited<ReturnType<typeof getCard>>
>;
export type GetCardQueryError = void | HTTPValidationError;
export function useGetCard<
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError,
>(
cardId: string,
options: {
query: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getCard>>,
TError,
Awaited<ReturnType<typeof getCard>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetCard<
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError,
>(
cardId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getCard>>,
TError,
Awaited<ReturnType<typeof getCard>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetCard<
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError,
>(
cardId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary
*/
export function useGetCard<
TData = Awaited<ReturnType<typeof getCard>>,
TError = void | HTTPValidationError,
>(
cardId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof getCard>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGetCardQueryOptions(cardId, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary
*/
export const updateCard = (cardId: string, reqUpdateCard: ReqUpdateCard) => {
return customFetch<ResCard>({
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<ReturnType<typeof updateCard>>,
TError,
{ cardId: string; data: ReqUpdateCard },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof updateCard>>,
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<ReturnType<typeof updateCard>>,
{ cardId: string; data: ReqUpdateCard }
> = (props) => {
const { cardId, data } = props ?? {};
return updateCard(cardId, data);
};
return { mutationFn, ...mutationOptions };
};
export type UpdateCardMutationResult = NonNullable<
Awaited<ReturnType<typeof updateCard>>
>;
export type UpdateCardMutationBody = ReqUpdateCard;
export type UpdateCardMutationError = void | HTTPValidationError;
/**
* @summary
*/
export const useUpdateCard = <
TError = void | HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof updateCard>>,
TError,
{ cardId: string; data: ReqUpdateCard },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof updateCard>>,
TError,
{ cardId: string; data: ReqUpdateCard },
TContext
> => {
const mutationOptions = getUpdateCardMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary
*/
export const deleteCard = (cardId: string) => {
return customFetch<ResDeleteCard>({
url: `/v1/card/delete/${cardId}`,
method: "DELETE",
});
};
export const getDeleteCardMutationOptions = <
TError = void | HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteCard>>,
TError,
{ cardId: string },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof deleteCard>>,
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<ReturnType<typeof deleteCard>>,
{ cardId: string }
> = (props) => {
const { cardId } = props ?? {};
return deleteCard(cardId);
};
return { mutationFn, ...mutationOptions };
};
export type DeleteCardMutationResult = NonNullable<
Awaited<ReturnType<typeof deleteCard>>
>;
export type DeleteCardMutationError = void | HTTPValidationError;
/**
* @summary
*/
export const useDeleteCard = <
TError = void | HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteCard>>,
TError,
{ cardId: string },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof deleteCard>>,
TError,
{ cardId: string },
TContext
> => {
const mutationOptions = getDeleteCardMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@ -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<ResItemCategories>({
url: `/v1/item/categories`,
method: "GET",
signal,
});
};
export const getListItemCategoriesQueryKey = () => {
return [`/v1/item/categories`] as const;
};
export const getListItemCategoriesQueryOptions = <
TData = Awaited<ReturnType<typeof listItemCategories>>,
TError = void,
>(options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof listItemCategories>>,
TError,
TData
>
>;
}) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getListItemCategoriesQueryKey();
const queryFn: QueryFunction<
Awaited<ReturnType<typeof listItemCategories>>
> = ({ signal }) => listItemCategories(signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof listItemCategories>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type ListItemCategoriesQueryResult = NonNullable<
Awaited<ReturnType<typeof listItemCategories>>
>;
export type ListItemCategoriesQueryError = void;
export function useListItemCategories<
TData = Awaited<ReturnType<typeof listItemCategories>>,
TError = void,
>(
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof listItemCategories>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof listItemCategories>>,
TError,
Awaited<ReturnType<typeof listItemCategories>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListItemCategories<
TData = Awaited<ReturnType<typeof listItemCategories>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof listItemCategories>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof listItemCategories>>,
TError,
Awaited<ReturnType<typeof listItemCategories>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListItemCategories<
TData = Awaited<ReturnType<typeof listItemCategories>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof listItemCategories>>,
TError,
TData
>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary (distinct)
*/
export function useListItemCategories<
TData = Awaited<ReturnType<typeof listItemCategories>>,
TError = void,
>(
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof listItemCategories>>,
TError,
TData
>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getListItemCategoriesQueryOptions(options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
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<ResCheckCodes>({
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<ReturnType<typeof checkItemCodes>>,
TError,
{ data: ReqCheckCodes },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof checkItemCodes>>,
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<ReturnType<typeof checkItemCodes>>,
{ data: ReqCheckCodes }
> = (props) => {
const { data } = props ?? {};
return checkItemCodes(data);
};
return { mutationFn, ...mutationOptions };
};
export type CheckItemCodesMutationResult = NonNullable<
Awaited<ReturnType<typeof checkItemCodes>>
>;
export type CheckItemCodesMutationBody = ReqCheckCodes;
export type CheckItemCodesMutationError = void | HTTPValidationError;
/**
* @summary ( )
*/
export const useCheckItemCodes = <
TError = void | HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof checkItemCodes>>,
TError,
{ data: ReqCheckCodes },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof checkItemCodes>>,
TError,
{ data: ReqCheckCodes },
TContext
> => {
const mutationOptions = getCheckItemCodesMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary ()
*/

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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";

View File

@ -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;
}

View File

@ -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;
};

View File

@ -10,6 +10,10 @@ export type ListSuppliersParams = {
* //
*/
search?: string | null;
/**
* (HIGH/MEDIUM/LOW)
*/
priority?: string | null;
/**
* @minimum 1
*/

View File

@ -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[];
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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[];
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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[];
}

View File

@ -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;

View File

@ -20,5 +20,6 @@ export interface ResMe {
email?: ResMeEmail;
contact_number?: ResMeContactNumber;
role?: number;
role_label?: string;
company?: ResMeCompany;
}

View File

@ -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<ResCheckCodes>({
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<ReturnType<typeof checkSupplierCodes>>,
TError,
{ data: ReqCheckCodes },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof checkSupplierCodes>>,
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<ReturnType<typeof checkSupplierCodes>>,
{ data: ReqCheckCodes }
> = (props) => {
const { data } = props ?? {};
return checkSupplierCodes(data);
};
return { mutationFn, ...mutationOptions };
};
export type CheckSupplierCodesMutationResult = NonNullable<
Awaited<ReturnType<typeof checkSupplierCodes>>
>;
export type CheckSupplierCodesMutationBody = ReqCheckCodes;
export type CheckSupplierCodesMutationError = void | HTTPValidationError;
/**
* @summary ( )
*/
export const useCheckSupplierCodes = <
TError = void | HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof checkSupplierCodes>>,
TError,
{ data: ReqCheckCodes },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof checkSupplierCodes>>,
TError,
{ data: ReqCheckCodes },
TContext
> => {
const mutationOptions = getCheckSupplierCodesMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary ()
*/