2025-11-04 14:58:51 +07:00
|
|
|
part of '../printer.dart';
|
|
|
|
|
|
|
|
|
|
abstract class IPrinterRepository {
|
|
|
|
|
Future<Either<PrinterFailure, bool>> connectBluetooth(String macAddress);
|
|
|
|
|
Future<Either<PrinterFailure, bool>> disconectBluetooth();
|
|
|
|
|
Future<Either<PrinterFailure, bool>> isBluetoothEnabled();
|
|
|
|
|
Future<Either<PrinterFailure, List<BluetoothInfo>>>
|
|
|
|
|
getPairedBluetoothDevices();
|
2025-11-04 22:13:15 +07:00
|
|
|
Future<Either<PrinterFailure, Unit>> createPrinter(Printer printer);
|
|
|
|
|
Future<Either<PrinterFailure, Unit>> updatePrinter(Printer printer, int id);
|
|
|
|
|
Future<Either<PrinterFailure, Unit>> deletePrinter(int id);
|
|
|
|
|
Future<Either<PrinterFailure, Printer>> getPrinterByCode(String code);
|
2025-11-06 18:15:54 +07:00
|
|
|
Future<Either<PrinterFailure, bool>> printStruct(
|
|
|
|
|
Printer printer,
|
|
|
|
|
List<int> printValue,
|
|
|
|
|
);
|
2025-11-07 16:29:26 +07:00
|
|
|
|
2026-09-02 20:44:14 +07:00
|
|
|
/// Mencetak [stations] untuk [order], melaporkan status tiap station.
|
|
|
|
|
///
|
|
|
|
|
/// Setiap emit berisi daftar lengkap semua station, jadi UI cukup
|
|
|
|
|
/// menggambar ulang apa adanya.
|
|
|
|
|
///
|
|
|
|
|
/// Satu station yang gagal **tidak** membatalkan station lainnya — semuanya
|
|
|
|
|
/// tetap dicoba. Station Bluetooth dijalankan berurutan karena radionya
|
|
|
|
|
/// hanya satu, station Network dijalankan paralel karena tidak berebut
|
|
|
|
|
/// sumber daya dengan Bluetooth.
|
|
|
|
|
Stream<List<PrintStationResult>> printStations({
|
2025-11-10 13:28:18 +07:00
|
|
|
required Order order,
|
2026-09-02 20:44:14 +07:00
|
|
|
required List<PrintStation> stations,
|
2025-11-10 13:28:18 +07:00
|
|
|
});
|
2025-11-04 14:58:51 +07:00
|
|
|
}
|