openstackid-resources/app/Repositories/Summit/DoctrineSummitBookableVenueRoomAttributeValueRepository.php
smarcet a1b8c46273 Added enpoints to CRUD bookable rooms
Add bookable room to summit

POST /api/v1/summits/{id}/locations/venues/{venue_id}/bookable-rooms

payload

time_slot_cost: required|numeric
currency:required|iso_currency_code(USD,EUR)
capacity:required|integer
floor_id:sometimes|integer
name:sometimes|string|max:255
description:sometimes|string
order:sometimes|integer|min:1

update bookable room per summit

PUT /api/v1/summits/{id}/locations/venues/{venue_id}/bookable-rooms/{room_id}

payload

time_slot_cost: required|numeric
currency:required|iso_currency_code(USD,EUR)
capacity:required|integer
floor_id:sometimes|integer
name:sometimes|string|max:255
description:sometimes|string
order:sometimes|integer|min:1

delete bookable room

DELETE /api/v1/summits/{id}/locations/venues/{venue_id}/bookable-rooms/{room_id}

add attribute value to bookable room

PUT /api/v1/summits/{id}/locations/venues/{venue_id}/bookable-rooms/{room_id}/attributes/{attribute_id}

delete attribute value from bookable room

DELETE /api/v1/summits/{id}/locations/venues/{venue_id}/bookable-rooms/{room_id}/attributes/{attribute_id}

Added missing endpoints to CRUD bookable rooms attributes
per summit

Get all bookable rooms attribute types

GET /api/v1/summits/{id}/bookable-room-attribute-types

Get bookable room attribute type by id

GET /api/v1/summits/{id}/bookable-room-attribute-types/{type_id}

Add bookable room attribute type

POST /api/v1/summits/{id}/bookable-room-attribute-types

payload

type [required|string]

Update bookable room attribute type

PUT /api/v1/summits/{id}/bookable-room-attribute-types/{type_id}

payload

type [required|string]

delete attribute type by id

DELETE /api/v1/summits/{id}/bookable-room-attribute-types/{type_id}

get all attribute values by attribute type

GET /api/v1/summits/{id}/bookable-room-attribute-types/{type_id}/values

add attribute value to attribute type

POST /api/v1/summits/{id}/bookable-room-attribute-types/{type_id}/values

payload

value [required|string]

update attribute value

PUT /api/v1/summits/{id}/bookable-room-attribute-types/{type_id}/values/{value_id}

payload

value [required|string]

delete attribute value by id

DELETE /api/v1/summits/{id}/bookable-room-attribute-types/{type_id}/values/{value_id}

refund endpoint (admin only)

DELETE /api/v1/summits/{id}/bookable-rooms/{room_id}/reservations/{reservation_id}/refund

payload

amount [numeric|required]

get all reservations by summit (admin)

GET /api/v1/summits/{id}/locations/bookable-rooms/all/reservations

query params

page:integer|min:1
per_page:required_with:page|integer|min:1|max:100
filter:

allowed filters

summit_id: ['==']
room_name: ['==', '=@']
room_id: ['==']
owner_id: ['==']
status:  ['==']
start_datetime: ['>', '<', '<=', '>=', '==']
end_datetime:  ['>', '<', '<=', '>=', '==']

order

allowed ordering

id,start_datetime,end_datetime

Change-Id: Ic7f6ed7defaf20b8799a7d94beb0a82103b206f0
2019-06-19 18:19:58 -03:00

67 lines
2.0 KiB
PHP

<?php namespace App\Repositories\Summit;
/**
* Copyright 2019 OpenStack Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
use App\Models\Foundation\Summit\Repositories\ISummitBookableVenueRoomAttributeValueRepository;
use App\Repositories\SilverStripeDoctrineRepository;
use models\summit\SummitBookableVenueRoomAttributeValue;
use utils\DoctrineJoinFilterMapping;
/**
* Class DoctrineSummitBookableVenueRoomAttributeValueRepository
* @package App\Repositories\Summit
*/
final class DoctrineSummitBookableVenueRoomAttributeValueRepository
extends SilverStripeDoctrineRepository implements ISummitBookableVenueRoomAttributeValueRepository
{
/**
* @return array
*/
protected function getFilterMappings()
{
return
[
'value' => 'e.value:json_string',
'summit_id' => new DoctrineJoinFilterMapping
(
'e.summit',
's',
"s.id :operator ':value'"
),
'type_id' => new DoctrineJoinFilterMapping
(
'e.type',
't',
"t.id :operator ':value'"
),
];
}
/**
* @return array
*/
protected function getOrderMappings()
{
return [
'id' => 'e.id',
'value' => 'e.value',
];
}
/**
* @return string
*/
protected function getBaseEntity()
{
return SummitBookableVenueRoomAttributeValue::class;
}
}