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

@JsonSerializable()
class FormSubmittedEntity {
	String? id;
	@JSONField(name: "user_id")
	String? userId;
	@JSONField(name: "estate_online_form_id")
	String? estateOnlineFormId;
	@JSONField(name: "sent_on")
	String? sentOn;
	@JSONField(name: "rejected_on")
	String? rejectedOn;
	@JSONField(name: "approved_on")
	String? approvedOn;
	@JSONField(name: "estate_online_form")
	FormSubmittedEstateOnlineForm? estateOnlineForm;
	IdNameEntity? account;
	FormSubmittedOrder? order;

	FormSubmittedEntity();

	factory FormSubmittedEntity.fromJson(Map<String, dynamic> json) => $FormSubmittedEntityFromJson(json);

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

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


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

	FormSubmittedEstateOnlineForm();

	factory FormSubmittedEstateOnlineForm.fromJson(Map<String, dynamic> json) => $FormSubmittedEstateOnlineFormFromJson(json);

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

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


@JsonSerializable()
class FormSubmittedOrder {
	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=己退款

	FormSubmittedOrder();

	factory FormSubmittedOrder.fromJson(Map<String, dynamic> json) => $FormSubmittedOrderFromJson(json);

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

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