unioil-loyalty-app/routes/api.php

256 lines
12 KiB
PHP

<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| CMS API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
// cms login
Route::post('cms/login_username', 'API\UserController@cms_usernameLogin');
Route::post('cms/login_password', 'API\UserController@cms_login');
Route::post('cms/login_changePassword', 'API\UserController@cms_changePassword');
Route::post('cms/checkTime', 'API\UserController@checkTime');
Route::get('cms/convertmd5', 'API\UserController@convertmd5');
Route::get('cms/systemPreference', 'API\SystemPreferenceController@index');
Route::get('cms/systemPreference/{id}', 'API\SystemPreferenceController@show');
// paypal execute
Route::post('cms/paypalExecute','API\PaymentController@paypal_execute');
// Notifications
Route::get('cms/notification', 'API\InAppNotificationController@index');
Route::get('cms/notification/{id}', 'API\InAppNotificationController@show');
Route::put('cms/notification/{id}', 'API\InAppNotificationController@update');
Route::group(['middleware' => 'auth:api'], function() {
// routes that needs authentication
//system preference update
Route::post('cms/systemPreference', 'API\SystemPreferenceController@store');
Route::get('cms/logout','API\UserController@logout_cms');
// admin
Route::resource('cms/admin', 'API\AdminController');
Route::post('cms/generatePassword', 'API\AdminController@generate_password');
Route::post('cms/adminChangeStatus', 'API\AdminController@changeStatus');
Route::delete('cms/adminBatchDelete', 'API\AdminController@batch_delete');
Route::post('cms/adminProfile', 'API\AdminController@myProfile');
// members
Route::resource('cms/member', 'API\MemberController');
Route::delete('cms/memberBatchDelete','API\MemberController@batch_delete');
Route::post('cms/memberActivate/{uuid}','API\MemberController@activate_locked');
// Top Up
Route::resource('cms/topUp', 'API\TopUpController');
Route::delete('cms/topUpBatchDelete', 'API\TopUpController@batch_delete');
Route::get('cms/generateFeeCode', 'API\TopUpController@generate_fee_code');
// Card Types
Route::resource('cms/cardType','API\CardTypeController');
Route::post('cms/cardTypeUpdate/{uuid}','API\CardTypeController@update');
Route::delete('cms/cardTypeBatchDelete', 'API\CardTypeController@batch_delete');
// Promotions
Route::resource('cms/promotion','API\PromotionController');
Route::get('cms/promoTypes','API\PromotionController@promo_types');
Route::post('cms/updatePromotion/{uuid}','API\PromotionController@update');
Route::delete('cms/promotionBatchDelete', 'API\PromotionController@batch_delete');
Route::get('cms/getPromotions','API\PromotionController@get_promotions');
Route::get('cms/promotionDisableTopTwo','API\PromotionController@disable_toptwo');
// Stations
Route::get('cms/getStations','API\StationController@get_viewable');
// Reports
Route::get('cms/reportTopUp','API\ReportsController@top_up');
Route::get('cms/reportTopUpExport','API\ReportsController@export_top_up');
Route::get('cms/reportStationRatings','API\ReportsController@station_rating');
Route::get('cms/reportStationRatingsExport','API\ReportsController@export_station_rating');
Route::get('cms/reportMobileUsage','API\ReportsController@mobile_usage');
Route::get('cms/reportMobileUsageExport','API\ReportsController@export_mobile_usage');
Route::get('cms/reportRegistration','API\ReportsController@registration');
Route::get('cms/reportRegistrationExport','API\ReportsController@export_registration');
// Terms And Privacy
Route::resource('cms/TermsAndPrivacy', 'API\TermsAndPrivacyController');
Route::delete('cms/TermsAndPrivacyBatchDelete', 'API\TermsAndPrivacyController@batch_delete');
// Photo Slider
Route::resource('cms/photoSlider','API\PhotoSliderController');
Route::post('cms/updatePhotoSlider/{uuid}','API\PhotoSliderController@update');
Route::delete('cms/photoSliderBatchDelete', 'API\PhotoSliderController@batch_delete');
Route::get('cms/photoSliderCount','API\PhotoSliderController@check_count');
// Stratuscast Update
Route::get('cms/stratuscastCityProvince','API\CityAndProvinceController@sync');
Route::get('cms/stratuscastStation','API\StationController@manual_overide');
Route::get('cms/stratuscastProducts','API\ProductDetailsController@sync');
Route::get('cms/stratuscastAboutUs','API\SystemPreferenceController@about_us');
// //RNRPH Update Stations
Route::get('mobile/syncstations','API\StationController@manual_update');
Route::get('mobile/synccities','API\CityAndProvinceController@syncCityProvince');
// Notifications with Auth
Route::post('cms/notification', 'API\InAppNotificationController@store');
// Route::put('cms/notification/{id}', 'API\InAppNotificationController@update');
Route::delete('cms/notification/{id}', 'API\InAppNotificationController@destroy');
});
/*
|--------------------------------------------------------------------------
| Mobile API Routes
|--------------------------------------------------------------------------
|
|
|
|
|
*/
// Enroll and Register
Route::get('mobile/topUp/get_count','API\TopUpController@get_count');
Route::post('mobile/loginCardNumber','API\UserController@mobile_loginCardNumber');
Route::post('mobile/loginMobileNumber','API\UserController@mobile_loginMobileNumber');
Route::post('mobile/loginCardNumberEnroll','API\UserController@mobile_loginCardNumber_enroll');
Route::post('mobile/loginBirthdate','API\UserController@mobile_loginBirthdate');
Route::get('mobile/requestOtp','API\UserController@create_otp');
// Apply Card OTP
Route::get('mobile/mobileOtp','API\UserController@mobile_otp');
Route::get('mobile/validateOtp','API\UserController@mobile_validate_otp');
Route::post('mobile/sendOTP','API\UserController@validate_otp');
Route::post('mobile/validatePin','API\UserController@mobile_validatePin');
Route::post('mobile/activateCard','API\UserController@mobile_activateCard');
// Sign Up
Route::post('mobile/signUpIDNumber','API\SignUpController@check_id_number');
Route::post('mobile/signUp','API\SignUpController@store');
//otp checker
Route::get('extra/getotp/{mobile}','API\UserController@checkmobileotp');
// NOTE these routes are from inial plan of CR1
// Route::post('mobile/signUp','API\SignUpController@store');
// Route::post('mobile/signUpDocuments','API\SignUpController@upload');
// Route::get('mobile/signUpSubmit/{uuid}','API\SignUpController@signupSubmit');
// Route::get('mobile/signUpReview/{uuid}','API\SignUpController@review');
// Route::get('mobile/idNumberType/{code}','API\IDNumberTypeController@mobile_show');
// Terms and Privacy
Route::get('mobile/termsAndPrivacy','API\TermsAndPrivacyController@mobile_terms_privacy');
// Promotions
Route::get('mobile/promotions','API\PromotionController@mobile_promotions');
Route::post('mobile/promotionsGPS','API\PromotionController@mobile_promotions_gps');
Route::get('mobile/promotions/{uuid}','API\PromotionController@mobile_promotions_details');
Route::get('mobile/getpromo','API\PromotionController@getTopTwoPromotion');
Route::get('mobile/whatshot','API\PhotoSliderController@get_photo_slider');
Route::get('mobile/contactus','API\SystemPreferenceController@mobile_system_preference');
Route::get('mobile/getcardtype','API\CardTypeController@getAllCardType');
Route::get('mobile/cityDropdown','API\CityAndProvinceController@get_all'); // stratus
Route::get('mobile/cityList','API\CityAndProvinceController@get_city_list'); //rnrph
//mpin
Route::get('mobile/getMpin','API\UserController@mobile_getPin');
Route::post('mobile/mpinUpdate','API\UserController@mobile_updateMpin');
//Route::post('mobile/securityQuestion','API\MemberController@validateMember');
Route::group(['middleware' => 'auth:api'], function() {
// User Profile
Route::get('mobile/userProfile','API\MemberController@myProfile');
//validate member
Route::post('mobile/securityQuestion','API\MemberController@validateMember');
// Edit Profile
Route::post('mobile/editProfile','API\MemberController@update');
Route::post('mobile/editProfileOTP','API\MemberController@confirm_otp');
Route::get('mobile/vehicleOwnDropdown','API\CodeVehicleOwnController@get_all');
Route::get('mobile/fuelTypeDropdown','API\CodeFuelTypeController@get_all');
Route::get('mobile/civilStatusDropdown','API\CodeCivilStatusController@get_all');
Route::get('mobile/genderDropdown','API\CodeGenderController@get_all');
Route::resource('mobile/fueltracker','API\FuelTrackerController');
//mpin
//Route::get('mobile/getMpin','API\UserController@mobile_getPin');
//Route::post('mobile/mpinUpdate','API\UserController@mobile_updateMpin');
// Station Locator
Route::post('mobile/stationNearby','API\StationController@nearby');
// Route::get('mobile/stationFavorites','API\StationController@favorites');
Route::get('mobile/stationViaCity/{uuid}','API\StationController@by_city');
Route::get('mobile/stationDetails/{uuid}','API\StationController@fuel_prices'); // stratus
Route::get('mobile/stationfuels/{uuid}','API\StationController@get_station_fuel_details'); // rnr
Route::get('mobile/stationFavorites','API\StationController@favorites');
Route::get('mobile/stationSetFavorite/{uuid}','API\StationController@set_favorite');
Route::delete('mobile/stationDeleteFavorite/{uuid}','API\StationController@delete_favorite');
// Transactions
Route::get('mobile/transactions','API\PaymentController@transactions');
Route::get('mobile/singleTransaction','API\PaymentController@single_transaction');
Route::post('mobile/rateTransaction','API\PaymentController@rate_transaction');
Route::get('mobile/transactionStatus/{id}','API\PaymentController@get_status');
Route::post('mobile/paymaya_execute','API\PaymentController@paymaya_execute');
//shared treats
Route::get('mobile/sharedtreats','API\SharedTreatsController@index');
// Paypal
Route::post('mobile/paypalURL','API\PaymentController@get_paypal_url');
// Fuel List - Fuel Efficiency
Route::get('mobile/fuelList','API\ProductDetailsController@get_fuels_from_products');
Route::get('mobile/fuels','API\ProductDetailsController@getFuelList');
//logout
Route::post('mobile/logout','API\UserController@logout_mobile');
// Count User Payment Transactions
Route::get('mobile/count_total_transactions','API\PaymentController@count_total_transactions');
//Paymaya Tokenization
Route::get('mobile/paymayatokens','API\PaymayaTokensController@index');
Route::post('mobile/paymayatokens','API\PaymayaTokensController@store');
Route::get('mobile/paymayatokens/{card_number}','API\PaymayaTokensController@show');
Route::delete('mobile/paymayatokens/{paymaya_token_uuid}', 'API\PaymayaTokensController@destroy');
});
Route::get('mobile/systemPreference/{id}', 'API\SystemPreferenceController@show_mobile');
Route::resource('mobile/products','API\ProductDetailsController');
Route::post('mobile/stationSearch','API\StationController@search');
Route::get('mobile/productsSync','API\ProductDetailsController@sync');
Route::get('mobile/checkOTP/{card_number}','API\UserController@checkOTP');
Route::get('mobile/checkMobile/{mobile}','API\UserController@checkMobile');
//New Station endpoints
Route::get('mobile/provinces','API\StationController@get_provinces');
Route::get('mobile/stations','API\StationController@get_stations');
Route::get('mobile/cities','API\StationController@get_cities');
Route::get('mobile/stationfuels','API\StationController@get_station_fuels');
//mobile version
Route::get('mobile/getVersion/{platform}','API\SystemPreferenceController@mobile_version');