- 협상대화: 사용 카드 번호/멘트(Slate 서식본)/와일드 조건·메모 표시, SlateRenderer
밑줄·헥스색·{변수} 치환 보정, 말풍선 우측정렬·발신자 아바타 제거
- 견적상세 헤더: DB 컬럼명 라벨 제거, 견적정보/(진행상태+세팅)/상품(이미지) 2열 재배치,
협상카드 탭에 사용 카드 수 표시
- DataTable 행 패딩 축소, 협력사명 아바타 제거, 카드관리 본인 카드 안내문
- orval 재생성(QuotationCardData 신규 필드)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
417 lines
14 KiB
TypeScript
417 lines
14 KiB
TypeScript
/**
|
|
* 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';
|
|
|
|
|
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
|
|
|
|
|
/**
|
|
* @summary 협상카드 목록
|
|
*/
|
|
export const listCards = (
|
|
params?: ListCardsParams,
|
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customFetch<ResCardList>(
|
|
{url: `/v1/card/list`, method: 'GET',
|
|
params, signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
|
|
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>>, request?: SecondParameter<typeof customFetch>}
|
|
) => {
|
|
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
|
const queryKey = queryOptions?.queryKey ?? getListCardsQueryKey(params);
|
|
|
|
|
|
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof listCards>>> = ({ signal }) => listCards(params, requestOptions, 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'
|
|
>, request?: SecondParameter<typeof customFetch>}
|
|
, 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'
|
|
>, request?: SecondParameter<typeof customFetch>}
|
|
, 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>>, request?: SecondParameter<typeof customFetch>}
|
|
, 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>>, request?: SecondParameter<typeof customFetch>}
|
|
, 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,
|
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customFetch<ResCard>(
|
|
{url: `/v1/card/create`, method: 'POST',
|
|
headers: {'Content-Type': 'application/json', },
|
|
data: reqCreateCard, signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
export const getCreateCardMutationOptions = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createCard>>, TError,{data: ReqCreateCard}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
): UseMutationOptions<Awaited<ReturnType<typeof createCard>>, TError,{data: ReqCreateCard}, TContext> => {
|
|
|
|
const mutationKey = ['createCard'];
|
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
options
|
|
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
: {mutation: { mutationKey, }, request: undefined};
|
|
|
|
|
|
|
|
|
|
const mutationFn: MutationFunction<Awaited<ReturnType<typeof createCard>>, {data: ReqCreateCard}> = (props) => {
|
|
const {data} = props ?? {};
|
|
|
|
return createCard(data,requestOptions)
|
|
}
|
|
|
|
|
|
|
|
|
|
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>, request?: SecondParameter<typeof customFetch>}
|
|
, 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,
|
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customFetch<ResCard>(
|
|
{url: `/v1/card/${cardId}`, method: 'GET', signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
|
|
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>>, request?: SecondParameter<typeof customFetch>}
|
|
) => {
|
|
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
|
const queryKey = queryOptions?.queryKey ?? getGetCardQueryKey(cardId);
|
|
|
|
|
|
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCard>>> = ({ signal }) => getCard(cardId, requestOptions, 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'
|
|
>, request?: SecondParameter<typeof customFetch>}
|
|
, 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'
|
|
>, request?: SecondParameter<typeof customFetch>}
|
|
, 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>>, request?: SecondParameter<typeof customFetch>}
|
|
, 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>>, request?: SecondParameter<typeof customFetch>}
|
|
, 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,
|
|
options?: SecondParameter<typeof customFetch>,) => {
|
|
|
|
|
|
return customFetch<ResCard>(
|
|
{url: `/v1/card/update/${cardId}`, method: 'PATCH',
|
|
headers: {'Content-Type': 'application/json', },
|
|
data: reqUpdateCard
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
export const getUpdateCardMutationOptions = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateCard>>, TError,{cardId: string;data: ReqUpdateCard}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
): UseMutationOptions<Awaited<ReturnType<typeof updateCard>>, TError,{cardId: string;data: ReqUpdateCard}, TContext> => {
|
|
|
|
const mutationKey = ['updateCard'];
|
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
options
|
|
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
: {mutation: { mutationKey, }, request: undefined};
|
|
|
|
|
|
|
|
|
|
const mutationFn: MutationFunction<Awaited<ReturnType<typeof updateCard>>, {cardId: string;data: ReqUpdateCard}> = (props) => {
|
|
const {cardId,data} = props ?? {};
|
|
|
|
return updateCard(cardId,data,requestOptions)
|
|
}
|
|
|
|
|
|
|
|
|
|
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>, request?: SecondParameter<typeof customFetch>}
|
|
, 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,
|
|
options?: SecondParameter<typeof customFetch>,) => {
|
|
|
|
|
|
return customFetch<ResDeleteCard>(
|
|
{url: `/v1/card/delete/${cardId}`, method: 'DELETE'
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
export const getDeleteCardMutationOptions = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteCard>>, TError,{cardId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
): UseMutationOptions<Awaited<ReturnType<typeof deleteCard>>, TError,{cardId: string}, TContext> => {
|
|
|
|
const mutationKey = ['deleteCard'];
|
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
options
|
|
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
: {mutation: { mutationKey, }, request: undefined};
|
|
|
|
|
|
|
|
|
|
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteCard>>, {cardId: string}> = (props) => {
|
|
const {cardId} = props ?? {};
|
|
|
|
return deleteCard(cardId,requestOptions)
|
|
}
|
|
|
|
|
|
|
|
|
|
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>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient): UseMutationResult<
|
|
Awaited<ReturnType<typeof deleteCard>>,
|
|
TError,
|
|
{cardId: string},
|
|
TContext
|
|
> => {
|
|
|
|
const mutationOptions = getDeleteCardMutationOptions(options);
|
|
|
|
return useMutation(mutationOptions, queryClient);
|
|
}
|
|
|