feat: complete sell
This commit is contained in:
parent
b4375fbaa2
commit
bee5e05296
5 changed files with 144 additions and 38 deletions
|
|
@ -23,4 +23,12 @@ class BookInstanceRepository {
|
|||
) async {
|
||||
return await _apiClient.sendBook(book, owner, bal, price);
|
||||
}
|
||||
|
||||
Future<Result<void>> sellBooks(List<BookInstance> books) async {
|
||||
Map<String, double?> res = {};
|
||||
for (BookInstance instance in books) {
|
||||
res[instance.id.toString()] = instance.soldPrice;
|
||||
}
|
||||
return await _apiClient.sellBooks(res);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue