updateRegion(name, fullName, regionClassification, countryISO, currencyISO, timeZoneId);
return Response.ok().build();
}
private URI updateRegion(String name, String fullName, RegionClassification classification, String countryISO, String currencyISO, String timeZoneId) {
ManageableRegion region = new ManageableRegion();
region.setUniqueId(data().getRegion().getUniqueId());
region.setParentRegionIds(data().getRegion().getRegion().getParentRegionIds());
region.setName(name);
region.setFullName(fullName);
region.setClassification(classification);
region.setCountry(countryISO != null ? Country.of(countryISO) : null);
region.setCurrency(currencyISO != null ? Currency.of(currencyISO) : null);
region.setTimeZone(timeZoneId != null ? ZoneId.of(timeZoneId) : null);
RegionDocument doc = new RegionDocument(region);
doc = data().getRegionMaster().update(doc);
data().setRegion(doc);
return WebRegionResource.uri(data());
}