asdasdasd

This commit is contained in:
Phuoc Nguyen
2025-10-29 16:12:37 +07:00
parent cb4df363ab
commit c12869b01f
11 changed files with 394 additions and 51 deletions

View File

@@ -11,12 +11,14 @@ abstract class ProductsRepository {
///
/// [warehouseId] - The ID of the warehouse
/// [type] - The operation type ('import' or 'export')
/// [forceRefresh] - If true, fetch from API even if cache exists
///
/// Returns Either<Failure, List<ProductEntity>>
Future<Either<Failure, List<ProductEntity>>> getProducts(
int warehouseId,
String type,
);
String type, {
bool forceRefresh = false,
});
/// Get product stages for a product in a warehouse
///

View File

@@ -14,12 +14,18 @@ class GetProductsUseCase {
///
/// [warehouseId] - The ID of the warehouse to get products from
/// [type] - The operation type ('import' or 'export')
/// [forceRefresh] - If true, bypass cache and fetch from API
///
/// Returns Either<Failure, List<ProductEntity>>
Future<Either<Failure, List<ProductEntity>>> call(
int warehouseId,
String type,
) async {
return await repository.getProducts(warehouseId, type);
String type, {
bool forceRefresh = false,
}) async {
return await repository.getProducts(
warehouseId,
type,
forceRefresh: forceRefresh,
);
}
}