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

@JsonSerializable()
class FacilityPageEntity {
	int count = 0;
	int page = 0;
	int limit = 0;
	@JSONField(name: "count_page")
	int countPage = 0;
	@JSONField(name: "total_deposit")
	String? totalDeposit;

	List<FacilityDetail>? list = [];

	FacilityPageEntity();

	factory FacilityPageEntity.fromJson(Map<String, dynamic> json) => $FacilityPageEntityFromJson(json);

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

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

@JsonSerializable()
class FacilityDetail {
	FacilityPageListBooking? booking;
	FacilityPageListFacility? facility;
	@JSONField(name: "time_period")
	FacilityPageListTimePeriod? timePeriod;
	IdNameEntity? account;
	FacilityOrder? order;

	FacilityDetail();

	factory FacilityDetail.fromJson(Map<String, dynamic> json) => $FacilityDetailFromJson(json);

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

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

@JsonSerializable()
class FacilityPageListBooking {
	String? id;
	String? date;
	String? start;
	String? end;
	String? deposit;
	@JSONField(name: "deposit_refund")
	String? depositRefund;
	@JSONField(name: "deposit_refund_at")
	String? depositRefundAt;

	FacilityPageListBooking();

	factory FacilityPageListBooking.fromJson(Map<String, dynamic> json) => $FacilityPageListBookingFromJson(json);

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

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

@JsonSerializable()
class FacilityPageListFacility {
	String? id;
	String? name;
	IdNameEntity? type;

	FacilityPageListFacility();

	factory FacilityPageListFacility.fromJson(Map<String, dynamic> json) => $FacilityPageListFacilityFromJson(json);

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

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

@JsonSerializable()
class FacilityPageListTimePeriod {
	String? price;
	String? deposit;

	FacilityPageListTimePeriod();

	factory FacilityPageListTimePeriod.fromJson(Map<String, dynamic> json) => $FacilityPageListTimePeriodFromJson(json);

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

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

@JsonSerializable()
class FacilityOrder {
	String? id;
	@JSONField(name: "total_amount")
	String? totalAmount;
	@JSONField(name: "order_amount")
	String? orderAmount;
	@JSONField(name: "deposit_amount")
	String? depositAmount;
	@JSONField(name: "payment_status")
	int paymentStatus = 0;  //0=未支付，1=已支付，2=支付失败
	@JSONField(name: "refund_status")
	int refundStatus = 0;   //0=末退歌，1=部分退歌，2=己退款

	FacilityOrder();

	factory FacilityOrder.fromJson(Map<String, dynamic> json) => $FacilityOrderFromJson(json);

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

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