# Changelog

All notable changes to the Deal Flow plugin are documented here.

## [0.9.4] - 2026-06-10

### Fixed
- **Task queue filtering by pipeline with "All owners" returned HTTP 400** — empty optional query parameters (e.g. an unset owner filter) were validated as if required, rejecting otherwise-valid filter requests. Empty optional query params are now treated as absent, so pipeline filtering with "All owners" works and produces clean filter URLs.
- **Updates page now shows the actual release date of the latest version** — previously the page only displayed the license update window ("Updates included through …"), which customers misread as the package/release date. The in-plugin updates page now shows the real "Released {date}" of the latest version alongside the license window, on both the "Update available" and "Up to date" cards (server-rendered and AJAX "Check Now" refresh).

## [0.9.3] - 2026-06-04

### Fixed
- **New Deal form opened from a modal (Reports/Pipeline/list) dumped a raw AJAX payload instead of rendering after Save** — modal contentTemplate now targets the real rendering controllers, not the forwarding facade. When the New Deal form was opened as an ajaxmodal and saved with "Save & Close", the page displayed the raw Mautic AJAX JSON wrapper (`{"activeLink":…,"newContent":…}`) as visible text instead of rendering the board. The modal `contentTemplate` resolved to the forwarding `DealController` facade, whose `forward()` sub-request was re-detected as ajax and re-wrapped as JSON-in-JSON. The modal `contentTemplate` now targets the real rendering controllers (`DealListController`, `DealFormController`, `DealViewController`), which render HTML directly via `delegateView()`. Affected `resolveReturnContext()` in `Controller/Trait/DealFormHelpersTrait.php` and the inline modal `postActionRedirect` calls in `Controller/DealFormController.php`. Full-page (non-modal) create/edit was unaffected and remains unchanged.

## [0.9.2] - 2026-06-04

### Fixed
- **Packaging defect (HTTP 500 on all Deal pages)** — the 0.9.1 release archive was built from a stale source and omitted the `DealController` sub-controllers (`DealListController`, `DealFormController`, `DealViewController`, `DealViewAjaxController`, `DealBatchController`, `DealAttachmentController`) along with their `Controller/Trait/` and `Controller/Helper/` dependencies, the `Compat/` layer, and `ViewModel/` classes. Fresh 0.9.1 installs returned 500 (`Controller "…DealListController" does neither exist as service nor as class`) on `/s/deal-flow/pipeline`, `/new`, and any deal view. 0.9.2 is a complete, verified build containing all required files. Release archives are now produced solely via `make package` from the canonical source.

### Note
- **0.9.1 is withdrawn.** Anyone on 0.9.1 should upgrade to 0.9.2. 0.9.0 is unaffected.

## [0.9.0] - 2026-03-29

### Added
- **CLI updater workflow** — download, apply, and rollback commands for plugin updates

### Changed
- Update downloads now extract into an isolated staging directory before the live plugin swap

### Fixed
- Global search service wiring across supported Mautic versions
- Update instructions now match the staged CLI update flow shipped in the plugin

## [0.8.0] - 2026-03-15

### Added
- **Contact timeline injection** — deals appear on Mautic contact timeline
- **Contact view tab** — "Deals" tab on contact detail page showing associated deals
- **Global search** — deals searchable from Mautic's top search bar
- **Deal list search** — filter deals by title, stage, status
- **Batch actions** — multi-select deals for stage change or archive
- **Undo toast** — 60-second undo window for destructive batch actions
- **Pipeline velocity reporting** — average days to close, cycle time, monthly close rate
- **Docker test infrastructure** — `make gate` runs PHPUnit, PHPStan, CS Fixer in container
- PHPStan level 6 configuration
- PHP-CS-Fixer with PSR-12/Symfony rules

### Changed
- DealRepository migrated from ServiceEntityRepository to CommonRepository
- DealModel wired with full AbstractCommonModel constructor arguments
- All entity tests updated for FormEntity API (camelCase change tracking)

### Fixed
- 3 service wiring bugs causing 500 errors on cache rebuild
- DateTimeImmutable crash in `isChanged()` for `setExpectedCloseDate()`
- InputBag/ParameterBag compatibility for Symfony 6+
- `wrapInTransaction` mock target in tests

## [0.7.0] - 2026-03-15

### Added
- **FormEntity migration** — Deal, Pipeline, DealStage now extend Mautic's FormEntity
- **DealModel** — thin FormModel subclass for campaign integration
- **Campaign condition** — "Contact has matching Deal Flow deal"
- **Campaign action** — "Move Deal Flow deal to stage"
- **Segment filters** — pipeline, stage, status, stakeholder role, amount
- Dashboard widget config popovers

### Changed
- Entity timestamps: `createdAt` → `dateAdded`, `updatedAt` → `dateModified`
- Pipeline/DealStage: `isActive` → `isPublished`
- Deal gained `isPublished` toggle

## [0.6.4] - 2026-03-15

### Added
- Deal.qualification field
- DealNote.activityType field
- InboundWebhookSource.fieldMapping field
- Database migration for new fields
- 219 characterization tests

### Fixed
- `isChanged()` calls: camelCase only, removed DateTimeImmutable/relationship calls
- DealManager flush consolidation

## [0.6.3] - 2026-03-14

### Fixed
- Missing `isChanged()` calls across 9 entities
- DealManager flush consolidation for batch operations

## [0.6.2] - 2026-03-13

### Added
- 8 dashboard widgets: stage breakdown, pipeline value, won/lost, closing this month, owner leaderboard, stale deals, weighted forecast, overdue tasks
- Revenue Over Time widget with weekly/cumulative toggle
- Clickable links on all dashboard widgets
- Config screen for plugin settings
- 36 unit tests

## [0.6.0] - 2026-03-12

### Added
- AJAX kanban board for pipeline view
- Health indicator dots on deal cards
- Deal list pagination
- XSS protection fixes
- Deal field builder UX improvements

## [0.5.0] - 2026-03-10

### Added
- Per-source inbound webhook credentials with HMAC signing
- API documentation views
- Company deals sidebar on company view
- Deal attachment API
- Modal new deal flow

## [0.1.0] - 2026-03-08

### Added
- Initial Deal Flow plugin for Mautic 7
- 10 entities: Deal, DealStage, Pipeline, DealNote, DealTask, DealContactAssociation, DealAttachment, DealAuditEvent, DealField, InboundWebhookSource
- Pipeline and stage management
- Deal CRUD with form builder
- REST API for deals
- Permission system (view/edit/create/delete own/other)
