Marketing · Activity report & PDF
Read-only closure report for a finished activity: KPI achievement against goals, estimated vs final cost with an over/under-budget verdict, participating stores, activity actions, supplier costs and ratings — exportable as a PDF.
| Area | Marketing |
| Routes | marketing.campaigns.show |
| Centre modules | marketing |
| Staff levels | root · admin · manager · crmmanager · weboperator · content_creator · owner |
| Models | campaign · campaign-action · campaign-goal · supplier · supplier-rating |
| UI label | campaign-report.estimated-cost / marketing.campaign.rating |
| Coverage | 4 use cases · 1 happy · 4 failure |
How it works
Only reachable once the activity’s status is finished (campaign.canShow). campaign-stats supplies the measured KPI values; campaignGoalsColumns pairs each KPI with its goal and current value to produce an achievement figure. The cost verdict is a single derived label: campaign-report.final-cost-in-estimated (‘Within budget’) or campaign-report.final-cost-over-estimated (‘Over budget’). Store lists collapse to campaign-report.all-shops or campaign-report.more-shops (’+ {shops} stores’). createPDF renders the report for distribution. hiddenKPIs lets a centre suppress KPIs that do not apply, and referredComparison / lastYearPeriod support like-for-like comparison against the reference period. Activity actions are drawn on a Gantt timeline (nf-gantt) spanning the activity’s start and end dates, and the section is hidden when there are no actions.
Use cases
Why someone opens this (4)
- Reporting a completed activity’s results and ROI to the centre’s owners.
- Comparing performance against the same period last year.
- Reconciling supplier invoices against the activity’s estimated budget.
- Rating suppliers after an event so future activities can pick better partners.
Path map
flowchart LR F(["Activity report and PDF"]):::feat F --> H1["Report produced and exported"]:::ok F -.-> X1["Activity not finished"]:::bad F -.-> X2["No goals defined"]:::bad F -.-> X3["Stats unavailable"]:::bad F -.-> X4["Rating missing"]:::bad classDef feat fill:#b0432c,stroke:#b0432c,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Report produced and exported
- User opens a finished activity’s report.
campaign-statsresolves the measured KPIs and each goal shows its achievement.- Costs are totalled and compared to the estimate, yielding the within/over-budget verdict.
createPDFgenerates the PDF and the user shares it.
Failure paths
Activity not finished
Cause — Status is planned, active or closed.
What happens —
canShowis false and the report route is not offered.
No goals defined
Cause — The activity was run without KPI goals.
What happens — The achievement table renders without comparison values — no error, but the report loses its point.
Stats unavailable
Cause —
campaign-statsfails to resolve.What happens — No dedicated error surface in this component; KPI tiles render empty.
Rating missing
Cause — The activity was closed without a rating.
What happens — Blocked earlier by the campaign model’s
ratingpresence rule on closure.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Report produced and exported
- ⛔ Activity not finished
- ⛔ No goals defined
- ⛔ Stats unavailable
- ⛔ Rating missing
Implementation
app/controllers/marketing/campaigns/show.jsapp/components/campaign-report.jsapp/services/campaign-stats.jsapp/enums/campaign-kpis.jsapp/models/campaign-goal.jsapp/models/campaign-action.js
Translation keys (12)
Key English campaign-report.estimated-costEstimated cost campaign-report.final-costFinal cost campaign-report.final-cost-in-estimatedWithin bugdet campaign-report.final-cost-over-estimatedOver budget campaign-report.all-shopsAll stores campaign-report.more-shops+ {shops} stores kpiKpi achievementAchievement current-valueCurrent value goal-valueGoal value marketing.campaign.ratingActivity rating marketing.campaigns.actionsActivity actions
Related
- Same area — Activity list & duplication · Activity editor (loyalty mechanics, rules & targeting) · Activity campaigns (programme grouping) · Email campaign list, duplication & stop · Email campaign builder (wizard, A-B test, scheduling) · Digital games (lottery) · Fidcard · Present cards (Fideliza gift cards) · Book appointment
- Shares data with — Customer create & edit · Customer CSV import · Customer receipts tab & ticket-stamp generation · Customer loyalty — raffle tickets · Customer loyalty — cards & stamps · Customer loyalty — rewards · Receipt verification queue · Store create & edit
Generated from doc/feature-inventory.json · id marketing-campaign-report · commit 276788ca6