[feat] negodata: 통계 페이지(성과 분석) 추가 — 파생 집계 API + recharts 차트
- 백엔드 GET /v1/statistics/summary: 회사/내견적 스코프, 최근 6개월 파생 집계(저장 X, DDL 0) - 지표: 총절감/절감률/낙찰률/앵커도달률/마감수/재견적라운드 + 월별추이·마감결과분해·참여율·유형별(협상/견적)·카테고리·카드빈도 - 프론트 recharts+shadcn Chart, 사이드바 통계 nav, /statistics Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc0e78ec73
commit
c32ee300e6
39 files changed
+2140
-1
No files matched your search
@@ -9,6 +9,7 @@ export * from './bodyUploadItemImageV1ItemImagePost';
|
||||
export * from './cardData';
|
||||
export * from './cardDataCondition';
|
||||
export * from './cardDataCreatedAt';
|
||||
export * from './cardDataCreatorName';
|
||||
export * from './cardDataEditScript';
|
||||
export * from './cardDataMemo';
|
||||
export * from './cardDataName';
|
||||
@@ -53,6 +54,7 @@ export * from './itemData';
|
||||
export * from './itemDataCategory';
|
||||
export * from './itemDataCode';
|
||||
export * from './itemDataCreatedAt';
|
||||
export * from './itemDataCreatorName';
|
||||
export * from './itemDataDeliveryFeeYn';
|
||||
export * from './itemDataDeliveryType';
|
||||
export * from './itemDataImageUrl';
|
||||
@@ -120,6 +122,7 @@ export * from './quotationSettingDataUpdatedAt';
|
||||
export * from './quotationSettingDataUserId';
|
||||
export * from './quotationStatus';
|
||||
export * from './quotationType';
|
||||
export * from './reqAwardQuotation';
|
||||
export * from './reqBulkMapByNames';
|
||||
export * from './reqCheckCodes';
|
||||
export * from './reqCreateCard';
|
||||
@@ -319,6 +322,8 @@ export * from './resRefreshTokenMsg';
|
||||
export * from './resSessionChat';
|
||||
export * from './resSessionChatMsg';
|
||||
export * from './resSessionChatSessionId';
|
||||
export * from './resStatisticsSummary';
|
||||
export * from './resStatisticsSummaryMsg';
|
||||
export * from './resSupplier';
|
||||
export * from './resSupplierItem';
|
||||
export * from './resSupplierItemList';
|
||||
@@ -348,9 +353,18 @@ export * from './sessionDataRejectDeliveryType';
|
||||
export * from './sessionDataRejectPrice';
|
||||
export * from './sessionDataRejectReason';
|
||||
export * from './sessionStatus';
|
||||
export * from './statCardUsage';
|
||||
export * from './statCategory';
|
||||
export * from './statKpi';
|
||||
export * from './statMonthPoint';
|
||||
export * from './statOutcome';
|
||||
export * from './statParticipation';
|
||||
export * from './statScope';
|
||||
export * from './statTypeRow';
|
||||
export * from './supplierData';
|
||||
export * from './supplierDataCode';
|
||||
export * from './supplierDataCreatedAt';
|
||||
export * from './supplierDataCreatorName';
|
||||
export * from './supplierDataManagerContactNumber';
|
||||
export * from './supplierDataManagerEmail';
|
||||
export * from './supplierDataManagerName';
|
||||
|
||||
@@ -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 { ResStatisticsSummaryMsg } from './resStatisticsSummaryMsg';
|
||||
import type { StatScope } from './statScope';
|
||||
|
||||
export interface ResStatisticsSummary {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResStatisticsSummaryMsg;
|
||||
company?: StatScope;
|
||||
mine?: StatScope;
|
||||
}
|
||||
@@ -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 ResStatisticsSummaryMsg = string | null;
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface StatCardUsage {
|
||||
type: string;
|
||||
label: string;
|
||||
uses?: number;
|
||||
avg_drop?: number;
|
||||
}
|
||||
@@ -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 StatCategory {
|
||||
category: string;
|
||||
savings?: number;
|
||||
count?: number;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface StatKpi {
|
||||
total_savings?: number;
|
||||
savings_rate?: number;
|
||||
award_rate?: number;
|
||||
anchor_reach_rate?: number;
|
||||
savings_delta_mom?: number;
|
||||
closed_count?: number;
|
||||
regen_avg_round?: number;
|
||||
}
|
||||
@@ -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 StatMonthPoint {
|
||||
month: string;
|
||||
savings?: number;
|
||||
rate?: number;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface StatOutcome {
|
||||
awarded?: number;
|
||||
open_price?: number;
|
||||
open_equal?: number;
|
||||
open_noshow?: number;
|
||||
open_reject?: number;
|
||||
}
|
||||
@@ -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 StatParticipation {
|
||||
bid?: number;
|
||||
no_participate?: number;
|
||||
rejected?: number;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { StatKpi } from './statKpi';
|
||||
import type { StatMonthPoint } from './statMonthPoint';
|
||||
import type { StatOutcome } from './statOutcome';
|
||||
import type { StatParticipation } from './statParticipation';
|
||||
import type { StatTypeRow } from './statTypeRow';
|
||||
import type { StatCategory } from './statCategory';
|
||||
import type { StatCardUsage } from './statCardUsage';
|
||||
|
||||
export interface StatScope {
|
||||
kpi?: StatKpi;
|
||||
trend?: StatMonthPoint[];
|
||||
outcome?: StatOutcome;
|
||||
participation?: StatParticipation;
|
||||
type_split?: StatTypeRow[];
|
||||
categories?: StatCategory[];
|
||||
cards?: StatCardUsage[];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface StatTypeRow {
|
||||
label: string;
|
||||
award_rate?: number;
|
||||
avg_savings?: number;
|
||||
count?: number;
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
useQuery
|
||||
} from '@tanstack/react-query';
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseQueryOptions,
|
||||
UseQueryResult
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
import type {
|
||||
ResStatisticsSummary
|
||||
} from '.././model';
|
||||
|
||||
import { customFetch } from '../../mutator/custom-fetch';
|
||||
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @summary 통계 요약(회사 전체 + 내 견적)
|
||||
*/
|
||||
export const getStatisticsSummary = (
|
||||
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResStatisticsSummary>(
|
||||
{url: `/v1/statistics/summary`, method: 'GET', signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetStatisticsSummaryQueryKey = () => {
|
||||
return [
|
||||
`/v1/statistics/summary`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetStatisticsSummaryQueryOptions = <TData = Awaited<ReturnType<typeof getStatisticsSummary>>, TError = void>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getStatisticsSummary>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetStatisticsSummaryQueryKey();
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getStatisticsSummary>>> = ({ signal }) => getStatisticsSummary(requestOptions, signal);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getStatisticsSummary>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetStatisticsSummaryQueryResult = NonNullable<Awaited<ReturnType<typeof getStatisticsSummary>>>
|
||||
export type GetStatisticsSummaryQueryError = void
|
||||
|
||||
|
||||
export function useGetStatisticsSummary<TData = Awaited<ReturnType<typeof getStatisticsSummary>>, TError = void>(
|
||||
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getStatisticsSummary>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getStatisticsSummary>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getStatisticsSummary>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetStatisticsSummary<TData = Awaited<ReturnType<typeof getStatisticsSummary>>, TError = void>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getStatisticsSummary>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getStatisticsSummary>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getStatisticsSummary>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetStatisticsSummary<TData = Awaited<ReturnType<typeof getStatisticsSummary>>, TError = void>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getStatisticsSummary>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary 통계 요약(회사 전체 + 내 견적)
|
||||
*/
|
||||
|
||||
export function useGetStatisticsSummary<TData = Awaited<ReturnType<typeof getStatisticsSummary>>, TError = void>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getStatisticsSummary>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetStatisticsSummaryQueryOptions(options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey ;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user