import 'package:dartz/dartz.dart';
import '../../core/error/failures.dart';
import '../entities/share_account.dart';
import '../entities/mining_record.dart';
import '../entities/global_state.dart';
import '../entities/planting_record.dart';
import '../entities/batch_mining_record.dart';

/// 挖矿记录分页数据
class MiningRecordsPage {
  final List<MiningRecord> items;
  final int total;
  final int page;
  final int pageSize;
  final int totalPages;

  const MiningRecordsPage({
    required this.items,
    required this.total,
    required this.page,
    required this.pageSize,
    required this.totalPages,
  });
}

abstract class MiningRepository {
  Future<Either<Failure, ShareAccount>> getShareAccount(String accountSequence);

  Future<Either<Failure, MiningRecordsPage>> getMiningRecords(
    String accountSequence, {
    int page = 1,
    int pageSize = 20,
  });

  Future<Either<Failure, GlobalState>> getGlobalState();

  Future<Either<Failure, PlantingLedgerPage>> getPlantingLedger(
    String accountSequence, {
    int page = 1,
    int pageSize = 10,
  });

  Future<Either<Failure, BatchMiningRecordsPage>> getBatchMiningRecords(
    String accountSequence, {
    int page = 1,
    int pageSize = 20,
  });
}
