API Search - Renames route "api/search/fares" to "api/search/prices".
- Renamed Request/Response items as well.
This commit is contained in:
@@ -7,8 +7,8 @@ use App\Repository\RoomAvailabilityRepository;
|
||||
use App\Repository\RoomCategoryRepository;
|
||||
use App\Request\SearchAvailabilityPeriodRequest;
|
||||
use App\Response\SearchAvailabilityResponse;
|
||||
use App\Request\SearchFareCategoryRequest;
|
||||
use App\Response\SearchFareCategoryResponse;
|
||||
use App\Request\SearchPricesForCategoryRequest;
|
||||
use App\Response\SearchPricesForCategoryResponse;
|
||||
use App\Service\PricesService;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@@ -89,7 +89,7 @@ class SearchRoomsController extends AbstractController
|
||||
* Returns price for a room category.
|
||||
* This price is the total for all the selected days by guest number.
|
||||
*/
|
||||
#[Route('/api/search/fares', name: 'app_search_faresForCategory', methods: ["POST"], format: "json")]
|
||||
#[Route('/api/search/prices', name: 'app_search_pricesForCategory', methods: ["POST"], format: "json")]
|
||||
#[OA\Tag(name: "Searchs")]
|
||||
#[OA\Response(
|
||||
response: 200,
|
||||
@@ -100,7 +100,7 @@ class SearchRoomsController extends AbstractController
|
||||
new OA\Property(
|
||||
property: "results",
|
||||
type: "array",
|
||||
items: new OA\Items(ref: new Model(type: SearchFareCategoryResponse::class))
|
||||
items: new OA\Items(ref: new Model(type: SearchPricesForCategoryResponse::class))
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -108,14 +108,14 @@ class SearchRoomsController extends AbstractController
|
||||
#[OA\RequestBody(
|
||||
content: new OA\JsonContent(
|
||||
type: 'object',
|
||||
ref: new Model(type: SearchFareCategoryRequest::class),
|
||||
ref: new Model(type: SearchPricesForCategoryRequest::class),
|
||||
)
|
||||
)]
|
||||
public function getFaresForCategoryOnPeriod(
|
||||
public function getPricesForCategoryOnPeriod(
|
||||
Request $request,
|
||||
RoomCategoryRepository $repoCat,
|
||||
PricesService $priceService,
|
||||
#[MapRequestPayload()] SearchFareCategoryRequest $searchRequest
|
||||
#[MapRequestPayload()] SearchPricesForCategoryRequest $searchRequest
|
||||
): Response {
|
||||
if (\is_null($searchRequest)) {
|
||||
throw new \Exception('Invalid Payload', 400);
|
||||
|
||||
Reference in New Issue
Block a user