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 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 json) => _$InsightsIntraResponseModelFromJson(json); } @freezed abstract class InsightsIntraDataModel with _$InsightsIntraDataModel { const factory InsightsIntraDataModel({required IntraChartModel intra}) = _InsightsIntraDataModel; factory InsightsIntraDataModel.fromJson(Map json) => _$InsightsIntraDataModelFromJson(json); }