This commit is contained in:
@@ -7,6 +7,7 @@ class DashboardAnalyticDto with _$DashboardAnalyticDto {
|
||||
const factory DashboardAnalyticDto({
|
||||
@JsonKey(name: 'organization_id') String? organizationId,
|
||||
@JsonKey(name: 'outlet_id') String? outletId,
|
||||
@JsonKey(name: 'outlet_name') String? outletName,
|
||||
@JsonKey(name: 'date_from') String? dateFrom,
|
||||
@JsonKey(name: 'date_to') String? dateTo,
|
||||
@JsonKey(name: 'overview') DashboardOverviewDto? overview,
|
||||
@@ -22,6 +23,7 @@ class DashboardAnalyticDto with _$DashboardAnalyticDto {
|
||||
DashboardAnalytic toDomain() => DashboardAnalytic(
|
||||
organizationId: organizationId ?? '',
|
||||
outletId: outletId ?? '',
|
||||
outletName: outletName ?? '',
|
||||
dateFrom: dateFrom ?? '',
|
||||
dateTo: dateTo ?? '',
|
||||
overview: overview?.toDomain() ?? DashboardOverview.empty(),
|
||||
@@ -42,6 +44,9 @@ class DashboardOverviewDto with _$DashboardOverviewDto {
|
||||
@JsonKey(name: 'total_customers') int? totalCustomers,
|
||||
@JsonKey(name: 'voided_orders') int? voidedOrders,
|
||||
@JsonKey(name: 'refunded_orders') int? refundedOrders,
|
||||
@JsonKey(name: 'total_item_sold') int? totalItemSold,
|
||||
@JsonKey(name: 'total_low_stock') int? totalLowStock,
|
||||
@JsonKey(name: 'total_product_active') int? totalProductActive,
|
||||
}) = _DashboardOverviewDto;
|
||||
|
||||
factory DashboardOverviewDto.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -54,6 +59,9 @@ class DashboardOverviewDto with _$DashboardOverviewDto {
|
||||
totalCustomers: totalCustomers ?? 0,
|
||||
voidedOrders: voidedOrders ?? 0,
|
||||
refundedOrders: refundedOrders ?? 0,
|
||||
totalItemSold: totalItemSold ?? 0,
|
||||
totalLowStock: totalLowStock ?? 0,
|
||||
totalProductActive: totalProductActive ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user