Feat(medusa): handle reservation quantity update for line items (#3484)

**What**
-  Raise exception if a reservation is updated or created to have larger quantity than is unfulfilled for a line-item

Fixes CORE-1249
This commit is contained in:
Philip Korsholm
2023-03-16 09:15:39 +00:00
committed by GitHub
parent 061a600f80
commit 38c8d49f46
6 changed files with 281 additions and 0 deletions
@@ -152,6 +152,17 @@ export default class InventoryService
return inventoryLevel
}
/**
* Retrieves a reservation item
* @param inventoryItemId - the id of the reservation item
* @return the retrieved reservation level
*/
async retrieveReservationItem(reservationId: string): Promise<ReservationItemDTO> {
return await this.reservationItemService_
.withTransaction(this.activeManager_)
.retrieve(reservationId)
}
/**
* Creates a reservation item
* @param input - the input object