Initial commit: unionflow-mobile-apps
Application Flutter complète (sans build artifacts). Signed-off-by: lions dev Team
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
/// Repository interface pour le workflow financier
|
||||
library finance_workflow_repository;
|
||||
|
||||
import 'package:dartz/dartz.dart';
|
||||
import '../../../../core/error/failures.dart';
|
||||
import '../entities/transaction_approval.dart';
|
||||
import '../entities/budget.dart';
|
||||
import '../entities/financial_audit_log.dart';
|
||||
|
||||
/// Interface du repository de workflow financier
|
||||
abstract class FinanceWorkflowRepository {
|
||||
// === APPROBATIONS ===
|
||||
|
||||
/// Récupère les approbations en attente pour un utilisateur
|
||||
Future<Either<Failure, List<TransactionApproval>>> getPendingApprovals({
|
||||
String? organizationId,
|
||||
});
|
||||
|
||||
/// Récupère une approbation par son ID
|
||||
Future<Either<Failure, TransactionApproval>> getApprovalById(String approvalId);
|
||||
|
||||
/// Approuve une transaction
|
||||
Future<Either<Failure, TransactionApproval>> approveTransaction({
|
||||
required String approvalId,
|
||||
String? comment,
|
||||
});
|
||||
|
||||
/// Rejette une transaction
|
||||
Future<Either<Failure, TransactionApproval>> rejectTransaction({
|
||||
required String approvalId,
|
||||
required String reason,
|
||||
});
|
||||
|
||||
/// Demande une approbation pour une transaction
|
||||
Future<Either<Failure, TransactionApproval>> requestApproval({
|
||||
required String transactionId,
|
||||
required TransactionType transactionType,
|
||||
required double amount,
|
||||
});
|
||||
|
||||
/// Récupère l'historique des approbations
|
||||
Future<Either<Failure, List<TransactionApproval>>> getApprovalsHistory({
|
||||
String? organizationId,
|
||||
DateTime? startDate,
|
||||
DateTime? endDate,
|
||||
ApprovalStatus? status,
|
||||
});
|
||||
|
||||
// === BUDGETS ===
|
||||
|
||||
/// Récupère tous les budgets
|
||||
Future<Either<Failure, List<Budget>>> getBudgets({
|
||||
String? organizationId,
|
||||
BudgetStatus? status,
|
||||
int? year,
|
||||
});
|
||||
|
||||
/// Récupère un budget par son ID
|
||||
Future<Either<Failure, Budget>> getBudgetById(String budgetId);
|
||||
|
||||
/// Crée un nouveau budget
|
||||
Future<Either<Failure, Budget>> createBudget({
|
||||
required String name,
|
||||
String? description,
|
||||
required String organizationId,
|
||||
required BudgetPeriod period,
|
||||
required int year,
|
||||
int? month,
|
||||
required List<BudgetLine> lines,
|
||||
});
|
||||
|
||||
/// Met à jour un budget
|
||||
Future<Either<Failure, Budget>> updateBudget({
|
||||
required String budgetId,
|
||||
String? name,
|
||||
String? description,
|
||||
List<BudgetLine>? lines,
|
||||
BudgetStatus? status,
|
||||
});
|
||||
|
||||
/// Supprime un budget
|
||||
Future<Either<Failure, void>> deleteBudget(String budgetId);
|
||||
|
||||
/// Récupère le suivi budgétaire (réalisé vs prévu)
|
||||
Future<Either<Failure, Map<String, dynamic>>> getBudgetTracking({
|
||||
required String budgetId,
|
||||
});
|
||||
|
||||
// === AUDIT LOGS ===
|
||||
|
||||
/// Récupère les logs d'audit
|
||||
Future<Either<Failure, List<FinancialAuditLog>>> getAuditLogs({
|
||||
String? organizationId,
|
||||
DateTime? startDate,
|
||||
DateTime? endDate,
|
||||
AuditOperation? operation,
|
||||
AuditEntityType? entityType,
|
||||
AuditSeverity? severity,
|
||||
int? limit,
|
||||
});
|
||||
|
||||
/// Récupère les anomalies détectées
|
||||
Future<Either<Failure, List<FinancialAuditLog>>> getAnomalies({
|
||||
String? organizationId,
|
||||
DateTime? startDate,
|
||||
DateTime? endDate,
|
||||
});
|
||||
|
||||
/// Exporte les logs d'audit (CSV/PDF)
|
||||
Future<Either<Failure, String>> exportAuditLogs({
|
||||
required String organizationId,
|
||||
DateTime? startDate,
|
||||
DateTime? endDate,
|
||||
String format = 'csv',
|
||||
});
|
||||
|
||||
// === STATISTIQUES ===
|
||||
|
||||
/// Récupère les statistiques de workflow
|
||||
Future<Either<Failure, Map<String, dynamic>>> getWorkflowStats({
|
||||
required String organizationId,
|
||||
DateTime? startDate,
|
||||
DateTime? endDate,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user