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

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

	GarageSaleHistoryEntity();

	factory GarageSaleHistoryEntity.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryEntityFromJson(json);

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

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

@JsonSerializable()
class GarageSaleHistoryList {
	String? id;
	String? sn;
	@JSONField(name: "order_status")
	String? orderStatus;
	@JSONField(name: "created_at")
	String? createdAt;
	IdNameEntity? service;
	IdNameEntity? merchant;
	@JSONField(name: "order_products")
	List<GarageSaleHistoryListOrderProducts> orderProducts = [];

	GarageSaleHistoryList();

	factory GarageSaleHistoryList.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryListFromJson(json);

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

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


@JsonSerializable()
class GarageSaleHistoryListOrderProducts {
	String? id;
	@JSONField(name: "product_name")
	String? productName;
	int quantity = 0;
	@JSONField(name: "total_amount")
	String? totalAmount;
	@JSONField(name: "planned_service_at")
	String? plannedServiceAt;

	GarageSaleHistoryListOrderProducts();

	factory GarageSaleHistoryListOrderProducts.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryListOrderProductsFromJson(json);

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

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