String promoTypeStr = RequestUtil.getString(req.getData().get("promoTypeStr"));
Double promoValue = RequestUtil.getDouble(req.getData().get("promoValue"));
String description = RequestUtil.getString(req.getData().get("description"));
Promo promo = new Promo();
promo.setStartDate(startDate);
promo.setEndDate(endDate);
promo.setPromoType(PromoType.fromString(promoTypeStr));
promo.setPromoValue(promoValue);
promo.setDescription(description);
try {
Promo promoResp = coreManager.save(Promo.class, promo);
resp = promoResp;
} catch (Exception e) {
SgwtRestErrorResponse resp1 = new SgwtRestErrorResponse(-1);
resp1.addError("exception", e.getMessage());
return resp1;