feat(FE): slicing UI dashboard and define data types

This commit is contained in:
randy-ar
2026-01-09 16:48:38 +07:00
parent 64a0a9c8a8
commit 777b06c690
20 changed files with 5442 additions and 3450 deletions
-52
View File
@@ -1,52 +0,0 @@
export interface DashboardProduction {
statistics_data: DashboardProductionStatisticsData[];
production_charts: DashboardProductionProductionCharts[];
standard_productions: DashboardProductionStandardProductions[];
egg_weights: DashboardProductionEggWeights[];
fcr_data: DashboardProductionFcrData[];
}
export interface DashboardProductionFcrData {
flock: DashboardProductionFcrDataFlock;
fcr: number;
}
export interface DashboardProductionEggWeights {
flock: DashboardProductionFcrDataFlock;
weight: number;
}
export interface DashboardProductionStandardProductions {
week: number;
standards: DashboardProductionStandardProductionsStandards[];
flocks: DashboardProductionProductionChartsFlocks[];
}
export interface DashboardProductionProductionCharts {
date: string;
flocks: DashboardProductionProductionChartsFlocks[];
}
export interface DashboardProductionStatisticsData {
title: string;
value: number;
change: number;
period: string;
changeType: string;
}
export interface DashboardProductionFcrDataFlock {
id: number;
name: string;
}
export interface DashboardProductionStandardProductionsStandards {
name: string;
value: number;
}
export interface DashboardProductionProductionChartsFlocks {
id: number;
name: string;
data: number;
}
+50
View File
@@ -0,0 +1,50 @@
export interface Dashboard {
statistics_data: DashboardStatisticsData[];
charts: DashboardComparisonCharts | DashboardOverviewCharts;
}
export interface DashboardComparisonCharts {
location: DashboardCharts;
flock: DashboardCharts;
kandang: DashboardCharts;
}
export interface DashboardOverviewCharts {
body_weight: DashboardCharts;
performance: DashboardCharts;
fcr: DashboardCharts;
quality_control: DashboardCharts;
deplesi: DashboardCharts;
}
export interface DashboardCharts {
series: DashboardChartsSeries[];
dataset: DashboardChartsDataset[];
}
export interface DashboardStatisticsData {
label: string;
value: number;
percent_last_month: number;
}
export interface DashboardChartsDataset {
week: number;
// Index signature to support dynamic keys (series IDs) in comparison mode
[key: string | number]: number | undefined;
}
export interface DashboardChartsSeries {
id: string | number;
label: string;
unit: string;
}
export interface DashboardFilter {
start_date: string;
end_date: string;
analysis_mode: 'OVERVIEW' | 'COMPARISON';
location_ids: number[];
flock_ids: number[];
kandang_ids: number[];
}