feat: category analytic source

This commit is contained in:
efrilm
2025-08-17 22:46:25 +07:00
parent 50b06da627
commit 8eef620c16
13 changed files with 1929 additions and 638 deletions
@@ -61,4 +61,28 @@ class AnalyticRepository implements IAnalyticRepository {
return left(const AnalyticFailure.unexpectedError());
}
}
@override
Future<Either<AnalyticFailure, CategoryAnalytic>> getCategory({
required DateTime dateFrom,
required DateTime dateTo,
}) async {
try {
final result = await _dataProvider.fetchCategory(
dateFrom: dateFrom,
dateTo: dateTo,
);
if (result.hasError) {
return left(result.error!);
}
final auth = result.data!.toDomain();
return right(auth);
} catch (e, s) {
log('getCategoryError', name: _logName, error: e, stackTrace: s);
return left(const AnalyticFailure.unexpectedError());
}
}
}