createTransaction method
Implementation
Future<CreateTransactionResponse> createTransaction(
String wholesalerTransactionId,
String cornerStoreId,
double totalAmount,
List<Products> products) async {
final response = await client.post('/v1/transaction', data: {
'wholesalerTransactionId': wholesalerTransactionId,
'cornerStoreId': cornerStoreId,
'totalAmount': totalAmount,
'products': products.map((product) => product.toMap()).toList(),
});
return CreateTransactionResponse(response.data as Map<String, dynamic>);
}