| @@ -46,18 +46,18 @@ | ||
| 46 | 46 | $router->post('login', [UserController::class, 'login']); |
| 47 | 47 | }); |
| 48 | 48 | |
| 49 | 49 | $router->prefix('customers') |
| 50 | - ->withPolicy('CustomerFrontendPolicy')->group(function (Router $router) { | |
| 51 | - //$router->post('/', [CustomerController::class, 'store']); | |
| 52 | - $router->get('/{customerId}', [CustomerController::class, 'getDetails']); | |
| 53 | - $router->put('/{customerId}', [CustomerController::class, 'updateDetails']); | |
| 54 | - $router->get('/{customerId}/orders', [CustomerController::class, 'getCustomerOrders']); | |
| 50 | + ->withPolicy('PublicPolicy')->group(function (Router $router) { | |
| 51 | + // Customer self-service (details/orders/address CRUD) lives under the | |
| 52 | + // customer-profile group — the duplicates that used to sit here shadowed | |
| 53 | + // the admin customers group and were unreachable dead code (audit #5). | |
| 54 | + // Only these checkout-context routes, with no admin counterpart, remain. | |
| 55 | + // PublicPolicy rather than a login gate (audit #6): guests reach these | |
| 56 | + // from checkout, and both controllers fully self-guard (current-customer | |
| 57 | + // resolution + ownership), answering guests with their own envelopes. | |
| 55 | 58 | $router->get('/{customerAddressId}/update-address-select', [CustomerController::class, 'updateAddressSelect']); |
| 56 | - $router->put('/{customerId}/address', [CustomerController::class, 'updateAddress']); | |
| 57 | 59 | $router->post('/add-address', [CustomerController::class, 'createAddress']); |
| 58 | - $router->delete('/{customerId}/address', [CustomerController::class, 'removeAddress']); | |
| 59 | - $router->post('/{customerId}/address/make-primary', [CustomerController::class, 'setAddressPrimary']); | |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | 62 | $router->prefix('customer-profile')->withPolicy('CustomerFrontendPolicy')->group(function (Router $router) { |
| 63 | 63 | $router->get('/', [CustomerProfileController::class, 'index']); |
| @@ -63,8 +63,9 @@ | ||
| 63 | 63 | $router->get('/', [CustomerProfileController::class, 'index']); |
| 64 | 64 | $router->get('/downloads', [CustomerProfileController::class, 'getDownloads']); |
| 65 | 65 | |
| 66 | 66 | $router->get('/profile', [CustomerProfileController::class, 'getCustomerProfileDetails']); |
| 67 | + $router->get('/sections', [CustomerProfileController::class, 'getSections']); | |
| 67 | 68 | $router->post('/create-address', [CustomerProfileController::class, 'createCustomerProfileAddress']); |
| 68 | 69 | |
| 69 | 70 | $router->post('/edit-address', [CustomerProfileController::class, 'updateCustomerProfileAddress']); |
| 70 | 71 | $router->post('/make-primary-address', [CustomerProfileController::class, 'makePrimaryCustomerProfileAddress']); |
| @@ -92,6 +93,8 @@ | ||
| 92 | 93 | $router->post('subscriptions/{subscription_uuid}/switch-payment-method', [CustomerSubscriptionController::class, 'switchPaymentMethod'])->alphaNumDash('subscription_uuid'); |
| 93 | 94 | $router->post('subscriptions/{subscription_uuid}/confirm-subscription-switch', [CustomerSubscriptionController::class, 'confirmSubscriptionSwitch'])->alphaNumDash('subscription_uuid'); |
| 94 | 95 | $router->post('subscriptions/{subscription_uuid}/cancel-auto-renew', [CustomerSubscriptionController::class, 'cancelAutoRenew'])->alphaNumDash('subscription_uuid'); |
| 95 | 96 | $router->post('subscriptions/{subscription_uuid}/initiate-early-payment', [CustomerSubscriptionController::class, 'initiateEarlyPayment'])->alphaNumDash('subscription_uuid'); |
| 97 | + $router->post('subscriptions/{subscription_uuid}/pause', [CustomerSubscriptionController::class, 'pauseSubscription'])->alphaNumDash('subscription_uuid'); | |
| 98 | + $router->post('subscriptions/{subscription_uuid}/resume', [CustomerSubscriptionController::class, 'resumeSubscription'])->alphaNumDash('subscription_uuid'); | |
| 96 | 99 | |
| 97 | 100 | }); |