feat: add a book by scanning

This commit is contained in:
Alzalia 2025-08-09 01:42:22 +02:00
parent 72fd0b66a9
commit 981dce5bfe
14 changed files with 264 additions and 59 deletions

View file

@ -5,7 +5,7 @@ class BookInstance {
required this.id,
required this.ownerId,
required this.price,
required this.status,
required this.available,
this.soldPrice,
});
@ -15,14 +15,15 @@ class BookInstance {
int ownerId;
double price;
double? soldPrice;
bool status;
bool available;
factory BookInstance.fromJSON(Map<String, dynamic> json) => BookInstance(
balId: json["balId"],
bookId: json["bookId"],
balId: json["bal_id"],
bookId: json["book_id"],
id: json["id"],
ownerId: json["ownerId"],
ownerId: json["owner_id"],
price: json["price"],
status: json["status"],
available: json["available"],
soldPrice: json["sold_price"] ?? 0,
);
}