Initial commit: unionflow-mobile-apps

Application Flutter complète (sans build artifacts).

Signed-off-by: lions dev Team
This commit is contained in:
dahoud
2026-03-15 16:30:08 +00:00
commit d094d6db9c
1790 changed files with 507435 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
/// Modèle d'alerte système
/// Correspond à SystemAlertResponse du backend
library system_alert_model;
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'system_alert_model.g.dart';
@JsonSerializable(explicitToJson: true)
class SystemAlertModel extends Equatable {
final String? id;
final String? level; // CRITICAL, ERROR, WARNING, INFO
final String? title;
final String? message;
final DateTime? timestamp;
final bool? acknowledged;
final String? acknowledgedBy;
final DateTime? acknowledgedAt;
final String? source;
final String? alertType;
final double? currentValue;
final double? thresholdValue;
const SystemAlertModel({
this.id,
this.level,
this.title,
this.message,
this.timestamp,
this.acknowledged,
this.acknowledgedBy,
this.acknowledgedAt,
this.source,
this.alertType,
this.currentValue,
this.thresholdValue,
});
factory SystemAlertModel.fromJson(Map<String, dynamic> json) =>
_$SystemAlertModelFromJson(json);
Map<String, dynamic> toJson() => _$SystemAlertModelToJson(this);
@override
List<Object?> get props => [
id,
level,
title,
message,
timestamp,
acknowledged,
acknowledgedBy,
acknowledgedAt,
source,
alertType,
currentValue,
thresholdValue,
];
}

View File

@@ -0,0 +1,43 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'system_alert_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SystemAlertModel _$SystemAlertModelFromJson(Map<String, dynamic> json) =>
SystemAlertModel(
id: json['id'] as String?,
level: json['level'] as String?,
title: json['title'] as String?,
message: json['message'] as String?,
timestamp: json['timestamp'] == null
? null
: DateTime.parse(json['timestamp'] as String),
acknowledged: json['acknowledged'] as bool?,
acknowledgedBy: json['acknowledgedBy'] as String?,
acknowledgedAt: json['acknowledgedAt'] == null
? null
: DateTime.parse(json['acknowledgedAt'] as String),
source: json['source'] as String?,
alertType: json['alertType'] as String?,
currentValue: (json['currentValue'] as num?)?.toDouble(),
thresholdValue: (json['thresholdValue'] as num?)?.toDouble(),
);
Map<String, dynamic> _$SystemAlertModelToJson(SystemAlertModel instance) =>
<String, dynamic>{
'id': instance.id,
'level': instance.level,
'title': instance.title,
'message': instance.message,
'timestamp': instance.timestamp?.toIso8601String(),
'acknowledged': instance.acknowledged,
'acknowledgedBy': instance.acknowledgedBy,
'acknowledgedAt': instance.acknowledgedAt?.toIso8601String(),
'source': instance.source,
'alertType': instance.alertType,
'currentValue': instance.currentValue,
'thresholdValue': instance.thresholdValue,
};

View File

@@ -0,0 +1,54 @@
/// Modèle d'entrée de log système
/// Correspond à SystemLogResponse du backend
library system_log_model;
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'system_log_model.g.dart';
@JsonSerializable(explicitToJson: true)
class SystemLogModel extends Equatable {
final String? id;
final String? level; // CRITICAL, ERROR, WARN, INFO, DEBUG, TRACE
final String? source; // API, Auth, Database, Cache, Security, Performance, System
final String? message;
final String? details;
final DateTime? timestamp;
final String? username;
final String? ipAddress;
final String? requestId;
final String? stackTrace;
const SystemLogModel({
this.id,
this.level,
this.source,
this.message,
this.details,
this.timestamp,
this.username,
this.ipAddress,
this.requestId,
this.stackTrace,
});
factory SystemLogModel.fromJson(Map<String, dynamic> json) =>
_$SystemLogModelFromJson(json);
Map<String, dynamic> toJson() => _$SystemLogModelToJson(this);
@override
List<Object?> get props => [
id,
level,
source,
message,
details,
timestamp,
username,
ipAddress,
requestId,
stackTrace,
];
}

View File

@@ -0,0 +1,37 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'system_log_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SystemLogModel _$SystemLogModelFromJson(Map<String, dynamic> json) =>
SystemLogModel(
id: json['id'] as String?,
level: json['level'] as String?,
source: json['source'] as String?,
message: json['message'] as String?,
details: json['details'] as String?,
timestamp: json['timestamp'] == null
? null
: DateTime.parse(json['timestamp'] as String),
username: json['username'] as String?,
ipAddress: json['ipAddress'] as String?,
requestId: json['requestId'] as String?,
stackTrace: json['stackTrace'] as String?,
);
Map<String, dynamic> _$SystemLogModelToJson(SystemLogModel instance) =>
<String, dynamic>{
'id': instance.id,
'level': instance.level,
'source': instance.source,
'message': instance.message,
'details': instance.details,
'timestamp': instance.timestamp?.toIso8601String(),
'username': instance.username,
'ipAddress': instance.ipAddress,
'requestId': instance.requestId,
'stackTrace': instance.stackTrace,
};

View File

@@ -0,0 +1,66 @@
/// Modèle des métriques système
/// Correspond à SystemMetricsResponse du backend
library system_metrics_model;
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'system_metrics_model.g.dart';
@JsonSerializable(explicitToJson: true)
class SystemMetricsModel extends Equatable {
final double? cpuUsagePercent;
final double? memoryUsagePercent;
final double? diskUsagePercent;
final double? networkUsageMbps;
final int? activeConnections;
final double? errorRate;
final int? averageResponseTimeMs;
final int? uptime;
final String? uptimeFormatted;
final int? totalLogs24h;
final int? totalErrors24h;
final int? totalWarnings24h;
final int? totalRequests24h;
final DateTime? timestamp;
const SystemMetricsModel({
this.cpuUsagePercent,
this.memoryUsagePercent,
this.diskUsagePercent,
this.networkUsageMbps,
this.activeConnections,
this.errorRate,
this.averageResponseTimeMs,
this.uptime,
this.uptimeFormatted,
this.totalLogs24h,
this.totalErrors24h,
this.totalWarnings24h,
this.totalRequests24h,
this.timestamp,
});
factory SystemMetricsModel.fromJson(Map<String, dynamic> json) =>
_$SystemMetricsModelFromJson(json);
Map<String, dynamic> toJson() => _$SystemMetricsModelToJson(this);
@override
List<Object?> get props => [
cpuUsagePercent,
memoryUsagePercent,
diskUsagePercent,
networkUsageMbps,
activeConnections,
errorRate,
averageResponseTimeMs,
uptime,
uptimeFormatted,
totalLogs24h,
totalErrors24h,
totalWarnings24h,
totalRequests24h,
timestamp,
];
}

View File

@@ -0,0 +1,45 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'system_metrics_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SystemMetricsModel _$SystemMetricsModelFromJson(Map<String, dynamic> json) =>
SystemMetricsModel(
cpuUsagePercent: (json['cpuUsagePercent'] as num?)?.toDouble(),
memoryUsagePercent: (json['memoryUsagePercent'] as num?)?.toDouble(),
diskUsagePercent: (json['diskUsagePercent'] as num?)?.toDouble(),
networkUsageMbps: (json['networkUsageMbps'] as num?)?.toDouble(),
activeConnections: (json['activeConnections'] as num?)?.toInt(),
errorRate: (json['errorRate'] as num?)?.toDouble(),
averageResponseTimeMs: (json['averageResponseTimeMs'] as num?)?.toInt(),
uptime: (json['uptime'] as num?)?.toInt(),
uptimeFormatted: json['uptimeFormatted'] as String?,
totalLogs24h: (json['totalLogs24h'] as num?)?.toInt(),
totalErrors24h: (json['totalErrors24h'] as num?)?.toInt(),
totalWarnings24h: (json['totalWarnings24h'] as num?)?.toInt(),
totalRequests24h: (json['totalRequests24h'] as num?)?.toInt(),
timestamp: json['timestamp'] == null
? null
: DateTime.parse(json['timestamp'] as String),
);
Map<String, dynamic> _$SystemMetricsModelToJson(SystemMetricsModel instance) =>
<String, dynamic>{
'cpuUsagePercent': instance.cpuUsagePercent,
'memoryUsagePercent': instance.memoryUsagePercent,
'diskUsagePercent': instance.diskUsagePercent,
'networkUsageMbps': instance.networkUsageMbps,
'activeConnections': instance.activeConnections,
'errorRate': instance.errorRate,
'averageResponseTimeMs': instance.averageResponseTimeMs,
'uptime': instance.uptime,
'uptimeFormatted': instance.uptimeFormatted,
'totalLogs24h': instance.totalLogs24h,
'totalErrors24h': instance.totalErrors24h,
'totalWarnings24h': instance.totalWarnings24h,
'totalRequests24h': instance.totalRequests24h,
'timestamp': instance.timestamp?.toIso8601String(),
};