runable
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import '../../../../core/errors/failures.dart';
|
||||
import '../entities/scan_entity.dart';
|
||||
|
||||
/// Abstract repository interface for scanner operations
|
||||
/// This defines the contract that the data layer must implement
|
||||
abstract class ScannerRepository {
|
||||
/// Save scan data to remote server
|
||||
Future<Either<Failure, void>> saveScan({
|
||||
required String barcode,
|
||||
required String field1,
|
||||
required String field2,
|
||||
required String field3,
|
||||
required String field4,
|
||||
});
|
||||
|
||||
/// Get scan history from local storage
|
||||
Future<Either<Failure, List<ScanEntity>>> getScanHistory();
|
||||
|
||||
/// Save scan to local storage
|
||||
Future<Either<Failure, void>> saveScanLocally(ScanEntity scan);
|
||||
|
||||
/// Delete a scan from local storage
|
||||
Future<Either<Failure, void>> deleteScanLocally(String barcode);
|
||||
|
||||
/// Clear all scan history from local storage
|
||||
Future<Either<Failure, void>> clearScanHistory();
|
||||
|
||||
/// Get a specific scan by barcode from local storage
|
||||
Future<Either<Failure, ScanEntity?>> getScanByBarcode(String barcode);
|
||||
|
||||
/// Update a scan in local storage
|
||||
Future<Either<Failure, void>> updateScanLocally(ScanEntity scan);
|
||||
}
|
||||
Reference in New Issue
Block a user