officeId attribute is added in HolidayApiConstants class
This commit is contained in:
+1
@@ -18,6 +18,7 @@ public class HolidayApiConstants {
|
||||
public static final String toDate = "toDate";
|
||||
public static final String description = "description";
|
||||
public static final String offices = "offices";
|
||||
public static final String officeId = "officeId";
|
||||
|
||||
public static final Set<String> HOLIDAY_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(localeParamName,
|
||||
dateFormatParamName, name, fromDate, toDate, description, offices));
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ public class HolidayDataValidator {
|
||||
offices = new HashSet<Long>(array.size());
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
final JsonObject officeElement = array.get(i).getAsJsonObject();
|
||||
final Long officeId = this.fromApiJsonHelper.extractLongNamed("officeId", officeElement);
|
||||
final Long officeId = this.fromApiJsonHelper.extractLongNamed(HolidayApiConstants.officeId, officeElement);
|
||||
baseDataValidator.reset().parameter(HolidayApiConstants.offices).value(officeId).notNull();
|
||||
offices.add(officeId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public class HolidayWritePlatformServiceJpaRepositoryImpl implements HolidayWrit
|
||||
offices = new HashSet<Office>(array.size());
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
final JsonObject officeElement = array.get(i).getAsJsonObject();
|
||||
final Long officeId = this.fromApiJsonHelper.extractLongNamed("officeId", officeElement);
|
||||
final Long officeId = this.fromApiJsonHelper.extractLongNamed(HolidayApiConstants.officeId, officeElement);
|
||||
final Office office = this.officeRepository.findOne(officeId);
|
||||
if (office == null) { throw new OfficeNotFoundException(officeId); }
|
||||
offices.add(office);
|
||||
|
||||
Reference in New Issue
Block a user