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
@@ -0,0 +1,366 @@
{
"code": 200,
"status": "success",
"message": "Get dashboard performance flock comparison successfully",
"meta": {
"page": 1,
"limit": 10,
"total_pages": 1,
"total_results": 1,
"filters": {
"start_date": "2025-12-01",
"end_date": "2025-12-31",
"analysis_mode": "COMPARASION",
"lokasi_ids": [1],
"flock_ids": [1, 2, 3],
"kandang_ids": []
}
},
"data": {
"statistics_data": [
{
"label": "HPP Global",
"value": 16200,
"percent_last_month": 15.5
},
{
"label": "Avg. Selling Price",
"value": 28300,
"percent_last_month": -50
},
{
"label": "FCR",
"value": 24.02,
"percent_last_month": 15.5
},
{
"label": "Mortality",
"value": 5,
"percent_last_month": -15.5
}
],
"charts": {
"flock": {
"series": [
{
"id": 1,
"label": "Flock Dago",
"unit": "%"
},
{
"id": 2,
"label": "Flock Sulanjana",
"unit": "%"
},
{
"id": 3,
"label": "Flock Garut 2",
"unit": "%"
}
],
"dataset": [
{
"week": 1,
"1": 18.5,
"2": 20.2,
"3": 17.8
},
{
"week": 2,
"1": 19.2,
"2": 21.5,
"3": 18.1
},
{
"week": 3,
"1": 20.1,
"2": 22.8,
"3": 18.5
},
{
"week": 4,
"1": 21.5,
"2": 24.0,
"3": 19.2
},
{
"week": 5,
"1": 22.8,
"2": 23.5,
"3": 20.4
},
{
"week": 6,
"1": 24.2,
"2": 22.1,
"3": 21.6
},
{
"week": 7,
"1": 25.8,
"2": 21.8,
"3": 22.9
},
{
"week": 8,
"1": 26.5,
"2": 22.4,
"3": 23.5
},
{
"week": 9,
"1": 26.2,
"2": 23.9,
"3": 24.1
},
{
"week": 10,
"1": 25.4,
"2": 24.8,
"3": 24.8
},
{
"week": 11,
"1": 24.8,
"2": 26.2,
"3": 25.4
},
{
"week": 12,
"1": 24.1,
"2": 27.5,
"3": 26.2
},
{
"week": 13,
"1": 23.5,
"2": 28.1,
"3": 27.5
},
{
"week": 14,
"1": 22.8,
"2": 27.4,
"3": 28.4
},
{
"week": 15,
"1": 21.9,
"2": 26.5,
"3": 29.1
},
{
"week": 16,
"1": 21.2,
"2": 25.8,
"3": 28.5
},
{
"week": 17,
"1": 20.8,
"2": 24.2,
"3": 27.2
},
{
"week": 18,
"1": 20.1,
"2": 23.1,
"3": 26.1
},
{
"week": 19,
"1": 19.5,
"2": 22.5,
"3": 25.8
},
{
"week": 20,
"1": 19.8,
"2": 21.9,
"3": 24.5
},
{
"week": 21,
"1": 20.5,
"2": 21.4,
"3": 23.2
},
{
"week": 22,
"1": 21.8,
"2": 21.0,
"3": 22.8
},
{
"week": 23,
"1": 22.5,
"2": 21.8,
"3": 21.9
},
{
"week": 24,
"1": 23.9,
"2": 22.5,
"3": 21.2
},
{
"week": 25,
"1": 24.5,
"2": 23.4,
"3": 20.5
},
{
"week": 26,
"1": 25.1,
"2": 24.8,
"3": 20.1
},
{
"week": 27,
"1": 26.8,
"2": 25.5,
"3": 19.8
},
{
"week": 28,
"1": 27.5,
"2": 26.2,
"3": 20.4
},
{
"week": 29,
"1": 27.2,
"2": 27.8,
"3": 21.5
},
{
"week": 30,
"1": 26.4,
"2": 28.5,
"3": 22.1
},
{
"week": 31,
"1": 25.8,
"2": 29.2,
"3": 23.4
},
{
"week": 32,
"1": 24.9,
"2": 28.8,
"3": 24.2
},
{
"week": 33,
"1": 24.2,
"2": 27.4,
"3": 25.8
},
{
"week": 34,
"1": 23.5,
"2": 26.5,
"3": 26.4
},
{
"week": 35,
"1": 22.8,
"2": 25.8,
"3": 27.1
},
{
"week": 36,
"1": 21.4,
"2": 24.2,
"3": 27.8
},
{
"week": 37,
"1": 20.5,
"2": 23.5,
"3": 28.2
},
{
"week": 38,
"1": 19.8,
"2": 22.8,
"3": 28.9
},
{
"week": 39,
"1": 19.2,
"2": 21.9,
"3": 27.5
},
{
"week": 40,
"1": 18.8,
"2": 21.2,
"3": 26.4
},
{
"week": 41,
"1": 18.5,
"2": 20.8,
"3": 25.2
},
{
"week": 42,
"1": 19.1,
"2": 20.5,
"3": 24.1
},
{
"week": 43,
"1": 20.2,
"2": 21.4,
"3": 23.5
},
{
"week": 44,
"1": 21.5,
"2": 22.8,
"3": 22.1
},
{
"week": 45,
"1": 22.8,
"2": 24.1,
"3": 21.8
},
{
"week": 46,
"1": 23.4,
"2": 25.2,
"3": 20.9
},
{
"week": 47,
"1": 24.1,
"2": 26.8,
"3": 20.1
},
{
"week": 48,
"1": 25.8,
"2": 27.5,
"3": 19.5
},
{
"week": 49,
"1": 26.2,
"2": 28.2,
"3": 19.1
},
{
"week": 50,
"1": 26.8,
"2": 28.8,
"3": 18.8
}
]
}
}
}
}
@@ -0,0 +1,366 @@
{
"code": 200,
"status": "success",
"message": "Get dashboard performance kandang comparison successfully",
"meta": {
"page": 1,
"limit": 10,
"total_pages": 1,
"total_results": 1,
"filters": {
"start_date": "2025-12-01",
"end_date": "2025-12-31",
"analysis_mode": "COMPARASION",
"lokasi_ids": [1],
"flock_ids": [1],
"kandang_ids": [1, 2, 3]
}
},
"data": {
"statistics_data": [
{
"label": "HPP Global",
"value": 16200,
"percent_last_month": 15.5
},
{
"label": "Avg. Selling Price",
"value": 28300,
"percent_last_month": -50
},
{
"label": "FCR",
"value": 24.02,
"percent_last_month": 15.5
},
{
"label": "Mortality",
"value": 5,
"percent_last_month": -15.5
}
],
"charts": {
"kandang": {
"series": [
{
"id": 1,
"label": "Kandang Dago",
"unit": "%"
},
{
"id": 2,
"label": "Kandang Sulanjana",
"unit": "%"
},
{
"id": 3,
"label": "Kandang Garut 2",
"unit": "%"
}
],
"dataset": [
{
"week": 1,
"1": 21.2,
"2": 19.5,
"3": 20.1
},
{
"week": 2,
"1": 22.5,
"2": 19.8,
"3": 20.4
},
{
"week": 3,
"1": 23.1,
"2": 20.2,
"3": 21.0
},
{
"week": 4,
"1": 24.5,
"2": 21.5,
"3": 22.1
},
{
"week": 5,
"1": 25.8,
"2": 22.4,
"3": 23.5
},
{
"week": 6,
"1": 26.2,
"2": 23.1,
"3": 24.8
},
{
"week": 7,
"1": 27.5,
"2": 24.5,
"3": 26.2
},
{
"week": 8,
"1": 28.1,
"2": 25.8,
"3": 27.5
},
{
"week": 9,
"1": 28.8,
"2": 26.2,
"3": 28.4
},
{
"week": 10,
"1": 29.1,
"2": 27.5,
"3": 28.1
},
{
"week": 11,
"1": 28.5,
"2": 28.1,
"3": 27.4
},
{
"week": 12,
"1": 27.2,
"2": 29.1,
"3": 26.5
},
{
"week": 13,
"1": 26.1,
"2": 28.5,
"3": 25.8
},
{
"week": 14,
"1": 25.8,
"2": 27.2,
"3": 24.2
},
{
"week": 15,
"1": 24.5,
"2": 26.1,
"3": 23.1
},
{
"week": 16,
"1": 23.2,
"2": 25.8,
"3": 22.5
},
{
"week": 17,
"1": 22.8,
"2": 24.5,
"3": 21.9
},
{
"week": 18,
"1": 21.9,
"2": 23.2,
"3": 21.0
},
{
"week": 19,
"1": 21.2,
"2": 22.8,
"3": 20.5
},
{
"week": 20,
"1": 20.5,
"2": 21.9,
"3": 19.8
},
{
"week": 21,
"1": 19.8,
"2": 21.2,
"3": 19.2
},
{
"week": 22,
"1": 20.4,
"2": 20.5,
"3": 18.5
},
{
"week": 23,
"1": 21.0,
"2": 19.8,
"3": 18.1
},
{
"week": 24,
"1": 22.1,
"2": 20.4,
"3": 17.8
},
{
"week": 25,
"1": 23.5,
"2": 21.0,
"3": 18.5
},
{
"week": 26,
"1": 24.8,
"2": 22.1,
"3": 19.2
},
{
"week": 27,
"1": 26.2,
"2": 23.5,
"3": 20.1
},
{
"week": 28,
"1": 27.5,
"2": 24.8,
"3": 21.5
},
{
"week": 29,
"1": 28.4,
"2": 26.2,
"3": 22.8
},
{
"week": 30,
"1": 28.1,
"2": 27.5,
"3": 24.2
},
{
"week": 31,
"1": 27.4,
"2": 28.4,
"3": 25.8
},
{
"week": 32,
"1": 26.5,
"2": 28.1,
"3": 26.5
},
{
"week": 33,
"1": 25.8,
"2": 27.4,
"3": 27.2
},
{
"week": 34,
"1": 24.2,
"2": 26.5,
"3": 28.1
},
{
"week": 35,
"1": 23.1,
"2": 25.8,
"3": 28.5
},
{
"week": 36,
"1": 22.5,
"2": 24.2,
"3": 29.1
},
{
"week": 37,
"1": 21.9,
"2": 23.1,
"3": 28.8
},
{
"week": 38,
"1": 21.0,
"2": 22.5,
"3": 28.1
},
{
"week": 39,
"1": 20.5,
"2": 21.9,
"3": 27.4
},
{
"week": 40,
"1": 19.8,
"2": 21.0,
"3": 26.5
},
{
"week": 41,
"1": 19.2,
"2": 20.5,
"3": 25.8
},
{
"week": 42,
"1": 18.5,
"2": 19.8,
"3": 24.2
},
{
"week": 43,
"1": 18.1,
"2": 19.2,
"3": 23.1
},
{
"week": 44,
"1": 17.8,
"2": 18.5,
"3": 22.5
},
{
"week": 45,
"1": 18.5,
"2": 18.1,
"3": 21.9
},
{
"week": 46,
"1": 19.2,
"2": 17.8,
"3": 21.0
},
{
"week": 47,
"1": 20.1,
"2": 18.5,
"3": 20.5
},
{
"week": 48,
"1": 21.5,
"2": 19.2,
"3": 19.8
},
{
"week": 49,
"1": 22.8,
"2": 20.1,
"3": 19.2
},
{
"week": 50,
"1": 24.2,
"2": 21.5,
"3": 18.5
}
]
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,15 @@
{
"statistics_data": [
{
"label": "HPP Global",
"value": 16200,
"percent_last_month": 15.5
},
{
"label": "Avg. Selling Price",
"value": 28300,
"percent_last_month": -50
}
],
"charts": {}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -5,35 +5,23 @@
* This file is auto-generated. Do not edit manually.
*/
import {
DashboardProductionStatisticsData,
DashboardProductionProductionChartsFlocks,
DashboardProductionProductionCharts,
DashboardProductionStandardProductionsStandards,
DashboardProductionStandardProductions,
DashboardProductionFcrDataFlock,
DashboardProductionEggWeights,
DashboardProductionFcrData,
DashboardProduction,
} from '../../types/api/dashboard/dashboard-production';
import { Dashboard } from '../../types/api/dashboard/dashboard';
import { BaseApiResponse } from '@/types/api/api-general';
import dummyData from './dashboard.production.dummy.json';
import dummyData from './dashboard.default.json';
/**
* Get dummy DashboardProduction data
* @returns Promise with BaseApiResponse containing DashboardProduction
*/
export async function getDummySingle(): Promise<
BaseApiResponse<DashboardProduction>
> {
export async function getDummySingle(): Promise<BaseApiResponse<Dashboard>> {
return new Promise((resolve) => {
setTimeout(() => {
resolve({
code: 200,
status: 'success',
message: 'Data retrieved successfully',
data: dummyData as unknown as DashboardProduction,
data: dummyData as unknown as Dashboard,
});
}, 500);
});
});
}