# Properties

Catálogo de imóveis — **Sprint 002 (R0)** · validado em ambiente local.

Namespace: `ImovelZapAi\Properties\`

## Documentação

- Sprint: [`docs/sprints/SPRINT_002_PROPERTIES.md`](../../docs/sprints/SPRINT_002_PROPERTIES.md)
- Ambiente local: [`docs/operations/LOCAL_DEV.md`](../../docs/operations/LOCAL_DEV.md)
- Blueprint: [`docs/blueprints/PROPERTY_BLUEPRINT.md`](../../docs/blueprints/PROPERTY_BLUEPRINT.md)

## Rotas web

Middleware: `auth`, `tenant.*`, `role:Admin|Gestor|Corretor`

| Método | Rota | Nome |
|--------|------|------|
| GET | `/imoveis` | `properties.index` |
| GET | `/imoveis/criar` | `properties.create` |
| POST | `/imoveis` | `properties.store` |
| GET | `/imoveis/cep/{cep}` | `properties.cep.lookup` |
| GET | `/imoveis/{property}` | `properties.show` |
| GET | `/imoveis/{property}/editar` | `properties.edit` |
| PUT | `/imoveis/{property}` | `properties.update` |
| DELETE | `/imoveis/{property}` | `properties.destroy` |

## CEP

`CepLookupService` consulta ViaCEP, resolve `state_id` / `city_id` (criando no catálogo se necessário) e retorna logradouro e bairro. O formulário (`properties/_form.blade.php`) consome `GET /imoveis/cep/{cep}`.

## Testes

```bash
docker compose exec -w /var/www/html/backend php php artisan test tests/Feature/Properties tests/Unit/Properties
docker compose exec -w /var/www/html/backend php composer test:properties:coverage
```

DoD automatizado: `PropertyDefinitionOfDoneTest`.
