import 'package:json_annotation/json_annotation.dart';

import '../common/base_page.dart';

part 'review_again_list_params.g.dart';

@JsonSerializable()
class ReviewAgainListParams extends BasePage {
  @JsonKey(name: 'TaskId')
  int taskId;

  @JsonKey(name: 'QuestionNo')
  String? questionNo;

  @JsonKey(name: 'IsFinish')
  bool isFinish;

  @JsonKey(name: 'SortName')
  String? sortName;

  @JsonKey(name: 'Order')
  String? order; // asc desc

  @JsonKey(name: 'keyword')
  String? keyword;

  ReviewAgainListParams(
      {required this.taskId, required this.questionNo, this.isFinish = true, required page, required limit})
      : super(page, limit);

  factory ReviewAgainListParams.fromJson(Map<String, dynamic> srcJson) => _$ReviewAgainListParamsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ReviewAgainListParamsToJson(this);

  /// 条件赛选
  void setConditionalFiltering({String? keyword, String? sortName, String? order}) {
    this.keyword = keyword;
    this.sortName = sortName;
    this.order = order;
  }
}
