53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import { FeedWastageStats, WastageHotspot, FeedWastageAlert, WastageDataPoint } from '../types';
|
|
|
|
export const initialFeedWastageStats: FeedWastageStats = {
|
|
currentWastage: { value: 4.8, unit: '%', status: 'warning' },
|
|
totalWastedKg: { value: 125, unit: 'kg/hari' },
|
|
estimatedLoss: { value: 1875000, unit: 'IDR/hari' },
|
|
criticalZones: { value: 3, unit: 'Zona' },
|
|
};
|
|
|
|
export const initialWastageHotspots: WastageHotspot[] = Array.from({ length: 48 }, (_, i) => {
|
|
const rand = Math.random();
|
|
let level: 'low' | 'medium' | 'high' = 'low';
|
|
if (rand > 0.9) level = 'high';
|
|
else if (rand > 0.7) level = 'medium';
|
|
return {
|
|
id: `Z-${i + 1}`,
|
|
level,
|
|
};
|
|
});
|
|
|
|
export const initialWastageAlerts: FeedWastageAlert[] = [
|
|
{
|
|
id: 'fw-1',
|
|
location: 'Kandang C / Lt 1',
|
|
wastageLevel: 7.2,
|
|
timestamp: new Date(Date.now() - 15 * 60 * 1000),
|
|
message: 'Pemborosan pakan terdeteksi di atas ambang batas kritis.',
|
|
},
|
|
{
|
|
id: 'fw-2',
|
|
location: 'Kandang A / Lt 2',
|
|
wastageLevel: 5.5,
|
|
timestamp: new Date(Date.now() - 2 * 60 * 60 * 1000),
|
|
message: 'Pemborosan pakan terdeteksi di atas ambang batas normal.',
|
|
},
|
|
{
|
|
id: 'fw-3',
|
|
location: 'Kandang K-01',
|
|
wastageLevel: 6.1,
|
|
timestamp: new Date(Date.now() - 5 * 60 * 60 * 1000),
|
|
message: 'Pemborosan pakan terdeteksi di atas ambang batas normal.',
|
|
},
|
|
];
|
|
|
|
export const initialWastageHistory: WastageDataPoint[] = Array.from({ length: 7 }, (_, i) => {
|
|
const date = new Date();
|
|
date.setDate(date.getDate() - (6 - i));
|
|
return {
|
|
date: date.toLocaleDateString('id-ID', { day: '2-digit', month: 'short' }),
|
|
percentage: 4.5 + Math.random() * 1.5 - 0.5,
|
|
};
|
|
});
|