feat: inventory
This commit is contained in:
@@ -257,3 +257,131 @@ Map<String, dynamic> _$$CategoryAnalyticItemDtoImplToJson(
|
||||
'product_count': instance.productCount,
|
||||
'order_count': instance.orderCount,
|
||||
};
|
||||
|
||||
_$InventoryAnalyticDtoImpl _$$InventoryAnalyticDtoImplFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _$InventoryAnalyticDtoImpl(
|
||||
summary: json['summary'] == null
|
||||
? null
|
||||
: InventorySummaryDto.fromJson(json['summary'] as Map<String, dynamic>),
|
||||
products: (json['products'] as List<dynamic>?)
|
||||
?.map((e) => InventoryProductDto.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
ingredients: (json['ingredients'] as List<dynamic>?)
|
||||
?.map((e) => InventoryIngredientDto.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$InventoryAnalyticDtoImplToJson(
|
||||
_$InventoryAnalyticDtoImpl instance,
|
||||
) => <String, dynamic>{
|
||||
'summary': instance.summary,
|
||||
'products': instance.products,
|
||||
'ingredients': instance.ingredients,
|
||||
};
|
||||
|
||||
_$InventorySummaryDtoImpl _$$InventorySummaryDtoImplFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _$InventorySummaryDtoImpl(
|
||||
totalProducts: (json['total_products'] as num?)?.toInt(),
|
||||
totalIngredients: (json['total_ingredients'] as num?)?.toInt(),
|
||||
totalValue: (json['total_value'] as num?)?.toInt(),
|
||||
lowStockProducts: (json['low_stock_products'] as num?)?.toInt(),
|
||||
lowStockIngredients: (json['low_stock_ingredients'] as num?)?.toInt(),
|
||||
zeroStockProducts: (json['zero_stock_products'] as num?)?.toInt(),
|
||||
zeroStockIngredients: (json['zero_stock_ingredients'] as num?)?.toInt(),
|
||||
totalSoldProducts: (json['total_sold_products'] as num?)?.toInt(),
|
||||
totalSoldIngredients: (json['total_sold_ingredients'] as num?)?.toInt(),
|
||||
outletId: json['outlet_id'] as String?,
|
||||
outletName: json['outlet_name'] as String?,
|
||||
generatedAt: json['generated_at'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$InventorySummaryDtoImplToJson(
|
||||
_$InventorySummaryDtoImpl instance,
|
||||
) => <String, dynamic>{
|
||||
'total_products': instance.totalProducts,
|
||||
'total_ingredients': instance.totalIngredients,
|
||||
'total_value': instance.totalValue,
|
||||
'low_stock_products': instance.lowStockProducts,
|
||||
'low_stock_ingredients': instance.lowStockIngredients,
|
||||
'zero_stock_products': instance.zeroStockProducts,
|
||||
'zero_stock_ingredients': instance.zeroStockIngredients,
|
||||
'total_sold_products': instance.totalSoldProducts,
|
||||
'total_sold_ingredients': instance.totalSoldIngredients,
|
||||
'outlet_id': instance.outletId,
|
||||
'outlet_name': instance.outletName,
|
||||
'generated_at': instance.generatedAt,
|
||||
};
|
||||
|
||||
_$InventoryProductDtoImpl _$$InventoryProductDtoImplFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _$InventoryProductDtoImpl(
|
||||
id: json['id'] as String?,
|
||||
productId: json['product_id'] as String?,
|
||||
productName: json['product_name'] as String?,
|
||||
categoryName: json['category_name'] as String?,
|
||||
quantity: (json['quantity'] as num?)?.toInt(),
|
||||
reorderLevel: (json['reorder_level'] as num?)?.toInt(),
|
||||
unitCost: (json['unit_cost'] as num?)?.toInt(),
|
||||
totalValue: (json['total_value'] as num?)?.toInt(),
|
||||
totalIn: (json['total_in'] as num?)?.toInt(),
|
||||
totalOut: (json['total_out'] as num?)?.toInt(),
|
||||
isLowStock: json['is_low_stock'] as bool?,
|
||||
isZeroStock: json['is_zero_stock'] as bool?,
|
||||
updatedAt: json['updated_at'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$InventoryProductDtoImplToJson(
|
||||
_$InventoryProductDtoImpl instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product_id': instance.productId,
|
||||
'product_name': instance.productName,
|
||||
'category_name': instance.categoryName,
|
||||
'quantity': instance.quantity,
|
||||
'reorder_level': instance.reorderLevel,
|
||||
'unit_cost': instance.unitCost,
|
||||
'total_value': instance.totalValue,
|
||||
'total_in': instance.totalIn,
|
||||
'total_out': instance.totalOut,
|
||||
'is_low_stock': instance.isLowStock,
|
||||
'is_zero_stock': instance.isZeroStock,
|
||||
'updated_at': instance.updatedAt,
|
||||
};
|
||||
|
||||
_$InventoryIngredientDtoImpl _$$InventoryIngredientDtoImplFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _$InventoryIngredientDtoImpl(
|
||||
id: json['id'] as String?,
|
||||
ingredientId: json['ingredient_id'] as String?,
|
||||
ingredientName: json['ingredient_name'] as String?,
|
||||
unitName: json['unit_name'] as String?,
|
||||
quantity: (json['quantity'] as num?)?.toInt(),
|
||||
reorderLevel: (json['reorder_level'] as num?)?.toInt(),
|
||||
unitCost: (json['unit_cost'] as num?)?.toInt(),
|
||||
totalValue: (json['total_value'] as num?)?.toInt(),
|
||||
totalIn: (json['total_in'] as num?)?.toInt(),
|
||||
totalOut: (json['total_out'] as num?)?.toInt(),
|
||||
isLowStock: json['is_low_stock'] as bool?,
|
||||
isZeroStock: json['is_zero_stock'] as bool?,
|
||||
updatedAt: json['updated_at'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$InventoryIngredientDtoImplToJson(
|
||||
_$InventoryIngredientDtoImpl instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'ingredient_id': instance.ingredientId,
|
||||
'ingredient_name': instance.ingredientName,
|
||||
'unit_name': instance.unitName,
|
||||
'quantity': instance.quantity,
|
||||
'reorder_level': instance.reorderLevel,
|
||||
'unit_cost': instance.unitCost,
|
||||
'total_value': instance.totalValue,
|
||||
'total_in': instance.totalIn,
|
||||
'total_out': instance.totalOut,
|
||||
'is_low_stock': instance.isLowStock,
|
||||
'is_zero_stock': instance.isZeroStock,
|
||||
'updated_at': instance.updatedAt,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user