<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\MainController;

Route::prefix('api/admin')->group(function () {
    // start auth
    Route::prefix('auth')->group(function () {
        Route::post('login', 'Admin\Api\AuthController@login');
        //        Route::post('signup', 'Admin\Api\Auth\RegisterController@signup');
//        Route::post('resetemail', 'Admin\Api\Auth\ForgotPasswordController@sendResetLinkEmail');
//        Route::post('resetpassword', 'Admin\Api\Auth\ResetPasswordController@reset');
        Route::get('logout', 'Admin\Api\AuthController@logout');
    });
    // end auth

    Route::middleware('auth')->group(function () {
        Route::get('projects-list-admin', [MainController::class, 'projectsListAdmin']);
        Route::get('areas-list-admin', [MainController::class, 'areasListAdmin']);
        Route::get('development-and-projects-list-admin', [MainController::class, 'developmentsAndProjectsListAdmin']);
        // start users
        Route::get('users', 'Admin\Api\UsersController@usersList');
        Route::post('deleteuser', 'Admin\Api\UsersController@deleteUser');
        Route::post('updateuserstatus', 'Admin\Api\UsersController@updateUserStatus');
        Route::post('createagency', 'Admin\Api\UsersController@createAgency')->name('create-agency');
        Route::post('updateagency', 'Admin\Api\UsersController@updateAgency')->name('update-agency');
        Route::post('createagent', 'Admin\Api\UsersController@createAgent')->name('create-agent');
        Route::post('updateagent', 'Admin\Api\UsersController@updateAgent')->name('update-agent');
//        Route::post('updateuser/{id}', 'Admin\Api\UsersController@updateUser')->name('update-user');
        // Route::post('updateuserblock', 'Admin\Api\UsersController@updateUserBlock');
        Route::get('getuserdetail/{id}', 'Admin\Api\UsersController@getUserDetail');
        // end users

        // start admins
        Route::get('admins', 'Admin\Api\AdminsController@adminsList');
        Route::post('createadmin', 'Admin\Api\AdminsController@createAdmin');
        Route::post('updateadmin/{id}', 'Admin\Api\AdminsController@updateAdmin');
        Route::post('deleteadmin', 'Admin\Api\AdminsController@deleteAdmin');
        Route::get('getadmindetail/{id}', 'Admin\Api\AdminsController@getAdminDetail');
        // end admins

        // start pages
        Route::get('pages', 'Admin\Api\PagesController@pagesList');
        Route::post('createpage', 'Admin\Api\PagesController@createPage');
        Route::post('updatepage/{id}', 'Admin\Api\PagesController@updatePage');
        Route::post('deletepage', 'Admin\Api\PagesController@deletePage');
        Route::post('updatepagestatus', 'Admin\Api\PagesController@updatePageStatus');
        Route::get('getpagedetail/{id}', 'Admin\Api\PagesController@getPageDetail');
        // end pages

        // start testimonials
        Route::get('testimonials', 'Admin\Api\TestimonialsController@testimonialsList');
        Route::post('createtestimonial', 'Admin\Api\TestimonialsController@createTestimonial');
        Route::post('updatetestimonial/{id}', 'Admin\Api\TestimonialsController@updateTestimonial');
        Route::post('deletetestimonial', 'Admin\Api\TestimonialsController@deleteTestimonial');
        Route::post('updatetestimonialstatus', 'Admin\Api\TestimonialsController@updateTestimonialStatus');
        Route::post('uploadtestimonialfile', 'Admin\Api\TestimonialsController@uploadTestimonialFile');
        Route::post('uploadtestimonialfiles', 'Admin\Api\TestimonialsController@uploadTestimonialFiles');
        Route::post('deleteuploadedtestimonialfile', 'Admin\Api\TestimonialsController@deleteUploadedTestimonialFile');
        Route::get('gettestimonialdetail/{id}', 'Admin\Api\TestimonialsController@getTestimonialDetail');
        // end testimonials

        // start banners
        Route::get('banners', 'Admin\Api\BannersController@bannersList');
        Route::post('createbanner', 'Admin\Api\BannersController@createBanner');
        Route::post('updatebanner/{id}', 'Admin\Api\BannersController@updateBanner');
        Route::post('deletebanner', 'Admin\Api\BannersController@deleteBanner');
        Route::post('updatebannerstatus', 'Admin\Api\BannersController@updateBannerStatus');
        Route::post('uploadbannerfile', 'Admin\Api\BannersController@uploadBannerFile');
        Route::post('uploadbannerfiles', 'Admin\Api\BannersController@uploadBannerFiles');
        Route::post('deleteuploadedbannerfile', 'Admin\Api\BannersController@deleteUploadedBannerFile');
        Route::get('getbannerdetail/{id}', 'Admin\Api\BannersController@getBannerDetail');
        // end banners

        // start attributes
        Route::get('attributes', 'Admin\Api\AttributesController@attributesList');
        Route::post('createattribute', 'Admin\Api\AttributesController@createAttribute');
        Route::post('updateattribute/{id}', 'Admin\Api\AttributesController@updateAttribute');
        Route::post('updateattributestatus', 'Admin\Api\AttributesController@updateAttributeStatus');
        Route::post('uploadattributefile', 'Admin\Api\AttributesController@uploadAttributeFile');
        Route::post('uploadattributefiles', 'Admin\Api\AttributesController@uploadAttributeFiles');
        Route::post('deleteuploadedattributefile', 'Admin\Api\AttributesController@deleteUploadedAttributeFile');
        Route::post('deleteattribute', 'Admin\Api\AttributesController@deleteAttribute');
        Route::get('getattributedetail/{id}', 'Admin\Api\AttributesController@getAttributeDetail');
        // end attributes

        // start categories
        Route::get('categories', 'Admin\Api\CategoriesController@categoriesList');
        Route::post('createcategory', 'Admin\Api\CategoriesController@createCategory');
        Route::post('updatecategory/{id}', 'Admin\Api\CategoriesController@updateCategory');
        Route::post('updatecategorystatus', 'Admin\Api\CategoriesController@updateCategoryStatus');
        Route::post('deletecategory', 'Admin\Api\CategoriesController@deleteCategory');
        Route::get('getcategorydetail/{id}', 'Admin\Api\CategoriesController@getCategoryDetail');
        // end categories

        // start posts
        Route::get('posts', 'Admin\Api\PostsController@postsList');
        Route::post('createpost', 'Admin\Api\PostsController@createPost');
        Route::post('updatepost/{id}', 'Admin\Api\PostsController@updatePost');
        Route::post('updatepoststatus', 'Admin\Api\PostsController@updatePostStatus');
        Route::post('deletepost', 'Admin\Api\PostsController@deletePost');
        Route::get('getpostdetail/{id}', 'Admin\Api\PostsController@getPostDetail');
        Route::post('uploadpostfile', 'Admin\Api\PostsController@uploadPostFile');
        Route::post('uploadpostfiles', 'Admin\Api\PostsController@uploadPostFiles');
        Route::post('deleteuploadedpostfile', 'Admin\Api\PostsController@deleteUploadedPostFile');
        // end posts

        // start listings
        Route::get('listings', 'Admin\Api\ListingsController@listingList');
        Route::get('publiclistings', 'Admin\Api\ListingsController@publicListingList');
        Route::get('listingreqs', 'Admin\Api\ListingsController@listingReqsList');
        Route::get('getlistingdetail/{id}', 'Admin\Api\ListingsController@getListingDetail');
        Route::get('getpubliclistingdetail/{id}', 'Admin\Api\ListingsController@getPublicListingDetail');
        Route::post('createlisting', 'Admin\Api\ListingsController@createListing');
        Route::post('updatelisting/{id}', 'Admin\Api\ListingsController@updateListing');
        Route::post('deletelisting', 'Admin\Api\ListingsController@deleteListing');
        Route::post('updatelistingstatus', 'Admin\Api\ListingsController@updateListingStatus');
        Route::post('uploadlistingfile', 'Admin\Api\ListingsController@uploadListingFile');
        Route::post('uploadlistingfiles', 'Admin\Api\ListingsController@uploadListingFiles');
        Route::post('deleteuploadedlistingfile', 'Admin\Api\ListingsController@deleteUploadedListingFile');
        // end listings

        // start roles
        Route::get('roles', 'Admin\Api\RolesController@rolesList');
        Route::post('createrole', 'Admin\Api\RolesController@createRole');
        Route::post('updaterole/{id}', 'Admin\Api\RolesController@updateRole');
        Route::post('updaterolestatus', 'Admin\Api\RolesController@updateRoleStatus');
        Route::post('deleterole', 'Admin\Api\RolesController@deleteRole');
        Route::get('getroledetail/{id}', 'Admin\Api\RolesController@getRoleDetail');
        // end roles

        // start calling database
        Route::get('cds', 'Admin\Api\CdsController@cdsList');
        Route::post('createcd', 'Admin\Api\CdsController@createCd');
        Route::post('updatecd/{id}', 'Admin\Api\CdsController@updateCd');
        Route::post('updatecdstatus', 'Admin\Api\CdsController@updateCdStatus');
        Route::post('deletecd', 'Admin\Api\CdsController@deleteCd');
        Route::get('getcddetail/{id}', 'Admin\Api\CdsController@getCdDetail');
        Route::post('cd-bulk-action', 'Admin\Api\CdsController@cdBulkAction')->name('cd-bulk-action');
        // end database

        // start leads
        Route::get('leads', 'Admin\Api\LeadsController@leadsList');
        Route::get('leadlistings', 'Admin\Api\LeadsController@leadListingsList');
        Route::post('createlead', 'Admin\Api\LeadsController@createLead');
        Route::post('updatelead/{id}', 'Admin\Api\LeadsController@updateLead');
        Route::post('updateleadstatus', 'Admin\Api\LeadsController@updateLeadStatus');
        Route::post('deletelead', 'Admin\Api\LeadsController@deleteLead');
        Route::get('getleaddetail/{id}', 'Admin\Api\LeadsController@getLeadDetail');
        Route::post('leads-bulk-action', 'Admin\Api\LeadsController@leadsBulkAction')->name('leads-bulk-action');
        Route::post('save-lead-note', 'Admin\Api\LeadsController@saveLeadNote')->name('save-lead-note');
        // end leads

        // start offplan
        Route::get('offplan', 'Admin\Api\OffplanController@offplansList');
        Route::post('createoffplan', 'Admin\Api\OffplanController@createOffplan')->name('add-offplan');
//        Route::post('deleteoffplan', 'Admin\Api\OffplanController@deleteOffplan');
//        Route::get('getoffplandetail/{id}', 'Admin\Api\OffplanController@getOffplanDetail');
        // end offplan

        // start contacts
        Route::get('contacts', 'Admin\Api\ContactsController@contactsList');
        Route::get('contactlistings', 'Admin\Api\ContactsController@contactListingsList');
        Route::post('createcontact', 'Admin\Api\ContactsController@createContact');
        Route::post('updatecontact/{id}', 'Admin\Api\ContactsController@updateContact')->name('updateContact');
        Route::post('updatecontactstatus', 'Admin\Api\ContactsController@updateContactStatus');
        Route::post('deletecontact', 'Admin\Api\ContactsController@deleteContact');
        Route::get('getcontactdetail/{id}', 'Admin\Api\ContactsController@getContactDetail');
        // end contacts

        // start appointments
        Route::get('appointments', 'Admin\Api\AppointmentsController@appointmentsList');
        Route::post('createappointment', 'Admin\Api\AppointmentsController@createAppointment');
        Route::post('updateappointment/{id}', 'Admin\Api\AppointmentsController@updateAppointment');
        Route::post('deleteappointment', 'Admin\Api\AppointmentsController@deleteAppointment');
        Route::get('getappointmentdetail/{id}', 'Admin\Api\AppointmentsController@getAppointmentDetail');
        // end appointments
    });
});
