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

@JsonSerializable()
class FormDetailEntity {
	String? id;
	@JSONField(name: "user_id")
	String? userId;
	String? description;
	FormContentEntity? content;  //详情内容
	int status = 0;  //0-已提交未审核，1-已审核通过，2-审核失败
	@JSONField(name: "created_at")
	String? createdAt;
	@JSONField(name: "updated_at")
	String? updateAt;
	FormOrder? order;

	FormDetailEntity();

	factory FormDetailEntity.fromJson(Map<String, dynamic> json) => $FormDetailEntityFromJson(json);

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

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

@JsonSerializable()
class FormOrder {
	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=己退款
	@JSONField(name: "paid_at")
	String? paidAt;
	@JSONField(name: "refunded_at")
	String? refundedAt;

	FormOrder();

	factory FormOrder.fromJson(Map<String, dynamic> json) => $FormOrderFromJson(json);

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

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