From c7fc06ef50b1289b042793cd97edc167ea21f70b Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Sun, 26 Mar 2023 00:43:08 +0800 Subject: [PATCH] Fix routes and acl for apiv2 #730 --- config/packages/catalyst_auth.yaml | 136 ++++++++++++++++++++++++++++- config/routes/api.yaml | 90 +++++++++---------- config/routes/apiv2.yaml | 97 ++++++++++---------- 3 files changed, 231 insertions(+), 92 deletions(-) diff --git a/config/packages/catalyst_auth.yaml b/config/packages/catalyst_auth.yaml index eab14d01..324d0812 100644 --- a/config/packages/catalyst_auth.yaml +++ b/config/packages/catalyst_auth.yaml @@ -591,7 +591,7 @@ catalyst_auth: label: Delete api: - user_entity: "App\\Entity\\CustomerUser" + user_entity: "App\\Entity\\ApiUser" acl_data: - id: warranty label: Warranty Access @@ -715,3 +715,137 @@ catalyst_auth: acls: - id: tapi_service.list label: List Third Party Services + + cust_api_v2: + user_entity: "App\\Entity\\CustomerUser" + acl_data: + - id: cust_api_v2.auth + label: Authentication + acls: + - id: cust_api_v2.auth.register + label: Register + - id: cust_api_v2.auth.confirm + label: Confirm Number + - id: cust_api_v2.auth.validate + label: Validate Code + - id: cust_api_v2.auth.resend_code + label: Resend Code + - id: cust_api_v2.customer + label: Customer + acls: + - id: cust_api_v2.customer.info + label: Info + - id: cust_api_v2.customer.update + label: Update + - id: cust_api_v2.customer.status + label: Status + - id: cust_api_v2.customer.hash + label: Hash + - id: cust_api_v2.device + label: Device + acls: + - id: cust_api_v2.device.id + label: Update + - id: cust_api_v2.invoice + label: Invoice + acls: + - id: cust_api_v2.invoice.estimate + label: Estimate + - id: cust_api_v2.jo + label: Job Order + acls: + - id: cust_api_v2.jo.ongoing + label: List Ongoing + - id: cust_api_v2.jo.invoice + label: Get Invoice + - id: cust_api_v2.jo.cancel + label: Cancel + - id: cust_api_v2.jo.info + label: Info + - id: cust_api_v2.jo.history + label: History + - id: cust_api_v2.jo.latest + label: Latest + - id: cust_api_v2.jo.all_ongoing + label: List All Ongoing + - id: cust_api_v2.jo.ongoing_count + label: List Ongoing Count + - id: cust_api_v2.jo.create + label: Create + - id: cust_api_v2.jo.request + label: Request + - id: cust_api_v2.jo.completed + label: List Completed + - id: cust_api_v2.location + label: Location + acls: + - id: cust_api_v2.location.support + label: Get Support Status + - id: cust_api_v2.location.nearest_hub_and_slots + label: List Nearest Hub and Slots + - id: cust_api_v2.location.create + label: Create + - id: cust_api_v2.location.list + label: List + - id: cust_api_v2.partner + label: Partner + acls: + - id: cust_api_v2.partner.info + label: Info + - id: cust_api_v2.partner.closest + label: List Closest Partners + - id: cust_api_v2.partner.review + label: Review + - id: cust_api_v2.privacy + label: Privacy + acls: + - id: cust_api_v2.privacy.settings + label: Get Privacy Settings + - id: cust_api_v2.promo + label: Promo + acls: + - id: cust_api_v2.promo.list + label: Get Promos + - id: cust_api_v2.rider + label: Rider + acls: + - id: cust_api_v2.rider.status + label: Status + - id: cust_api_v2.rider.rating + label: Rate + - id: cust_api_v2.schedule + label: Schedule + acls: + - id: cust_api_v2.schedule.status + label: Get Schedule Option Status + - id: cust_api_v2.service + label: Service + acls: + - id: cust_api_v2.service.list + label: List + - id: cust_api_v2.vehicle + label: Vehicle + acls: + - id: cust_api_v2.vehicle.mfgs + label: List Manufacturers + - id: cust_api_v2.vehicle.makes + label: List Makes + - id: cust_api_v2.vehicle.create + label: Add + - id: cust_api_v2.vehicle.update + label: Update + - id: cust_api_v2.vehicle.list + label: List + - id: cust_api_v2.vehicle.batteries + label: Compatible Batteries + - id: cust_api_v2.vehicle.delete + label: Delete + - id: cust_api_v2.warranty + label: Warranty + acls: + - id: cust_api_v2.warranty.activate + label: Activate + - id: cust_api_v2.warranty.check + label: Check Status + - id: cust_api_v2.warranty.register + label: Register \ No newline at end of file diff --git a/config/routes/api.yaml b/config/routes/api.yaml index 8512fb7a..19e3a468 100644 --- a/config/routes/api.yaml +++ b/config/routes/api.yaml @@ -1,227 +1,227 @@ # api -apiv2_register: +api_register: path: /api/register controller: App\Controller\APIController::register methods: [POST] -apiv2_confirm: +api_confirm: path: /api/number_confirm controller: App\Controller\APIController::confirmNumber methods: [POST] -apiv2_validate: +api_validate: path: /api/code_validate controller: App\Controller\APIController::validateCode methods: [POST] -apiv2_info_get: +api_info_get: path: /api/info controller: App\Controller\APIController::getInfo methods: [GET] -apiv2_info_update: +api_info_update: path: /api/info controller: App\Controller\APIController::updateInfo methods: [POST] -apiv2_status: +api_status: path: /api/status controller: App\Controller\APIController::getStatus methods: [GET] -apiv2_vehicle_mfg_list: +api_vehicle_mfg_list: path: /api/vehicle/mfgs controller: App\Controller\APIController::listVehicleManufacturers methods: [GET] -apiv2_vehicle_make_list: +api_vehicle_make_list: path: /api/vehicle/mfgs/{mfg_id}/makes controller: App\Controller\APIController::listVehicleMakes methods: [GET] -apiv2_cust_vehicle_add: +api_cust_vehicle_add: path: /api/vehicles controller: App\Controller\APIController::addVehicle methods: [POST] -apiv2_cust_vehicle_update: +api_cust_vehicle_update: path: /api/vehicles/{id} controller: App\Controller\APIController::updateVehicle methods: [POST] -apiv2_cust_vehicle_list: +api_cust_vehicle_list: path: /api/vehicles controller: App\Controller\APIController::listVehicles methods: [GET] -apiv2_promo_list: +api_promo_list: path: /api/promos controller: App\Controller\APIController::listPromos methods: [GET] -apiv2_battery_list: +api_battery_list: path: /api/vehicles/{vid}/compatible_batteries controller: App\Controller\APIController::getCompatibleBatteries methods: [GET] -apiv2_jo_request: +api_jo_request: path: /api/job_order controller: App\Controller\APIController::requestJobOrder methods: [POST] -apiv2_estimate: +api_estimate: path: /api/estimate controller: App\Controller\APIController::getEstimate methods: [POST] -apiv2_ongoing: +api_ongoing: path: /api/job_order/ongoing controller: App\Controller\APIController::getOngoing methods: [GET] -apiv2_rider_status: +api_rider_status: path: /api/rider controller: App\Controller\APIController::getRiderStatus methods: [GET] -apiv2_rider_rating_add: +api_rider_rating_add: path: /api/rider_rating controller: App\Controller\APIController::addRiderRating methods: [POST] -apiv2_jo_cancel: +api_jo_cancel: path: /api/job_order/cancel controller: App\Controller\APIController:cancelJobOrder methods: [POST] -apiv2_jo_history: +api_jo_history: path: /api/job_order/history controller: App\Controller\APIController:getJOHistory methods: [GET] -apiv2_jo_invoice: +api_jo_invoice: path: /api/job_order/invoice controller: App\Controller\APIController:getJOInvoice methods: [GET] -apiv2_device_id: +api_device_id: path: /api/device_id controller: App\Controller\APIController:updateDeviceID methods: [POST] -apiv2_privacy: +api_privacy: path: /api/privacy controller: App\Controller\APIController:privacySettings methods: [POST] -apiv2_resend_code: +api_resend_code: path: /api/resend_code controller: App\Controller\APIController:resendCode methods: [POST] -apiv2_location_support: +api_location_support: path: /api/location_support controller: App\Controller\APIController:locationSupport methods: [GET] -apiv2_activate_warranty: +api_activate_warranty: path: /api/activate_warranty controller: App\Controller\APIController:activateWarranty methods: [POST] -apiv2_service_list: +api_service_list: path: /api/services controller: App\Controller\APIController:listServices methods: [GET] -apiv2_partner_info: +api_partner_info: path: /api/partners/{pid} controller: App\Controller\APIController:getPartnerInformation methods: [GET] -apiv2_partner: +api_partner: path: /api/partners controller: App\Controller\APIController:getClosestPartners methods: [GET] -apiv2_partner_review: +api_partner_review: path: /api/partners/{pid}/review controller: App\Controller\APIController:reviewPartner methods: [POST] -apiv2_nearest_hub_slots: +api_nearest_hub_slots: path: /api/hub_slots controller: App\Controller\APIController::getNearestHubAndSlots methods: [GET] -apiv2_new_jo_request: +api_new_jo_request: path: /api/new_job_order controller: App\Controller\APIController::newRequestJobOrder methods: [POST] -apiv2_version_check: +api_version_check: path: /api/version_check controller: App\Controller\APIController::versionCheck methods: [GET] -apiv2_schedule_option_status: +api_schedule_option_status: path: /api/schedule_option_status controller: App\Controller\APIController::scheduleOptionStatus methods: [GET] # paperless warranty / qr code -apiv2_warr_serial_check: +api_warr_serial_check: path: /api/warranty/{serial} controller: App\Controller\APIController::warrantyCheck methods: [GET] -apiv2_warr_serial_register: +api_warr_serial_register: path: /api/warranty/{serial} controller: App\Controller\APIController::warrantyRegister methods: [POST] -apiv2_jo_info: +api_jo_info: path: /api/job_order/{id}/info controller: App\Controller\APIController::getJobOrderInfo methods: [GET] -apiv2_ongoing_job_orders: +api_ongoing_job_orders: path: /api/job_orders/ongoing controller: App\Controller\APIController::getAllOngoingJobOrders methods: [GET] -apiv2_ongoing_jo_count: +api_ongoing_jo_count: path: /api/job_orders/ongoing/count controller: App\Controller\APIController::getOngoingJobOrderCount methods: [GET] -apiv2_new_location: +api_new_location: path: /api/new_location controller: App\Controller\APIController::addLocation methods: [POST] -apiv2_locations: +api_locations: path: /api/locations controller: App\Controller\APIController::getLocations methods: [GET] -apiv2_cust_vehicle_remove: +api_cust_vehicle_remove: path: /api/vehicles/{id}/remove controller: App\Controller\APIController::removeVehicle methods: [POST] -apiv2_latest_job_order: +api_latest_job_order: path: /api/job_order/latest controller: App\Controller\APIController::getLatestJobOrder methods: [GET] -apiv2_customer_hash_get: +api_customer_hash_get: path: /api/customer_hash controller: App\Controller\APIController::getCustomerHash methods: [GET] -#apiv2_completed_job_orders: +#api_completed_job_orders: # path: /api/job_orders/completed # controller: App\Controller\APIController::getCompletedJobOrders # methods: [GET] diff --git a/config/routes/apiv2.yaml b/config/routes/apiv2.yaml index 2253f65d..80872490 100644 --- a/config/routes/apiv2.yaml +++ b/config/routes/apiv2.yaml @@ -1,227 +1,232 @@ # api -api_register: +apiv2_register: path: /apiv2/register controller: App\Controller\CustomerAppAPI\AuthController::register methods: [POST] -api_confirm: +apiv2_confirm: path: /apiv2/number_confirm controller: App\Controller\CustomerAppAPI\AuthController::confirmNumber methods: [POST] -api_validate: +apiv2_validate: path: /apiv2/code_validate controller: App\Controller\CustomerAppAPI\AuthController::validateCode methods: [POST] -api_info_get: +apiv2_info_get: path: /apiv2/info controller: App\Controller\CustomerAppAPI\CustomerController::getInfo methods: [GET] -api_info_update: +apiv2_info_update: path: /apiv2/info controller: App\Controller\CustomerAppAPI\CustomerController::updateInfo methods: [POST] -api_status: +apiv2_status: path: /apiv2/status controller: App\Controller\CustomerAppAPI\CustomerController::getStatus methods: [GET] -api_vehicle_mfg_list: +apiv2_vehicle_mfg_list: path: /apiv2/vehicle/mfgs controller: App\Controller\CustomerAppAPI\VehicleController::listVehicleManufacturers methods: [GET] -api_vehicle_make_list: +apiv2_vehicle_make_list: path: /apiv2/vehicle/mfgs/{mfg_id}/makes controller: App\Controller\CustomerAppAPI\VehicleController::listVehicleMakes methods: [GET] -api_cust_vehicle_add: +apiv2_cust_vehicle_add: path: /apiv2/vehicles controller: App\Controller\CustomerAppAPI\VehicleController::addVehicle methods: [POST] -api_cust_vehicle_update: +apiv2_cust_vehicle_update: path: /apiv2/vehicles/{id} controller: App\Controller\CustomerAppAPI\VehicleController::updateVehicle methods: [POST] -api_cust_vehicle_list: +apiv2_cust_vehicle_list: path: /apiv2/vehicles controller: App\Controller\CustomerAppAPI\VehicleController::listVehicles methods: [GET] -api_promo_list: +apiv2_promo_list: path: /apiv2/promos controller: App\Controller\CustomerAppAPI\PromoController::listPromos methods: [GET] -api_battery_list: +apiv2_battery_list: path: /apiv2/vehicles/{vid}/compatible_batteries controller: App\Controller\CustomerAppAPI\VehicleController::getCompatibleBatteries methods: [GET] -api_jo_request: +apiv2_jo_request: path: /apiv2/job_order controller: App\Controller\CustomerAppAPI\JobOrderController::requestJobOrder methods: [POST] -api_estimate: +apiv2_estimate: path: /apiv2/estimate - controller: App\Controller\CustomerAppAPI\EstimateController::getEstimate + controller: App\Controller\CustomerAppAPI\InvoiceController::getEstimate methods: [POST] -api_ongoing: +apiv2_ongoing: path: /apiv2/job_order/ongoing controller: App\Controller\CustomerAppAPI\JobOrderController::getOngoing methods: [GET] -api_rider_status: +apiv2_rider_status: path: /apiv2/rider controller: App\Controller\CustomerAppAPI\RiderController::getRiderStatus methods: [GET] -api_rider_rating_add: +apiv2_rider_rating_add: path: /apiv2/rider_rating controller: App\Controller\CustomerAppAPI\RiderController::addRiderRating methods: [POST] -api_jo_cancel: +apiv2_jo_cancel: path: /apiv2/job_order/cancel controller: App\Controller\CustomerAppAPI\JobOrderController:cancelJobOrder methods: [POST] -api_jo_history: +apiv2_jo_history: path: /apiv2/job_order/history controller: App\Controller\CustomerAppAPI\JobOrderController:getJOHistory methods: [GET] -api_jo_invoice: +apiv2_jo_invoice: path: /apiv2/job_order/invoice controller: App\Controller\CustomerAppAPI\JobOrderController:getJOInvoice methods: [GET] -api_device_id: +apiv2_device_id: path: /apiv2/device_id controller: App\Controller\CustomerAppAPI\DeviceController:updateDeviceID methods: [POST] -api_privacy: +apiv2_privacy: path: /apiv2/privacy controller: App\Controller\CustomerAppAPI\PrivacyController:privacySettings methods: [POST] -api_resend_code: +apiv2_resend_code: path: /apiv2/resend_code controller: App\Controller\CustomerAppAPI\AuthController:resendCode methods: [POST] -api_location_support: +apiv2_location_support: path: /apiv2/location_support controller: App\Controller\CustomerAppAPI\LocationController:locationSupport methods: [GET] -api_activate_warranty: +apiv2_activate_warranty: path: /apiv2/activate_warranty controller: App\Controller\CustomerAppAPI\WarrantyController:activateWarranty methods: [POST] -api_service_list: +apiv2_service_list: path: /apiv2/services controller: App\Controller\CustomerAppAPI\ServiceController:listServices methods: [GET] -api_partner_info: +apiv2_partner_info: path: /apiv2/partners/{pid} controller: App\Controller\CustomerAppAPI\PartnerController:getPartnerInformation methods: [GET] -api_partner: +apiv2_partner: path: /apiv2/partners controller: App\Controller\CustomerAppAPI\PartnerController:getClosestPartners methods: [GET] -api_partner_review: +apiv2_partner_review: path: /apiv2/partners/{pid}/review controller: App\Controller\CustomerAppAPI\PartnerController:reviewPartner methods: [POST] -api_nearest_hub_slots: +apiv2_nearest_hub_slots: path: /apiv2/hub_slots controller: App\Controller\CustomerAppAPI\LocationController::getNearestHubAndSlots methods: [GET] -api_new_jo_request: +apiv2_new_jo_request: path: /apiv2/new_job_order controller: App\Controller\CustomerAppAPI\JobOrderController::newRequestJobOrder methods: [POST] -api_version_check: +apiv2_version_check: path: /apiv2/version_check controller: App\Controller\CustomerAppAPI\AppController::versionCheck methods: [GET] -api_schedule_option_status: +apiv2_schedule_option_status: path: /apiv2/schedule_option_status controller: App\Controller\CustomerAppAPI\ScheduleController::scheduleOptionStatus methods: [GET] # paperless warranty / qr code -api_warr_serial_check: +apiv2_warr_serial_check: path: /apiv2/warranty/{serial} controller: App\Controller\CustomerAppAPI\WarrantyController::warrantyCheck methods: [GET] -api_warr_serial_register: +apiv2_warr_serial_register: path: /apiv2/warranty/{serial} controller: App\Controller\CustomerAppAPI\WarrantyController::warrantyRegister methods: [POST] -api_jo_info: +apiv2_jo_info: path: /apiv2/job_order/{id}/info controller: App\Controller\CustomerAppAPI\JobOrderController::getJobOrderInfo methods: [GET] -api_ongoing_job_orders: +apiv2_ongoing_job_orders: path: /apiv2/job_orders/ongoing controller: App\Controller\CustomerAppAPI\JobOrderController::getAllOngoingJobOrders methods: [GET] -api_ongoing_jo_count: +apiv2_ongoing_jo_count: path: /apiv2/job_orders/ongoing/count controller: App\Controller\CustomerAppAPI\JobOrderController::getOngoingJobOrderCount methods: [GET] -api_new_location: +apiv2_new_location: path: /apiv2/new_location controller: App\Controller\CustomerAppAPI\LocationController::addLocation methods: [POST] -api_locations: +apiv2_locations: path: /apiv2/locations controller: App\Controller\CustomerAppAPI\LocationController::getLocations methods: [GET] -api_cust_vehicle_remove: +apiv2_location_remove: + path: /apiv2/locations/{id}/remove + controller: App\Controller\CustomerAppAPI\LocationController::removeLocation + methods: [POST] + +apiv2_cust_vehicle_remove: path: /apiv2/vehicles/{id}/remove controller: App\Controller\CustomerAppAPI\VehicleController::removeVehicle methods: [POST] -api_latest_job_order: +apiv2_latest_job_order: path: /apiv2/job_order/latest controller: App\Controller\CustomerAppAPI\JobOrderController::getLatestJobOrder methods: [GET] -api_customer_hash_get: +apiv2_customer_hash_get: path: /apiv2/customer_hash controller: App\Controller\CustomerAppAPI\CustomerController::getCustomerHash methods: [GET] -#api_completed_job_orders: +#apiv2_completed_job_orders: # path: /apiv2/job_orders/completed # controller: App\Controller\CustomerAppAPI\JobOrderController::getCompletedJobOrders # methods: [GET]