mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE): Add chart data types to Uniformity API types
This commit is contained in:
+57
@@ -1,6 +1,62 @@
|
||||
import { BaseMetadata } from '@/types/api/api-general';
|
||||
import { BaseApproval } from '@/types/api/approval/approval';
|
||||
|
||||
// ==================== CHART DATA TYPES ====================
|
||||
export type WeightDistributionData = {
|
||||
weight: number;
|
||||
count: number;
|
||||
};
|
||||
|
||||
export type StatisticsData = {
|
||||
mean: number;
|
||||
standardDeviation: number;
|
||||
min: number;
|
||||
max: number;
|
||||
};
|
||||
|
||||
export type WeekBarChartData = {
|
||||
has_data: boolean;
|
||||
weight_distribution: WeightDistributionData[];
|
||||
ideal_range: {
|
||||
min: number;
|
||||
max: number;
|
||||
} | null;
|
||||
statistics: StatisticsData | null;
|
||||
};
|
||||
|
||||
export type BarChart = {
|
||||
current_week: number;
|
||||
all_weeks: Record<string, WeekBarChartData>;
|
||||
};
|
||||
|
||||
export type AvailableWeek = {
|
||||
week: number;
|
||||
uniformity_percentage: number;
|
||||
ideal_count: number;
|
||||
outside_ideal_count: number;
|
||||
total_count: number;
|
||||
has_data: boolean;
|
||||
};
|
||||
|
||||
export type WeekInfo = {
|
||||
total_weeks: number;
|
||||
weeks_with_data: number;
|
||||
current_week_index: number;
|
||||
has_prev_week: boolean;
|
||||
has_next_week: boolean;
|
||||
};
|
||||
|
||||
export type GaugeChart = {
|
||||
current_week: number;
|
||||
available_weeks: AvailableWeek[];
|
||||
week_info: WeekInfo;
|
||||
};
|
||||
|
||||
export type ChartData = {
|
||||
bar_chart: BarChart;
|
||||
gauge_chart: GaugeChart;
|
||||
};
|
||||
|
||||
// ==================== GET ALL RESPONSE ====================
|
||||
export type Uniformity = BaseMetadata & {
|
||||
id: number;
|
||||
@@ -21,6 +77,7 @@ export type Uniformity = BaseMetadata & {
|
||||
standard_mean_weight: number | null;
|
||||
standard_uniformity: number | null;
|
||||
created_at: string;
|
||||
chart_data?: ChartData;
|
||||
created_by: number;
|
||||
latest_approval?: BaseApproval;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user