getPendingUpSync method

  1. @override
Future<List<OpLogEntry<PgrServiceModel>>> getPendingUpSync(
  1. DataModelType type, {
  2. required String createdBy,
})
override

Implementation

@override
Future<List<OpLogEntry<PgrServiceModel>>> getPendingUpSync(
  DataModelType type, {
  required String createdBy,
}) async {
  final pendingEntries = await isar.opLogs
      .filter()
      .entityTypeEqualTo(type)
      .operationEqualTo(DataOperation.create)
      .serverGeneratedIdIsNull()
      .syncedUpEqualTo(false)
      .syncedDownEqualTo(false)
      .createdByEqualTo(createdBy)
      .sortByCreatedAt()
      .findAll();

  final entriesList = pendingEntries.map((e) {
    return OpLogEntry.fromOpLog<PgrServiceModel>(e);
  }).toList();

  return entriesList;
}