From b9ab5238ba2bf14933f97cd384f10ed14824fb3a Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Fri, 13 Mar 2026 15:07:39 +0100 Subject: [PATCH] Add stat screen (wip) to be tested + ia assistant activation for mobile (todo add to tablet) + SERVICE GENERATION --- .../app_configuration_link_screen.dart | 39 + .../Section/SubSection/Game/game_config.dart | 2 - lib/Screens/Main/main_screen.dart | 12 + lib/Screens/Statistics/statistics_screen.dart | 513 ++++++ lib/api/openApiTest.dart | 2 +- lib/api/swagger.yaml | 1509 ++++++++++++----- lib/client.dart | 4 + manager_api_new/.openapi-generator/FILES | 51 + manager_api_new/README.md | 29 +- manager_api_new/doc/AIApi.md | 57 + manager_api_new/doc/AgendaEventStatDTO.md | 17 + manager_api_new/doc/AiCardDTO.md | 17 + manager_api_new/doc/AiChatMessage.md | 16 + manager_api_new/doc/AiChatRequest.md | 20 + manager_api_new/doc/AiChatResponse.md | 17 + .../doc/AiChatResponseNavigation.md | 17 + ...AppConfigurationLinkApplicationInstance.md | 1 + manager_api_new/doc/ApplicationInstance.md | 1 + manager_api_new/doc/ApplicationInstanceDTO.md | 2 + manager_api_new/doc/DayStatDTO.md | 18 + manager_api_new/doc/GameDTO.md | 1 + manager_api_new/doc/GameStatDTO.md | 17 + manager_api_new/doc/GuidedPathDTO.md | 1 + manager_api_new/doc/Instance.md | 1 + manager_api_new/doc/InstanceDTO.md | 1 + manager_api_new/doc/MapDTO.md | 2 + manager_api_new/doc/NavigationActionDTO.md | 17 + manager_api_new/doc/PoiStatDTO.md | 18 + manager_api_new/doc/ProblemDetails.md | 20 + manager_api_new/doc/QuizStatDTO.md | 19 + manager_api_new/doc/SectionStatDTO.md | 18 + manager_api_new/doc/StatsApi.md | 106 ++ manager_api_new/doc/StatsSummaryDTO.md | 24 + manager_api_new/doc/VisitEventDTO.md | 24 + manager_api_new/lib/api.dart | 12 + manager_api_new/lib/api/ai_api.dart | 72 + manager_api_new/lib/api/stats_api.dart | 93 + manager_api_new/lib/api_client.dart | 30 + manager_api_new/lib/model/ai_card_dto.dart | 146 ++ .../lib/model/ai_chat_message.dart | 132 ++ .../lib/model/ai_chat_request.dart | 185 ++ .../lib/model/ai_chat_response.dart | 146 ++ .../model/ai_chat_response_navigation.dart | 146 ++ .../lib/model/app_type_extensions.dart | 22 + .../lib/model/application_instance.dart | 23 +- .../lib/model/application_instance_dto.dart | 31 +- .../lib/model/guided_path_dto.dart | 12 +- manager_api_new/lib/model/instance.dart | 23 +- manager_api_new/lib/model/instance_dto.dart | 13 +- .../lib/model/navigation_action_dto.dart | 146 ++ .../lib/model/problem_details.dart | 176 ++ .../lib/model/stats_summary_dto.dart | 269 +++ .../lib/model/visit_event_dto.dart | 238 +++ .../test/agenda_event_stat_dto_test.dart | 34 + manager_api_new/test/ai_api_test.dart | 24 + manager_api_new/test/ai_card_dto_test.dart | 34 + .../test/ai_chat_message_test.dart | 29 + .../test/ai_chat_request_test.dart | 49 + .../ai_chat_response_navigation_test.dart | 34 + .../test/ai_chat_response_test.dart | 34 + manager_api_new/test/day_stat_dto_test.dart | 39 + manager_api_new/test/game_stat_dto_test.dart | 34 + .../test/navigation_action_dto_test.dart | 34 + manager_api_new/test/poi_stat_dto_test.dart | 39 + .../test/problem_details_test.dart | 49 + manager_api_new/test/quiz_stat_dto_test.dart | 44 + .../test/section_stat_dto_test.dart | 39 + manager_api_new/test/stats_api_test.dart | 29 + .../test/stats_summary_dto_test.dart | 69 + .../test/visit_event_dto_test.dart | 69 + pubspec.lock | 16 + pubspec.yaml | 1 + 72 files changed, 4745 insertions(+), 483 deletions(-) create mode 100644 lib/Screens/Statistics/statistics_screen.dart create mode 100644 manager_api_new/doc/AIApi.md create mode 100644 manager_api_new/doc/AgendaEventStatDTO.md create mode 100644 manager_api_new/doc/AiCardDTO.md create mode 100644 manager_api_new/doc/AiChatMessage.md create mode 100644 manager_api_new/doc/AiChatRequest.md create mode 100644 manager_api_new/doc/AiChatResponse.md create mode 100644 manager_api_new/doc/AiChatResponseNavigation.md create mode 100644 manager_api_new/doc/DayStatDTO.md create mode 100644 manager_api_new/doc/GameStatDTO.md create mode 100644 manager_api_new/doc/NavigationActionDTO.md create mode 100644 manager_api_new/doc/PoiStatDTO.md create mode 100644 manager_api_new/doc/ProblemDetails.md create mode 100644 manager_api_new/doc/QuizStatDTO.md create mode 100644 manager_api_new/doc/SectionStatDTO.md create mode 100644 manager_api_new/doc/StatsApi.md create mode 100644 manager_api_new/doc/StatsSummaryDTO.md create mode 100644 manager_api_new/doc/VisitEventDTO.md create mode 100644 manager_api_new/lib/api/ai_api.dart create mode 100644 manager_api_new/lib/api/stats_api.dart create mode 100644 manager_api_new/lib/model/ai_card_dto.dart create mode 100644 manager_api_new/lib/model/ai_chat_message.dart create mode 100644 manager_api_new/lib/model/ai_chat_request.dart create mode 100644 manager_api_new/lib/model/ai_chat_response.dart create mode 100644 manager_api_new/lib/model/ai_chat_response_navigation.dart create mode 100644 manager_api_new/lib/model/app_type_extensions.dart create mode 100644 manager_api_new/lib/model/navigation_action_dto.dart create mode 100644 manager_api_new/lib/model/problem_details.dart create mode 100644 manager_api_new/lib/model/stats_summary_dto.dart create mode 100644 manager_api_new/lib/model/visit_event_dto.dart create mode 100644 manager_api_new/test/agenda_event_stat_dto_test.dart create mode 100644 manager_api_new/test/ai_api_test.dart create mode 100644 manager_api_new/test/ai_card_dto_test.dart create mode 100644 manager_api_new/test/ai_chat_message_test.dart create mode 100644 manager_api_new/test/ai_chat_request_test.dart create mode 100644 manager_api_new/test/ai_chat_response_navigation_test.dart create mode 100644 manager_api_new/test/ai_chat_response_test.dart create mode 100644 manager_api_new/test/day_stat_dto_test.dart create mode 100644 manager_api_new/test/game_stat_dto_test.dart create mode 100644 manager_api_new/test/navigation_action_dto_test.dart create mode 100644 manager_api_new/test/poi_stat_dto_test.dart create mode 100644 manager_api_new/test/problem_details_test.dart create mode 100644 manager_api_new/test/quiz_stat_dto_test.dart create mode 100644 manager_api_new/test/section_stat_dto_test.dart create mode 100644 manager_api_new/test/stats_api_test.dart create mode 100644 manager_api_new/test/stats_summary_dto_test.dart create mode 100644 manager_api_new/test/visit_event_dto_test.dart diff --git a/lib/Screens/Applications/app_configuration_link_screen.dart b/lib/Screens/Applications/app_configuration_link_screen.dart index 81a6f90..70ec2ed 100644 --- a/lib/Screens/Applications/app_configuration_link_screen.dart +++ b/lib/Screens/Applications/app_configuration_link_screen.dart @@ -285,6 +285,45 @@ class _AppConfigurationLinkScreenState extends State ), ), ), + // Assistant IA — visible uniquement si l'instance a la fonctionnalité + if (managerAppContext.instanceDTO?.isAssistant == true) + Container( + width: elementWidth, + height: elementHeight, + child: Center( + child: StatefulBuilder( + builder: (context, localSetState) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Assistant IA :", style: TextStyle(fontSize: 16)), + Switch( + activeThumbColor: kPrimaryColor, + inactiveThumbColor: kBodyTextColor, + inactiveTrackColor: kSecond, + hoverColor: kPrimaryColor.withValues(alpha: 0.2), + value: _applicationInstanceDTO.isAssistant ?? false, + onChanged: (bool newValue) async { + try { + _applicationInstanceDTO.isAssistant = newValue; + var applicationLink = await updateApplicationInstance(appContext, _applicationInstanceDTO); + if (applicationLink != null) { + localSetState(() { + _applicationInstanceDTO.isAssistant = applicationLink.isAssistant; + }); + showNotification(kSuccess, kWhite, "Application mobile mise à jour succès", context, null); + } + } catch (e) { + showNotification(kError, kWhite, "Une erreur est survenue", context, null); + } + }, + ), + ], + ); + }, + ), + ), + ), ], ), ), diff --git a/lib/Screens/Configurations/Section/SubSection/Game/game_config.dart b/lib/Screens/Configurations/Section/SubSection/Game/game_config.dart index 258f9a9..5945140 100644 --- a/lib/Screens/Configurations/Section/SubSection/Game/game_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Game/game_config.dart @@ -203,7 +203,6 @@ class _GameConfigState extends State { NumberInputContainer( label: "Lignes :", initialValue: gameDTO.rows ?? 3, - color: kPrimaryColor, isSmall: true, onChanged: (String value) { setState(() { @@ -215,7 +214,6 @@ class _GameConfigState extends State { NumberInputContainer( label: "Colonnes :", initialValue: gameDTO.cols ?? 3, - color: kPrimaryColor, isSmall: true, onChanged: (String value) { setState(() { diff --git a/lib/Screens/Main/main_screen.dart b/lib/Screens/Main/main_screen.dart index 5dc499b..7d8cfee 100644 --- a/lib/Screens/Main/main_screen.dart +++ b/lib/Screens/Main/main_screen.dart @@ -11,6 +11,7 @@ import 'package:manager_app/Models/menuSection.dart'; import 'package:manager_app/Screens/Configurations/configurations_screen.dart'; import 'package:manager_app/Screens/Kiosk_devices/kiosk_screen.dart'; import 'package:manager_app/Screens/Resources/resources_screen.dart'; +import 'package:manager_app/Screens/Statistics/statistics_screen.dart'; import 'package:manager_app/Screens/Applications/app_configuration_link_screen.dart'; import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; @@ -50,6 +51,9 @@ class _MainScreenState extends State { resources = MenuSection(name: "Ressources", type: "resources", menuId: 6, subMenu: []); menu.sections = [devices, configurations, resources]; + if (widget.instance.isStatistic == true) { + menu.sections!.add(MenuSection(name: "Statistiques", type: "statistics", menuId: 7, subMenu: [])); + } if(currentPosition.value == null) { if (widget.instance.isMobile!) { @@ -305,6 +309,9 @@ class _MainScreenState extends State { case "resources": currentPosition = 6; break; + case "statistics": + currentPosition = 7; + break; } } @@ -360,6 +367,11 @@ class _MainScreenState extends State { ] ) ); + case 'statistics' : + return const Padding( + padding: EdgeInsets.all(8.0), + child: StatisticsScreen() + ); default: return Text('Hellow default'); } diff --git a/lib/Screens/Statistics/statistics_screen.dart b/lib/Screens/Statistics/statistics_screen.dart new file mode 100644 index 0000000..684cae0 --- /dev/null +++ b/lib/Screens/Statistics/statistics_screen.dart @@ -0,0 +1,513 @@ +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_app/Models/managerContext.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/constants.dart'; +import 'package:manager_api_new/api.dart'; +import 'package:provider/provider.dart'; + +class StatisticsScreen extends StatefulWidget { + const StatisticsScreen({Key? key}) : super(key: key); + + @override + _StatisticsScreenState createState() => _StatisticsScreenState(); +} + +class _StatisticsScreenState extends State { + int _selectedDays = 30; + AppType? _selectedAppType; // null = "Tous" + Future? _future; + late ManagerAppContext _managerAppContext; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) => _load()); + } + + void _load() { + final days = _selectedDays; + final appType = _selectedAppType; + setState(() { + _future = _managerAppContext.clientAPI!.statsApi!.statsGetSummary( + _managerAppContext.instanceId!, + from: DateTime.now().subtract(Duration(days: days)), + to: DateTime.now(), + appType: appType?.name, + ); + }); + } + + String _formatDuration(int seconds) { + if (seconds < 60) return '${seconds}s'; + final m = seconds ~/ 60; + final s = seconds % 60; + return '${m}m${s > 0 ? ' ${s}s' : ''}'; + } + + @override + Widget build(BuildContext context) { + final appContext = Provider.of(context); + _managerAppContext = appContext.getContext() as ManagerAppContext; + + return Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildHeader(), + const SizedBox(height: 16), + Expanded( + child: FutureBuilder( + future: _future, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + if (snapshot.hasError || snapshot.data == null) { + return Center(child: Text('Impossible de charger les statistiques', style: TextStyle(color: kBodyTextColor))); + } + final stats = snapshot.data!; + return _buildDashboard(stats); + }, + ), + ), + ], + ), + ); + } + + Widget _buildHeader() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Statistiques', style: TextStyle(fontSize: 26, fontWeight: FontWeight.w600, color: kPrimaryColor)), + SegmentedButton( + style: SegmentedButton.styleFrom( + selectedBackgroundColor: kPrimaryColor, + selectedForegroundColor: kWhite, + ), + segments: const [ + ButtonSegment(value: 7, label: Text('7j')), + ButtonSegment(value: 30, label: Text('30j')), + ButtonSegment(value: 90, label: Text('90j')), + ], + selected: {_selectedDays}, + onSelectionChanged: (s) { + _selectedDays = s.first; + _load(); + }, + ), + ], + ), + const SizedBox(height: 10), + Wrap( + spacing: 8, + children: [ + ChoiceChip( + label: const Text('Tous'), + selected: _selectedAppType == null, + selectedColor: kPrimaryColor, + labelStyle: TextStyle(color: _selectedAppType == null ? kWhite : kBodyTextColor), + onSelected: (_) { _selectedAppType = null; _load(); }, + ), + ...AppType.values.map((type) => ChoiceChip( + label: Text(type.name), + selected: _selectedAppType == type, + selectedColor: kPrimaryColor, + labelStyle: TextStyle(color: _selectedAppType == type ? kWhite : kBodyTextColor), + onSelected: (_) { _selectedAppType = type; _load(); }, + )), + ], + ), + ], + ); + } + + Widget _buildDashboard(StatsSummaryDTO stats) { + if (stats.totalSessions == 0) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.bar_chart_outlined, size: 56, color: kBodyTextColor.withValues(alpha: 0.4)), + const SizedBox(height: 16), + Text( + 'Pas encore de données pour cette période', + style: TextStyle(fontSize: 15, color: kBodyTextColor), + ), + if (_selectedAppType != null) ...[ + const SizedBox(height: 8), + Text( + 'Aucun event reçu pour le type "${_selectedAppType!.name}"', + style: TextStyle(fontSize: 13, color: kBodyTextColor.withValues(alpha: 0.6)), + ), + ], + ], + ), + ); + } + + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // KPI cards + _buildKpiRow(stats), + const SizedBox(height: 20), + // Line chart + _buildLineChart(stats), + const SizedBox(height: 20), + // Bar chart + Donut charts + _buildChartsRow(stats), + const SizedBox(height: 20), + // Bottom tables + _buildTablesRow(stats), + ], + ), + ); + } + + Widget _buildKpiRow(StatsSummaryDTO stats) { + final topAppType = stats.appTypeDistribution.isNotEmpty + ? stats.appTypeDistribution.entries.reduce((a, b) => a.value > b.value ? a : b) + : null; + final topLang = stats.languageDistribution.isNotEmpty + ? stats.languageDistribution.entries.reduce((a, b) => a.value > b.value ? a : b) + : null; + + return Row( + children: [ + _kpiCard('Sessions', '${stats.totalSessions}', Icons.people_outline), + const SizedBox(width: 12), + _kpiCard('Durée moy.', _formatDuration(stats.avgVisitDurationSeconds), Icons.timer_outlined), + const SizedBox(width: 12), + _kpiCard('App top', topAppType?.key ?? '—', Icons.phone_iphone), + const SizedBox(width: 12), + _kpiCard('Langue top', topLang?.key.toUpperCase() ?? '—', Icons.language), + ], + ); + } + + Widget _kpiCard(String label, String value, IconData icon) { + return Expanded( + child: Card( + elevation: 0, + color: kWhite, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(icon, color: kPrimaryColor, size: 22), + const SizedBox(height: 8), + Text(value, style: TextStyle(fontSize: 26, fontWeight: FontWeight.w700, color: kPrimaryColor)), + const SizedBox(height: 4), + Text(label, style: TextStyle(fontSize: 13, color: kBodyTextColor)), + ], + ), + ), + ), + ); + } + + Widget _buildLineChart(StatsSummaryDTO stats) { + if (stats.visitsByDay.isEmpty) return const SizedBox(); + + final spots = []; + final mobileSpots = []; + final tabletSpots = []; + + for (var i = 0; i < stats.visitsByDay.length; i++) { + final d = stats.visitsByDay[i]; + spots.add(FlSpot(i.toDouble(), d.total.toDouble())); + mobileSpots.add(FlSpot(i.toDouble(), d.mobile.toDouble())); + tabletSpots.add(FlSpot(i.toDouble(), d.tablet.toDouble())); + } + + final isFiltered = _selectedAppType != null; + + return Card( + elevation: 0, + color: kWhite, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + child: Padding( + padding: const EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Visites par jour', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: kPrimaryColor)), + const SizedBox(height: 4), + if (!isFiltered) Row(children: [ + _legendDot(kPrimaryColor), const SizedBox(width: 4), Text('Mobile', style: TextStyle(fontSize: 12, color: kBodyTextColor)), + const SizedBox(width: 12), + _legendDot(kSecond), const SizedBox(width: 4), Text('Tablet', style: TextStyle(fontSize: 12, color: kBodyTextColor)), + ]), + const SizedBox(height: 16), + SizedBox( + height: 200, + child: LineChart(LineChartData( + gridData: FlGridData(show: true, drawVerticalLine: false), + titlesData: FlTitlesData( + leftTitles: AxisTitles(sideTitles: SideTitles(showTitles: true, reservedSize: 32)), + rightTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)), + topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)), + bottomTitles: AxisTitles(sideTitles: SideTitles( + showTitles: true, + interval: (stats.visitsByDay.length / 5).ceilToDouble().clamp(1, double.infinity), + getTitlesWidget: (value, meta) { + final idx = value.toInt(); + if (idx < 0 || idx >= stats.visitsByDay.length) return const SizedBox(); + final date = stats.visitsByDay[idx].date ?? ''; + return Text(date.length >= 5 ? date.substring(5) : date, style: const TextStyle(fontSize: 10)); + }, + )), + ), + borderData: FlBorderData(show: false), + lineBarsData: isFiltered + ? [_lineBar(spots, kPrimaryColor)] + : [_lineBar(mobileSpots, kPrimaryColor), _lineBar(tabletSpots, kSecond)], + )), + ), + ], + ), + ), + ); + } + + Widget _legendDot(Color color) { + return Container(width: 10, height: 10, decoration: BoxDecoration(color: color, shape: BoxShape.circle)); + } + + LineChartBarData _lineBar(List spots, Color color) { + return LineChartBarData( + spots: spots, + isCurved: true, + color: color, + barWidth: 2, + dotData: FlDotData(show: false), + belowBarData: BarAreaData(show: true, color: color.withOpacity(0.1)), + ); + } + + Widget _buildChartsRow(StatsSummaryDTO stats) { + final showAppTypeDonut = _selectedAppType == null; + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(flex: 2, child: _buildTopSectionsChart(stats)), + const SizedBox(width: 12), + if (showAppTypeDonut) ...[ + Expanded(child: _buildDonut(stats.appTypeDistribution, 'Apps')), + const SizedBox(width: 12), + ], + Expanded(child: _buildDonut(stats.languageDistribution, 'Langues')), + ], + ); + } + + Widget _buildTopSectionsChart(StatsSummaryDTO stats) { + if (stats.topSections.isEmpty) return const SizedBox(); + final sections = stats.topSections.take(8).toList(); + final maxViews = sections.map((s) => s.views).reduce((a, b) => a > b ? a : b); + + return Card( + elevation: 0, + color: kWhite, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + child: Padding( + padding: const EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Top sections', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: kPrimaryColor)), + const SizedBox(height: 16), + SizedBox( + height: 240, + child: BarChart(BarChartData( + alignment: BarChartAlignment.spaceAround, + maxY: maxViews.toDouble() * 1.2, + barTouchData: BarTouchData(enabled: true), + titlesData: FlTitlesData( + leftTitles: AxisTitles(sideTitles: SideTitles(showTitles: true, reservedSize: 32)), + rightTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)), + topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)), + bottomTitles: AxisTitles(sideTitles: SideTitles( + showTitles: true, + getTitlesWidget: (value, meta) { + final idx = value.toInt(); + if (idx < 0 || idx >= sections.length) return const SizedBox(); + final title = sections[idx].sectionTitle ?? sections[idx].sectionId ?? ''; + return Padding( + padding: const EdgeInsets.only(top: 4), + child: Text( + title.length > 8 ? '${title.substring(0, 8)}…' : title, + style: const TextStyle(fontSize: 10), + ), + ); + }, + )), + ), + borderData: FlBorderData(show: false), + gridData: FlGridData(drawVerticalLine: false), + barGroups: List.generate(sections.length, (i) => BarChartGroupData( + x: i, + barRods: [BarChartRodData( + toY: sections[i].views.toDouble(), + color: kPrimaryColor, + width: 16, + borderRadius: const BorderRadius.vertical(top: Radius.circular(4)), + )], + )), + )), + ), + ], + ), + ), + ); + } + + static const _chartColors = [ + Color(0xFF264863), + Color(0xFF4A8FAD), + Color(0xFF87C4D8), + Color(0xFFC2C9D6), + Color(0xFF8BA7B8), + Color(0xFF1A3347), + ]; + + Widget _buildDonut(Map data, String title) { + if (data.isEmpty) return const SizedBox(); + final total = data.values.fold(0, (a, b) => a + b); + final entries = data.entries.toList(); + + return Card( + elevation: 0, + color: kWhite, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + child: Padding( + padding: const EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(title, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: kPrimaryColor)), + const SizedBox(height: 16), + SizedBox( + height: 160, + child: PieChart(PieChartData( + centerSpaceRadius: 45, + sectionsSpace: 2, + sections: List.generate(entries.length, (i) { + final pct = total > 0 ? (entries[i].value / total * 100).round() : 0; + return PieChartSectionData( + value: entries[i].value.toDouble(), + color: _chartColors[i % _chartColors.length], + title: '$pct%', + titleStyle: const TextStyle(fontSize: 11, color: Colors.white, fontWeight: FontWeight.w600), + radius: 40, + ); + }), + )), + ), + const SizedBox(height: 12), + ...List.generate(entries.length, (i) => Padding( + padding: const EdgeInsets.symmetric(vertical: 2), + child: Row(children: [ + Container(width: 10, height: 10, decoration: BoxDecoration( + color: _chartColors[i % _chartColors.length], shape: BoxShape.circle)), + const SizedBox(width: 6), + Expanded(child: Text(entries[i].key, style: TextStyle(fontSize: 12, color: kBodyTextColor), overflow: TextOverflow.ellipsis)), + Text('${entries[i].value}', style: TextStyle(fontSize: 12, color: kBodyTextColor)), + ]), + )), + ], + ), + ), + ); + } + + Widget _buildTablesRow(StatsSummaryDTO stats) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (stats.topPois.isNotEmpty) Expanded(child: _buildPoiTable(stats)), + if (stats.topPois.isNotEmpty && stats.topAgendaEvents.isNotEmpty) const SizedBox(width: 12), + if (stats.topAgendaEvents.isNotEmpty) Expanded(child: _buildAgendaTable(stats)), + if ((stats.topPois.isNotEmpty || stats.topAgendaEvents.isNotEmpty) && stats.quizStats.isNotEmpty) const SizedBox(width: 12), + if (stats.quizStats.isNotEmpty) Expanded(child: _buildQuizTable(stats)), + if ((stats.topPois.isNotEmpty || stats.topAgendaEvents.isNotEmpty || stats.quizStats.isNotEmpty) && stats.gameStats.isNotEmpty) const SizedBox(width: 12), + if (stats.gameStats.isNotEmpty) Expanded(child: _buildGameTable(stats)), + ], + ); + } + + Widget _buildPoiTable(StatsSummaryDTO stats) { + return _tableCard('Top POI', ['POI', 'Taps'], stats.topPois.map((p) => [ + p.title ?? p.geoPointId?.toString() ?? '—', + '${p.taps}', + ]).toList()); + } + + Widget _buildAgendaTable(StatsSummaryDTO stats) { + return _tableCard('Top événements agenda', ['Événement', 'Taps'], stats.topAgendaEvents.map((e) => [ + e.eventTitle ?? e.eventId ?? '—', + '${e.taps}', + ]).toList()); + } + + Widget _buildQuizTable(StatsSummaryDTO stats) { + return _tableCard('Quiz', ['Section', 'Score moy', 'Complétions'], stats.quizStats.map((q) => [ + q.sectionTitle ?? q.sectionId ?? '—', + '${q.avgScore.toStringAsFixed(1)} / ${q.totalQuestions}', + '${q.completions}', + ]).toList()); + } + + Widget _buildGameTable(StatsSummaryDTO stats) { + return _tableCard('Jeux', ['Type', 'Complétions', 'Durée moy.'], stats.gameStats.map((g) => [ + g.gameType ?? '—', + '${g.completions}', + _formatDuration(g.avgDurationSeconds), + ]).toList()); + } + + Widget _tableCard(String title, List headers, List> rows) { + return Card( + elevation: 0, + color: kWhite, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: kPrimaryColor)), + const SizedBox(height: 12), + Table( + columnWidths: const {0: FlexColumnWidth(2), 1: FlexColumnWidth(1)}, + children: [ + TableRow( + decoration: BoxDecoration(border: Border(bottom: BorderSide(color: kSecond))), + children: headers.map((h) => Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Text(h, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: kBodyTextColor)), + )).toList(), + ), + ...rows.map((row) => TableRow( + children: row.map((cell) => Padding( + padding: const EdgeInsets.symmetric(vertical: 6), + child: Text(cell, style: TextStyle(fontSize: 13, color: kBodyTextColor), overflow: TextOverflow.ellipsis), + )).toList(), + )).toList(), + ], + ), + ], + ), + ), + ); + } +} diff --git a/lib/api/openApiTest.dart b/lib/api/openApiTest.dart index 39357a9..e434c54 100644 --- a/lib/api/openApiTest.dart +++ b/lib/api/openApiTest.dart @@ -1,4 +1,4 @@ -// Openapi Generator last run: : 2026-02-27T13:23:36.794687 +// Openapi Generator last run: : 2026-03-13T12:04:24.358808 import 'package:openapi_generator_annotations/openapi_generator_annotations.dart'; @Openapi( diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index d37ac90..ed8783a 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -4,7 +4,7 @@ "info": { "title": "Manager Service", "description": "API Manager Service", - "version": "Version Alpha" + "version": "Version Alpha 5.0" }, "servers": [ { @@ -134,6 +134,58 @@ } } }, + "/api/Ai/chat": { + "post": { + "tags": [ + "AI" + ], + "operationId": "Ai_Chat", + "requestBody": { + "x-name": "request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiChatRequest" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiChatResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/api/ApplicationInstance": { "get": { "tags": [ @@ -5209,6 +5261,116 @@ ] } }, + "/api/Stats/event": { + "post": { + "tags": [ + "Stats" + ], + "operationId": "Stats_TrackEvent", + "requestBody": { + "x-name": "dto", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VisitEventDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/Stats/summary": { + "get": { + "tags": [ + "Stats" + ], + "operationId": "Stats_GetSummary", + "parameters": [ + { + "name": "instanceId", + "in": "query", + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + }, + { + "name": "from", + "in": "query", + "schema": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "x-position": 2 + }, + { + "name": "to", + "in": "query", + "schema": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "x-position": 3 + }, + { + "name": "appType", + "in": "query", + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 4 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatsSummaryDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, "/api/User": { "get": { "tags": [ @@ -5554,6 +5716,162 @@ } } }, + "AiChatResponse": { + "type": "object", + "additionalProperties": false, + "properties": { + "reply": { + "type": "string", + "nullable": true + }, + "cards": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/AiCardDTO" + } + }, + "navigation": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/NavigationActionDTO" + } + ] + } + } + }, + "AiCardDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "title": { + "type": "string", + "nullable": true + }, + "subtitle": { + "type": "string", + "nullable": true + }, + "icon": { + "type": "string", + "nullable": true + } + } + }, + "NavigationActionDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "sectionId": { + "type": "string", + "nullable": true + }, + "sectionTitle": { + "type": "string", + "nullable": true + }, + "sectionType": { + "type": "string", + "nullable": true + } + } + }, + "ProblemDetails": { + "type": "object", + "additionalProperties": { + "nullable": true + }, + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + }, + "extensions": { + "type": "object", + "additionalProperties": {} + } + } + }, + "AiChatRequest": { + "type": "object", + "additionalProperties": false, + "properties": { + "message": { + "type": "string", + "nullable": true + }, + "instanceId": { + "type": "string", + "nullable": true + }, + "appType": { + "$ref": "#/components/schemas/AppType" + }, + "configurationId": { + "type": "string", + "nullable": true + }, + "language": { + "type": "string", + "nullable": true + }, + "history": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/AiChatMessage" + } + } + } + }, + "AppType": { + "type": "integer", + "description": "0 = Mobile\n1 = Tablet\n2 = Web\n3 = VR", + "x-enumNames": [ + "Mobile", + "Tablet", + "Web", + "VR" + ], + "enum": [ + 0, + 1, + 2, + 3 + ] + }, + "AiChatMessage": { + "type": "object", + "additionalProperties": false, + "properties": { + "role": { + "type": "string", + "nullable": true + }, + "content": { + "type": "string", + "nullable": true + } + } + }, "ApplicationInstanceDTO": { "type": "object", "additionalProperties": false, @@ -5621,25 +5939,15 @@ "$ref": "#/components/schemas/SectionEventDTO" } ] + }, + "isAssistant": { + "type": "boolean" + }, + "isStatistic": { + "type": "boolean" } } }, - "AppType": { - "type": "integer", - "description": "0 = Mobile\n1 = Tablet\n2 = Web\n3 = VR", - "x-enumNames": [ - "Mobile", - "Tablet", - "Web", - "VR" - ], - "enum": [ - 0, - 1, - 2, - 3 - ] - }, "AppConfigurationLink": { "type": "object", "additionalProperties": false, @@ -5915,6 +6223,9 @@ "$ref": "#/components/schemas/SectionEvent" } ] + }, + "isAssistant": { + "type": "boolean" } } }, @@ -7411,6 +7722,9 @@ }, "isVR": { "type": "boolean" + }, + "isAssistant": { + "type": "boolean" } } }, @@ -7453,6 +7767,9 @@ "isVR": { "type": "boolean" }, + "isAssistant": { + "type": "boolean" + }, "applicationInstanceDTOs": { "type": "array", "nullable": true, @@ -7468,7 +7785,8 @@ "properties": { "id": { "type": "integer", - "format": "int32" + "format": "int32", + "nullable": true }, "label": { "type": "array", @@ -7591,7 +7909,8 @@ }, "zoom": { "type": "integer", - "format": "int32" + "format": "int32", + "nullable": true } } }, @@ -7619,7 +7938,8 @@ "properties": { "zoom": { "type": "integer", - "format": "int32" + "format": "int32", + "nullable": true }, "mapType": { "nullable": true, @@ -7674,6 +7994,16 @@ "centerLongitude": { "type": "string", "nullable": true + }, + "isParcours": { + "type": "boolean" + }, + "guidedPaths": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/GuidedPathDTO" + } } } } @@ -7851,7 +8181,8 @@ }, "order": { "type": "integer", - "format": "int32" + "format": "int32", + "nullable": true }, "resourceId": { "type": "string", @@ -7873,7 +8204,8 @@ "properties": { "id": { "type": "integer", - "format": "int32" + "format": "int32", + "nullable": true }, "label": { "type": "array", @@ -7901,435 +8233,6 @@ } } }, - "SliderDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "contents": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/ContentDTO" - } - } - } - } - ] - }, - "VideoDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "source": { - "type": "string", - "nullable": true - } - } - } - ] - }, - "WebDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "source": { - "type": "string", - "nullable": true - } - } - } - ] - }, - "MenuDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "sections": { - "type": "array", - "nullable": true, - "items": {} - } - } - } - ] - }, - "PlayerMessageDTO": { - "type": "object", - "additionalProperties": false, - "properties": { - "configChanged": { - "type": "boolean" - }, - "isDeleted": { - "type": "boolean" - } - } - }, - "QuizDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "questions": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/QuestionDTO" - } - }, - "bad_level": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - }, - "medium_level": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - }, - "good_level": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - }, - "great_level": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - } - } - } - ] - }, - "QuestionDTO": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "format": "int32", - "nullable": true - }, - "label": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - }, - "responses": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/ResponseDTO" - } - }, - "imageBackgroundResourceId": { - "type": "string", - "nullable": true - }, - "imageBackgroundResourceType": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ResourceType" - } - ] - }, - "imageBackgroundResourceUrl": { - "type": "string", - "nullable": true - }, - "order": { - "type": "integer", - "format": "int32", - "nullable": true - } - } - }, - "TranslationAndResourceDTO": { - "type": "object", - "additionalProperties": false, - "properties": { - "language": { - "type": "string", - "nullable": true - }, - "value": { - "type": "string", - "nullable": true - }, - "resourceId": { - "type": "string", - "nullable": true - }, - "resource": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ResourceDTO" - } - ] - } - } - }, - "ResponseDTO": { - "type": "object", - "additionalProperties": false, - "properties": { - "label": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - }, - "isGood": { - "type": "boolean" - }, - "order": { - "type": "integer", - "format": "int32" - } - } - }, - "ArticleDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "content": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationDTO" - } - }, - "isContentTop": { - "type": "boolean" - }, - "audioIds": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationDTO" - } - }, - "isReadAudioAuto": { - "type": "boolean" - }, - "contents": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/ContentDTO" - } - } - } - } - ] - }, - "PdfDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "pdfs": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/OrderedTranslationAndResourceDTO" - } - } - } - } - ] - }, - "OrderedTranslationAndResourceDTO": { - "type": "object", - "additionalProperties": false, - "properties": { - "translationAndResourceDTOs": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - }, - "order": { - "type": "integer", - "format": "int32" - } - } - }, - "GameDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "messageDebut": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - }, - "messageFin": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationAndResourceDTO" - } - }, - "puzzleImage": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ResourceDTO" - } - ] - }, - "puzzleImageId": { - "type": "string", - "nullable": true - }, - "rows": { - "type": "integer", - "format": "int32" - }, - "cols": { - "type": "integer", - "format": "int32" - }, - "gameType": { - "$ref": "#/components/schemas/GameTypes" - } - } - } - ] - }, - "GameTypes": { - "type": "integer", - "description": "0 = Puzzle\n1 = SlidingPuzzle\n2 = Escape", - "x-enumNames": [ - "Puzzle", - "SlidingPuzzle", - "Escape" - ], - "enum": [ - 0, - 1, - 2 - ] - }, - "AgendaDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "isOnlineAgenda": { - "type": "boolean" - }, - "resourceIds": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/TranslationDTO" - } - }, - "agendaMapProvider": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/MapProvider" - } - ] - }, - "events": { - "type": "array", - "nullable": true, - "items": { - "$ref": "#/components/schemas/EventAgendaDTO" - } - } - } - } - ] - }, - "WeatherDTO": { - "allOf": [ - { - "$ref": "#/components/schemas/SectionDTO" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "city": { - "type": "string", - "nullable": true - }, - "updatedDate": { - "type": "string", - "format": "date-time", - "nullable": true - }, - "result": { - "type": "string", - "nullable": true - } - } - } - ] - }, "GuidedPathDTO": { "type": "object", "additionalProperties": false, @@ -8364,6 +8267,10 @@ "type": "string", "nullable": true }, + "sectionGameId": { + "type": "string", + "nullable": true + }, "isLinear": { "type": "boolean" }, @@ -8375,7 +8282,8 @@ }, "order": { "type": "integer", - "format": "int32" + "format": "int32", + "nullable": true }, "steps": { "type": "array", @@ -8400,7 +8308,8 @@ }, "order": { "type": "integer", - "format": "int32" + "format": "int32", + "nullable": true }, "title": { "type": "array", @@ -8571,6 +8480,53 @@ } } }, + "TranslationAndResourceDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "language": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + }, + "resourceId": { + "type": "string", + "nullable": true + }, + "resource": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/ResourceDTO" + } + ] + } + } + }, + "ResponseDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "label": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "isGood": { + "type": "boolean" + }, + "order": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + }, "SectionQuiz": { "allOf": [ { @@ -9058,6 +9014,20 @@ } ] }, + "GameTypes": { + "type": "integer", + "description": "0 = Puzzle\n1 = SlidingPuzzle\n2 = Escape", + "x-enumNames": [ + "Puzzle", + "SlidingPuzzle", + "Escape" + ], + "enum": [ + 0, + 1, + 2 + ] + }, "QuestionType": { "type": "integer", "description": "0 = Simple\n1 = MultipleChoice\n2 = Puzzle", @@ -9072,6 +9042,383 @@ 2 ] }, + "SliderDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "contents": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/ContentDTO" + } + } + } + } + ] + }, + "VideoDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "source": { + "type": "string", + "nullable": true + } + } + } + ] + }, + "WebDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "source": { + "type": "string", + "nullable": true + } + } + } + ] + }, + "MenuDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "sections": { + "type": "array", + "nullable": true, + "items": {} + } + } + } + ] + }, + "PlayerMessageDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "configChanged": { + "type": "boolean" + }, + "isDeleted": { + "type": "boolean" + } + } + }, + "QuizDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "questions": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/QuestionDTO" + } + }, + "bad_level": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "medium_level": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "good_level": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "great_level": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + } + } + } + ] + }, + "QuestionDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "label": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "responses": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/ResponseDTO" + } + }, + "imageBackgroundResourceId": { + "type": "string", + "nullable": true + }, + "imageBackgroundResourceType": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/ResourceType" + } + ] + }, + "imageBackgroundResourceUrl": { + "type": "string", + "nullable": true + }, + "order": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + }, + "ArticleDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "content": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "isContentTop": { + "type": "boolean" + }, + "audioIds": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "isReadAudioAuto": { + "type": "boolean" + }, + "contents": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/ContentDTO" + } + } + } + } + ] + }, + "PdfDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "pdfs": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/OrderedTranslationAndResourceDTO" + } + } + } + } + ] + }, + "OrderedTranslationAndResourceDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "translationAndResourceDTOs": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "order": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + }, + "GameDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "messageDebut": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "messageFin": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "puzzleImage": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/ResourceDTO" + } + ] + }, + "puzzleImageId": { + "type": "string", + "nullable": true + }, + "rows": { + "type": "integer", + "format": "int32" + }, + "cols": { + "type": "integer", + "format": "int32" + }, + "gameType": { + "$ref": "#/components/schemas/GameTypes" + }, + "guidedPaths": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/GuidedPathDTO" + } + } + } + } + ] + }, + "AgendaDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "isOnlineAgenda": { + "type": "boolean" + }, + "resourceIds": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "agendaMapProvider": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/MapProvider" + } + ] + }, + "events": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/EventAgendaDTO" + } + } + } + } + ] + }, + "WeatherDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/SectionDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "city": { + "type": "string", + "nullable": true + }, + "updatedDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "result": { + "type": "string", + "nullable": true + } + } + } + ] + }, "ProgrammeBlockDTO": { "type": "object", "additionalProperties": false, @@ -9166,6 +9513,254 @@ } } }, + "VisitEventDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "instanceId": { + "type": "string", + "nullable": true + }, + "configurationId": { + "type": "string", + "nullable": true + }, + "sectionId": { + "type": "string", + "nullable": true + }, + "sessionId": { + "type": "string", + "nullable": true + }, + "eventType": { + "type": "string", + "nullable": true + }, + "appType": { + "type": "string", + "nullable": true + }, + "language": { + "type": "string", + "nullable": true + }, + "durationSeconds": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "metadata": { + "type": "string", + "nullable": true + }, + "timestamp": { + "type": "string", + "format": "date-time", + "nullable": true + } + } + }, + "StatsSummaryDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "totalSessions": { + "type": "integer", + "format": "int32" + }, + "avgVisitDurationSeconds": { + "type": "integer", + "format": "int32" + }, + "topSections": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/SectionStatDTO" + } + }, + "visitsByDay": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/DayStatDTO" + } + }, + "languageDistribution": { + "type": "object", + "nullable": true, + "additionalProperties": { + "type": "integer", + "format": "int32" + } + }, + "appTypeDistribution": { + "type": "object", + "nullable": true, + "additionalProperties": { + "type": "integer", + "format": "int32" + } + }, + "topPois": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/PoiStatDTO" + } + }, + "topAgendaEvents": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/AgendaEventStatDTO" + } + }, + "quizStats": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/QuizStatDTO" + } + }, + "gameStats": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/GameStatDTO" + } + } + } + }, + "SectionStatDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "sectionId": { + "type": "string", + "nullable": true + }, + "sectionTitle": { + "type": "string", + "nullable": true + }, + "views": { + "type": "integer", + "format": "int32" + }, + "avgDurationSeconds": { + "type": "integer", + "format": "int32" + } + } + }, + "DayStatDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "date": { + "type": "string", + "nullable": true + }, + "total": { + "type": "integer", + "format": "int32" + }, + "mobile": { + "type": "integer", + "format": "int32" + }, + "tablet": { + "type": "integer", + "format": "int32" + } + } + }, + "PoiStatDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "geoPointId": { + "type": "integer", + "format": "int32" + }, + "title": { + "type": "string", + "nullable": true + }, + "taps": { + "type": "integer", + "format": "int32" + }, + "sectionId": { + "type": "string", + "nullable": true + } + } + }, + "AgendaEventStatDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "eventId": { + "type": "string", + "nullable": true + }, + "eventTitle": { + "type": "string", + "nullable": true + }, + "taps": { + "type": "integer", + "format": "int32" + } + } + }, + "QuizStatDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "sectionId": { + "type": "string", + "nullable": true + }, + "sectionTitle": { + "type": "string", + "nullable": true + }, + "avgScore": { + "type": "number", + "format": "double" + }, + "totalQuestions": { + "type": "integer", + "format": "int32" + }, + "completions": { + "type": "integer", + "format": "int32" + } + } + }, + "GameStatDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "gameType": { + "type": "string", + "nullable": true + }, + "completions": { + "type": "integer", + "format": "int32" + }, + "avgDurationSeconds": { + "type": "integer", + "format": "int32" + } + } + }, "User": { "type": "object", "additionalProperties": false, @@ -9265,6 +9860,10 @@ "name": "Authentication", "description": "Authentication management" }, + { + "name": "AI", + "description": "Assistant IA" + }, { "name": "ApplicationInstance", "description": "Application instance management" @@ -9305,6 +9904,10 @@ "name": "Section quiz", "description": "Section quiz management" }, + { + "name": "Stats", + "description": "Visit statistics tracking and summary" + }, { "name": "User", "description": "User management" diff --git a/lib/client.dart b/lib/client.dart index 68480eb..ba4ef27 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -41,6 +41,9 @@ class Client { SectionEventApi? _sectionEventApi; SectionEventApi? get sectionEventApi => _sectionEventApi; + StatsApi? _statsApi; + StatsApi? get statsApi => _statsApi; + Client(String path) { _apiClient = ApiClient(basePath: path); //basePath: "https://192.168.31.140"); @@ -58,5 +61,6 @@ class Client { _sectionQuizApi = SectionQuizApi(_apiClient); _sectionAgendaApi = SectionAgendaApi(_apiClient); _sectionEventApi = SectionEventApi(_apiClient); + _statsApi = StatsApi(_apiClient); } } diff --git a/manager_api_new/.openapi-generator/FILES b/manager_api_new/.openapi-generator/FILES index 5e137b6..252916a 100644 --- a/manager_api_new/.openapi-generator/FILES +++ b/manager_api_new/.openapi-generator/FILES @@ -2,8 +2,15 @@ .travis.yml README.md analysis_options.yaml +doc/AIApi.md doc/AgendaDTO.md doc/AgendaDTOAllOfAgendaMapProvider.md +doc/AgendaEventStatDTO.md +doc/AiCardDTO.md +doc/AiChatMessage.md +doc/AiChatRequest.md +doc/AiChatResponse.md +doc/AiChatResponseNavigation.md doc/AppConfigurationLink.md doc/AppConfigurationLinkApplicationInstance.md doc/AppConfigurationLinkConfiguration.md @@ -28,6 +35,7 @@ doc/Coordinate.md doc/CoordinateEqualityComparer.md doc/CoordinateSequence.md doc/CoordinateSequenceFactory.md +doc/DayStatDTO.md doc/Device.md doc/DeviceApi.md doc/DeviceDTO.md @@ -42,6 +50,7 @@ doc/EventAgendaDTOResource.md doc/ExportConfigurationDTO.md doc/GameDTO.md doc/GameDTOAllOfPuzzleImage.md +doc/GameStatDTO.md doc/GameTypes.md doc/GeoPoint.md doc/GeoPointDTO.md @@ -80,6 +89,7 @@ doc/MapProvider.md doc/MapTypeApp.md doc/MapTypeMapBox.md doc/MenuDTO.md +doc/NavigationActionDTO.md doc/NtsGeometryServices.md doc/NtsGeometryServicesCoordinateEqualityComparer.md doc/NtsGeometryServicesGeometryOverlay.md @@ -88,12 +98,14 @@ doc/OrderedTranslationAndResourceDTO.md doc/Ordinates.md doc/PdfDTO.md doc/PlayerMessageDTO.md +doc/PoiStatDTO.md doc/Point.md doc/PointAllOfBoundary.md doc/PointAllOfCoordinate.md doc/PointAllOfCoordinateSequence.md doc/PrecisionModel.md doc/PrecisionModels.md +doc/ProblemDetails.md doc/ProgrammeBlock.md doc/ProgrammeBlockDTO.md doc/QuestionDTO.md @@ -103,6 +115,7 @@ doc/QuizDTO.md doc/QuizQuestion.md doc/QuizQuestionGuidedStep.md doc/QuizQuestionSectionQuiz.md +doc/QuizStatDTO.md doc/Resource.md doc/ResourceApi.md doc/ResourceDTO.md @@ -125,8 +138,11 @@ doc/SectionMapAllOfMapTypeMapbox.md doc/SectionMapApi.md doc/SectionQuiz.md doc/SectionQuizApi.md +doc/SectionStatDTO.md doc/SectionType.md doc/SliderDTO.md +doc/StatsApi.md +doc/StatsSummaryDTO.md doc/TokenDTO.md doc/TranslationAndResourceDTO.md doc/TranslationDTO.md @@ -134,10 +150,12 @@ doc/User.md doc/UserApi.md doc/UserDetailDTO.md doc/VideoDTO.md +doc/VisitEventDTO.md doc/WeatherDTO.md doc/WebDTO.md git_push.sh lib/api.dart +lib/api/ai_api.dart lib/api/application_instance_api.dart lib/api/authentication_api.dart lib/api/configuration_api.dart @@ -149,6 +167,7 @@ lib/api/section_api.dart lib/api/section_event_api.dart lib/api/section_map_api.dart lib/api/section_quiz_api.dart +lib/api/stats_api.dart lib/api/user_api.dart lib/api_client.dart lib/api_exception.dart @@ -160,6 +179,12 @@ lib/auth/http_bearer_auth.dart lib/auth/oauth.dart lib/model/agenda_dto.dart lib/model/agenda_dto_all_of_agenda_map_provider.dart +lib/model/agenda_event_stat_dto.dart +lib/model/ai_card_dto.dart +lib/model/ai_chat_message.dart +lib/model/ai_chat_request.dart +lib/model/ai_chat_response.dart +lib/model/ai_chat_response_navigation.dart lib/model/app_configuration_link.dart lib/model/app_configuration_link_application_instance.dart lib/model/app_configuration_link_configuration.dart @@ -181,6 +206,7 @@ lib/model/coordinate.dart lib/model/coordinate_equality_comparer.dart lib/model/coordinate_sequence.dart lib/model/coordinate_sequence_factory.dart +lib/model/day_stat_dto.dart lib/model/device.dart lib/model/device_detail_dto.dart lib/model/device_dto.dart @@ -194,6 +220,7 @@ lib/model/event_agenda_dto_resource.dart lib/model/export_configuration_dto.dart lib/model/game_dto.dart lib/model/game_dto_all_of_puzzle_image.dart +lib/model/game_stat_dto.dart lib/model/game_types.dart lib/model/geo_point.dart lib/model/geo_point_dto.dart @@ -231,6 +258,7 @@ lib/model/map_provider.dart lib/model/map_type_app.dart lib/model/map_type_map_box.dart lib/model/menu_dto.dart +lib/model/navigation_action_dto.dart lib/model/nts_geometry_services.dart lib/model/nts_geometry_services_coordinate_equality_comparer.dart lib/model/nts_geometry_services_geometry_overlay.dart @@ -239,12 +267,14 @@ lib/model/ordered_translation_and_resource_dto.dart lib/model/ordinates.dart lib/model/pdf_dto.dart lib/model/player_message_dto.dart +lib/model/poi_stat_dto.dart lib/model/point.dart lib/model/point_all_of_boundary.dart lib/model/point_all_of_coordinate.dart lib/model/point_all_of_coordinate_sequence.dart lib/model/precision_model.dart lib/model/precision_models.dart +lib/model/problem_details.dart lib/model/programme_block.dart lib/model/programme_block_dto.dart lib/model/question_dto.dart @@ -254,6 +284,7 @@ lib/model/quiz_dto.dart lib/model/quiz_question.dart lib/model/quiz_question_guided_step.dart lib/model/quiz_question_section_quiz.dart +lib/model/quiz_stat_dto.dart lib/model/resource.dart lib/model/resource_dto.dart lib/model/resource_type.dart @@ -270,14 +301,34 @@ lib/model/section_map_all_of_map_map_type.dart lib/model/section_map_all_of_map_resource.dart lib/model/section_map_all_of_map_type_mapbox.dart lib/model/section_quiz.dart +lib/model/section_stat_dto.dart lib/model/section_type.dart lib/model/slider_dto.dart +lib/model/stats_summary_dto.dart lib/model/token_dto.dart lib/model/translation_and_resource_dto.dart lib/model/translation_dto.dart lib/model/user.dart lib/model/user_detail_dto.dart lib/model/video_dto.dart +lib/model/visit_event_dto.dart lib/model/weather_dto.dart lib/model/web_dto.dart pubspec.yaml +test/agenda_event_stat_dto_test.dart +test/ai_api_test.dart +test/ai_card_dto_test.dart +test/ai_chat_message_test.dart +test/ai_chat_request_test.dart +test/ai_chat_response_navigation_test.dart +test/ai_chat_response_test.dart +test/day_stat_dto_test.dart +test/game_stat_dto_test.dart +test/navigation_action_dto_test.dart +test/poi_stat_dto_test.dart +test/problem_details_test.dart +test/quiz_stat_dto_test.dart +test/section_stat_dto_test.dart +test/stats_api_test.dart +test/stats_summary_dto_test.dart +test/visit_event_dto_test.dart diff --git a/manager_api_new/README.md b/manager_api_new/README.md index 835bf79..39ea9f3 100644 --- a/manager_api_new/README.md +++ b/manager_api_new/README.md @@ -3,7 +3,7 @@ API Manager Service This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: Version Alpha +- API version: Version Alpha 5.0 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.DartClientCodegen @@ -43,15 +43,14 @@ import 'package:manager_api_new/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; -final api_instance = ApplicationInstanceApi(); -final applicationInstanceId = applicationInstanceId_example; // String | -final appConfigurationLinkDTO = AppConfigurationLinkDTO(); // AppConfigurationLinkDTO | +final api_instance = AIApi(); +final aiChatRequest = AiChatRequest(); // AiChatRequest | try { - final result = api_instance.applicationInstanceAddConfigurationToApplicationInstance(applicationInstanceId, appConfigurationLinkDTO); + final result = api_instance.aiChat(aiChatRequest); print(result); } catch (e) { - print('Exception when calling ApplicationInstanceApi->applicationInstanceAddConfigurationToApplicationInstance: $e\n'); + print('Exception when calling AIApi->aiChat: $e\n'); } ``` @@ -62,6 +61,7 @@ All URIs are relative to *https://localhost:5001* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AIApi* | [**aiChat**](doc//AIApi.md#aichat) | **POST** /api/Ai/chat | *ApplicationInstanceApi* | [**applicationInstanceAddConfigurationToApplicationInstance**](doc//ApplicationInstanceApi.md#applicationinstanceaddconfigurationtoapplicationinstance) | **POST** /api/ApplicationInstance/{applicationInstanceId}/application-link | *ApplicationInstanceApi* | [**applicationInstanceCreate**](doc//ApplicationInstanceApi.md#applicationinstancecreate) | **POST** /api/ApplicationInstance | *ApplicationInstanceApi* | [**applicationInstanceDelete**](doc//ApplicationInstanceApi.md#applicationinstancedelete) | **DELETE** /api/ApplicationInstance/{id} | @@ -154,6 +154,8 @@ Class | Method | HTTP request | Description *SectionQuizApi* | [**sectionQuizDelete**](doc//SectionQuizApi.md#sectionquizdelete) | **DELETE** /api/SectionQuiz/questions/delete/{quizQuestionId} | *SectionQuizApi* | [**sectionQuizGetAllQuizQuestionFromSection**](doc//SectionQuizApi.md#sectionquizgetallquizquestionfromsection) | **GET** /api/SectionQuiz/{sectionId}/questions | *SectionQuizApi* | [**sectionQuizUpdate**](doc//SectionQuizApi.md#sectionquizupdate) | **PUT** /api/SectionQuiz | +*StatsApi* | [**statsGetSummary**](doc//StatsApi.md#statsgetsummary) | **GET** /api/Stats/summary | +*StatsApi* | [**statsTrackEvent**](doc//StatsApi.md#statstrackevent) | **POST** /api/Stats/event | *UserApi* | [**userCreateUser**](doc//UserApi.md#usercreateuser) | **POST** /api/User | *UserApi* | [**userDeleteUser**](doc//UserApi.md#userdeleteuser) | **DELETE** /api/User/{id} | *UserApi* | [**userGet**](doc//UserApi.md#userget) | **GET** /api/User | @@ -165,6 +167,12 @@ Class | Method | HTTP request | Description - [AgendaDTO](doc//AgendaDTO.md) - [AgendaDTOAllOfAgendaMapProvider](doc//AgendaDTOAllOfAgendaMapProvider.md) + - [AgendaEventStatDTO](doc//AgendaEventStatDTO.md) + - [AiCardDTO](doc//AiCardDTO.md) + - [AiChatMessage](doc//AiChatMessage.md) + - [AiChatRequest](doc//AiChatRequest.md) + - [AiChatResponse](doc//AiChatResponse.md) + - [AiChatResponseNavigation](doc//AiChatResponseNavigation.md) - [AppConfigurationLink](doc//AppConfigurationLink.md) - [AppConfigurationLinkApplicationInstance](doc//AppConfigurationLinkApplicationInstance.md) - [AppConfigurationLinkConfiguration](doc//AppConfigurationLinkConfiguration.md) @@ -186,6 +194,7 @@ Class | Method | HTTP request | Description - [CoordinateEqualityComparer](doc//CoordinateEqualityComparer.md) - [CoordinateSequence](doc//CoordinateSequence.md) - [CoordinateSequenceFactory](doc//CoordinateSequenceFactory.md) + - [DayStatDTO](doc//DayStatDTO.md) - [Device](doc//Device.md) - [DeviceDTO](doc//DeviceDTO.md) - [DeviceDetailDTO](doc//DeviceDetailDTO.md) @@ -199,6 +208,7 @@ Class | Method | HTTP request | Description - [ExportConfigurationDTO](doc//ExportConfigurationDTO.md) - [GameDTO](doc//GameDTO.md) - [GameDTOAllOfPuzzleImage](doc//GameDTOAllOfPuzzleImage.md) + - [GameStatDTO](doc//GameStatDTO.md) - [GameTypes](doc//GameTypes.md) - [GeoPoint](doc//GeoPoint.md) - [GeoPointDTO](doc//GeoPointDTO.md) @@ -236,6 +246,7 @@ Class | Method | HTTP request | Description - [MapTypeApp](doc//MapTypeApp.md) - [MapTypeMapBox](doc//MapTypeMapBox.md) - [MenuDTO](doc//MenuDTO.md) + - [NavigationActionDTO](doc//NavigationActionDTO.md) - [NtsGeometryServices](doc//NtsGeometryServices.md) - [NtsGeometryServicesCoordinateEqualityComparer](doc//NtsGeometryServicesCoordinateEqualityComparer.md) - [NtsGeometryServicesGeometryOverlay](doc//NtsGeometryServicesGeometryOverlay.md) @@ -244,12 +255,14 @@ Class | Method | HTTP request | Description - [Ordinates](doc//Ordinates.md) - [PdfDTO](doc//PdfDTO.md) - [PlayerMessageDTO](doc//PlayerMessageDTO.md) + - [PoiStatDTO](doc//PoiStatDTO.md) - [Point](doc//Point.md) - [PointAllOfBoundary](doc//PointAllOfBoundary.md) - [PointAllOfCoordinate](doc//PointAllOfCoordinate.md) - [PointAllOfCoordinateSequence](doc//PointAllOfCoordinateSequence.md) - [PrecisionModel](doc//PrecisionModel.md) - [PrecisionModels](doc//PrecisionModels.md) + - [ProblemDetails](doc//ProblemDetails.md) - [ProgrammeBlock](doc//ProgrammeBlock.md) - [ProgrammeBlockDTO](doc//ProgrammeBlockDTO.md) - [QuestionDTO](doc//QuestionDTO.md) @@ -259,6 +272,7 @@ Class | Method | HTTP request | Description - [QuizQuestion](doc//QuizQuestion.md) - [QuizQuestionGuidedStep](doc//QuizQuestionGuidedStep.md) - [QuizQuestionSectionQuiz](doc//QuizQuestionSectionQuiz.md) + - [QuizStatDTO](doc//QuizStatDTO.md) - [Resource](doc//Resource.md) - [ResourceDTO](doc//ResourceDTO.md) - [ResourceType](doc//ResourceType.md) @@ -275,14 +289,17 @@ Class | Method | HTTP request | Description - [SectionMapAllOfMapResource](doc//SectionMapAllOfMapResource.md) - [SectionMapAllOfMapTypeMapbox](doc//SectionMapAllOfMapTypeMapbox.md) - [SectionQuiz](doc//SectionQuiz.md) + - [SectionStatDTO](doc//SectionStatDTO.md) - [SectionType](doc//SectionType.md) - [SliderDTO](doc//SliderDTO.md) + - [StatsSummaryDTO](doc//StatsSummaryDTO.md) - [TokenDTO](doc//TokenDTO.md) - [TranslationAndResourceDTO](doc//TranslationAndResourceDTO.md) - [TranslationDTO](doc//TranslationDTO.md) - [User](doc//User.md) - [UserDetailDTO](doc//UserDetailDTO.md) - [VideoDTO](doc//VideoDTO.md) + - [VisitEventDTO](doc//VisitEventDTO.md) - [WeatherDTO](doc//WeatherDTO.md) - [WebDTO](doc//WebDTO.md) diff --git a/manager_api_new/doc/AIApi.md b/manager_api_new/doc/AIApi.md new file mode 100644 index 0000000..c6ed324 --- /dev/null +++ b/manager_api_new/doc/AIApi.md @@ -0,0 +1,57 @@ +# manager_api_new.api.AIApi + +## Load the API package +```dart +import 'package:manager_api_new/api.dart'; +``` + +All URIs are relative to *http://192.168.31.228:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**aiChat**](AIApi.md#aichat) | **POST** /api/Ai/chat | + + +# **aiChat** +> AiChatResponse aiChat(aiChatRequest) + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AIApi(); +final aiChatRequest = AiChatRequest(); // AiChatRequest | + +try { + final result = api_instance.aiChat(aiChatRequest); + print(result); +} catch (e) { + print('Exception when calling AIApi->aiChat: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aiChatRequest** | [**AiChatRequest**](AiChatRequest.md)| | + +### Return type + +[**AiChatResponse**](AiChatResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_new/doc/AgendaEventStatDTO.md b/manager_api_new/doc/AgendaEventStatDTO.md new file mode 100644 index 0000000..9e9a489 --- /dev/null +++ b/manager_api_new/doc/AgendaEventStatDTO.md @@ -0,0 +1,17 @@ +# manager_api_new.model.AgendaEventStatDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**eventId** | **String** | | [optional] +**eventTitle** | **String** | | [optional] +**taps** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/AiCardDTO.md b/manager_api_new/doc/AiCardDTO.md new file mode 100644 index 0000000..e3d7931 --- /dev/null +++ b/manager_api_new/doc/AiCardDTO.md @@ -0,0 +1,17 @@ +# manager_api_new.model.AiCardDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **String** | | [optional] +**subtitle** | **String** | | [optional] +**icon** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/AiChatMessage.md b/manager_api_new/doc/AiChatMessage.md new file mode 100644 index 0000000..0f77461 --- /dev/null +++ b/manager_api_new/doc/AiChatMessage.md @@ -0,0 +1,16 @@ +# manager_api_new.model.AiChatMessage + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role** | **String** | | [optional] +**content** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/AiChatRequest.md b/manager_api_new/doc/AiChatRequest.md new file mode 100644 index 0000000..1e2eb05 --- /dev/null +++ b/manager_api_new/doc/AiChatRequest.md @@ -0,0 +1,20 @@ +# manager_api_new.model.AiChatRequest + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | [optional] +**instanceId** | **String** | | [optional] +**appType** | [**AppType**](AppType.md) | | [optional] +**configurationId** | **String** | | [optional] +**language** | **String** | | [optional] +**history** | [**List**](AiChatMessage.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/AiChatResponse.md b/manager_api_new/doc/AiChatResponse.md new file mode 100644 index 0000000..e4680dc --- /dev/null +++ b/manager_api_new/doc/AiChatResponse.md @@ -0,0 +1,17 @@ +# manager_api_new.model.AiChatResponse + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reply** | **String** | | [optional] +**cards** | [**List**](AiCardDTO.md) | | [optional] [default to const []] +**navigation** | [**AiChatResponseNavigation**](AiChatResponseNavigation.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/AiChatResponseNavigation.md b/manager_api_new/doc/AiChatResponseNavigation.md new file mode 100644 index 0000000..da85ad1 --- /dev/null +++ b/manager_api_new/doc/AiChatResponseNavigation.md @@ -0,0 +1,17 @@ +# manager_api_new.model.AiChatResponseNavigation + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sectionId** | **String** | | [optional] +**sectionTitle** | **String** | | [optional] +**sectionType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/AppConfigurationLinkApplicationInstance.md b/manager_api_new/doc/AppConfigurationLinkApplicationInstance.md index c5cea4a..1395a7c 100644 --- a/manager_api_new/doc/AppConfigurationLinkApplicationInstance.md +++ b/manager_api_new/doc/AppConfigurationLinkApplicationInstance.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **languages** | **List** | | [optional] [default to const []] **sectionEventId** | **String** | | [optional] **sectionEvent** | [**ApplicationInstanceSectionEvent**](ApplicationInstanceSectionEvent.md) | | [optional] +**isAssistant** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/ApplicationInstance.md b/manager_api_new/doc/ApplicationInstance.md index ef8a2f7..b2c3546 100644 --- a/manager_api_new/doc/ApplicationInstance.md +++ b/manager_api_new/doc/ApplicationInstance.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **languages** | **List** | | [optional] [default to const []] **sectionEventId** | **String** | | [optional] **sectionEvent** | [**ApplicationInstanceSectionEvent**](ApplicationInstanceSectionEvent.md) | | [optional] +**isAssistant** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/ApplicationInstanceDTO.md b/manager_api_new/doc/ApplicationInstanceDTO.md index f71507b..a594b11 100644 --- a/manager_api_new/doc/ApplicationInstanceDTO.md +++ b/manager_api_new/doc/ApplicationInstanceDTO.md @@ -22,6 +22,8 @@ Name | Type | Description | Notes **languages** | **List** | | [optional] [default to const []] **sectionEventId** | **String** | | [optional] **sectionEventDTO** | [**ApplicationInstanceDTOSectionEventDTO**](ApplicationInstanceDTOSectionEventDTO.md) | | [optional] +**isAssistant** | **bool** | | [optional] +**isStatistic** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/DayStatDTO.md b/manager_api_new/doc/DayStatDTO.md new file mode 100644 index 0000000..64dcdd1 --- /dev/null +++ b/manager_api_new/doc/DayStatDTO.md @@ -0,0 +1,18 @@ +# manager_api_new.model.DayStatDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **String** | | [optional] +**total** | **int** | | [optional] +**mobile** | **int** | | [optional] +**tablet** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/GameDTO.md b/manager_api_new/doc/GameDTO.md index 151e328..0681458 100644 --- a/manager_api_new/doc/GameDTO.md +++ b/manager_api_new/doc/GameDTO.md @@ -34,6 +34,7 @@ Name | Type | Description | Notes **rows** | **int** | | [optional] **cols** | **int** | | [optional] **gameType** | [**GameTypes**](GameTypes.md) | | [optional] +**guidedPaths** | [**List**](GuidedPathDTO.md) | | [optional] [default to const []] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/GameStatDTO.md b/manager_api_new/doc/GameStatDTO.md new file mode 100644 index 0000000..748f7b7 --- /dev/null +++ b/manager_api_new/doc/GameStatDTO.md @@ -0,0 +1,17 @@ +# manager_api_new.model.GameStatDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**gameType** | **String** | | [optional] +**completions** | **int** | | [optional] +**avgDurationSeconds** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/GuidedPathDTO.md b/manager_api_new/doc/GuidedPathDTO.md index b3bf456..18ea4c6 100644 --- a/manager_api_new/doc/GuidedPathDTO.md +++ b/manager_api_new/doc/GuidedPathDTO.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] **sectionMapId** | **String** | | [optional] **sectionEventId** | **String** | | [optional] +**sectionGameId** | **String** | | [optional] **isLinear** | **bool** | | [optional] **requireSuccessToAdvance** | **bool** | | [optional] **hideNextStepsUntilComplete** | **bool** | | [optional] diff --git a/manager_api_new/doc/Instance.md b/manager_api_new/doc/Instance.md index 26ec759..059c32b 100644 --- a/manager_api_new/doc/Instance.md +++ b/manager_api_new/doc/Instance.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **isTablet** | **bool** | | [optional] **isWeb** | **bool** | | [optional] **isVR** | **bool** | | [optional] +**isAssistant** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/InstanceDTO.md b/manager_api_new/doc/InstanceDTO.md index 0bfc79c..7f7615f 100644 --- a/manager_api_new/doc/InstanceDTO.md +++ b/manager_api_new/doc/InstanceDTO.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **isTablet** | **bool** | | [optional] **isWeb** | **bool** | | [optional] **isVR** | **bool** | | [optional] +**isAssistant** | **bool** | | [optional] **applicationInstanceDTOs** | [**List**](ApplicationInstanceDTO.md) | | [optional] [default to const []] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/MapDTO.md b/manager_api_new/doc/MapDTO.md index f55c258..acb39e8 100644 --- a/manager_api_new/doc/MapDTO.md +++ b/manager_api_new/doc/MapDTO.md @@ -37,6 +37,8 @@ Name | Type | Description | Notes **categories** | [**List**](CategorieDTO.md) | | [optional] [default to const []] **centerLatitude** | **String** | | [optional] **centerLongitude** | **String** | | [optional] +**isParcours** | **bool** | | [optional] +**guidedPaths** | [**List**](GuidedPathDTO.md) | | [optional] [default to const []] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/NavigationActionDTO.md b/manager_api_new/doc/NavigationActionDTO.md new file mode 100644 index 0000000..72608fd --- /dev/null +++ b/manager_api_new/doc/NavigationActionDTO.md @@ -0,0 +1,17 @@ +# manager_api_new.model.NavigationActionDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sectionId** | **String** | | [optional] +**sectionTitle** | **String** | | [optional] +**sectionType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/PoiStatDTO.md b/manager_api_new/doc/PoiStatDTO.md new file mode 100644 index 0000000..2e87f4d --- /dev/null +++ b/manager_api_new/doc/PoiStatDTO.md @@ -0,0 +1,18 @@ +# manager_api_new.model.PoiStatDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**geoPointId** | **int** | | [optional] +**title** | **String** | | [optional] +**taps** | **int** | | [optional] +**sectionId** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/ProblemDetails.md b/manager_api_new/doc/ProblemDetails.md new file mode 100644 index 0000000..6488d18 --- /dev/null +++ b/manager_api_new/doc/ProblemDetails.md @@ -0,0 +1,20 @@ +# manager_api_new.model.ProblemDetails + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | | [optional] +**title** | **String** | | [optional] +**status** | **int** | | [optional] +**detail** | **String** | | [optional] +**instance** | **String** | | [optional] +**extensions** | [**Map**](Object.md) | | [optional] [default to const {}] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/QuizStatDTO.md b/manager_api_new/doc/QuizStatDTO.md new file mode 100644 index 0000000..13b31d8 --- /dev/null +++ b/manager_api_new/doc/QuizStatDTO.md @@ -0,0 +1,19 @@ +# manager_api_new.model.QuizStatDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sectionId** | **String** | | [optional] +**sectionTitle** | **String** | | [optional] +**avgScore** | **double** | | [optional] +**totalQuestions** | **int** | | [optional] +**completions** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/SectionStatDTO.md b/manager_api_new/doc/SectionStatDTO.md new file mode 100644 index 0000000..8bbff17 --- /dev/null +++ b/manager_api_new/doc/SectionStatDTO.md @@ -0,0 +1,18 @@ +# manager_api_new.model.SectionStatDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sectionId** | **String** | | [optional] +**sectionTitle** | **String** | | [optional] +**views** | **int** | | [optional] +**avgDurationSeconds** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/StatsApi.md b/manager_api_new/doc/StatsApi.md new file mode 100644 index 0000000..42b7509 --- /dev/null +++ b/manager_api_new/doc/StatsApi.md @@ -0,0 +1,106 @@ +# manager_api_new.api.StatsApi + +## Load the API package +```dart +import 'package:manager_api_new/api.dart'; +``` + +All URIs are relative to *http://192.168.31.228:5000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**statsGetSummary**](StatsApi.md#statsgetsummary) | **GET** /api/Stats/summary | +[**statsTrackEvent**](StatsApi.md#statstrackevent) | **POST** /api/Stats/event | + + +# **statsGetSummary** +> StatsSummaryDTO statsGetSummary(instanceId, from, to, appType) + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = StatsApi(); +final instanceId = instanceId_example; // String | +final from = 2013-10-20T19:20:30+01:00; // DateTime | +final to = 2013-10-20T19:20:30+01:00; // DateTime | +final appType = appType_example; // String | + +try { + final result = api_instance.statsGetSummary(instanceId, from, to, appType); + print(result); +} catch (e) { + print('Exception when calling StatsApi->statsGetSummary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] + **from** | **DateTime**| | [optional] + **to** | **DateTime**| | [optional] + **appType** | **String**| | [optional] + +### Return type + +[**StatsSummaryDTO**](StatsSummaryDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **statsTrackEvent** +> statsTrackEvent(visitEventDTO) + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = StatsApi(); +final visitEventDTO = VisitEventDTO(); // VisitEventDTO | + +try { + api_instance.statsTrackEvent(visitEventDTO); +} catch (e) { + print('Exception when calling StatsApi->statsTrackEvent: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **visitEventDTO** | [**VisitEventDTO**](VisitEventDTO.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_new/doc/StatsSummaryDTO.md b/manager_api_new/doc/StatsSummaryDTO.md new file mode 100644 index 0000000..26b021a --- /dev/null +++ b/manager_api_new/doc/StatsSummaryDTO.md @@ -0,0 +1,24 @@ +# manager_api_new.model.StatsSummaryDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**totalSessions** | **int** | | [optional] +**avgVisitDurationSeconds** | **int** | | [optional] +**topSections** | [**List**](SectionStatDTO.md) | | [optional] [default to const []] +**visitsByDay** | [**List**](DayStatDTO.md) | | [optional] [default to const []] +**languageDistribution** | **Map** | | [optional] [default to const {}] +**appTypeDistribution** | **Map** | | [optional] [default to const {}] +**topPois** | [**List**](PoiStatDTO.md) | | [optional] [default to const []] +**topAgendaEvents** | [**List**](AgendaEventStatDTO.md) | | [optional] [default to const []] +**quizStats** | [**List**](QuizStatDTO.md) | | [optional] [default to const []] +**gameStats** | [**List**](GameStatDTO.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/VisitEventDTO.md b/manager_api_new/doc/VisitEventDTO.md new file mode 100644 index 0000000..b12a80f --- /dev/null +++ b/manager_api_new/doc/VisitEventDTO.md @@ -0,0 +1,24 @@ +# manager_api_new.model.VisitEventDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instanceId** | **String** | | [optional] +**configurationId** | **String** | | [optional] +**sectionId** | **String** | | [optional] +**sessionId** | **String** | | [optional] +**eventType** | **String** | | [optional] +**appType** | **String** | | [optional] +**language** | **String** | | [optional] +**durationSeconds** | **int** | | [optional] +**metadata** | **String** | | [optional] +**timestamp** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/lib/api.dart b/manager_api_new/lib/api.dart index 2f81630..ca264ea 100644 --- a/manager_api_new/lib/api.dart +++ b/manager_api_new/lib/api.dart @@ -28,6 +28,7 @@ part 'auth/oauth.dart'; part 'auth/http_basic_auth.dart'; part 'auth/http_bearer_auth.dart'; +part 'api/ai_api.dart'; part 'api/application_instance_api.dart'; part 'api/authentication_api.dart'; part 'api/configuration_api.dart'; @@ -39,10 +40,16 @@ part 'api/section_agenda_api.dart'; part 'api/section_event_api.dart'; part 'api/section_map_api.dart'; part 'api/section_quiz_api.dart'; +part 'api/stats_api.dart'; part 'api/user_api.dart'; part 'model/agenda_dto.dart'; part 'model/agenda_dto_all_of_agenda_map_provider.dart'; +part 'model/ai_card_dto.dart'; +part 'model/ai_chat_message.dart'; +part 'model/ai_chat_request.dart'; +part 'model/ai_chat_response.dart'; +part 'model/ai_chat_response_navigation.dart'; part 'model/app_configuration_link.dart'; part 'model/app_configuration_link_application_instance.dart'; part 'model/app_configuration_link_configuration.dart'; @@ -51,6 +58,7 @@ part 'model/app_configuration_link_dto_configuration.dart'; part 'model/app_configuration_link_dto_device.dart'; part 'model/app_configuration_link_device.dart'; part 'model/app_type.dart'; +part 'model/app_type_extensions.dart'; part 'model/application_instance.dart'; part 'model/application_instance_dto.dart'; part 'model/application_instance_dto_section_event_dto.dart'; @@ -114,6 +122,7 @@ part 'model/map_provider.dart'; part 'model/map_type_app.dart'; part 'model/map_type_map_box.dart'; part 'model/menu_dto.dart'; +part 'model/navigation_action_dto.dart'; part 'model/nts_geometry_services.dart'; part 'model/nts_geometry_services_coordinate_equality_comparer.dart'; part 'model/nts_geometry_services_geometry_overlay.dart'; @@ -128,6 +137,7 @@ part 'model/point_all_of_coordinate.dart'; part 'model/point_all_of_coordinate_sequence.dart'; part 'model/precision_model.dart'; part 'model/precision_models.dart'; +part 'model/problem_details.dart'; part 'model/programme_block.dart'; part 'model/programme_block_dto.dart'; part 'model/question_dto.dart'; @@ -155,12 +165,14 @@ part 'model/section_map_all_of_map_type_mapbox.dart'; part 'model/section_quiz.dart'; part 'model/section_type.dart'; part 'model/slider_dto.dart'; +part 'model/stats_summary_dto.dart'; part 'model/token_dto.dart'; part 'model/translation_and_resource_dto.dart'; part 'model/translation_dto.dart'; part 'model/user.dart'; part 'model/user_detail_dto.dart'; part 'model/video_dto.dart'; +part 'model/visit_event_dto.dart'; part 'model/weather_dto.dart'; part 'model/web_dto.dart'; diff --git a/manager_api_new/lib/api/ai_api.dart b/manager_api_new/lib/api/ai_api.dart new file mode 100644 index 0000000..f37ca63 --- /dev/null +++ b/manager_api_new/lib/api/ai_api.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AIApi { + AIApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Ai/chat' operation and returns the [Response]. + /// Parameters: + /// + /// * [AiChatRequest] aiChatRequest (required): + Future aiChatWithHttpInfo( + AiChatRequest aiChatRequest, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/Ai/chat'; + + // ignore: prefer_final_locals + Object? postBody = aiChatRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [AiChatRequest] aiChatRequest (required): + Future aiChat( + AiChatRequest aiChatRequest, + ) async { + final response = await aiChatWithHttpInfo( + aiChatRequest, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'AiChatResponse', + ) as AiChatResponse; + } + return null; + } +} diff --git a/manager_api_new/lib/api/stats_api.dart b/manager_api_new/lib/api/stats_api.dart new file mode 100644 index 0000000..a1f9f6c --- /dev/null +++ b/manager_api_new/lib/api/stats_api.dart @@ -0,0 +1,93 @@ +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class StatsApi { + StatsApi([ApiClient? apiClient]) + : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Track a single visit event (anonymous) + Future statsTrackEventWithHttpInfo(VisitEventDTO visitEventDTO) async { + const path = r'/api/Stats/event'; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + visitEventDTO, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future statsTrackEvent(VisitEventDTO visitEventDTO) async { + final response = await statsTrackEventWithHttpInfo(visitEventDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + } + + /// Get aggregated statistics for an instance + Future statsGetSummaryWithHttpInfo( + String instanceId, { + DateTime? from, + DateTime? to, + String? appType, + }) async { + const path = r'/api/Stats/summary'; + + final queryParams = [ + QueryParam(r'instanceId', instanceId), + if (from != null) QueryParam(r'from', parameterToString(from)), + if (to != null) QueryParam(r'to', parameterToString(to)), + if (appType != null) QueryParam(r'appType', appType), + ]; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + null, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future statsGetSummary( + String instanceId, { + DateTime? from, + DateTime? to, + String? appType, + }) async { + final response = await statsGetSummaryWithHttpInfo(instanceId, from: from, to: to, appType: appType); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'StatsSummaryDTO', + ) as StatsSummaryDTO; + } + return null; + } +} diff --git a/manager_api_new/lib/api_client.dart b/manager_api_new/lib/api_client.dart index 9d4b385..bd71a5f 100644 --- a/manager_api_new/lib/api_client.dart +++ b/manager_api_new/lib/api_client.dart @@ -233,6 +233,18 @@ class ApiClient { return AgendaDTO.fromJson(value); case 'AgendaDTOAllOfAgendaMapProvider': return AgendaDTOAllOfAgendaMapProvider.fromJson(value); + case 'AgendaEventStatDTO': + return AgendaEventStatDTO.fromJson(value); + case 'AiCardDTO': + return AiCardDTO.fromJson(value); + case 'AiChatMessage': + return AiChatMessage.fromJson(value); + case 'AiChatRequest': + return AiChatRequest.fromJson(value); + case 'AiChatResponse': + return AiChatResponse.fromJson(value); + case 'AiChatResponseNavigation': + return AiChatResponseNavigation.fromJson(value); case 'AppConfigurationLink': return AppConfigurationLink.fromJson(value); case 'AppConfigurationLinkApplicationInstance': @@ -275,6 +287,8 @@ class ApiClient { return CoordinateSequence.fromJson(value); case 'CoordinateSequenceFactory': return CoordinateSequenceFactory.fromJson(value); + case 'DayStatDTO': + return DayStatDTO.fromJson(value); case 'Device': return Device.fromJson(value); case 'DeviceDTO': @@ -301,6 +315,8 @@ class ApiClient { return GameDTO.fromJson(value); case 'GameDTOAllOfPuzzleImage': return GameDTOAllOfPuzzleImage.fromJson(value); + case 'GameStatDTO': + return GameStatDTO.fromJson(value); case 'GameTypes': return GameTypesTypeTransformer().decode(value); case 'GeoPoint': @@ -375,6 +391,8 @@ class ApiClient { return MapTypeMapBoxTypeTransformer().decode(value); case 'MenuDTO': return MenuDTO.fromJson(value); + case 'NavigationActionDTO': + return NavigationActionDTO.fromJson(value); case 'NtsGeometryServices': return NtsGeometryServices.fromJson(value); case 'NtsGeometryServicesCoordinateEqualityComparer': @@ -391,6 +409,8 @@ class ApiClient { return PdfDTO.fromJson(value); case 'PlayerMessageDTO': return PlayerMessageDTO.fromJson(value); + case 'PoiStatDTO': + return PoiStatDTO.fromJson(value); case 'Point': return Point.fromJson(value); case 'PointAllOfBoundary': @@ -403,6 +423,8 @@ class ApiClient { return PrecisionModel.fromJson(value); case 'PrecisionModels': return PrecisionModelsTypeTransformer().decode(value); + case 'ProblemDetails': + return ProblemDetails.fromJson(value); case 'ProgrammeBlock': return ProgrammeBlock.fromJson(value); case 'ProgrammeBlockDTO': @@ -421,6 +443,8 @@ class ApiClient { return QuizQuestionGuidedStep.fromJson(value); case 'QuizQuestionSectionQuiz': return QuizQuestionSectionQuiz.fromJson(value); + case 'QuizStatDTO': + return QuizStatDTO.fromJson(value); case 'Resource': return Resource.fromJson(value); case 'ResourceDTO': @@ -453,10 +477,14 @@ class ApiClient { return SectionMapAllOfMapTypeMapbox.fromJson(value); case 'SectionQuiz': return SectionQuiz.fromJson(value); + case 'SectionStatDTO': + return SectionStatDTO.fromJson(value); case 'SectionType': return SectionTypeTypeTransformer().decode(value); case 'SliderDTO': return SliderDTO.fromJson(value); + case 'StatsSummaryDTO': + return StatsSummaryDTO.fromJson(value); case 'TokenDTO': return TokenDTO.fromJson(value); case 'TranslationAndResourceDTO': @@ -469,6 +497,8 @@ class ApiClient { return UserDetailDTO.fromJson(value); case 'VideoDTO': return VideoDTO.fromJson(value); + case 'VisitEventDTO': + return VisitEventDTO.fromJson(value); case 'WeatherDTO': return WeatherDTO.fromJson(value); case 'WebDTO': diff --git a/manager_api_new/lib/model/ai_card_dto.dart b/manager_api_new/lib/model/ai_card_dto.dart new file mode 100644 index 0000000..832041b --- /dev/null +++ b/manager_api_new/lib/model/ai_card_dto.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AiCardDTO { + /// Returns a new [AiCardDTO] instance. + AiCardDTO({ + this.title, + this.subtitle, + this.icon, + }); + + String? title; + + String? subtitle; + + String? icon; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AiCardDTO && + other.title == title && + other.subtitle == subtitle && + other.icon == icon; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (title == null ? 0 : title!.hashCode) + + (subtitle == null ? 0 : subtitle!.hashCode) + + (icon == null ? 0 : icon!.hashCode); + + @override + String toString() => + 'AiCardDTO[title=$title, subtitle=$subtitle, icon=$icon]'; + + Map toJson() { + final json = {}; + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.subtitle != null) { + json[r'subtitle'] = this.subtitle; + } else { + json[r'subtitle'] = null; + } + if (this.icon != null) { + json[r'icon'] = this.icon; + } else { + json[r'icon'] = null; + } + return json; + } + + /// Returns a new [AiCardDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AiCardDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "AiCardDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "AiCardDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AiCardDTO( + title: mapValueOfType(json, r'title'), + subtitle: mapValueOfType(json, r'subtitle'), + icon: mapValueOfType(json, r'icon'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = AiCardDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AiCardDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AiCardDTO-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = AiCardDTO.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/ai_chat_message.dart b/manager_api_new/lib/model/ai_chat_message.dart new file mode 100644 index 0000000..bedb9f5 --- /dev/null +++ b/manager_api_new/lib/model/ai_chat_message.dart @@ -0,0 +1,132 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AiChatMessage { + /// Returns a new [AiChatMessage] instance. + AiChatMessage({ + this.role, + this.content, + }); + + String? role; + + String? content; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AiChatMessage && other.role == role && other.content == content; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (role == null ? 0 : role!.hashCode) + + (content == null ? 0 : content!.hashCode); + + @override + String toString() => 'AiChatMessage[role=$role, content=$content]'; + + Map toJson() { + final json = {}; + if (this.role != null) { + json[r'role'] = this.role; + } else { + json[r'role'] = null; + } + if (this.content != null) { + json[r'content'] = this.content; + } else { + json[r'content'] = null; + } + return json; + } + + /// Returns a new [AiChatMessage] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AiChatMessage? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "AiChatMessage[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "AiChatMessage[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AiChatMessage( + role: mapValueOfType(json, r'role'), + content: mapValueOfType(json, r'content'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = AiChatMessage.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AiChatMessage.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AiChatMessage-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = AiChatMessage.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/ai_chat_request.dart b/manager_api_new/lib/model/ai_chat_request.dart new file mode 100644 index 0000000..7518e05 --- /dev/null +++ b/manager_api_new/lib/model/ai_chat_request.dart @@ -0,0 +1,185 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AiChatRequest { + /// Returns a new [AiChatRequest] instance. + AiChatRequest({ + this.message, + this.instanceId, + this.appType, + this.configurationId, + this.language, + this.history = const [], + }); + + String? message; + + String? instanceId; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + AppType? appType; + + String? configurationId; + + String? language; + + List? history; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AiChatRequest && + other.message == message && + other.instanceId == instanceId && + other.appType == appType && + other.configurationId == configurationId && + other.language == language && + _deepEquality.equals(other.history, history); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (message == null ? 0 : message!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + + (appType == null ? 0 : appType!.hashCode) + + (configurationId == null ? 0 : configurationId!.hashCode) + + (language == null ? 0 : language!.hashCode) + + (history == null ? 0 : history!.hashCode); + + @override + String toString() => + 'AiChatRequest[message=$message, instanceId=$instanceId, appType=$appType, configurationId=$configurationId, language=$language, history=$history]'; + + Map toJson() { + final json = {}; + if (this.message != null) { + json[r'message'] = this.message; + } else { + json[r'message'] = null; + } + if (this.instanceId != null) { + json[r'instanceId'] = this.instanceId; + } else { + json[r'instanceId'] = null; + } + if (this.appType != null) { + json[r'appType'] = this.appType; + } else { + json[r'appType'] = null; + } + if (this.configurationId != null) { + json[r'configurationId'] = this.configurationId; + } else { + json[r'configurationId'] = null; + } + if (this.language != null) { + json[r'language'] = this.language; + } else { + json[r'language'] = null; + } + if (this.history != null) { + json[r'history'] = this.history; + } else { + json[r'history'] = null; + } + return json; + } + + /// Returns a new [AiChatRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AiChatRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "AiChatRequest[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "AiChatRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AiChatRequest( + message: mapValueOfType(json, r'message'), + instanceId: mapValueOfType(json, r'instanceId'), + appType: AppType.fromJson(json[r'appType']), + configurationId: mapValueOfType(json, r'configurationId'), + language: mapValueOfType(json, r'language'), + history: AiChatMessage.listFromJson(json[r'history']), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = AiChatRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AiChatRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AiChatRequest-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = AiChatRequest.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/ai_chat_response.dart b/manager_api_new/lib/model/ai_chat_response.dart new file mode 100644 index 0000000..461c8cf --- /dev/null +++ b/manager_api_new/lib/model/ai_chat_response.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AiChatResponse { + /// Returns a new [AiChatResponse] instance. + AiChatResponse({ + this.reply, + this.cards = const [], + this.navigation, + }); + + String? reply; + + List? cards; + + AiChatResponseNavigation? navigation; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AiChatResponse && + other.reply == reply && + _deepEquality.equals(other.cards, cards) && + other.navigation == navigation; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (reply == null ? 0 : reply!.hashCode) + + (cards == null ? 0 : cards!.hashCode) + + (navigation == null ? 0 : navigation!.hashCode); + + @override + String toString() => + 'AiChatResponse[reply=$reply, cards=$cards, navigation=$navigation]'; + + Map toJson() { + final json = {}; + if (this.reply != null) { + json[r'reply'] = this.reply; + } else { + json[r'reply'] = null; + } + if (this.cards != null) { + json[r'cards'] = this.cards; + } else { + json[r'cards'] = null; + } + if (this.navigation != null) { + json[r'navigation'] = this.navigation; + } else { + json[r'navigation'] = null; + } + return json; + } + + /// Returns a new [AiChatResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AiChatResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "AiChatResponse[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "AiChatResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AiChatResponse( + reply: mapValueOfType(json, r'reply'), + cards: AiCardDTO.listFromJson(json[r'cards']), + navigation: AiChatResponseNavigation.fromJson(json[r'navigation']), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = AiChatResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AiChatResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AiChatResponse-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = AiChatResponse.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/ai_chat_response_navigation.dart b/manager_api_new/lib/model/ai_chat_response_navigation.dart new file mode 100644 index 0000000..a29e258 --- /dev/null +++ b/manager_api_new/lib/model/ai_chat_response_navigation.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AiChatResponseNavigation { + /// Returns a new [AiChatResponseNavigation] instance. + AiChatResponseNavigation({ + this.sectionId, + this.sectionTitle, + this.sectionType, + }); + + String? sectionId; + + String? sectionTitle; + + String? sectionType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AiChatResponseNavigation && + other.sectionId == sectionId && + other.sectionTitle == sectionTitle && + other.sectionType == sectionType; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (sectionId == null ? 0 : sectionId!.hashCode) + + (sectionTitle == null ? 0 : sectionTitle!.hashCode) + + (sectionType == null ? 0 : sectionType!.hashCode); + + @override + String toString() => + 'AiChatResponseNavigation[sectionId=$sectionId, sectionTitle=$sectionTitle, sectionType=$sectionType]'; + + Map toJson() { + final json = {}; + if (this.sectionId != null) { + json[r'sectionId'] = this.sectionId; + } else { + json[r'sectionId'] = null; + } + if (this.sectionTitle != null) { + json[r'sectionTitle'] = this.sectionTitle; + } else { + json[r'sectionTitle'] = null; + } + if (this.sectionType != null) { + json[r'sectionType'] = this.sectionType; + } else { + json[r'sectionType'] = null; + } + return json; + } + + /// Returns a new [AiChatResponseNavigation] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AiChatResponseNavigation? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "AiChatResponseNavigation[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "AiChatResponseNavigation[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AiChatResponseNavigation( + sectionId: mapValueOfType(json, r'sectionId'), + sectionTitle: mapValueOfType(json, r'sectionTitle'), + sectionType: mapValueOfType(json, r'sectionType'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = AiChatResponseNavigation.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AiChatResponseNavigation.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AiChatResponseNavigation-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = AiChatResponseNavigation.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/app_type_extensions.dart b/manager_api_new/lib/model/app_type_extensions.dart new file mode 100644 index 0000000..351be28 --- /dev/null +++ b/manager_api_new/lib/model/app_type_extensions.dart @@ -0,0 +1,22 @@ +// @dart=2.18 + +part of openapi.api; + +/// Extension ajoutant le nom string à [AppType], synchronisé avec l'enum C# backend. +/// À mettre à jour si de nouvelles valeurs sont ajoutées au backend. +extension AppTypeName on AppType { + String get name { + switch (value) { + case 0: + return 'Mobile'; + case 1: + return 'Tablet'; + case 2: + return 'Web'; + case 3: + return 'VR'; + default: + return value.toString(); + } + } +} diff --git a/manager_api_new/lib/model/application_instance.dart b/manager_api_new/lib/model/application_instance.dart index c99251f..53d1cfc 100644 --- a/manager_api_new/lib/model/application_instance.dart +++ b/manager_api_new/lib/model/application_instance.dart @@ -27,6 +27,7 @@ class ApplicationInstance { this.languages = const [], this.sectionEventId, this.sectionEvent, + this.isAssistant, }); String instanceId; @@ -63,6 +64,14 @@ class ApplicationInstance { ApplicationInstanceSectionEvent? sectionEvent; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isAssistant; + @override bool operator ==(Object other) => identical(this, other) || @@ -80,7 +89,8 @@ class ApplicationInstance { other.layoutMainPage == layoutMainPage && _deepEquality.equals(other.languages, languages) && other.sectionEventId == sectionEventId && - other.sectionEvent == sectionEvent; + other.sectionEvent == sectionEvent && + other.isAssistant == isAssistant; @override int get hashCode => @@ -98,11 +108,12 @@ class ApplicationInstance { (layoutMainPage == null ? 0 : layoutMainPage!.hashCode) + (languages == null ? 0 : languages!.hashCode) + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + - (sectionEvent == null ? 0 : sectionEvent!.hashCode); + (sectionEvent == null ? 0 : sectionEvent!.hashCode) + + (isAssistant == null ? 0 : isAssistant!.hashCode); @override String toString() => - 'ApplicationInstance[instanceId=$instanceId, appType=$appType, id=$id, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent]'; + 'ApplicationInstance[instanceId=$instanceId, appType=$appType, id=$id, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent, isAssistant=$isAssistant]'; Map toJson() { final json = {}; @@ -168,6 +179,11 @@ class ApplicationInstance { } else { json[r'sectionEvent'] = null; } + if (this.isAssistant != null) { + json[r'isAssistant'] = this.isAssistant; + } else { + json[r'isAssistant'] = null; + } return json; } @@ -212,6 +228,7 @@ class ApplicationInstance { sectionEventId: mapValueOfType(json, r'sectionEventId'), sectionEvent: ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']), + isAssistant: mapValueOfType(json, r'isAssistant'), ); } return null; diff --git a/manager_api_new/lib/model/application_instance_dto.dart b/manager_api_new/lib/model/application_instance_dto.dart index f73f8ae..9e1de79 100644 --- a/manager_api_new/lib/model/application_instance_dto.dart +++ b/manager_api_new/lib/model/application_instance_dto.dart @@ -27,6 +27,8 @@ class ApplicationInstanceDTO { this.languages = const [], this.sectionEventId, this.sectionEventDTO, + this.isAssistant, + this.isStatistic, }); String? id; @@ -69,6 +71,10 @@ class ApplicationInstanceDTO { SectionEventDTO? sectionEventDTO; + bool? isAssistant; + + bool? isStatistic; + @override bool operator ==(Object other) => identical(this, other) || @@ -86,7 +92,9 @@ class ApplicationInstanceDTO { other.layoutMainPage == layoutMainPage && _deepEquality.equals(other.languages, languages) && other.sectionEventId == sectionEventId && - other.sectionEventDTO == sectionEventDTO; + other.sectionEventDTO == sectionEventDTO && + other.isAssistant == isAssistant && + other.isStatistic == isStatistic; @override int get hashCode => @@ -104,11 +112,13 @@ class ApplicationInstanceDTO { (layoutMainPage == null ? 0 : layoutMainPage!.hashCode) + (languages == null ? 0 : languages!.hashCode) + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + - (sectionEventDTO == null ? 0 : sectionEventDTO!.hashCode); + (sectionEventDTO == null ? 0 : sectionEventDTO!.hashCode) + + (isAssistant == null ? 0 : isAssistant!.hashCode) + + (isStatistic == null ? 0 : isStatistic!.hashCode); @override String toString() => - 'ApplicationInstanceDTO[id=$id, instanceId=$instanceId, appType=$appType, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEventDTO=$sectionEventDTO]'; + 'ApplicationInstanceDTO[id=$id, instanceId=$instanceId, appType=$appType, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEventDTO=$sectionEventDTO, isAssistant=$isAssistant, isStatistic=$isStatistic]'; Map toJson() { final json = {}; @@ -182,6 +192,16 @@ class ApplicationInstanceDTO { } else { json[r'sectionEventDTO'] = null; } + if (this.isAssistant != null) { + json[r'isAssistant'] = this.isAssistant; + } else { + json[r'isAssistant'] = null; + } + if (this.isStatistic != null) { + json[r'isStatistic'] = this.isStatistic; + } else { + json[r'isStatistic'] = null; + } return json; } @@ -224,8 +244,9 @@ class ApplicationInstanceDTO { .toList(growable: false) : const [], sectionEventId: mapValueOfType(json, r'sectionEventId'), - sectionEventDTO: SectionEventDTO.fromJson( - json[r'sectionEventDTO']), + sectionEventDTO: SectionEventDTO.fromJson(json[r'sectionEventDTO']), + isAssistant: mapValueOfType(json, r'isAssistant'), + isStatistic: mapValueOfType(json, r'isStatistic'), ); } return null; diff --git a/manager_api_new/lib/model/guided_path_dto.dart b/manager_api_new/lib/model/guided_path_dto.dart index 45e8bcd..0366439 100644 --- a/manager_api_new/lib/model/guided_path_dto.dart +++ b/manager_api_new/lib/model/guided_path_dto.dart @@ -65,12 +65,6 @@ class GuidedPathDTO { /// bool? hideNextStepsUntilComplete; - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// int? order; List? steps; @@ -129,12 +123,12 @@ class GuidedPathDTO { json[r'instanceId'] = null; } if (this.title != null) { - json[r'title'] = this.title!.map((v) => v.toJson()).toList(); + json[r'title'] = this.title; } else { json[r'title'] = null; } if (this.description != null) { - json[r'description'] = this.description!.map((v) => v.toJson()).toList(); + json[r'description'] = this.description; } else { json[r'description'] = null; } @@ -174,7 +168,7 @@ class GuidedPathDTO { json[r'order'] = null; } if (this.steps != null) { - json[r'steps'] = this.steps!.map((v) => v.toJson()).toList(); + json[r'steps'] = this.steps; } else { json[r'steps'] = null; } diff --git a/manager_api_new/lib/model/instance.dart b/manager_api_new/lib/model/instance.dart index b1fb94d..77d886f 100644 --- a/manager_api_new/lib/model/instance.dart +++ b/manager_api_new/lib/model/instance.dart @@ -23,6 +23,7 @@ class Instance { this.isTablet, this.isWeb, this.isVR, + this.isAssistant, }); String id; @@ -87,6 +88,14 @@ class Instance { /// bool? isVR; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isAssistant; + @override bool operator ==(Object other) => identical(this, other) || @@ -100,7 +109,8 @@ class Instance { other.isMobile == isMobile && other.isTablet == isTablet && other.isWeb == isWeb && - other.isVR == isVR; + other.isVR == isVR && + other.isAssistant == isAssistant; @override int get hashCode => @@ -114,11 +124,12 @@ class Instance { (isMobile == null ? 0 : isMobile!.hashCode) + (isTablet == null ? 0 : isTablet!.hashCode) + (isWeb == null ? 0 : isWeb!.hashCode) + - (isVR == null ? 0 : isVR!.hashCode); + (isVR == null ? 0 : isVR!.hashCode) + + (isAssistant == null ? 0 : isAssistant!.hashCode); @override String toString() => - 'Instance[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR]'; + 'Instance[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR, isAssistant=$isAssistant]'; Map toJson() { final json = {}; @@ -164,6 +175,11 @@ class Instance { } else { json[r'isVR'] = null; } + if (this.isAssistant != null) { + json[r'isAssistant'] = this.isAssistant; + } else { + json[r'isAssistant'] = null; + } return json; } @@ -198,6 +214,7 @@ class Instance { isTablet: mapValueOfType(json, r'isTablet'), isWeb: mapValueOfType(json, r'isWeb'), isVR: mapValueOfType(json, r'isVR'), + isAssistant: mapValueOfType(json, r'isAssistant'), ); } return null; diff --git a/manager_api_new/lib/model/instance_dto.dart b/manager_api_new/lib/model/instance_dto.dart index 5e2e74f..8d7e076 100644 --- a/manager_api_new/lib/model/instance_dto.dart +++ b/manager_api_new/lib/model/instance_dto.dart @@ -23,6 +23,7 @@ class InstanceDTO { this.isTablet, this.isWeb, this.isVR, + this.isAssistant, this.applicationInstanceDTOs = const [], }); @@ -82,6 +83,8 @@ class InstanceDTO { /// bool? isVR; + bool? isAssistant; + List? applicationInstanceDTOs; @override @@ -98,6 +101,7 @@ class InstanceDTO { other.isTablet == isTablet && other.isWeb == isWeb && other.isVR == isVR && + other.isAssistant == isAssistant && _deepEquality.equals( other.applicationInstanceDTOs, applicationInstanceDTOs); @@ -114,11 +118,12 @@ class InstanceDTO { (isTablet == null ? 0 : isTablet!.hashCode) + (isWeb == null ? 0 : isWeb!.hashCode) + (isVR == null ? 0 : isVR!.hashCode) + + (isAssistant == null ? 0 : isAssistant!.hashCode) + (applicationInstanceDTOs == null ? 0 : applicationInstanceDTOs!.hashCode); @override String toString() => - 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR, applicationInstanceDTOs=$applicationInstanceDTOs]'; + 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR, isAssistant=$isAssistant, applicationInstanceDTOs=$applicationInstanceDTOs]'; Map toJson() { final json = {}; @@ -172,6 +177,11 @@ class InstanceDTO { } else { json[r'isVR'] = null; } + if (this.isAssistant != null) { + json[r'isAssistant'] = this.isAssistant; + } else { + json[r'isAssistant'] = null; + } if (this.applicationInstanceDTOs != null) { json[r'applicationInstanceDTOs'] = this.applicationInstanceDTOs; } else { @@ -211,6 +221,7 @@ class InstanceDTO { isTablet: mapValueOfType(json, r'isTablet'), isWeb: mapValueOfType(json, r'isWeb'), isVR: mapValueOfType(json, r'isVR'), + isAssistant: mapValueOfType(json, r'isAssistant'), applicationInstanceDTOs: ApplicationInstanceDTO.listFromJson( json[r'applicationInstanceDTOs']), ); diff --git a/manager_api_new/lib/model/navigation_action_dto.dart b/manager_api_new/lib/model/navigation_action_dto.dart new file mode 100644 index 0000000..bf5fabe --- /dev/null +++ b/manager_api_new/lib/model/navigation_action_dto.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class NavigationActionDTO { + /// Returns a new [NavigationActionDTO] instance. + NavigationActionDTO({ + this.sectionId, + this.sectionTitle, + this.sectionType, + }); + + String? sectionId; + + String? sectionTitle; + + String? sectionType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NavigationActionDTO && + other.sectionId == sectionId && + other.sectionTitle == sectionTitle && + other.sectionType == sectionType; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (sectionId == null ? 0 : sectionId!.hashCode) + + (sectionTitle == null ? 0 : sectionTitle!.hashCode) + + (sectionType == null ? 0 : sectionType!.hashCode); + + @override + String toString() => + 'NavigationActionDTO[sectionId=$sectionId, sectionTitle=$sectionTitle, sectionType=$sectionType]'; + + Map toJson() { + final json = {}; + if (this.sectionId != null) { + json[r'sectionId'] = this.sectionId; + } else { + json[r'sectionId'] = null; + } + if (this.sectionTitle != null) { + json[r'sectionTitle'] = this.sectionTitle; + } else { + json[r'sectionTitle'] = null; + } + if (this.sectionType != null) { + json[r'sectionType'] = this.sectionType; + } else { + json[r'sectionType'] = null; + } + return json; + } + + /// Returns a new [NavigationActionDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static NavigationActionDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "NavigationActionDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "NavigationActionDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return NavigationActionDTO( + sectionId: mapValueOfType(json, r'sectionId'), + sectionTitle: mapValueOfType(json, r'sectionTitle'), + sectionType: mapValueOfType(json, r'sectionType'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = NavigationActionDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = NavigationActionDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of NavigationActionDTO-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = NavigationActionDTO.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/problem_details.dart b/manager_api_new/lib/model/problem_details.dart new file mode 100644 index 0000000..3e273de --- /dev/null +++ b/manager_api_new/lib/model/problem_details.dart @@ -0,0 +1,176 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ProblemDetails { + /// Returns a new [ProblemDetails] instance. + ProblemDetails({ + this.type, + this.title, + this.status, + this.detail, + this.instance, + this.extensions = const {}, + }); + + String? type; + + String? title; + + int? status; + + String? detail; + + String? instance; + + Map extensions; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ProblemDetails && + other.type == type && + other.title == title && + other.status == status && + other.detail == detail && + other.instance == instance && + _deepEquality.equals(other.extensions, extensions); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (type == null ? 0 : type!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (detail == null ? 0 : detail!.hashCode) + + (instance == null ? 0 : instance!.hashCode) + + (extensions.hashCode); + + @override + String toString() => + 'ProblemDetails[type=$type, title=$title, status=$status, detail=$detail, instance=$instance, extensions=$extensions]'; + + Map toJson() { + final json = {}; + if (this.type != null) { + json[r'type'] = this.type; + } else { + json[r'type'] = null; + } + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.status != null) { + json[r'status'] = this.status; + } else { + json[r'status'] = null; + } + if (this.detail != null) { + json[r'detail'] = this.detail; + } else { + json[r'detail'] = null; + } + if (this.instance != null) { + json[r'instance'] = this.instance; + } else { + json[r'instance'] = null; + } + json[r'extensions'] = this.extensions; + return json; + } + + /// Returns a new [ProblemDetails] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ProblemDetails? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "ProblemDetails[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "ProblemDetails[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ProblemDetails( + type: mapValueOfType(json, r'type'), + title: mapValueOfType(json, r'title'), + status: mapValueOfType(json, r'status'), + detail: mapValueOfType(json, r'detail'), + instance: mapValueOfType(json, r'instance'), + extensions: + mapCastOfType(json, r'extensions') ?? const {}, + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ProblemDetails.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ProblemDetails.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ProblemDetails-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ProblemDetails.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/stats_summary_dto.dart b/manager_api_new/lib/model/stats_summary_dto.dart new file mode 100644 index 0000000..dc7c9f2 --- /dev/null +++ b/manager_api_new/lib/model/stats_summary_dto.dart @@ -0,0 +1,269 @@ +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class StatsSummaryDTO { + StatsSummaryDTO({ + this.totalSessions = 0, + this.avgVisitDurationSeconds = 0, + this.topSections = const [], + this.visitsByDay = const [], + this.languageDistribution = const {}, + this.appTypeDistribution = const {}, + this.topPois = const [], + this.topAgendaEvents = const [], + this.quizStats = const [], + this.gameStats = const [], + }); + + int totalSessions; + int avgVisitDurationSeconds; + List topSections; + List visitsByDay; + Map languageDistribution; + Map appTypeDistribution; + List topPois; + List topAgendaEvents; + List quizStats; + List gameStats; + + static StatsSummaryDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + return StatsSummaryDTO( + totalSessions: mapValueOfType(json, r'totalSessions') ?? 0, + avgVisitDurationSeconds: mapValueOfType(json, r'avgVisitDurationSeconds') ?? 0, + topSections: SectionStatDTO.listFromJson(json[r'topSections']), + visitsByDay: DayStatDTO.listFromJson(json[r'visitsByDay']), + languageDistribution: (json[r'languageDistribution'] is Map) + ? (json[r'languageDistribution'] as Map).cast() + : {}, + appTypeDistribution: (json[r'appTypeDistribution'] is Map) + ? (json[r'appTypeDistribution'] as Map).cast() + : {}, + topPois: PoiStatDTO.listFromJson(json[r'topPois']), + topAgendaEvents: AgendaEventStatDTO.listFromJson(json[r'topAgendaEvents']), + quizStats: QuizStatDTO.listFromJson(json[r'quizStats']), + gameStats: GameStatDTO.listFromJson(json[r'gameStats']), + ); + } + return null; + } +} + +class SectionStatDTO { + SectionStatDTO({ + this.sectionId, + this.sectionTitle, + this.views = 0, + this.avgDurationSeconds = 0, + }); + + String? sectionId; + String? sectionTitle; + int views; + int avgDurationSeconds; + + static SectionStatDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + return SectionStatDTO( + sectionId: mapValueOfType(json, r'sectionId'), + sectionTitle: mapValueOfType(json, r'sectionTitle'), + views: mapValueOfType(json, r'views') ?? 0, + avgDurationSeconds: mapValueOfType(json, r'avgDurationSeconds') ?? 0, + ); + } + return null; + } + + static List listFromJson(dynamic json) { + final result = []; + if (json is List) { + for (final row in json) { + final value = SectionStatDTO.fromJson(row); + if (value != null) result.add(value); + } + } + return result; + } +} + +class DayStatDTO { + DayStatDTO({ + this.date, + this.total = 0, + this.mobile = 0, + this.tablet = 0, + }); + + String? date; + int total; + int mobile; + int tablet; + + static DayStatDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + return DayStatDTO( + date: mapValueOfType(json, r'date'), + total: mapValueOfType(json, r'total') ?? 0, + mobile: mapValueOfType(json, r'mobile') ?? 0, + tablet: mapValueOfType(json, r'tablet') ?? 0, + ); + } + return null; + } + + static List listFromJson(dynamic json) { + final result = []; + if (json is List) { + for (final row in json) { + final value = DayStatDTO.fromJson(row); + if (value != null) result.add(value); + } + } + return result; + } +} + +class PoiStatDTO { + PoiStatDTO({this.geoPointId, this.title, this.taps = 0, this.sectionId}); + + int? geoPointId; + String? title; + int taps; + String? sectionId; + + static PoiStatDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + return PoiStatDTO( + geoPointId: mapValueOfType(json, r'geoPointId'), + title: mapValueOfType(json, r'title'), + taps: mapValueOfType(json, r'taps') ?? 0, + sectionId: mapValueOfType(json, r'sectionId'), + ); + } + return null; + } + + static List listFromJson(dynamic json) { + final result = []; + if (json is List) { + for (final row in json) { + final value = PoiStatDTO.fromJson(row); + if (value != null) result.add(value); + } + } + return result; + } +} + +class AgendaEventStatDTO { + AgendaEventStatDTO({this.eventId, this.eventTitle, this.taps = 0}); + + String? eventId; + String? eventTitle; + int taps; + + static AgendaEventStatDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + return AgendaEventStatDTO( + eventId: mapValueOfType(json, r'eventId'), + eventTitle: mapValueOfType(json, r'eventTitle'), + taps: mapValueOfType(json, r'taps') ?? 0, + ); + } + return null; + } + + static List listFromJson(dynamic json) { + final result = []; + if (json is List) { + for (final row in json) { + final value = AgendaEventStatDTO.fromJson(row); + if (value != null) result.add(value); + } + } + return result; + } +} + +class QuizStatDTO { + QuizStatDTO({ + this.sectionId, + this.sectionTitle, + this.completions = 0, + this.avgScore = 0, + this.totalQuestions = 0, + }); + + String? sectionId; + String? sectionTitle; + int completions; + double avgScore; + int totalQuestions; + + static QuizStatDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + return QuizStatDTO( + sectionId: mapValueOfType(json, r'sectionId'), + sectionTitle: mapValueOfType(json, r'sectionTitle'), + completions: mapValueOfType(json, r'completions') ?? 0, + avgScore: mapValueOfType(json, r'avgScore') ?? 0, + totalQuestions: mapValueOfType(json, r'totalQuestions') ?? 0, + ); + } + return null; + } + + static List listFromJson(dynamic json) { + final result = []; + if (json is List) { + for (final row in json) { + final value = QuizStatDTO.fromJson(row); + if (value != null) result.add(value); + } + } + return result; + } +} + +class GameStatDTO { + GameStatDTO({this.gameType, this.completions = 0, this.avgDurationSeconds = 0}); + + String? gameType; + int completions; + int avgDurationSeconds; + + static GameStatDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + return GameStatDTO( + gameType: mapValueOfType(json, r'gameType'), + completions: mapValueOfType(json, r'completions') ?? 0, + avgDurationSeconds: mapValueOfType(json, r'avgDurationSeconds') ?? 0, + ); + } + return null; + } + + static List listFromJson(dynamic json) { + final result = []; + if (json is List) { + for (final row in json) { + final value = GameStatDTO.fromJson(row); + if (value != null) result.add(value); + } + } + return result; + } +} diff --git a/manager_api_new/lib/model/visit_event_dto.dart b/manager_api_new/lib/model/visit_event_dto.dart new file mode 100644 index 0000000..a92cc51 --- /dev/null +++ b/manager_api_new/lib/model/visit_event_dto.dart @@ -0,0 +1,238 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class VisitEventDTO { + /// Returns a new [VisitEventDTO] instance. + VisitEventDTO({ + this.instanceId, + this.configurationId, + this.sectionId, + this.sessionId, + this.eventType, + this.appType, + this.language, + this.durationSeconds, + this.metadata, + this.timestamp, + }); + + String? instanceId; + + String? configurationId; + + String? sectionId; + + String? sessionId; + + String? eventType; + + String? appType; + + String? language; + + int? durationSeconds; + + String? metadata; + + DateTime? timestamp; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is VisitEventDTO && + other.instanceId == instanceId && + other.configurationId == configurationId && + other.sectionId == sectionId && + other.sessionId == sessionId && + other.eventType == eventType && + other.appType == appType && + other.language == language && + other.durationSeconds == durationSeconds && + other.metadata == metadata && + other.timestamp == timestamp; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (instanceId == null ? 0 : instanceId!.hashCode) + + (configurationId == null ? 0 : configurationId!.hashCode) + + (sectionId == null ? 0 : sectionId!.hashCode) + + (sessionId == null ? 0 : sessionId!.hashCode) + + (eventType == null ? 0 : eventType!.hashCode) + + (appType == null ? 0 : appType!.hashCode) + + (language == null ? 0 : language!.hashCode) + + (durationSeconds == null ? 0 : durationSeconds!.hashCode) + + (metadata == null ? 0 : metadata!.hashCode) + + (timestamp == null ? 0 : timestamp!.hashCode); + + @override + String toString() => + 'VisitEventDTO[instanceId=$instanceId, configurationId=$configurationId, sectionId=$sectionId, sessionId=$sessionId, eventType=$eventType, appType=$appType, language=$language, durationSeconds=$durationSeconds, metadata=$metadata, timestamp=$timestamp]'; + + Map toJson() { + final json = {}; + if (this.instanceId != null) { + json[r'instanceId'] = this.instanceId; + } else { + json[r'instanceId'] = null; + } + if (this.configurationId != null) { + json[r'configurationId'] = this.configurationId; + } else { + json[r'configurationId'] = null; + } + if (this.sectionId != null) { + json[r'sectionId'] = this.sectionId; + } else { + json[r'sectionId'] = null; + } + if (this.sessionId != null) { + json[r'sessionId'] = this.sessionId; + } else { + json[r'sessionId'] = null; + } + if (this.eventType != null) { + json[r'eventType'] = this.eventType; + } else { + json[r'eventType'] = null; + } + if (this.appType != null) { + json[r'appType'] = this.appType; + } else { + json[r'appType'] = null; + } + if (this.language != null) { + json[r'language'] = this.language; + } else { + json[r'language'] = null; + } + if (this.durationSeconds != null) { + json[r'durationSeconds'] = this.durationSeconds; + } else { + json[r'durationSeconds'] = null; + } + if (this.metadata != null) { + json[r'metadata'] = this.metadata; + } else { + json[r'metadata'] = null; + } + if (this.timestamp != null) { + json[r'timestamp'] = this.timestamp!.toUtc().toIso8601String(); + } else { + json[r'timestamp'] = null; + } + return json; + } + + /// Returns a new [VisitEventDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static VisitEventDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "VisitEventDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "VisitEventDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return VisitEventDTO( + instanceId: mapValueOfType(json, r'instanceId'), + configurationId: mapValueOfType(json, r'configurationId'), + sectionId: mapValueOfType(json, r'sectionId'), + sessionId: mapValueOfType(json, r'sessionId'), + eventType: mapValueOfType(json, r'eventType'), + appType: mapValueOfType(json, r'appType'), + language: mapValueOfType(json, r'language'), + durationSeconds: mapValueOfType(json, r'durationSeconds'), + metadata: mapValueOfType(json, r'metadata'), + timestamp: mapDateTime(json, r'timestamp', r''), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = VisitEventDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = VisitEventDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of VisitEventDTO-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = VisitEventDTO.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} + +class VisitEventType { + static const sectionView = 'SectionView'; + static const sectionLeave = 'SectionLeave'; + static const mapPoiTap = 'MapPoiTap'; + static const qrScan = 'QrScan'; + static const quizComplete = 'QuizComplete'; + static const gameComplete = 'GameComplete'; + static const agendaEventTap = 'AgendaEventTap'; + static const menuItemTap = 'MenuItemTap'; + static const assistantMessage = 'AssistantMessage'; + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/test/agenda_event_stat_dto_test.dart b/manager_api_new/test/agenda_event_stat_dto_test.dart new file mode 100644 index 0000000..10bdafc --- /dev/null +++ b/manager_api_new/test/agenda_event_stat_dto_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for AgendaEventStatDTO +void main() { + // final instance = AgendaEventStatDTO(); + + group('test AgendaEventStatDTO', () { + // String eventId + test('to test the property `eventId`', () async { + // TODO + }); + + // String eventTitle + test('to test the property `eventTitle`', () async { + // TODO + }); + + // int taps + test('to test the property `taps`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/ai_api_test.dart b/manager_api_new/test/ai_api_test.dart new file mode 100644 index 0000000..ff7250d --- /dev/null +++ b/manager_api_new/test/ai_api_test.dart @@ -0,0 +1,24 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +/// tests for AIApi +void main() { + // final instance = AIApi(); + + group('tests for AIApi', () { + //Future aiChat(AiChatRequest aiChatRequest) async + test('test aiChat', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/ai_card_dto_test.dart b/manager_api_new/test/ai_card_dto_test.dart new file mode 100644 index 0000000..c02188f --- /dev/null +++ b/manager_api_new/test/ai_card_dto_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for AiCardDTO +void main() { + // final instance = AiCardDTO(); + + group('test AiCardDTO', () { + // String title + test('to test the property `title`', () async { + // TODO + }); + + // String subtitle + test('to test the property `subtitle`', () async { + // TODO + }); + + // String icon + test('to test the property `icon`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/ai_chat_message_test.dart b/manager_api_new/test/ai_chat_message_test.dart new file mode 100644 index 0000000..27a2035 --- /dev/null +++ b/manager_api_new/test/ai_chat_message_test.dart @@ -0,0 +1,29 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for AiChatMessage +void main() { + // final instance = AiChatMessage(); + + group('test AiChatMessage', () { + // String role + test('to test the property `role`', () async { + // TODO + }); + + // String content + test('to test the property `content`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/ai_chat_request_test.dart b/manager_api_new/test/ai_chat_request_test.dart new file mode 100644 index 0000000..dc6d890 --- /dev/null +++ b/manager_api_new/test/ai_chat_request_test.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for AiChatRequest +void main() { + // final instance = AiChatRequest(); + + group('test AiChatRequest', () { + // String message + test('to test the property `message`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // AppType appType + test('to test the property `appType`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // String language + test('to test the property `language`', () async { + // TODO + }); + + // List history (default value: const []) + test('to test the property `history`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/ai_chat_response_navigation_test.dart b/manager_api_new/test/ai_chat_response_navigation_test.dart new file mode 100644 index 0000000..f348603 --- /dev/null +++ b/manager_api_new/test/ai_chat_response_navigation_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for AiChatResponseNavigation +void main() { + // final instance = AiChatResponseNavigation(); + + group('test AiChatResponseNavigation', () { + // String sectionId + test('to test the property `sectionId`', () async { + // TODO + }); + + // String sectionTitle + test('to test the property `sectionTitle`', () async { + // TODO + }); + + // String sectionType + test('to test the property `sectionType`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/ai_chat_response_test.dart b/manager_api_new/test/ai_chat_response_test.dart new file mode 100644 index 0000000..5acdf41 --- /dev/null +++ b/manager_api_new/test/ai_chat_response_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for AiChatResponse +void main() { + // final instance = AiChatResponse(); + + group('test AiChatResponse', () { + // String reply + test('to test the property `reply`', () async { + // TODO + }); + + // List cards (default value: const []) + test('to test the property `cards`', () async { + // TODO + }); + + // AiChatResponseNavigation navigation + test('to test the property `navigation`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/day_stat_dto_test.dart b/manager_api_new/test/day_stat_dto_test.dart new file mode 100644 index 0000000..079b403 --- /dev/null +++ b/manager_api_new/test/day_stat_dto_test.dart @@ -0,0 +1,39 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for DayStatDTO +void main() { + // final instance = DayStatDTO(); + + group('test DayStatDTO', () { + // String date + test('to test the property `date`', () async { + // TODO + }); + + // int total + test('to test the property `total`', () async { + // TODO + }); + + // int mobile + test('to test the property `mobile`', () async { + // TODO + }); + + // int tablet + test('to test the property `tablet`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/game_stat_dto_test.dart b/manager_api_new/test/game_stat_dto_test.dart new file mode 100644 index 0000000..2231b19 --- /dev/null +++ b/manager_api_new/test/game_stat_dto_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for GameStatDTO +void main() { + // final instance = GameStatDTO(); + + group('test GameStatDTO', () { + // String gameType + test('to test the property `gameType`', () async { + // TODO + }); + + // int completions + test('to test the property `completions`', () async { + // TODO + }); + + // int avgDurationSeconds + test('to test the property `avgDurationSeconds`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/navigation_action_dto_test.dart b/manager_api_new/test/navigation_action_dto_test.dart new file mode 100644 index 0000000..9c57bbe --- /dev/null +++ b/manager_api_new/test/navigation_action_dto_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for NavigationActionDTO +void main() { + // final instance = NavigationActionDTO(); + + group('test NavigationActionDTO', () { + // String sectionId + test('to test the property `sectionId`', () async { + // TODO + }); + + // String sectionTitle + test('to test the property `sectionTitle`', () async { + // TODO + }); + + // String sectionType + test('to test the property `sectionType`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/poi_stat_dto_test.dart b/manager_api_new/test/poi_stat_dto_test.dart new file mode 100644 index 0000000..06aa4c9 --- /dev/null +++ b/manager_api_new/test/poi_stat_dto_test.dart @@ -0,0 +1,39 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for PoiStatDTO +void main() { + // final instance = PoiStatDTO(); + + group('test PoiStatDTO', () { + // int geoPointId + test('to test the property `geoPointId`', () async { + // TODO + }); + + // String title + test('to test the property `title`', () async { + // TODO + }); + + // int taps + test('to test the property `taps`', () async { + // TODO + }); + + // String sectionId + test('to test the property `sectionId`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/problem_details_test.dart b/manager_api_new/test/problem_details_test.dart new file mode 100644 index 0000000..7fbdd59 --- /dev/null +++ b/manager_api_new/test/problem_details_test.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for ProblemDetails +void main() { + // final instance = ProblemDetails(); + + group('test ProblemDetails', () { + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String title + test('to test the property `title`', () async { + // TODO + }); + + // int status + test('to test the property `status`', () async { + // TODO + }); + + // String detail + test('to test the property `detail`', () async { + // TODO + }); + + // String instance + test('to test the property `instance`', () async { + // TODO + }); + + // Map extensions (default value: const {}) + test('to test the property `extensions`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/quiz_stat_dto_test.dart b/manager_api_new/test/quiz_stat_dto_test.dart new file mode 100644 index 0000000..e8a200e --- /dev/null +++ b/manager_api_new/test/quiz_stat_dto_test.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for QuizStatDTO +void main() { + // final instance = QuizStatDTO(); + + group('test QuizStatDTO', () { + // String sectionId + test('to test the property `sectionId`', () async { + // TODO + }); + + // String sectionTitle + test('to test the property `sectionTitle`', () async { + // TODO + }); + + // double avgScore + test('to test the property `avgScore`', () async { + // TODO + }); + + // int totalQuestions + test('to test the property `totalQuestions`', () async { + // TODO + }); + + // int completions + test('to test the property `completions`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/section_stat_dto_test.dart b/manager_api_new/test/section_stat_dto_test.dart new file mode 100644 index 0000000..010dd31 --- /dev/null +++ b/manager_api_new/test/section_stat_dto_test.dart @@ -0,0 +1,39 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionStatDTO +void main() { + // final instance = SectionStatDTO(); + + group('test SectionStatDTO', () { + // String sectionId + test('to test the property `sectionId`', () async { + // TODO + }); + + // String sectionTitle + test('to test the property `sectionTitle`', () async { + // TODO + }); + + // int views + test('to test the property `views`', () async { + // TODO + }); + + // int avgDurationSeconds + test('to test the property `avgDurationSeconds`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/stats_api_test.dart b/manager_api_new/test/stats_api_test.dart new file mode 100644 index 0000000..8facbef --- /dev/null +++ b/manager_api_new/test/stats_api_test.dart @@ -0,0 +1,29 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +/// tests for StatsApi +void main() { + // final instance = StatsApi(); + + group('tests for StatsApi', () { + //Future statsGetSummary({ String instanceId, DateTime from, DateTime to, String appType }) async + test('test statsGetSummary', () async { + // TODO + }); + + //Future statsTrackEvent(VisitEventDTO visitEventDTO) async + test('test statsTrackEvent', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/stats_summary_dto_test.dart b/manager_api_new/test/stats_summary_dto_test.dart new file mode 100644 index 0000000..7e8f23f --- /dev/null +++ b/manager_api_new/test/stats_summary_dto_test.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for StatsSummaryDTO +void main() { + // final instance = StatsSummaryDTO(); + + group('test StatsSummaryDTO', () { + // int totalSessions + test('to test the property `totalSessions`', () async { + // TODO + }); + + // int avgVisitDurationSeconds + test('to test the property `avgVisitDurationSeconds`', () async { + // TODO + }); + + // List topSections (default value: const []) + test('to test the property `topSections`', () async { + // TODO + }); + + // List visitsByDay (default value: const []) + test('to test the property `visitsByDay`', () async { + // TODO + }); + + // Map languageDistribution (default value: const {}) + test('to test the property `languageDistribution`', () async { + // TODO + }); + + // Map appTypeDistribution (default value: const {}) + test('to test the property `appTypeDistribution`', () async { + // TODO + }); + + // List topPois (default value: const []) + test('to test the property `topPois`', () async { + // TODO + }); + + // List topAgendaEvents (default value: const []) + test('to test the property `topAgendaEvents`', () async { + // TODO + }); + + // List quizStats (default value: const []) + test('to test the property `quizStats`', () async { + // TODO + }); + + // List gameStats (default value: const []) + test('to test the property `gameStats`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/visit_event_dto_test.dart b/manager_api_new/test/visit_event_dto_test.dart new file mode 100644 index 0000000..482c454 --- /dev/null +++ b/manager_api_new/test/visit_event_dto_test.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for VisitEventDTO +void main() { + // final instance = VisitEventDTO(); + + group('test VisitEventDTO', () { + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // String sectionId + test('to test the property `sectionId`', () async { + // TODO + }); + + // String sessionId + test('to test the property `sessionId`', () async { + // TODO + }); + + // String eventType + test('to test the property `eventType`', () async { + // TODO + }); + + // String appType + test('to test the property `appType`', () async { + // TODO + }); + + // String language + test('to test the property `language`', () async { + // TODO + }); + + // int durationSeconds + test('to test the property `durationSeconds`', () async { + // TODO + }); + + // String metadata + test('to test the property `metadata`', () async { + // TODO + }); + + // DateTime timestamp + test('to test the property `timestamp`', () async { + // TODO + }); + }); +} diff --git a/pubspec.lock b/pubspec.lock index 6cf6a75..18adba5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -353,6 +353,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.3" + equatable: + dependency: transitive + description: + name: equatable + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" + url: "https://pub.dev" + source: hosted + version: "2.0.8" fake_async: dependency: transitive description: @@ -457,6 +465,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + fl_chart: + dependency: "direct main" + description: + name: fl_chart + sha256: "74959b99b92b9eebeed1a4049426fd67c4abc3c5a0f4d12e2877097d6a11ae08" + url: "https://pub.dev" + source: hosted + version: "0.69.2" flare_flutter: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index e2fa815..cc0ee67 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -77,6 +77,7 @@ dependencies: flutter_widget_from_html: ^0.15.3 firebase_storage: ^12.0.1 firebase_core: ^3.1.0 + fl_chart: ^0.69.0 #another_flushbar: ^1.12.30 dependency_overrides: