forked from eatvio/eatvio_app
feat(insights): added kbju fetching for analitics
This commit is contained in:
36
lib/features/insights/models/insights_response_model.dart
Normal file
36
lib/features/insights/models/insights_response_model.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:eatvio_app/features/insights/models/insights_payload_model.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'insights_response_model.freezed.dart';
|
||||
part 'insights_response_model.g.dart';
|
||||
|
||||
/// Ответ `GET /api/profile/insights[/{slug}]`: `{ "data": { weight, bmi, measure, daily, intra } }`.
|
||||
@freezed
|
||||
abstract class InsightsResponseModel with _$InsightsResponseModel {
|
||||
const factory InsightsResponseModel({required InsightsPayloadModel data}) =
|
||||
_InsightsResponseModel;
|
||||
|
||||
factory InsightsResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$InsightsResponseModelFromJson(json);
|
||||
}
|
||||
|
||||
/// Ответ `GET /api/profile/insights/intra` и `/insights/{slug}/intra`:
|
||||
/// `{ "data": { "intra": { ... } } }`.
|
||||
@freezed
|
||||
abstract class InsightsIntraResponseModel with _$InsightsIntraResponseModel {
|
||||
const factory InsightsIntraResponseModel({
|
||||
required InsightsIntraDataModel data,
|
||||
}) = _InsightsIntraResponseModel;
|
||||
|
||||
factory InsightsIntraResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$InsightsIntraResponseModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class InsightsIntraDataModel with _$InsightsIntraDataModel {
|
||||
const factory InsightsIntraDataModel({required IntraChartModel intra}) =
|
||||
_InsightsIntraDataModel;
|
||||
|
||||
factory InsightsIntraDataModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$InsightsIntraDataModelFromJson(json);
|
||||
}
|
||||
Reference in New Issue
Block a user