<?php
/**
 * API Routes v1 - Zabibu Residence
 * REST API with JWT Authentication
 */

// Auth
$router->post('/api/v1/auth/login', 'Api\AuthApiController@login');
$router->post('/api/v1/auth/refresh', 'Api\AuthApiController@refresh');
$router->post('/api/v1/auth/logout', 'Api\AuthApiController@logout');

// Properties (public)
$router->get('/api/v1/properties', 'Api\PropertyApiController@index');
$router->get('/api/v1/properties/{id}', 'Api\PropertyApiController@show');
$router->get('/api/v1/properties/search', 'Api\PropertyApiController@search');

// Bookings
$router->post('/api/v1/bookings', 'Api\BookingApiController@store');
$router->get('/api/v1/bookings/{ref}', 'Api\BookingApiController@show');

// Payments (callback endpoints)
$router->post('/api/v1/payments/selcom/callback', 'Api\PaymentApiController@selcomCallback');
$router->post('/api/v1/payments/azampay/callback', 'Api\PaymentApiController@azampayCallback');
$router->post('/api/v1/payments/mpesa/callback', 'Api\PaymentApiController@mpesaCallback');

// Tenant (protected)
$router->get('/api/v1/tenant/balance', 'Api\TenantApiController@balance');
$router->get('/api/v1/tenant/payments', 'Api\TenantApiController@payments');
$router->post('/api/v1/tenant/maintenance', 'Api\TenantApiController@maintenance');

// Regions/Districts for dropdowns
$router->get('/api/v1/regions', 'Api\LocationApiController@regions');
$router->get('/api/v1/regions/{id}/districts', 'Api\LocationApiController@districts');
$router->get('/api/v1/districts/{id}/wards', 'Api\LocationApiController@wards');
