[refactor] 공급유형 기준을 상품-협력사 매핑으로 전환

This commit is contained in:
minaChoi committed 2026-07-07 17:05:07 +09:00
1 parent 9ac8fe6363
commit d21e7c10b0
35 files changed
+157 -333

No files matched your search

@@ -114,7 +114,6 @@ export * from './quotationDataOverAction';
export * from './quotationDataPreferredSpId';
export * from './quotationDataPreferredSpName';
export * from './quotationDataPreferredSpYn';
export * from './quotationDataSupplierType';
export * from './quotationDataUpdatedAt';
export * from './quotationSettingData';
export * from './quotationSettingDataCreatedAt';
@@ -161,7 +160,6 @@ export * from './reqCreateQuotationMidAction';
export * from './reqCreateQuotationOverAction';
export * from './reqCreateQuotationSetting';
export * from './reqCreateQuotationStartTime';
export * from './reqCreateQuotationSupplierType';
export * from './reqCreateQuotationVersionId';
export * from './reqCreateSupplier';
export * from './reqCreateSupplierCode';
@@ -269,10 +267,6 @@ export * from './resItemListMsg';
export * from './resItemMsg';
export * from './resItemSupplyTypeList';
export * from './resItemSupplyTypeListMsg';
export * from './resLastSupplierType';
export * from './resLastSupplierTypeMsg';
export * from './resLastSupplierTypeQtNumber';
export * from './resLastSupplierTypeSupplierType';
export * from './resLogin';
export * from './resLoginMsg';
export * from './resLowestPriceResult';
@@ -380,4 +374,4 @@ export * from './userRole';
export * from './userStatus';
export * from './validationError';
export * from './validationErrorCtx';
export * from './validationErrorLocItem';
export * from './validationErrorLocItem';
@@ -11,7 +11,6 @@ import type { QuotationDataManagerEmail } from './quotationDataManagerEmail';
import type { QuotationDataManagerContactNumber } from './quotationDataManagerContactNumber';
import type { QuotationDataMemo } from './quotationDataMemo';
import type { QuotationDataMdPrice } from './quotationDataMdPrice';
import type { QuotationDataSupplierType } from './quotationDataSupplierType';
import type { QuotationDataPreferredSpYn } from './quotationDataPreferredSpYn';
import type { QuotationDataPreferredSpId } from './quotationDataPreferredSpId';
import type { QuotationDataPreferredSpName } from './quotationDataPreferredSpName';
@@ -43,7 +42,6 @@ export interface QuotationData {
manager_contact_number?: QuotationDataManagerContactNumber;
memo?: QuotationDataMemo;
md_price?: QuotationDataMdPrice;
supplier_type?: QuotationDataSupplierType;
iteration?: number;
preferred_sp_yn?: QuotationDataPreferredSpYn;
preferred_sp_id?: QuotationDataPreferredSpId;
@@ -1,9 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
import type { SupplierType } from './supplierType';
export type QuotationDataSupplierType = SupplierType | null;
@@ -11,7 +11,6 @@ import type { ReqCreateQuotationManagerEmail } from './reqCreateQuotationManager
import type { ReqCreateQuotationManagerContactNumber } from './reqCreateQuotationManagerContactNumber';
import type { ReqCreateQuotationMemo } from './reqCreateQuotationMemo';
import type { ReqCreateQuotationMdPrice } from './reqCreateQuotationMdPrice';
import type { ReqCreateQuotationSupplierType } from './reqCreateQuotationSupplierType';
import type { ReqCreateQuotationMidAction } from './reqCreateQuotationMidAction';
import type { ReqCreateQuotationOverAction } from './reqCreateQuotationOverAction';
@@ -29,7 +28,6 @@ export interface ReqCreateQuotation {
manager_contact_number?: ReqCreateQuotationManagerContactNumber;
memo?: ReqCreateQuotationMemo;
md_price?: ReqCreateQuotationMdPrice;
supplier_type?: ReqCreateQuotationSupplierType;
item_ids?: string[];
supplier_ids?: string[];
card_ids?: string[];
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
export type ReqCreateQuotationSupplierType = number | null;
@@ -1,17 +0,0 @@
/**
* 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 { ResLastSupplierTypeMsg } from './resLastSupplierTypeMsg';
import type { ResLastSupplierTypeSupplierType } from './resLastSupplierTypeSupplierType';
import type { ResLastSupplierTypeQtNumber } from './resLastSupplierTypeQtNumber';
export interface ResLastSupplierType {
result?: ErrorInfo;
msg?: ResLastSupplierTypeMsg;
supplier_type?: ResLastSupplierTypeSupplierType;
qt_number?: ResLastSupplierTypeQtNumber;
}
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
export type ResLastSupplierTypeMsg = string | null;
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
export type ResLastSupplierTypeQtNumber = string | null;
@@ -1,9 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Negodata Api Server
* OpenAPI spec version: 0.1.0
*/
import type { SupplierType } from './supplierType';
export type ResLastSupplierTypeSupplierType = SupplierType | null;
@@ -6,8 +6,8 @@
*/
/**
* quotations.supplier_type 코드값. 없음(0,미지정)/유통(1)/제조(2)/총판(3).
없음은 프론트 폼에 '없음'으로 노출. KTC 앵커링 코드(기타=0)와 매핑 시 0↔없음 대응.
* partner.supplier_items.supply_type 코드값. 없음(0,미지정)/유통(1)/제조(2)/총판(3).
없음은 상품-협력사 매핑에서 유형 미지정 상태를 뜻한다.
*/
export type SupplierType = typeof SupplierType[keyof typeof SupplierType];
@@ -31,7 +31,6 @@ import type {
ReqRegenerateQuotation,
ResCreateQuotation,
ResDeleteQuotation,
ResLastSupplierType,
ResNotifySessions,
ResQuotation,
ResQuotationCards,
@@ -1136,96 +1135,6 @@ export const useDeleteQuotation = <TError = void | HTTPValidationError,
return useMutation(mutationOptions, queryClient);
}
/**
* @summary 협력사 직전 견적 유형
*/
export const getSupplierLastType = (
supplierId: string,
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
) => {
return customFetch<ResLastSupplierType>(
{url: `/v1/quotation/supplier/${supplierId}/last-type`, method: 'GET', signal
},
options);
}
export const getGetSupplierLastTypeQueryKey = (supplierId?: string,) => {
return [
`/v1/quotation/supplier/${supplierId}/last-type`
] as const;
}
export const getGetSupplierLastTypeQueryOptions = <TData = Awaited<ReturnType<typeof getSupplierLastType>>, TError = void | HTTPValidationError>(supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierLastType>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetSupplierLastTypeQueryKey(supplierId);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSupplierLastType>>> = ({ signal }) => getSupplierLastType(supplierId, requestOptions, signal);
return { queryKey, queryFn, enabled: !!(supplierId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getSupplierLastType>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetSupplierLastTypeQueryResult = NonNullable<Awaited<ReturnType<typeof getSupplierLastType>>>
export type GetSupplierLastTypeQueryError = void | HTTPValidationError
export function useGetSupplierLastType<TData = Awaited<ReturnType<typeof getSupplierLastType>>, TError = void | HTTPValidationError>(
supplierId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierLastType>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getSupplierLastType>>,
TError,
Awaited<ReturnType<typeof getSupplierLastType>>
> , 'initialData'
>, request?: SecondParameter<typeof customFetch>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSupplierLastType<TData = Awaited<ReturnType<typeof getSupplierLastType>>, TError = void | HTTPValidationError>(
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierLastType>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getSupplierLastType>>,
TError,
Awaited<ReturnType<typeof getSupplierLastType>>
> , 'initialData'
>, request?: SecondParameter<typeof customFetch>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSupplierLastType<TData = Awaited<ReturnType<typeof getSupplierLastType>>, TError = void | HTTPValidationError>(
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierLastType>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary 협력사 직전 견적 유형
*/
export function useGetSupplierLastType<TData = Awaited<ReturnType<typeof getSupplierLastType>>, TError = void | HTTPValidationError>(
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierLastType>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetSupplierLastTypeQueryOptions(supplierId,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey ;
return query;
}
/**
@@ -1319,4 +1228,3 @@ export function useGetQuotation<TData = Awaited<ReturnType<typeof getQuotation>>