outlet list

This commit is contained in:
efrilm
2026-05-12 16:47:36 +07:00
parent c2727a0995
commit 3541fc725c
10 changed files with 1159 additions and 74 deletions
@@ -33,4 +33,32 @@ class OutletRepository implements IOutletRepository {
return left(const OutletFailure.unexpectedError());
}
}
@override
Future<Either<OutletFailure, List<Outlet>>> getList({
int page = 1,
int limit = 10,
String? search,
bool? isActive,
}) async {
try {
final result = await _dataProvider.fetchList(
page: page,
limit: limit,
search: search,
isActive: isActive,
);
if (result.hasError) {
return left(result.error!);
}
final outlets = result.data!.map((e) => e.toDomain()).toList();
return right(outlets);
} catch (e, s) {
log('getOutletListError', name: _logName, error: e, stackTrace: s);
return left(const OutletFailure.unexpectedError());
}
}
}