mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-03 12:39:42 +00:00
Add audit functionality for Activity actions
- Introduced `ActivityDisplayer` and `ActivitySubjectConverter` for handling audit display and conversion logic. - Integrated `TriggerAuditInterface` in `ActivityController` and added audit triggers for create, list, update, delete, and view actions with translatable descriptions. - Updated `services.yaml` to register new audit-related services. - Enhanced French translations with audit-related labels for `Activity`.
This commit is contained in:
@@ -68,6 +68,7 @@ $this->triggerAudit->triggerAudit(
|
||||
- Audit every create, update, delete, view and list action on domain entities.
|
||||
- Use only the `$action` when it is obvious and self-explanatory.
|
||||
- Use the `$description` when the action alone is not enough. For example for a list, the main subject is the person (or the accompanying period) the list is attached to, and the description should summarize the list content (filters, ranges, counts, …).
|
||||
- The description should be a `TranslatableMessage`, and the first key of the message should be `audit`
|
||||
- Add `$metadata` to provide extra, machine-friendly details (ids, filters, pagination, counts, etc.).
|
||||
- Reuse the existing patterns found in current controllers and services.
|
||||
|
||||
@@ -84,7 +85,7 @@ Examples:
|
||||
($this->triggerAudit)(
|
||||
AuditTrail::AUDIT_LIST,
|
||||
$accompanyingPeriod,
|
||||
description: 'Listing resources for the current period',
|
||||
description: new TranslatableMessage('audit.Listing resources for the current period'),
|
||||
metadata: ['scope' => 'resources', 'filters' => ['category' => 'housing', 'page' => 1]]
|
||||
);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user