# Feature: Marketplace

## Purpose

Team integrations hub: catalogue of available and requestable third-party connections. WordPress/Flamingo is available to connect; Bark (and future partners) can be requested for Super Admin follow-up.

## Boundaries

- **Owns:** `integration_requests`; catalogue (`IntegrationCatalogue`); hub UI `Pages/Marketplace/Index.vue`; Super Admin request list/status updates
- **Does not own:** OAuth/credentials, sync jobs, customer/job creation, Bark or WordPress connectors
- **Depends on (platform only):** User / Team / auth; Super Admin middleware for request management
- **Depends on (other domains):** none required — WordPress settings link is soft (`Route::has('wordpress.settings')`)
- **Platform UI touchpoint:** Sidebar “Integrations”; Super Admin “Integration requests”. Revert those links if Marketplace is removed.

## Models

| Model | Table | Notes |
|-------|-------|-------|
| `IntegrationRequest` | `integration_requests` | Per-team request for a catalogue key; `status` pending/acknowledged/closed |

Schema is normalised. Catalogue entries are code-defined (not a DB table). Migration: `2026_09_16_130000_create_integration_requests_table.php`.

## Behaviour

- **Hub:** Owners/admins/editors (non-restricted roles) see available integrations and pending request state.
- **Request:** Owner/admin may submit one pending request per integration key (e.g. `bark`).
- **WordPress card:** Links to `wordpress.settings` when the WordPress domain is registered.
- **Super Admin:** List/filter requests; set status to acknowledged or closed.

## Routes

### Web

| Method | URI | Name | Controller |
|--------|-----|------|------------|
| GET | `/marketplace` | `marketplace.index` | Web\MarketplaceController@index |
| POST | `/marketplace/requests` | `marketplace.requests.store` | Web\MarketplaceController@store |

### Super Admin

| Method | URI | Name | Controller |
|--------|-----|------|------------|
| GET | `/super-admin/integration-requests` | `super-admin.integration-requests.index` | SuperAdmin\IntegrationRequestController@index |
| PUT | `/super-admin/integration-requests/{integration_request}` | `super-admin.integration-requests.update` | SuperAdmin\IntegrationRequestController@update |

### API

N/A

## Permissions

- View hub: team members with `read` who are not staff/customer/provider
- Request: owner, admin, or super admin
- Super Admin status updates: `super_admins` membership

## Tests

- Path: `laravel/tests/Feature/Domains/Marketplace/`
- Cover: list hub, request Bark, reject duplicate pending, staff forbidden, Super Admin status update

## Add / remove checklist

### Add

- [x] Domain folder + `DomainServiceProvider`
- [x] Provider registered
- [x] This wiki page linked from `docs/README.md`
- [ ] Feature tests passing

### Remove

- [ ] Provider unregistered
- [ ] Domain folder deleted
- [ ] This page and index link removed
- [ ] Feature tests deleted
- [ ] Sidebar + Super Admin nav links removed
- [ ] Remaining suite still green
