feat(negodata/front): PriceUpdateModal 데모 → LPS 실연동
- 가짜 setTimeout 애니메이션 제거 — 상품별 POST lowest-price(큐 접수, duplicated 는 결과 대기 합류) 후 GET 5초 폴링(서버가 조회 시 lps_db 증분 동기화를 겸하므로 폴링이 곧 수집) - 요청 시각 이후 crawl_end_time 이력만 이번 결과로 인정, 완료/미발견 로그 구분(emerald/amber), 5분 대기초과분은 주기 동기화 자동반영 안내 - 종료 시 /v1/item/list invalidate → 테이블 인터넷 최저가 컬럼 갱신 - 닫기 = 폴링만 중단(서버 검색은 계속됨을 UI 에 명시) - orval 재생성: lowest-price 응답 타입화(LowestPriceEntry·lowest_price) 검증: tsc 통과, vite build 통과 (API 흐름 자체는 ③ e2e 로 검증됨) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
28b4a9e797
commit
3171311746
9 files changed
+175
-49
No files matched your search
@@ -644,7 +644,8 @@ export const useDeleteItem = <TError = void | HTTPValidationError,
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 최저가 수집 요청(스텁)
|
||||
* 상품 1건을 LPS 에 즉시 검색 요청(수동 트리거, manual 우선순위). 결과는 GET lowest-price 폴링.
|
||||
* @summary 최저가 수집 요청
|
||||
*/
|
||||
export const triggerLowestPrice = (
|
||||
itemId: string,
|
||||
@@ -690,7 +691,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
export type TriggerLowestPriceMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 최저가 수집 요청(스텁)
|
||||
* @summary 최저가 수집 요청
|
||||
*/
|
||||
export const useTriggerLowestPrice = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof triggerLowestPrice>>, TError,{itemId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
@@ -706,7 +707,9 @@ export const useTriggerLowestPrice = <TError = void | HTTPValidationError,
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 최저가 수집 결과(스텁)
|
||||
* 대표 최저가(items.internet_lowest_price) + 최근 수집 이력(최신순).
|
||||
조회 전에 lps_db 증분 동기화를 한 번 수행해 5분 크론을 기다리지 않는다(멱등·저비용).
|
||||
* @summary 최저가 수집 결과
|
||||
*/
|
||||
export const getLowestPrice = (
|
||||
itemId: string,
|
||||
@@ -777,7 +780,7 @@ export function useGetLowestPrice<TData = Awaited<ReturnType<typeof getLowestPri
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary 최저가 수집 결과(스텁)
|
||||
* @summary 최저가 수집 결과
|
||||
*/
|
||||
|
||||
export function useGetLowestPrice<TData = Awaited<ReturnType<typeof getLowestPrice>>, TError = void | HTTPValidationError>(
|
||||
|
||||
@@ -78,6 +78,10 @@ export * from './listNotificationsParams';
|
||||
export * from './listQuotationsParams';
|
||||
export * from './listSuppliersParams';
|
||||
export * from './listUsersParams';
|
||||
export * from './lowestPriceEntry';
|
||||
export * from './lowestPriceEntryCrawlEndTime';
|
||||
export * from './lowestPriceEntryFailReason';
|
||||
export * from './lowestPriceEntryLpPrice';
|
||||
export * from './notificationData';
|
||||
export * from './notificationDataCreatedAt';
|
||||
export * from './notificationDataData';
|
||||
@@ -278,6 +282,7 @@ export * from './resItemSupplyTypeListMsg';
|
||||
export * from './resLogin';
|
||||
export * from './resLoginMsg';
|
||||
export * from './resLowestPriceResult';
|
||||
export * from './resLowestPriceResultLowestPrice';
|
||||
export * from './resLowestPriceResultMsg';
|
||||
export * from './resLowestPriceTrigger';
|
||||
export * from './resLowestPriceTriggerMsg';
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { LowestPriceEntryLpPrice } from './lowestPriceEntryLpPrice';
|
||||
import type { LowestPriceEntryFailReason } from './lowestPriceEntryFailReason';
|
||||
import type { LowestPriceEntryCrawlEndTime } from './lowestPriceEntryCrawlEndTime';
|
||||
|
||||
/**
|
||||
* 최저가 수집 이력 1건(partner.item_internet_lowest_prices).
|
||||
*/
|
||||
export interface LowestPriceEntry {
|
||||
lp_price?: LowestPriceEntryLpPrice;
|
||||
website?: number;
|
||||
success_yn?: boolean;
|
||||
fail_reason?: LowestPriceEntryFailReason;
|
||||
crawl_end_time?: LowestPriceEntryCrawlEndTime;
|
||||
}
|
||||
@@ -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 LowestPriceEntryCrawlEndTime = 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 LowestPriceEntryFailReason = 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 LowestPriceEntryLpPrice = number | null;
|
||||
@@ -6,11 +6,14 @@
|
||||
*/
|
||||
import type { ErrorInfo } from './errorInfo';
|
||||
import type { ResLowestPriceResultMsg } from './resLowestPriceResultMsg';
|
||||
import type { ResLowestPriceResultLowestPrice } from './resLowestPriceResultLowestPrice';
|
||||
import type { LowestPriceEntry } from './lowestPriceEntry';
|
||||
|
||||
export interface ResLowestPriceResult {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResLowestPriceResultMsg;
|
||||
item_id?: string;
|
||||
results?: unknown[];
|
||||
lowest_price?: ResLowestPriceResultLowestPrice;
|
||||
results?: LowestPriceEntry[];
|
||||
message?: 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 ResLowestPriceResultLowestPrice = number | null;
|
||||
Reference in new issue
Block a user