# FMS — Super Admin Guide (Version 1)

Sign in at **/admin/login**. What you see depends on your role. Every page checks your permissions on the server, and staff actions are recorded in the audit log.

## Roles

| Role | Can do |
|---|---|
| Platform Owner | Everything; the only role that can assign or remove the Platform Owner role. At least one active Owner must always exist. |
| Super Admin | Everything except managing Platform Owners |
| Platform Admin | Day-to-day administration: customers, plans, subscriptions, CMS, support, reports. No staff, roles, settings or refunds. |
| Accounts Officer | Payments, invoices, refunds, revenue reports |
| Subscription Manager | Plans, features, subscriptions |
| Support Staff | Customer lookup and support tickets |
| CMS Manager | Website content only. No customer or financial data. |
| Read-only Auditor | Read-only access to records and audit logs |

You can create custom roles under **Roles & permissions**. You can only grant permissions you hold yourself.

## First steps after installation

1. **My account → Two-factor authentication**: set it up.
2. **Settings → General**: platform name, support email, default currency and timezone.
3. **Settings → Email**: check SMTP and send a test email.
4. **Settings → Invoices & tax**: company name, address, tax number, tax rate, and whether plan prices include tax.
5. **Plans**: review the Free plan's limits and create paid plans (price, billing period, trial days, features).
6. **Settings → Payments**: connect Razorpay (see DEPLOYMENT.md §4).
7. **CMS → Pages**: replace the Terms and Privacy text; edit the home, features and pricing text.
8. **Staff**: add your team with the smallest role that fits.
9. **Settings → Security**: once everyone has set up two-factor, require it for all staff.

## Customers (Users)

- **Search** by name, email or mobile. Opening a customer is recorded in the audit log.
  - You see the customer's account details, plan, payments, support tickets and usage counts.
  - You do not see their individual transactions.
- **Suspend customer**: signs them out and blocks sign-in. A reason is required.
- **Suspend workspace**: keeps sign-in working but shows a "workspace suspended" page.
- **Grant exception**: switch a feature on or off, or set a number or "unlimited", optionally until a date. It overrides the plan for that customer only.
- **Give a plan free of charge**: assign any plan until a date, for example as compensation. Afterwards the customer returns to Free without a grace period. This isn't possible while the customer already has a paid plan.

## Plans & features

- Changing a plan's price, billing or features creates a **new version**. Existing subscribers keep what they bought until they renew.
- The default plan must be free, and there is always exactly one default plan.
- A plan with subscribers cannot be deleted. Deactivate it instead.
- Switching a feature off under **Features** removes it from every plan immediately.

## Subscriptions & payments

- A plan activates only when the payment gateway's signed webhook confirms the payment.
- When a paid plan ends without renewal, the customer gets a **grace period** (default 7 days, in Settings → Payments), then moves to Free. Their data is always kept.
- **Refunds** (Accounts Officer and above): open a payment and choose **Issue a refund**.
  - Refunds can be partial or full, and can optionally end the subscription now.
  - Refunds made directly in the Razorpay dashboard are recorded automatically.
- **Webhook log** shows every gateway event and whether it was processed, ignored (for example a duplicate) or failed.

## Support

- Customers open requests from **Help & support** in their app. The support email receives an alert.
- Reply from **Support**. Choose the status after your reply: *Waiting on customer* is usual.
- Tick **Internal note** for notes the customer must not see.
- A customer reply reopens the ticket.

## Website (CMS)

- **Pages**: text is written in simple formatting (Markdown); HTML is removed for safety.
  - Each page can be a draft, published, or scheduled for a date.
  - Built-in pages keep their address and cannot be deleted.
- **FAQs, Manuals, Announcements**: announcements can target website visitors, signed-in customers, or both, within a date window.
- **Messages**: contact-form messages. Mark them handled after replying by email.

## Reports & audit

- **Dashboard**: live counts. Revenue figures are visible only to staff with payment access.
- **Reports**: 12-month registrations, new paid subscriptions, payments and net revenue per currency, with a CSV download.
- **Audit log**: the *Staff activity* and *Customer activity* trails, filterable by event, person and date. Entries cannot be edited or deleted.
