multiquote service

This commit is contained in:
Stephan D
2025-12-17 21:56:07 +01:00
parent d649748f6f
commit 2d6586430f
12 changed files with 182 additions and 89 deletions

View File

@@ -1,9 +1,13 @@
import 'package:logging/logging.dart';
import 'package:pshared/api/requests/payment/quote.dart';
import 'package:pshared/api/requests/payment/quotes.dart';
import 'package:pshared/api/responses/payment/quotation.dart';
import 'package:pshared/api/responses/payment/quotes.dart';
import 'package:pshared/data/mapper/payment/payment_quote.dart';
import 'package:pshared/data/mapper/payment/quotes.dart';
import 'package:pshared/models/payment/quote.dart';
import 'package:pshared/models/payment/quotes.dart';
import 'package:pshared/service/authorization/service.dart';
import 'package:pshared/service/services.dart';
@@ -21,4 +25,14 @@ class QuotationService {
);
return PaymentQuoteResponse.fromJson(response).quote.toDomain();
}
static Future<PaymentQuotes> getMultipleQuotation(String organizationRef, QuotePaymentsRequest request) async {
_logger.fine('Quoting payments for organization $organizationRef');
final response = await AuthorizationService.getPOSTResponse(
_objectType,
'/quote-multiple/$organizationRef',
request.toJson(),
);
return PaymentQuotesResponse.fromJson(response).quote.toDomain();
}
}