splitLot method

Future<List<LotGenealogy>> splitLot(
  1. SplitLotRequest request
)

Split lot into multiple lots

Implementation

Future<List<LotGenealogy>> splitLot(SplitLotRequest request) async {
  final response = await _apiClient.post<Map<String, dynamic>>(
    '/api/v1/inventory/lot-genealogies/split',
    data: request.toJson(),
  );

  final lots = response['data'] as List<dynamic>;
  return lots
      .map((lot) => LotGenealogy.fromJson(lot as Map<String, dynamic>))
      .toList();
}