TenantAtlas/specs
ahmido 4d3fcd28a9 feat/032-backup-scheduling-mvp (#34)
What
Implements tenant-scoped backup scheduling end-to-end: schedules CRUD, minute-based dispatch, queued execution, run history, manual “Run now/Retry”, retention (keep last N), and auditability.

Key changes

Filament UI: Backup Schedules resource with tenant scoping + SEC-002 role gating.
Scheduler + queue: tenantpilot:schedules:dispatch command wired in scheduler (runs every minute), creates idempotent BackupScheduleRun records and dispatches jobs.
Execution: RunBackupScheduleJob syncs policies, creates immutable backup sets, updates run status, writes audit logs, applies retry/backoff mapping, and triggers retention.
Run history: Relation manager + “View” modal rendering run details.
UX polish: row actions grouped; bulk actions grouped (run now / retry / delete). Bulk dispatch writes DB notifications (shows in notifications panel).
Validation: policy type hard-validation on save; unknown policy types handled safely at runtime (skipped/partial).
Tests: comprehensive Pest coverage for CRUD/scoping/validation, idempotency, job outcomes, error mapping, retention, view modal, run-now/retry notifications, bulk delete (incl. operator forbidden).
Files / Areas

Filament: BackupScheduleResource.php and app/Filament/Resources/BackupScheduleResource/*
Scheduling/Jobs: app/Console/Commands/TenantpilotDispatchBackupSchedules.php, app/Jobs/RunBackupScheduleJob.php, app/Jobs/ApplyBackupScheduleRetentionJob.php, console.php
Models/Migrations: app/Models/BackupSchedule.php, app/Models/BackupScheduleRun.php, database/migrations/backup_schedules, backup_schedule_runs
Notifications: BackupScheduleRunDispatchedNotification.php
Specs: specs/032-backup-scheduling-mvp/* (tasks/checklist/quickstart updates)
How to test (Sail)

Run tests: ./vendor/bin/sail artisan test tests/Feature/BackupScheduling
Run formatter: ./vendor/bin/sail php ./vendor/bin/pint --dirty
Apply migrations: ./vendor/bin/sail artisan migrate
Manual dispatch: ./vendor/bin/sail artisan tenantpilot:schedules:dispatch
Notes

Uses DB notifications for queued UI actions to ensure they appear in the notifications panel even under queue fakes in tests.
Checklist gate for 032 is PASS; tasks updated accordingly.

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local>
Reviewed-on: #34
2026-01-05 04:22:13 +00:00
..
001-rbac-onboarding feat/004-assignments-scope-tags (#4) 2025-12-23 21:49:58 +00:00
002-filament-json spec: add 002 filament json 2025-12-14 19:56:17 +01:00
003-settings-catalog-readable dev-merges/c709b36 (#3) 2025-12-21 23:15:12 +00:00
004-assignments-scope-tags feat/004-assignments-scope-tags (#4) 2025-12-23 21:49:58 +00:00
005-bulk-operations feat/005-bulk-operations (#5) 2025-12-25 13:32:36 +00:00
006-sot-foundations-assignments feat(006): foundations + assignment mapping and preview-only restore guard (#7) 2025-12-26 23:44:31 +00:00
007-device-config-compliance feat(007): device config & compliance snapshot/restore improvements (#9) 2025-12-29 12:46:20 +00:00
008-apps-app-management feat: add metadata-only mobile app coverage with scope tag restore (#10) 2025-12-29 14:01:37 +00:00
009-app-protection-policy feat/009-app-protection-policy (#11) 2025-12-29 16:11:50 +00:00
010-admin-templates feat(010): Administrative Templates – restore from PolicyVersion + version visibility (#13) 2025-12-30 01:50:05 +00:00
011-restore-run-wizard feat/011-restore-run-wizard (#17) 2025-12-31 19:14:59 +00:00
012-windows-update-rings feat/012-windows-update-rings (#18) 2026-01-01 10:44:17 +00:00
013-scripts-management 013-scripts-management (#19) 2026-01-01 22:02:30 +00:00
014-enrollment-autopilot 014-enrollment-autopilot (#20) 2026-01-02 11:59:21 +00:00
015-policy-picker-ux 015-policy-picker-ux (#21) 2026-01-02 13:59:15 +00:00
016-backup-version-reuse feat: always capture policy when adding to backup (#22) 2026-01-02 14:33:29 +00:00
017-policy-types-mam-endpoint-security-baselines feat/017-policy-types-mam-endpoint-security-baselines (#23) 2026-01-03 02:06:35 +00:00
018-driver-updates-wufb feat/018-driver-updates-wufb (#27) 2026-01-04 00:38:54 +00:00
023-endpoint-security-restore feat/018-driver-updates-wufb (#27) 2026-01-04 00:38:54 +00:00
024-terms-and-conditions spec/024-additional-intune-types (#28) 2026-01-04 02:27:44 +00:00
025-policy-sets spec/024-additional-intune-types (#28) 2026-01-04 02:27:44 +00:00
026-custom-compliance-scripts spec/024-additional-intune-types (#28) 2026-01-04 02:27:44 +00:00
027-enrollment-config-subtypes feat/027-enrollment-config-subtypes (#31) 2026-01-04 13:25:15 +00:00
028-device-categories spec/024-additional-intune-types (#28) 2026-01-04 02:27:44 +00:00
029-wip-policies spec/024-additional-intune-types (#28) 2026-01-04 02:27:44 +00:00
030-intune-rbac-backup spec/024-additional-intune-types (#28) 2026-01-04 02:27:44 +00:00
031-tenant-portfolio-context-switch feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
032-backup-scheduling-mvp feat/032-backup-scheduling-mvp (#34) 2026-01-05 04:22:13 +00:00
900-policy-lifecycle feat/005-bulk-operations (#5) 2025-12-25 13:32:36 +00:00
.gitkeep chore(specs): add baseline specs folder 2025-12-14 19:42:35 +01:00