[feat] negodata: 견적 목표가 산정 개편 + 협상 초청메일 + 카드 사용구분
[견적·목표가] - 목표가 산정 KTC 기준 정비(MD 우선, 없으면 인터넷최저가·매입가·판매가 중 최저 / 신규는 인터넷최저가만) - 인터넷 평균 수수료 0.078 상수화(견적설정 컬럼 제거) - 앵커링가 세션 저장 + 목표가 클릭 시 산정내역 모달 - 재생성 시 목표가·앵커링가 재계산 없이 직전 값 상속(KTC) - MD 제시가·협력사 유형(유통·제조·총판·기타) 입력 [협상카드] - 사용 구분(공통/신규견적전용/재견적전용) [협상 진행] - 협력사 초청 메일 발송(일괄/개별·재발송, 발송상태 표시) [기타] - 견적상세 창 닫기 버그 수정, 불필요한 컬럼 주석 정리 - DB: 기존 DB는 postgres-init/04-alter.sql 적용 필요(자동 마이그레이션 없음) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b42d084063
commit
019f3dbeac
51 files changed
+1263
-163
No files matched your search
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* nego_cards/wild_cards.usage_type 코드값. 카드가 적용되는 견적 구분.
|
||||
공통=신규·재 모두(기본), 신규전용=신규협상/신규견적(QuotationType 3·4), 재전용=재협상/재견적(1·2).
|
||||
* nego_cards/wild_cards.usage_type 코드값. 협상카드 사용 범위(신규/재 견적·협상 양쪽 적용).
|
||||
공통=모두 적용(기본), 신규견적전용, 재견적전용.
|
||||
*/
|
||||
export type CardUsageType = typeof CardUsageType[keyof typeof CardUsageType];
|
||||
|
||||
|
||||
@@ -28,6 +28,13 @@ export * from './chatMessageDataScript';
|
||||
export * from './chatMessageDataStep';
|
||||
export * from './chatSender';
|
||||
export * from './companyData';
|
||||
export * from './companyUserData';
|
||||
export * from './companyUserDataContactNumber';
|
||||
export * from './companyUserDataCreatedAt';
|
||||
export * from './companyUserDataEmail';
|
||||
export * from './companyUserDataLastAccessedAt';
|
||||
export * from './companyUserDataName';
|
||||
export * from './companyUserDataUpdatedAt';
|
||||
export * from './deliveryType';
|
||||
export * from './errorInfo';
|
||||
export * from './errorInfoCode';
|
||||
@@ -59,6 +66,7 @@ export * from './listCardsParams';
|
||||
export * from './listItemsParams';
|
||||
export * from './listQuotationsParams';
|
||||
export * from './listSuppliersParams';
|
||||
export * from './listUsersParams';
|
||||
export * from './quotationCardData';
|
||||
export * from './quotationCardDataCondition';
|
||||
export * from './quotationCardDataEditScript';
|
||||
@@ -93,7 +101,6 @@ export * from './quotationSettingDataUserId';
|
||||
export * from './quotationStatus';
|
||||
export * from './quotationType';
|
||||
export * from './reqCheckCodes';
|
||||
export * from './reqCreateAccount';
|
||||
export * from './reqCreateCard';
|
||||
export * from './reqCreateCardCondition';
|
||||
export * from './reqCreateCardEditScript';
|
||||
@@ -101,6 +108,7 @@ export * from './reqCreateCardMemo';
|
||||
export * from './reqCreateCardName';
|
||||
export * from './reqCreateCardNumber';
|
||||
export * from './reqCreateCardScript';
|
||||
export * from './reqCreateCompanyUser';
|
||||
export * from './reqCreateItem';
|
||||
export * from './reqCreateItemCategory';
|
||||
export * from './reqCreateItemCode';
|
||||
@@ -146,6 +154,12 @@ export * from './reqUpdateCardNumber';
|
||||
export * from './reqUpdateCardScript';
|
||||
export * from './reqUpdateCardStatus';
|
||||
export * from './reqUpdateCardUsageType';
|
||||
export * from './reqUpdateCompanyUser';
|
||||
export * from './reqUpdateCompanyUserContactNumber';
|
||||
export * from './reqUpdateCompanyUserEmail';
|
||||
export * from './reqUpdateCompanyUserName';
|
||||
export * from './reqUpdateCompanyUserPassword';
|
||||
export * from './reqUpdateCompanyUserStatus';
|
||||
export * from './reqUpdateItem';
|
||||
export * from './reqUpdateItemCategory';
|
||||
export * from './reqUpdateItemCategoryType';
|
||||
@@ -167,10 +181,14 @@ export * from './reqUpdateItemQuantityUnit';
|
||||
export * from './reqUpdateItemSellingPrice';
|
||||
export * from './reqUpdateItemSpec';
|
||||
export * from './reqUpdateItemVatYn';
|
||||
export * from './reqUpdateMe';
|
||||
export * from './reqUpdateMeContactNumber';
|
||||
export * from './reqUpdateMeEmail';
|
||||
export * from './reqUpdateMeName';
|
||||
export * from './reqUpdateMePassword';
|
||||
export * from './reqUpdateQuotationSetting';
|
||||
export * from './reqUpdateQuotationSettingAnchoringValue';
|
||||
export * from './reqUpdateQuotationSettingCardCount';
|
||||
export * from './reqUpdateQuotationSettingInternetAverageFee';
|
||||
export * from './reqUpdateQuotationSettingTargetMarginRate';
|
||||
export * from './reqUpdateSupplier';
|
||||
export * from './reqUpdateSupplierCode';
|
||||
@@ -186,13 +204,18 @@ export * from './resCardListMsg';
|
||||
export * from './resCardMsg';
|
||||
export * from './resCheckCodes';
|
||||
export * from './resCheckCodesMsg';
|
||||
export * from './resCreateAccount';
|
||||
export * from './resCreateAccountMsg';
|
||||
export * from './resCompanyUser';
|
||||
export * from './resCompanyUserList';
|
||||
export * from './resCompanyUserListMsg';
|
||||
export * from './resCompanyUserMsg';
|
||||
export * from './resCompanyUserUser';
|
||||
export * from './resCreateQuotation';
|
||||
export * from './resCreateQuotationMsg';
|
||||
export * from './resCreateQuotationQtId';
|
||||
export * from './resDeleteCard';
|
||||
export * from './resDeleteCardMsg';
|
||||
export * from './resDeleteCompanyUser';
|
||||
export * from './resDeleteCompanyUserMsg';
|
||||
export * from './resDeleteItem';
|
||||
export * from './resDeleteItemMsg';
|
||||
export * from './resDeleteQuotation';
|
||||
@@ -229,6 +252,8 @@ export * from './resMeContactNumber';
|
||||
export * from './resMeEmail';
|
||||
export * from './resMeMsg';
|
||||
export * from './resMeName';
|
||||
export * from './resNotifySessions';
|
||||
export * from './resNotifySessionsMsg';
|
||||
export * from './resQuotation';
|
||||
export * from './resQuotationCards';
|
||||
export * from './resQuotationCardsMsg';
|
||||
@@ -268,9 +293,11 @@ export * from './resSupplierSupplier';
|
||||
export * from './sessionData';
|
||||
export * from './sessionDataBidAt';
|
||||
export * from './sessionDataBidPrice';
|
||||
export * from './sessionDataEmailSentAt';
|
||||
export * from './sessionDataRejectDeliveryType';
|
||||
export * from './sessionDataRejectPrice';
|
||||
export * from './sessionDataRejectReason';
|
||||
export * from './sessionDataTargetAnchoringPrice';
|
||||
export * from './sessionStatus';
|
||||
export * from './supplierData';
|
||||
export * from './supplierDataCode';
|
||||
@@ -282,6 +309,7 @@ export * from './supplierDataPriority';
|
||||
export * from './supplierDataUpdatedAt';
|
||||
export * from './supplierType';
|
||||
export * from './userRole';
|
||||
export * from './userStatus';
|
||||
export * from './validationError';
|
||||
export * from './validationErrorCtx';
|
||||
export * from './validationErrorLocItem';
|
||||
@@ -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 ListUsersParams = {
|
||||
/**
|
||||
* 로그인ID/이름/이메일 검색
|
||||
*/
|
||||
search?: string | null;
|
||||
/**
|
||||
* @minimum 1
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* @minimum 1
|
||||
* @maximum 100
|
||||
*/
|
||||
size?: number;
|
||||
};
|
||||
@@ -13,7 +13,6 @@ export interface QuotationSettingData {
|
||||
user_id?: QuotationSettingDataUserId;
|
||||
target_margin_rate: number;
|
||||
anchoring_value: number;
|
||||
internet_average_fee?: number;
|
||||
card_count: number;
|
||||
created_at?: QuotationSettingDataCreatedAt;
|
||||
updated_at?: QuotationSettingDataUpdatedAt;
|
||||
|
||||
@@ -8,6 +8,5 @@
|
||||
export interface ReqCreateQuotationSetting {
|
||||
target_margin_rate: number;
|
||||
anchoring_value?: number;
|
||||
internet_average_fee?: number;
|
||||
card_count?: number;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ReqUpdateMeName } from './reqUpdateMeName';
|
||||
import type { ReqUpdateMeEmail } from './reqUpdateMeEmail';
|
||||
import type { ReqUpdateMeContactNumber } from './reqUpdateMeContactNumber';
|
||||
import type { ReqUpdateMePassword } from './reqUpdateMePassword';
|
||||
|
||||
export interface ReqUpdateMe {
|
||||
name?: ReqUpdateMeName;
|
||||
email?: ReqUpdateMeEmail;
|
||||
contact_number?: ReqUpdateMeContactNumber;
|
||||
password?: ReqUpdateMePassword;
|
||||
}
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ReqUpdateQuotationSettingInternetAverageFee = number | null;
|
||||
export type ReqUpdateMeContactNumber = 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 ReqUpdateMeEmail = 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 ReqUpdateMeName = 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 ReqUpdateMePassword = string | null;
|
||||
@@ -6,12 +6,10 @@
|
||||
*/
|
||||
import type { ReqUpdateQuotationSettingTargetMarginRate } from './reqUpdateQuotationSettingTargetMarginRate';
|
||||
import type { ReqUpdateQuotationSettingAnchoringValue } from './reqUpdateQuotationSettingAnchoringValue';
|
||||
import type { ReqUpdateQuotationSettingInternetAverageFee } from './reqUpdateQuotationSettingInternetAverageFee';
|
||||
import type { ReqUpdateQuotationSettingCardCount } from './reqUpdateQuotationSettingCardCount';
|
||||
|
||||
export interface ReqUpdateQuotationSetting {
|
||||
target_margin_rate?: ReqUpdateQuotationSettingTargetMarginRate;
|
||||
anchoring_value?: ReqUpdateQuotationSettingAnchoringValue;
|
||||
internet_average_fee?: ReqUpdateQuotationSettingInternetAverageFee;
|
||||
card_count?: ReqUpdateQuotationSettingCardCount;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 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 { ResNotifySessionsMsg } from './resNotifySessionsMsg';
|
||||
|
||||
export interface ResNotifySessions {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResNotifySessionsMsg;
|
||||
sent?: number;
|
||||
failed?: number;
|
||||
skipped?: number;
|
||||
total?: number;
|
||||
}
|
||||
@@ -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 ResNotifySessionsMsg = string | null;
|
||||
@@ -5,12 +5,14 @@
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { QuotationType } from './quotationType';
|
||||
import type { SessionDataTargetAnchoringPrice } from './sessionDataTargetAnchoringPrice';
|
||||
import type { SessionStatus } from './sessionStatus';
|
||||
import type { SessionDataBidPrice } from './sessionDataBidPrice';
|
||||
import type { SessionDataBidAt } from './sessionDataBidAt';
|
||||
import type { SessionDataRejectReason } from './sessionDataRejectReason';
|
||||
import type { SessionDataRejectPrice } from './sessionDataRejectPrice';
|
||||
import type { SessionDataRejectDeliveryType } from './sessionDataRejectDeliveryType';
|
||||
import type { SessionDataEmailSentAt } from './sessionDataEmailSentAt';
|
||||
|
||||
export interface SessionData {
|
||||
session_id: string;
|
||||
@@ -21,6 +23,7 @@ export interface SessionData {
|
||||
qt_round: number;
|
||||
qt_type: QuotationType;
|
||||
target_price: number;
|
||||
target_anchoring_price?: SessionDataTargetAnchoringPrice;
|
||||
status: SessionStatus;
|
||||
bid_price?: SessionDataBidPrice;
|
||||
bid_at?: SessionDataBidAt;
|
||||
@@ -28,5 +31,6 @@ export interface SessionData {
|
||||
reject_reason?: SessionDataRejectReason;
|
||||
reject_price?: SessionDataRejectPrice;
|
||||
reject_delivery_type?: SessionDataRejectDeliveryType;
|
||||
email_sent_at?: SessionDataEmailSentAt;
|
||||
url?: 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 SessionDataEmailSentAt = 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 SessionDataTargetAnchoringPrice = number | null;
|
||||
@@ -6,15 +6,16 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* suppliers.type 코드값(KTC 앵커링 기준). 0=기타는 매칭 실패 폴백용 — UI 선택지엔 미노출.
|
||||
* quotations.supplier_type 코드값. 없음(0,미지정)/유통(1)/제조(2)/총판(3).
|
||||
없음은 프론트 폼에 '없음'으로 노출. KTC 앵커링 코드(기타=0)와 매핑 시 0↔없음 대응.
|
||||
*/
|
||||
export type SupplierType = typeof SupplierType[keyof typeof SupplierType];
|
||||
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export const SupplierType = {
|
||||
NONE: 0,
|
||||
DISTRIBUTION: 1,
|
||||
MANUFACTURE: 2,
|
||||
SOLE_AGENCY: 3,
|
||||
ETC: 0,
|
||||
} as const;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* users.status 코드값.
|
||||
*/
|
||||
export type UserStatus = typeof UserStatus[keyof typeof UserStatus];
|
||||
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export const UserStatus = {
|
||||
ACTIVE: 1,
|
||||
INACTIVE: 2,
|
||||
} as const;
|
||||
@@ -31,6 +31,7 @@ import type {
|
||||
ResCreateQuotation,
|
||||
ResDeleteQuotation,
|
||||
ResLastSupplierType,
|
||||
ResNotifySessions,
|
||||
ResQuotation,
|
||||
ResQuotationCards,
|
||||
ResQuotationList,
|
||||
@@ -516,6 +517,68 @@ export function useGetQuotationSessions<TData = Awaited<ReturnType<typeof getQuo
|
||||
|
||||
|
||||
/**
|
||||
* @summary 협상 초청 메일 발송
|
||||
*/
|
||||
export const notifyQuotation = (
|
||||
qtId: string,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResNotifySessions>(
|
||||
{url: `/v1/quotation/${qtId}/notify`, method: 'POST', signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getNotifyQuotationMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof notifyQuotation>>, TError,{qtId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof notifyQuotation>>, TError,{qtId: string}, TContext> => {
|
||||
|
||||
const mutationKey = ['notifyQuotation'];
|
||||
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 notifyQuotation>>, {qtId: string}> = (props) => {
|
||||
const {qtId} = props ?? {};
|
||||
|
||||
return notifyQuotation(qtId,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type NotifyQuotationMutationResult = NonNullable<Awaited<ReturnType<typeof notifyQuotation>>>
|
||||
|
||||
export type NotifyQuotationMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 협상 초청 메일 발송
|
||||
*/
|
||||
export const useNotifyQuotation = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof notifyQuotation>>, TError,{qtId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof notifyQuotation>>,
|
||||
TError,
|
||||
{qtId: string},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getNotifyQuotationMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 채팅 상세
|
||||
*/
|
||||
export const getSessionChat = (
|
||||
@@ -608,6 +671,68 @@ export function useGetSessionChat<TData = Awaited<ReturnType<typeof getSessionCh
|
||||
|
||||
|
||||
/**
|
||||
* @summary 세션 초청 메일 재발송
|
||||
*/
|
||||
export const notifySession = (
|
||||
sessionId: string,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResNotifySessions>(
|
||||
{url: `/v1/quotation/session/${sessionId}/notify`, method: 'POST', signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getNotifySessionMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof notifySession>>, TError,{sessionId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof notifySession>>, TError,{sessionId: string}, TContext> => {
|
||||
|
||||
const mutationKey = ['notifySession'];
|
||||
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 notifySession>>, {sessionId: string}> = (props) => {
|
||||
const {sessionId} = props ?? {};
|
||||
|
||||
return notifySession(sessionId,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type NotifySessionMutationResult = NonNullable<Awaited<ReturnType<typeof notifySession>>>
|
||||
|
||||
export type NotifySessionMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 세션 초청 메일 재발송
|
||||
*/
|
||||
export const useNotifySession = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof notifySession>>, TError,{sessionId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof notifySession>>,
|
||||
TError,
|
||||
{sessionId: string},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getNotifySessionMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 낙찰 결과
|
||||
*/
|
||||
export const getQuotationResult = (
|
||||
|
||||
Reference in new issue
Block a user