getPurchaseOrderHistory method
Implementation
Future<List<POHistory>> getPurchaseOrderHistory({
required String poNumber,
String acceptableType = 'L',
Options? getPurchaseConfirmationOptions,
}) async {
try {
Response<Json> response = await _deliveryApiProvider
.getPurchaseOrderHistory(
poNumber: poNumber,
getPurchaseConfirmationOptions: getPurchaseConfirmationOptions,
);
List<Json> jsonList = List.from(response.data!['results']);
return jsonList
.map(POHistory.fromJson)
.where((p) => p.histType == acceptableType)
.toList();
} catch (_) {
return [];
}
}