use of alfio.model.EventAndOrganizationId in project alf.io by alfio-event.
the class AdminReservationRequestRepository method insertRequest.
default void insertRequest(String requestId, long userId, EventAndOrganizationId event, Stream<AdminReservationModification> requestModifications) {
MapSqlParameterSource[] requests = requestModifications.map(res -> new MapSqlParameterSource("userId", userId).addValue("requestId", requestId).addValue("requestType", AdminReservationRequest.RequestType.IMPORT.name()).addValue("status", AdminReservationRequest.Status.PENDING.name()).addValue("eventId", event.getId()).addValue("body", Json.toJson(res))).toArray(MapSqlParameterSource[]::new);
getNamedParameterJdbcTemplate().batchUpdate("insert into admin_reservation_request(user_id, request_id, event_id, request_type, status, body) values(:userId, :requestId, :eventId, :requestType, :status, :body)", requests);
}
Aggregations