[feat] negodata: 협력사↔상품 매핑(취급상품·공급유형) + 견적 픽리스트 서버검색 콤보박스
- partner.supplier_items 매핑테이블 신설: supply_type(0없음/1유통/2제조/3총판), 부분 유니크 인덱스(soft-delete 인지). quotations.supplier_type와 의미단위 달라 컬럼명 supply_type. - 백엔드: supplier_item CRUD/service/router(/v1/supplier-item, by-supplier·by-item·create·bulk·update·delete). 소유권 company 스코프. ErrorType.SUPPLIER_ITEM_NOT_FOUND 추가. - DDL: 01-schema/04-alter(날짜접미 리네임) + dev DB 반영. - 프론트(feature): 협력사 엑셀 '취급상품' 컬럼(콤마 상품명→일괄매핑, 이름 미매칭 스킵+리포트, 유형 안받고 없음), 협력사 상세 취급상품 관리(추가/삭제/유형변경 즉시반영), 견적모달 협력사 리스트에 선택상품 공급유형 배지. - 재사용 서버검색 Combobox 신설 → 취급상품·견적상품·협력사초청·협상카드 픽리스트에 적용(size 100 캡 해소, 검색은 서버 ILIKE). 견적 선택상품 파생값은 useGetItem 단건조회로 안정화. - orval 재생성(supplier-item 클라이언트/모델). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ed175c5b65
commit
43dbcbcd96
37 files changed
+1871
-91
No files matched your search
@@ -69,6 +69,7 @@ export * from './itemDataSellingPrice';
|
||||
export * from './itemDataSpec';
|
||||
export * from './itemDataUpdatedAt';
|
||||
export * from './itemDataVatYn';
|
||||
export * from './itemSupplyType';
|
||||
export * from './listCardsParams';
|
||||
export * from './listItemsParams';
|
||||
export * from './listNotificationsParams';
|
||||
@@ -119,6 +120,7 @@ export * from './quotationSettingDataUpdatedAt';
|
||||
export * from './quotationSettingDataUserId';
|
||||
export * from './quotationStatus';
|
||||
export * from './quotationType';
|
||||
export * from './reqBulkMapByNames';
|
||||
export * from './reqCheckCodes';
|
||||
export * from './reqCreateCard';
|
||||
export * from './reqCreateCardCondition';
|
||||
@@ -160,6 +162,7 @@ export * from './reqCreateQuotationSupplierType';
|
||||
export * from './reqCreateQuotationVersionId';
|
||||
export * from './reqCreateSupplier';
|
||||
export * from './reqCreateSupplierCode';
|
||||
export * from './reqCreateSupplierItem';
|
||||
export * from './reqCreateSupplierManagerContactNumber';
|
||||
export * from './reqCreateSupplierManagerEmail';
|
||||
export * from './reqCreateSupplierManagerName';
|
||||
@@ -217,6 +220,9 @@ export * from './reqUpdateSupplierManagerEmail';
|
||||
export * from './reqUpdateSupplierManagerName';
|
||||
export * from './reqUpdateSupplierName';
|
||||
export * from './reqUpdateSupplierTotalRevenue';
|
||||
export * from './reqUpdateSupplyType';
|
||||
export * from './resBulkMapByNames';
|
||||
export * from './resBulkMapByNamesMsg';
|
||||
export * from './resCard';
|
||||
export * from './resCardCard';
|
||||
export * from './resCardList';
|
||||
@@ -258,6 +264,8 @@ export * from './resItemItem';
|
||||
export * from './resItemList';
|
||||
export * from './resItemListMsg';
|
||||
export * from './resItemMsg';
|
||||
export * from './resItemSupplyTypeList';
|
||||
export * from './resItemSupplyTypeListMsg';
|
||||
export * from './resLastSupplierType';
|
||||
export * from './resLastSupplierTypeMsg';
|
||||
export * from './resLastSupplierTypeQtNumber';
|
||||
@@ -312,6 +320,11 @@ export * from './resSessionChat';
|
||||
export * from './resSessionChatMsg';
|
||||
export * from './resSessionChatSessionId';
|
||||
export * from './resSupplier';
|
||||
export * from './resSupplierItem';
|
||||
export * from './resSupplierItemList';
|
||||
export * from './resSupplierItemListMsg';
|
||||
export * from './resSupplierItemMsg';
|
||||
export * from './resSupplierItemSupplierItem';
|
||||
export * from './resSupplierList';
|
||||
export * from './resSupplierListMsg';
|
||||
export * from './resSupplierMsg';
|
||||
@@ -324,6 +337,8 @@ export * from './resTargetBreakdownMdPrice';
|
||||
export * from './resTargetBreakdownMsg';
|
||||
export * from './resTargetBreakdownPurchase';
|
||||
export * from './resTargetBreakdownSelling';
|
||||
export * from './resWebPacketProtocol';
|
||||
export * from './resWebPacketProtocolMsg';
|
||||
export * from './sessionData';
|
||||
export * from './sessionDataAnchoringPrice';
|
||||
export * from './sessionDataBidAt';
|
||||
@@ -341,6 +356,10 @@ export * from './supplierDataManagerEmail';
|
||||
export * from './supplierDataManagerName';
|
||||
export * from './supplierDataTotalRevenue';
|
||||
export * from './supplierDataUpdatedAt';
|
||||
export * from './supplierItemData';
|
||||
export * from './supplierItemDataCreatedAt';
|
||||
export * from './supplierItemDataItemCode';
|
||||
export * from './supplierItemDataUpdatedAt';
|
||||
export * from './supplierType';
|
||||
export * from './targetCandidate';
|
||||
export * from './userRole';
|
||||
|
||||
@@ -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 ItemSupplyType {
|
||||
supplier_id: string;
|
||||
supply_type: number;
|
||||
}
|
||||
@@ -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 ReqBulkMapByNames {
|
||||
names?: string[];
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface ReqCreateSupplierItem {
|
||||
supplier_id: string;
|
||||
item_id: string;
|
||||
supply_type?: number;
|
||||
}
|
||||
@@ -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 ReqUpdateSupplyType {
|
||||
supply_type: number;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 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 { ResBulkMapByNamesMsg } from './resBulkMapByNamesMsg';
|
||||
|
||||
export interface ResBulkMapByNames {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResBulkMapByNamesMsg;
|
||||
created_count?: number;
|
||||
skipped_count?: number;
|
||||
unmatched?: string[];
|
||||
}
|
||||
@@ -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 ResBulkMapByNamesMsg = string | null;
|
||||
@@ -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 { ResItemSupplyTypeListMsg } from './resItemSupplyTypeListMsg';
|
||||
import type { ItemSupplyType } from './itemSupplyType';
|
||||
|
||||
export interface ResItemSupplyTypeList {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResItemSupplyTypeListMsg;
|
||||
suppliers?: ItemSupplyType[];
|
||||
}
|
||||
@@ -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 ResItemSupplyTypeListMsg = string | null;
|
||||
@@ -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 { ResSupplierItemMsg } from './resSupplierItemMsg';
|
||||
import type { ResSupplierItemSupplierItem } from './resSupplierItemSupplierItem';
|
||||
|
||||
export interface ResSupplierItem {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResSupplierItemMsg;
|
||||
supplier_item?: ResSupplierItemSupplierItem;
|
||||
}
|
||||
@@ -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 { ResSupplierItemListMsg } from './resSupplierItemListMsg';
|
||||
import type { SupplierItemData } from './supplierItemData';
|
||||
|
||||
export interface ResSupplierItemList {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResSupplierItemListMsg;
|
||||
supplier_items?: SupplierItemData[];
|
||||
}
|
||||
@@ -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 ResSupplierItemListMsg = string | null;
|
||||
@@ -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 ResSupplierItemMsg = string | null;
|
||||
@@ -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 { SupplierItemData } from './supplierItemData';
|
||||
|
||||
export type ResSupplierItemSupplierItem = SupplierItemData | null;
|
||||
@@ -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 { ResWebPacketProtocolMsg } from './resWebPacketProtocolMsg';
|
||||
|
||||
export interface ResWebPacketProtocol {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResWebPacketProtocolMsg;
|
||||
}
|
||||
@@ -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 ResWebPacketProtocolMsg = string | null;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { SupplierItemDataItemCode } from './supplierItemDataItemCode';
|
||||
import type { SupplierItemDataCreatedAt } from './supplierItemDataCreatedAt';
|
||||
import type { SupplierItemDataUpdatedAt } from './supplierItemDataUpdatedAt';
|
||||
|
||||
export interface SupplierItemData {
|
||||
supplier_item_id: string;
|
||||
item_id: string;
|
||||
item_name: string;
|
||||
item_code?: SupplierItemDataItemCode;
|
||||
supply_type: number;
|
||||
created_at?: SupplierItemDataCreatedAt;
|
||||
updated_at?: SupplierItemDataUpdatedAt;
|
||||
}
|
||||
@@ -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 SupplierItemDataCreatedAt = string | null;
|
||||
@@ -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 SupplierItemDataItemCode = string | null;
|
||||
@@ -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 SupplierItemDataUpdatedAt = string | null;
|
||||
@@ -0,0 +1,483 @@
|
||||
/**
|
||||
* 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,
|
||||
ReqBulkMapByNames,
|
||||
ReqCreateSupplierItem,
|
||||
ReqUpdateSupplyType,
|
||||
ResBulkMapByNames,
|
||||
ResItemSupplyTypeList,
|
||||
ResSupplierItem,
|
||||
ResSupplierItemList,
|
||||
ResWebPacketProtocol
|
||||
} from '.././model';
|
||||
|
||||
import { customFetch } from '../../mutator/custom-fetch';
|
||||
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @summary 협력사 취급상품 목록
|
||||
*/
|
||||
export const listSupplierItems = (
|
||||
supplierId: string,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResSupplierItemList>(
|
||||
{url: `/v1/supplier-item/by-supplier/${supplierId}`, method: 'GET', signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListSupplierItemsQueryKey = (supplierId?: string,) => {
|
||||
return [
|
||||
`/v1/supplier-item/by-supplier/${supplierId}`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getListSupplierItemsQueryOptions = <TData = Awaited<ReturnType<typeof listSupplierItems>>, TError = void | HTTPValidationError>(supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSupplierItems>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getListSupplierItemsQueryKey(supplierId);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof listSupplierItems>>> = ({ signal }) => listSupplierItems(supplierId, requestOptions, signal);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: !!(supplierId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listSupplierItems>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type ListSupplierItemsQueryResult = NonNullable<Awaited<ReturnType<typeof listSupplierItems>>>
|
||||
export type ListSupplierItemsQueryError = void | HTTPValidationError
|
||||
|
||||
|
||||
export function useListSupplierItems<TData = Awaited<ReturnType<typeof listSupplierItems>>, TError = void | HTTPValidationError>(
|
||||
supplierId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSupplierItems>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listSupplierItems>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listSupplierItems>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListSupplierItems<TData = Awaited<ReturnType<typeof listSupplierItems>>, TError = void | HTTPValidationError>(
|
||||
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSupplierItems>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listSupplierItems>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listSupplierItems>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListSupplierItems<TData = Awaited<ReturnType<typeof listSupplierItems>>, TError = void | HTTPValidationError>(
|
||||
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSupplierItems>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary 협력사 취급상품 목록
|
||||
*/
|
||||
|
||||
export function useListSupplierItems<TData = Awaited<ReturnType<typeof listSupplierItems>>, TError = void | HTTPValidationError>(
|
||||
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSupplierItems>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getListSupplierItemsQueryOptions(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 listItemSupplyTypes = (
|
||||
itemId: string,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResItemSupplyTypeList>(
|
||||
{url: `/v1/supplier-item/by-item/${itemId}`, method: 'GET', signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListItemSupplyTypesQueryKey = (itemId?: string,) => {
|
||||
return [
|
||||
`/v1/supplier-item/by-item/${itemId}`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getListItemSupplyTypesQueryOptions = <TData = Awaited<ReturnType<typeof listItemSupplyTypes>>, TError = void | HTTPValidationError>(itemId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listItemSupplyTypes>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getListItemSupplyTypesQueryKey(itemId);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof listItemSupplyTypes>>> = ({ signal }) => listItemSupplyTypes(itemId, requestOptions, signal);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: !!(itemId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listItemSupplyTypes>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type ListItemSupplyTypesQueryResult = NonNullable<Awaited<ReturnType<typeof listItemSupplyTypes>>>
|
||||
export type ListItemSupplyTypesQueryError = void | HTTPValidationError
|
||||
|
||||
|
||||
export function useListItemSupplyTypes<TData = Awaited<ReturnType<typeof listItemSupplyTypes>>, TError = void | HTTPValidationError>(
|
||||
itemId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listItemSupplyTypes>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listItemSupplyTypes>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listItemSupplyTypes>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListItemSupplyTypes<TData = Awaited<ReturnType<typeof listItemSupplyTypes>>, TError = void | HTTPValidationError>(
|
||||
itemId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listItemSupplyTypes>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listItemSupplyTypes>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listItemSupplyTypes>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListItemSupplyTypes<TData = Awaited<ReturnType<typeof listItemSupplyTypes>>, TError = void | HTTPValidationError>(
|
||||
itemId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listItemSupplyTypes>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary 상품 취급 협력사 공급유형 목록
|
||||
*/
|
||||
|
||||
export function useListItemSupplyTypes<TData = Awaited<ReturnType<typeof listItemSupplyTypes>>, TError = void | HTTPValidationError>(
|
||||
itemId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listItemSupplyTypes>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getListItemSupplyTypesQueryOptions(itemId,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey ;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @summary 취급상품 매핑 추가
|
||||
*/
|
||||
export const createSupplierItem = (
|
||||
reqCreateSupplierItem: ReqCreateSupplierItem,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResSupplierItem>(
|
||||
{url: `/v1/supplier-item/create`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqCreateSupplierItem, signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getCreateSupplierItemMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createSupplierItem>>, TError,{data: ReqCreateSupplierItem}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof createSupplierItem>>, TError,{data: ReqCreateSupplierItem}, TContext> => {
|
||||
|
||||
const mutationKey = ['createSupplierItem'];
|
||||
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 createSupplierItem>>, {data: ReqCreateSupplierItem}> = (props) => {
|
||||
const {data} = props ?? {};
|
||||
|
||||
return createSupplierItem(data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type CreateSupplierItemMutationResult = NonNullable<Awaited<ReturnType<typeof createSupplierItem>>>
|
||||
export type CreateSupplierItemMutationBody = ReqCreateSupplierItem
|
||||
export type CreateSupplierItemMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 취급상품 매핑 추가
|
||||
*/
|
||||
export const useCreateSupplierItem = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createSupplierItem>>, TError,{data: ReqCreateSupplierItem}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof createSupplierItem>>,
|
||||
TError,
|
||||
{data: ReqCreateSupplierItem},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getCreateSupplierItemMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 취급상품 이름 일괄 매핑(엑셀 업로드)
|
||||
*/
|
||||
export const bulkMapSupplierItems = (
|
||||
supplierId: string,
|
||||
reqBulkMapByNames: ReqBulkMapByNames,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResBulkMapByNames>(
|
||||
{url: `/v1/supplier-item/by-supplier/${supplierId}/bulk`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqBulkMapByNames, signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getBulkMapSupplierItemsMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof bulkMapSupplierItems>>, TError,{supplierId: string;data: ReqBulkMapByNames}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof bulkMapSupplierItems>>, TError,{supplierId: string;data: ReqBulkMapByNames}, TContext> => {
|
||||
|
||||
const mutationKey = ['bulkMapSupplierItems'];
|
||||
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 bulkMapSupplierItems>>, {supplierId: string;data: ReqBulkMapByNames}> = (props) => {
|
||||
const {supplierId,data} = props ?? {};
|
||||
|
||||
return bulkMapSupplierItems(supplierId,data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type BulkMapSupplierItemsMutationResult = NonNullable<Awaited<ReturnType<typeof bulkMapSupplierItems>>>
|
||||
export type BulkMapSupplierItemsMutationBody = ReqBulkMapByNames
|
||||
export type BulkMapSupplierItemsMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 취급상품 이름 일괄 매핑(엑셀 업로드)
|
||||
*/
|
||||
export const useBulkMapSupplierItems = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof bulkMapSupplierItems>>, TError,{supplierId: string;data: ReqBulkMapByNames}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof bulkMapSupplierItems>>,
|
||||
TError,
|
||||
{supplierId: string;data: ReqBulkMapByNames},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getBulkMapSupplierItemsMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 취급상품 공급유형 수정
|
||||
*/
|
||||
export const updateSupplyType = (
|
||||
supplierItemId: string,
|
||||
reqUpdateSupplyType: ReqUpdateSupplyType,
|
||||
options?: SecondParameter<typeof customFetch>,) => {
|
||||
|
||||
|
||||
return customFetch<ResWebPacketProtocol>(
|
||||
{url: `/v1/supplier-item/update/${supplierItemId}`, method: 'PATCH',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqUpdateSupplyType
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getUpdateSupplyTypeMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateSupplyType>>, TError,{supplierItemId: string;data: ReqUpdateSupplyType}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof updateSupplyType>>, TError,{supplierItemId: string;data: ReqUpdateSupplyType}, TContext> => {
|
||||
|
||||
const mutationKey = ['updateSupplyType'];
|
||||
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 updateSupplyType>>, {supplierItemId: string;data: ReqUpdateSupplyType}> = (props) => {
|
||||
const {supplierItemId,data} = props ?? {};
|
||||
|
||||
return updateSupplyType(supplierItemId,data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type UpdateSupplyTypeMutationResult = NonNullable<Awaited<ReturnType<typeof updateSupplyType>>>
|
||||
export type UpdateSupplyTypeMutationBody = ReqUpdateSupplyType
|
||||
export type UpdateSupplyTypeMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 취급상품 공급유형 수정
|
||||
*/
|
||||
export const useUpdateSupplyType = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateSupplyType>>, TError,{supplierItemId: string;data: ReqUpdateSupplyType}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof updateSupplyType>>,
|
||||
TError,
|
||||
{supplierItemId: string;data: ReqUpdateSupplyType},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getUpdateSupplyTypeMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 취급상품 매핑 삭제
|
||||
*/
|
||||
export const deleteSupplierItem = (
|
||||
supplierItemId: string,
|
||||
options?: SecondParameter<typeof customFetch>,) => {
|
||||
|
||||
|
||||
return customFetch<ResWebPacketProtocol>(
|
||||
{url: `/v1/supplier-item/delete/${supplierItemId}`, method: 'DELETE'
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getDeleteSupplierItemMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSupplierItem>>, TError,{supplierItemId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof deleteSupplierItem>>, TError,{supplierItemId: string}, TContext> => {
|
||||
|
||||
const mutationKey = ['deleteSupplierItem'];
|
||||
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 deleteSupplierItem>>, {supplierItemId: string}> = (props) => {
|
||||
const {supplierItemId} = props ?? {};
|
||||
|
||||
return deleteSupplierItem(supplierItemId,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type DeleteSupplierItemMutationResult = NonNullable<Awaited<ReturnType<typeof deleteSupplierItem>>>
|
||||
|
||||
export type DeleteSupplierItemMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 취급상품 매핑 삭제
|
||||
*/
|
||||
export const useDeleteSupplierItem = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSupplierItem>>, TError,{supplierItemId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof deleteSupplierItem>>,
|
||||
TError,
|
||||
{supplierItemId: string},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getDeleteSupplierItemMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user