# Public Page Provider Footer Link Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Add a localized service-provider login link to the `/people` and `/pets` footers.

**Architecture:** Keep the existing independent Blade footers and add the same named-route link to each. Reuse the existing bilingual `redesign_welcome.provider-footer` label and protect the behavior with an HTTP feature test that inspects the rendered footer.

**Tech Stack:** Laravel, Blade, PHPUnit, existing locale session middleware.

---

### Task 1: Add a failing bilingual footer contract

**Files:**
- Modify: `tests/Feature/PublicPagesAvailabilityTest.php`

- [ ] **Step 1: Write the failing test**

Add a test that loops through Spanish and English and then through `/people` and `/pets`. For each response, extract the `<footer>` and assert that it contains the relative provider login URL and the localized label:

```php
public function test_people_and_pets_footers_link_to_the_localized_provider_login(): void
{
    foreach (['es' => 'Prestadores de servicios', 'en' => 'Service providers'] as $locale => $label) {
        foreach (['/people', '/pets'] as $path) {
            $html = (string) $this->withSession(['locale' => $locale])
                ->get($path)
                ->assertOk()
                ->getContent();

            self::assertMatchesRegularExpression('/<footer\b.*<\/footer>/s', $html);
            preg_match('/<footer\b.*<\/footer>/s', $html, $matches);

            self::assertStringContainsString(
                'href="'.route('provider.login', absolute: false).'"',
                $matches[0]
            );
            self::assertStringContainsString($label, $matches[0]);
        }
    }
}
```

- [ ] **Step 2: Run the focused test and verify RED**

Run:

```bash
php artisan test tests/Feature/PublicPagesAvailabilityTest.php \
  --filter=people_and_pets_footers_link_to_the_localized_provider_login
```

Expected: FAIL because neither footer contains `/mi-prestador/login`.

### Task 2: Add the minimal footer links

**Files:**
- Modify: `resources/views/partials/redesign/people/footer.blade.php`
- Modify: `resources/views/partials/redesign/pets/footer.blade.php`

- [ ] **Step 1: Add the People footer link**

In the `MyCode` column, after the homepage link, add:

```blade
<a href="{{ route('provider.login', absolute: false) }}">{{ __('redesign_welcome.provider-footer') }}</a>
```

- [ ] **Step 2: Add the Pets footer link**

Add the identical localized named-route link in the corresponding `MyCode` column.

- [ ] **Step 3: Run the focused test and verify GREEN**

Run the Task 1 command again.

Expected: PASS for all four page/locale combinations.

### Task 3: Apply the patch version and verify the release

**Files:**
- Modify: `VERSION`

- [ ] **Step 1: Apply the version decision**

Change `VERSION` from `1.7.0` to `1.7.1`. This is a backward-compatible public navigation bugfix, so a patch increment is appropriate.

- [ ] **Step 2: Run focused and architectural verification**

```bash
php artisan test tests/Feature/PublicPagesAvailabilityTest.php
php artisan architecture:audit --strict
git diff --check
```

Expected: all tests pass, the architecture audit reports compliance, and `git diff --check` prints no errors.

- [ ] **Step 3: Inspect rendered HTML in both languages**

Render `/people` and `/pets` locally with Spanish and English locale sessions. Confirm the link is inside each footer, uses the expected localized text, and resolves to `/mi-prestador/login`.

- [ ] **Step 4: Run the complete regression suite**

```bash
php artisan test
```

Expected: the full suite passes without regressions.

- [ ] **Step 5: Commit only the feature files**

```bash
git add VERSION \
  tests/Feature/PublicPagesAvailabilityTest.php \
  resources/views/partials/redesign/people/footer.blade.php \
  resources/views/partials/redesign/pets/footer.blade.php
git commit --only VERSION \
  tests/Feature/PublicPagesAvailabilityTest.php \
  resources/views/partials/redesign/people/footer.blade.php \
  resources/views/partials/redesign/pets/footer.blade.php \
  -m "fix: link public page footers to providers"
```

When the version hook asks, keep the already evaluated value `1.7.1`.
