import 'package:domain/entity/id_name_entity.dart';
import 'package:domain/generated/json/base/json_field.dart';
import 'package:domain/generated/json/payment_page_entity.g.dart';
import 'dart:convert';
export 'package:domain/generated/json/payment_page_entity.g.dart';

@JsonSerializable()
class PaymentPageEntity {
  int count = 0;
  int page = 0;
  int limit = 0;
  @JSONField(name: "count_page")
  int countPage = 0;
  List<PaymentPageList> list = [];

  PaymentPageEntity();

  factory PaymentPageEntity.fromJson(Map<String, dynamic> json) => $PaymentPageEntityFromJson(json);

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

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class PaymentPageList {
  String? id;
  String? type;
  //property  五种
  //vehicle
  //online_form_apply
  //facility_booking
  //paid_service_order
  String? title;
  @JSONField(name: "total_amount")
  String? totalAmount;
  @JSONField(name: "order_amount")
  String? orderAmount;
  @JSONField(name: "deposit_amount")
  String? depositAmount;
  @JSONField(name: "refund_order_amount")
  String? refundOrderAmount;
  @JSONField(name: "refund_deposit_amount")
  String? refundDepositAmount;
  @JSONField(name: "payment_status")
  int paymentStatus = 0;
  @JSONField(name: "refund_status")
  int refundStatus = 0;
  @JSONField(name: "paid_at")
  String? paidAt;
  @JSONField(name: "refund_at")
  String? refundAt;
  @JSONField(name: "created_at")
  String? createdAt;
  IdNameEntity? account;
  OrderableEntity? orderable;

  PaymentPageList();

  factory PaymentPageList.fromJson(Map<String, dynamic> json) => $PaymentPageListFromJson(json);

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

  @override
  String toString() {
    return jsonEncode(this);
  }
}


@JsonSerializable()
class OrderableEntity {
  String? id;
  String? name;
  @JSONField(name: "estate_online_form_id")
  String? estateOnlineFormId;
  @JSONField(name: "online_form_type_id")
  String? onlineFormTypeId;
  @JSONField(name: "start_at")
  String? startAt;
  @JSONField(name: "end_at")
  String? endAt;

  OrderableEntity();

  factory OrderableEntity.fromJson(Map<String, dynamic> json) => $OrderableEntityFromJson(json);

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

  @override
  String toString() {
    return jsonEncode(this);
  }
}
