class AlarmMapper {

    public Alarm mapNewAlarmFormToSeyren(Alarm newAlarm) throws CerebroException {

        // Validate required fields
        alarmValidator.validateAlarm(newAlarm);

        // Reset unwanted fields or enforced default values
        newAlarm.setId(null);
        newAlarm.setLastCheck(null);

        if (newAlarm.getFrom() == null || newAlarm.getFrom().isEmpty()) {
            newAlarm.setFrom(DEFAULT_FROM);
        }

        if (newAlarm.getUntil() == null || newAlarm.getUntil().isEmpty()) {
            newAlarm.setUntil(DEFAULT_UNTIL);
        }

        updateSourcesToBackend(newAlarm);

        initListSubscription(newAlarm);

        return newAlarm;
    }

}