Initial commit: unionflow-mobile-apps
Application Flutter complète (sans build artifacts). Signed-off-by: lions dev Team
This commit is contained in:
63
lib/features/backup/data/models/backup_config_model.dart
Normal file
63
lib/features/backup/data/models/backup_config_model.dart
Normal file
@@ -0,0 +1,63 @@
|
||||
/// Modèle de configuration des sauvegardes
|
||||
/// Correspond à BackupConfigResponse du backend
|
||||
library backup_config_model;
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'backup_config_model.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class BackupConfigModel extends Equatable {
|
||||
final bool? autoBackupEnabled;
|
||||
final String? frequency; // HOURLY, DAILY, WEEKLY
|
||||
final String? retention;
|
||||
final int? retentionDays;
|
||||
final String? backupTime;
|
||||
final bool? includeDatabase;
|
||||
final bool? includeFiles;
|
||||
final bool? includeConfiguration;
|
||||
final DateTime? lastBackup;
|
||||
final DateTime? nextScheduledBackup;
|
||||
final int? totalBackups;
|
||||
final int? totalSizeBytes;
|
||||
final String? totalSizeFormatted;
|
||||
|
||||
const BackupConfigModel({
|
||||
this.autoBackupEnabled,
|
||||
this.frequency,
|
||||
this.retention,
|
||||
this.retentionDays,
|
||||
this.backupTime,
|
||||
this.includeDatabase,
|
||||
this.includeFiles,
|
||||
this.includeConfiguration,
|
||||
this.lastBackup,
|
||||
this.nextScheduledBackup,
|
||||
this.totalBackups,
|
||||
this.totalSizeBytes,
|
||||
this.totalSizeFormatted,
|
||||
});
|
||||
|
||||
factory BackupConfigModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$BackupConfigModelFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BackupConfigModelToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
autoBackupEnabled,
|
||||
frequency,
|
||||
retention,
|
||||
retentionDays,
|
||||
backupTime,
|
||||
includeDatabase,
|
||||
includeFiles,
|
||||
includeConfiguration,
|
||||
lastBackup,
|
||||
nextScheduledBackup,
|
||||
totalBackups,
|
||||
totalSizeBytes,
|
||||
totalSizeFormatted,
|
||||
];
|
||||
}
|
||||
45
lib/features/backup/data/models/backup_config_model.g.dart
Normal file
45
lib/features/backup/data/models/backup_config_model.g.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'backup_config_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BackupConfigModel _$BackupConfigModelFromJson(Map<String, dynamic> json) =>
|
||||
BackupConfigModel(
|
||||
autoBackupEnabled: json['autoBackupEnabled'] as bool?,
|
||||
frequency: json['frequency'] as String?,
|
||||
retention: json['retention'] as String?,
|
||||
retentionDays: (json['retentionDays'] as num?)?.toInt(),
|
||||
backupTime: json['backupTime'] as String?,
|
||||
includeDatabase: json['includeDatabase'] as bool?,
|
||||
includeFiles: json['includeFiles'] as bool?,
|
||||
includeConfiguration: json['includeConfiguration'] as bool?,
|
||||
lastBackup: json['lastBackup'] == null
|
||||
? null
|
||||
: DateTime.parse(json['lastBackup'] as String),
|
||||
nextScheduledBackup: json['nextScheduledBackup'] == null
|
||||
? null
|
||||
: DateTime.parse(json['nextScheduledBackup'] as String),
|
||||
totalBackups: (json['totalBackups'] as num?)?.toInt(),
|
||||
totalSizeBytes: (json['totalSizeBytes'] as num?)?.toInt(),
|
||||
totalSizeFormatted: json['totalSizeFormatted'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BackupConfigModelToJson(BackupConfigModel instance) =>
|
||||
<String, dynamic>{
|
||||
'autoBackupEnabled': instance.autoBackupEnabled,
|
||||
'frequency': instance.frequency,
|
||||
'retention': instance.retention,
|
||||
'retentionDays': instance.retentionDays,
|
||||
'backupTime': instance.backupTime,
|
||||
'includeDatabase': instance.includeDatabase,
|
||||
'includeFiles': instance.includeFiles,
|
||||
'includeConfiguration': instance.includeConfiguration,
|
||||
'lastBackup': instance.lastBackup?.toIso8601String(),
|
||||
'nextScheduledBackup': instance.nextScheduledBackup?.toIso8601String(),
|
||||
'totalBackups': instance.totalBackups,
|
||||
'totalSizeBytes': instance.totalSizeBytes,
|
||||
'totalSizeFormatted': instance.totalSizeFormatted,
|
||||
};
|
||||
69
lib/features/backup/data/models/backup_model.dart
Normal file
69
lib/features/backup/data/models/backup_model.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
/// Modèle de sauvegarde
|
||||
/// Correspond à BackupResponse du backend
|
||||
library backup_model;
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'backup_model.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class BackupModel extends Equatable {
|
||||
final String? id;
|
||||
final String? name;
|
||||
final String? description;
|
||||
final String? type; // AUTO, MANUAL, RESTORE_POINT
|
||||
final int? sizeBytes;
|
||||
final String? sizeFormatted;
|
||||
final String? status; // PENDING, IN_PROGRESS, COMPLETED, FAILED
|
||||
final DateTime? createdAt;
|
||||
final DateTime? completedAt;
|
||||
final String? createdBy;
|
||||
final bool? includesDatabase;
|
||||
final bool? includesFiles;
|
||||
final bool? includesConfiguration;
|
||||
final String? filePath;
|
||||
final String? errorMessage;
|
||||
|
||||
const BackupModel({
|
||||
this.id,
|
||||
this.name,
|
||||
this.description,
|
||||
this.type,
|
||||
this.sizeBytes,
|
||||
this.sizeFormatted,
|
||||
this.status,
|
||||
this.createdAt,
|
||||
this.completedAt,
|
||||
this.createdBy,
|
||||
this.includesDatabase,
|
||||
this.includesFiles,
|
||||
this.includesConfiguration,
|
||||
this.filePath,
|
||||
this.errorMessage,
|
||||
});
|
||||
|
||||
factory BackupModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$BackupModelFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BackupModelToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
name,
|
||||
description,
|
||||
type,
|
||||
sizeBytes,
|
||||
sizeFormatted,
|
||||
status,
|
||||
createdAt,
|
||||
completedAt,
|
||||
createdBy,
|
||||
includesDatabase,
|
||||
includesFiles,
|
||||
includesConfiguration,
|
||||
filePath,
|
||||
errorMessage,
|
||||
];
|
||||
}
|
||||
48
lib/features/backup/data/models/backup_model.g.dart
Normal file
48
lib/features/backup/data/models/backup_model.g.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'backup_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BackupModel _$BackupModelFromJson(Map<String, dynamic> json) => BackupModel(
|
||||
id: json['id'] as String?,
|
||||
name: json['name'] as String?,
|
||||
description: json['description'] as String?,
|
||||
type: json['type'] as String?,
|
||||
sizeBytes: (json['sizeBytes'] as num?)?.toInt(),
|
||||
sizeFormatted: json['sizeFormatted'] as String?,
|
||||
status: json['status'] as String?,
|
||||
createdAt: json['createdAt'] == null
|
||||
? null
|
||||
: DateTime.parse(json['createdAt'] as String),
|
||||
completedAt: json['completedAt'] == null
|
||||
? null
|
||||
: DateTime.parse(json['completedAt'] as String),
|
||||
createdBy: json['createdBy'] as String?,
|
||||
includesDatabase: json['includesDatabase'] as bool?,
|
||||
includesFiles: json['includesFiles'] as bool?,
|
||||
includesConfiguration: json['includesConfiguration'] as bool?,
|
||||
filePath: json['filePath'] as String?,
|
||||
errorMessage: json['errorMessage'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BackupModelToJson(BackupModel instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
'type': instance.type,
|
||||
'sizeBytes': instance.sizeBytes,
|
||||
'sizeFormatted': instance.sizeFormatted,
|
||||
'status': instance.status,
|
||||
'createdAt': instance.createdAt?.toIso8601String(),
|
||||
'completedAt': instance.completedAt?.toIso8601String(),
|
||||
'createdBy': instance.createdBy,
|
||||
'includesDatabase': instance.includesDatabase,
|
||||
'includesFiles': instance.includesFiles,
|
||||
'includesConfiguration': instance.includesConfiguration,
|
||||
'filePath': instance.filePath,
|
||||
'errorMessage': instance.errorMessage,
|
||||
};
|
||||
Reference in New Issue
Block a user