- 협상대화: 사용 카드 번호/멘트(Slate 서식본)/와일드 조건·메모 표시, SlateRenderer
밑줄·헥스색·{변수} 치환 보정, 말풍선 우측정렬·발신자 아바타 제거
- 견적상세 헤더: DB 컬럼명 라벨 제거, 견적정보/(진행상태+세팅)/상품(이미지) 2열 재배치,
협상카드 탭에 사용 카드 수 표시
- DataTable 행 패딩 축소, 협력사명 아바타 제거, 카드관리 본인 카드 안내문
- orval 재생성(QuotationCardData 신규 필드)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
483 lines
17 KiB
TypeScript
483 lines
17 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,
|
|
ListSuppliersParams,
|
|
ReqCheckCodes,
|
|
ReqCreateSupplier,
|
|
ReqUpdateSupplier,
|
|
ResCheckCodes,
|
|
ResDeleteSupplier,
|
|
ResSupplier,
|
|
ResSupplierList
|
|
} from '.././model';
|
|
|
|
import { customFetch } from '../../mutator/custom-fetch';
|
|
|
|
|
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
|
|
|
|
|
/**
|
|
* @summary 협력사 목록
|
|
*/
|
|
export const listSuppliers = (
|
|
params?: ListSuppliersParams,
|
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customFetch<ResSupplierList>(
|
|
{url: `/v1/supplier/list`, method: 'GET',
|
|
params, signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getListSuppliersQueryKey = (params?: ListSuppliersParams,) => {
|
|
return [
|
|
`/v1/supplier/list`, ...(params ? [params]: [])
|
|
] as const;
|
|
}
|
|
|
|
|
|
export const getListSuppliersQueryOptions = <TData = Awaited<ReturnType<typeof listSuppliers>>, TError = void | HTTPValidationError>(params?: ListSuppliersParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSuppliers>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
|
) => {
|
|
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
|
const queryKey = queryOptions?.queryKey ?? getListSuppliersQueryKey(params);
|
|
|
|
|
|
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof listSuppliers>>> = ({ signal }) => listSuppliers(params, requestOptions, signal);
|
|
|
|
|
|
|
|
|
|
|
|
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listSuppliers>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
}
|
|
|
|
export type ListSuppliersQueryResult = NonNullable<Awaited<ReturnType<typeof listSuppliers>>>
|
|
export type ListSuppliersQueryError = void | HTTPValidationError
|
|
|
|
|
|
export function useListSuppliers<TData = Awaited<ReturnType<typeof listSuppliers>>, TError = void | HTTPValidationError>(
|
|
params: undefined | ListSuppliersParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSuppliers>>, TError, TData>> & Pick<
|
|
DefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof listSuppliers>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof listSuppliers>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient
|
|
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useListSuppliers<TData = Awaited<ReturnType<typeof listSuppliers>>, TError = void | HTTPValidationError>(
|
|
params?: ListSuppliersParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSuppliers>>, TError, TData>> & Pick<
|
|
UndefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof listSuppliers>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof listSuppliers>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useListSuppliers<TData = Awaited<ReturnType<typeof listSuppliers>>, TError = void | HTTPValidationError>(
|
|
params?: ListSuppliersParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSuppliers>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
/**
|
|
* @summary 협력사 목록
|
|
*/
|
|
|
|
export function useListSuppliers<TData = Awaited<ReturnType<typeof listSuppliers>>, TError = void | HTTPValidationError>(
|
|
params?: ListSuppliersParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSuppliers>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
|
|
const queryOptions = getListSuppliersQueryOptions(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 createSupplier = (
|
|
reqCreateSupplier: ReqCreateSupplier,
|
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customFetch<ResSupplier>(
|
|
{url: `/v1/supplier/create`, method: 'POST',
|
|
headers: {'Content-Type': 'application/json', },
|
|
data: reqCreateSupplier, signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
export const getCreateSupplierMutationOptions = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createSupplier>>, TError,{data: ReqCreateSupplier}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
): UseMutationOptions<Awaited<ReturnType<typeof createSupplier>>, TError,{data: ReqCreateSupplier}, TContext> => {
|
|
|
|
const mutationKey = ['createSupplier'];
|
|
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 createSupplier>>, {data: ReqCreateSupplier}> = (props) => {
|
|
const {data} = props ?? {};
|
|
|
|
return createSupplier(data,requestOptions)
|
|
}
|
|
|
|
|
|
|
|
|
|
return { mutationFn, ...mutationOptions }}
|
|
|
|
export type CreateSupplierMutationResult = NonNullable<Awaited<ReturnType<typeof createSupplier>>>
|
|
export type CreateSupplierMutationBody = ReqCreateSupplier
|
|
export type CreateSupplierMutationError = void | HTTPValidationError
|
|
|
|
/**
|
|
* @summary 협력사 등록
|
|
*/
|
|
export const useCreateSupplier = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createSupplier>>, TError,{data: ReqCreateSupplier}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient): UseMutationResult<
|
|
Awaited<ReturnType<typeof createSupplier>>,
|
|
TError,
|
|
{data: ReqCreateSupplier},
|
|
TContext
|
|
> => {
|
|
|
|
const mutationOptions = getCreateSupplierMutationOptions(options);
|
|
|
|
return useMutation(mutationOptions, queryClient);
|
|
}
|
|
/**
|
|
* @summary 코드 중복 사전검사(업로드 즉시)
|
|
*/
|
|
export const checkSupplierCodes = (
|
|
reqCheckCodes: ReqCheckCodes,
|
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customFetch<ResCheckCodes>(
|
|
{url: `/v1/supplier/check-codes`, method: 'POST',
|
|
headers: {'Content-Type': 'application/json', },
|
|
data: reqCheckCodes, signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
export const getCheckSupplierCodesMutationOptions = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof checkSupplierCodes>>, TError,{data: ReqCheckCodes}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
): UseMutationOptions<Awaited<ReturnType<typeof checkSupplierCodes>>, TError,{data: ReqCheckCodes}, TContext> => {
|
|
|
|
const mutationKey = ['checkSupplierCodes'];
|
|
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 checkSupplierCodes>>, {data: ReqCheckCodes}> = (props) => {
|
|
const {data} = props ?? {};
|
|
|
|
return checkSupplierCodes(data,requestOptions)
|
|
}
|
|
|
|
|
|
|
|
|
|
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>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient): UseMutationResult<
|
|
Awaited<ReturnType<typeof checkSupplierCodes>>,
|
|
TError,
|
|
{data: ReqCheckCodes},
|
|
TContext
|
|
> => {
|
|
|
|
const mutationOptions = getCheckSupplierCodesMutationOptions(options);
|
|
|
|
return useMutation(mutationOptions, queryClient);
|
|
}
|
|
/**
|
|
* @summary 협력사 조회
|
|
*/
|
|
export const getSupplier = (
|
|
supplierId: string,
|
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customFetch<ResSupplier>(
|
|
{url: `/v1/supplier/${supplierId}`, method: 'GET', signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getGetSupplierQueryKey = (supplierId?: string,) => {
|
|
return [
|
|
`/v1/supplier/${supplierId}`
|
|
] as const;
|
|
}
|
|
|
|
|
|
export const getGetSupplierQueryOptions = <TData = Awaited<ReturnType<typeof getSupplier>>, TError = void | HTTPValidationError>(supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplier>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
|
) => {
|
|
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
|
const queryKey = queryOptions?.queryKey ?? getGetSupplierQueryKey(supplierId);
|
|
|
|
|
|
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSupplier>>> = ({ signal }) => getSupplier(supplierId, requestOptions, signal);
|
|
|
|
|
|
|
|
|
|
|
|
return { queryKey, queryFn, enabled: !!(supplierId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getSupplier>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
}
|
|
|
|
export type GetSupplierQueryResult = NonNullable<Awaited<ReturnType<typeof getSupplier>>>
|
|
export type GetSupplierQueryError = void | HTTPValidationError
|
|
|
|
|
|
export function useGetSupplier<TData = Awaited<ReturnType<typeof getSupplier>>, TError = void | HTTPValidationError>(
|
|
supplierId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplier>>, TError, TData>> & Pick<
|
|
DefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof getSupplier>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof getSupplier>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient
|
|
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useGetSupplier<TData = Awaited<ReturnType<typeof getSupplier>>, TError = void | HTTPValidationError>(
|
|
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplier>>, TError, TData>> & Pick<
|
|
UndefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof getSupplier>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof getSupplier>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useGetSupplier<TData = Awaited<ReturnType<typeof getSupplier>>, TError = void | HTTPValidationError>(
|
|
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplier>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
/**
|
|
* @summary 협력사 조회
|
|
*/
|
|
|
|
export function useGetSupplier<TData = Awaited<ReturnType<typeof getSupplier>>, TError = void | HTTPValidationError>(
|
|
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplier>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
|
|
const queryOptions = getGetSupplierQueryOptions(supplierId,options)
|
|
|
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
|
|
query.queryKey = queryOptions.queryKey ;
|
|
|
|
return query;
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* @summary 협력사 수정
|
|
*/
|
|
export const updateSupplier = (
|
|
supplierId: string,
|
|
reqUpdateSupplier: ReqUpdateSupplier,
|
|
options?: SecondParameter<typeof customFetch>,) => {
|
|
|
|
|
|
return customFetch<ResSupplier>(
|
|
{url: `/v1/supplier/update/${supplierId}`, method: 'PATCH',
|
|
headers: {'Content-Type': 'application/json', },
|
|
data: reqUpdateSupplier
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
export const getUpdateSupplierMutationOptions = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateSupplier>>, TError,{supplierId: string;data: ReqUpdateSupplier}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
): UseMutationOptions<Awaited<ReturnType<typeof updateSupplier>>, TError,{supplierId: string;data: ReqUpdateSupplier}, TContext> => {
|
|
|
|
const mutationKey = ['updateSupplier'];
|
|
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 updateSupplier>>, {supplierId: string;data: ReqUpdateSupplier}> = (props) => {
|
|
const {supplierId,data} = props ?? {};
|
|
|
|
return updateSupplier(supplierId,data,requestOptions)
|
|
}
|
|
|
|
|
|
|
|
|
|
return { mutationFn, ...mutationOptions }}
|
|
|
|
export type UpdateSupplierMutationResult = NonNullable<Awaited<ReturnType<typeof updateSupplier>>>
|
|
export type UpdateSupplierMutationBody = ReqUpdateSupplier
|
|
export type UpdateSupplierMutationError = void | HTTPValidationError
|
|
|
|
/**
|
|
* @summary 협력사 수정
|
|
*/
|
|
export const useUpdateSupplier = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateSupplier>>, TError,{supplierId: string;data: ReqUpdateSupplier}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient): UseMutationResult<
|
|
Awaited<ReturnType<typeof updateSupplier>>,
|
|
TError,
|
|
{supplierId: string;data: ReqUpdateSupplier},
|
|
TContext
|
|
> => {
|
|
|
|
const mutationOptions = getUpdateSupplierMutationOptions(options);
|
|
|
|
return useMutation(mutationOptions, queryClient);
|
|
}
|
|
/**
|
|
* @summary 협력사 삭제
|
|
*/
|
|
export const deleteSupplier = (
|
|
supplierId: string,
|
|
options?: SecondParameter<typeof customFetch>,) => {
|
|
|
|
|
|
return customFetch<ResDeleteSupplier>(
|
|
{url: `/v1/supplier/delete/${supplierId}`, method: 'DELETE'
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
export const getDeleteSupplierMutationOptions = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSupplier>>, TError,{supplierId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
): UseMutationOptions<Awaited<ReturnType<typeof deleteSupplier>>, TError,{supplierId: string}, TContext> => {
|
|
|
|
const mutationKey = ['deleteSupplier'];
|
|
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 deleteSupplier>>, {supplierId: string}> = (props) => {
|
|
const {supplierId} = props ?? {};
|
|
|
|
return deleteSupplier(supplierId,requestOptions)
|
|
}
|
|
|
|
|
|
|
|
|
|
return { mutationFn, ...mutationOptions }}
|
|
|
|
export type DeleteSupplierMutationResult = NonNullable<Awaited<ReturnType<typeof deleteSupplier>>>
|
|
|
|
export type DeleteSupplierMutationError = void | HTTPValidationError
|
|
|
|
/**
|
|
* @summary 협력사 삭제
|
|
*/
|
|
export const useDeleteSupplier = <TError = void | HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSupplier>>, TError,{supplierId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
, queryClient?: QueryClient): UseMutationResult<
|
|
Awaited<ReturnType<typeof deleteSupplier>>,
|
|
TError,
|
|
{supplierId: string},
|
|
TContext
|
|
> => {
|
|
|
|
const mutationOptions = getDeleteSupplierMutationOptions(options);
|
|
|
|
return useMutation(mutationOptions, queryClient);
|
|
}
|
|
|