public async Task <CreatePharmacyInventoryResponse> Post([FromBody] CreatePharmacyInventoryRequest request) { CreatePharmacyInventoryResponse createPharmacyInventoryResponse = null; try { if (request.QuantityOnHand <= 0) { throw new Exception($"QuantityOnHand must be non zero."); } var item = await _domainService.CreatePharmacyInventory(request); if (item != null) { createPharmacyInventoryResponse = _mapper.Map <CreatePharmacyInventoryResponse>(item); } } catch (Exception ex) { throw new Exception(ex.Message); } return(createPharmacyInventoryResponse); }
public CreatePharmacyInventoryResponse GetFakeCreatePharmacyInventoryResponse_QuantityOnHandNonZero() { var fake = new CreatePharmacyInventoryResponse() { QuantityOnHand = 5, UnitPrice = 15.62M, ReorderQuantity = 12, SellingUnitOfMeasure = "KG", UPC = "125698652100", VendorName = "VENDOR2", PharmacyName = "PHARMACY1", HospitalName = "HOSPITAL1" }; return(fake); }