# superadmin-content-and-automations Specification

## Purpose
TBD - created by archiving change superadmin-panel. Update Purpose after archive.
## Requirements
### Requirement: Cross-Tenant Social Post Oversight
The system SHALL provide superadmins with an aggregate view of all scheduled, published, and failed social posts across all tenants.

#### Scenario: Inspecting failed social posts and manual retry
- **WHEN** a superadmin visits `/superadmin/social/posts` with a filter for status = "failed"
- **THEN** the system SHALL display the failed post details, error messages from the Meta API, and a "Retry Post" button that dispatches the publishing job immediately

#### Scenario: Deleting or cancelling problematic posts
- **WHEN** a superadmin chooses to cancel a scheduled post from the global monitor
- **THEN** the system SHALL update the post status to cancelled, cancel pending queue jobs, and log an audit action

### Requirement: Comment Moderation & Flywheel Audit Trail
The system SHALL provide superadmins with visibility into automated comment moderation decisions, flagged comments, and DM flywheel triggers across all pages.

#### Scenario: Viewing flagged comments and moderation actions
- **WHEN** a superadmin visits `/superadmin/social/moderation`
- **THEN** the system SHALL display recent comments analyzed by the AI/moderation engine, sentiment flags, actions taken (hidden, unflagged, replied), and associated team/page details

#### Scenario: Inspecting flywheel automation executions
- **WHEN** a superadmin visits `/superadmin/social/flywheels`
- **THEN** the system SHALL display execution logs for comment-to-DM flywheel automation rules, including triggered keywords, sender info, and DM dispatch success status

