Files
BetterDesk/docs/commercialization-desktop-client.md
UNITRONIX 9d7a08e7ab feat(commercialization): group packages, billing periods, and RD reports
Modernize Commercialization on packages/sessions IA: Settings Time tab with
BILLING_TIMEZONE, group-only packages, monthly period history with midnight
split, Web Remote report overlay, pending_report in Sessions, and package
preview as a centered modal. Includes panel form polish and desktop-client
API notes.

Refs #456

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-10-18 22:45:17 +02:00

33 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Commercialization — desktop client / stock RustDesk
Billable sessions are created on the **BetterDesk server** for every connection that
uses this server’s signal/relay (`PrepareRelay` → `ActivateRelay` → `EndRelay`),
regardless of client SKU.
## Stock RustDesk
- No in-client work-report UI.
- When `BILLING_REQUIRE_WORK_REPORT` is enabled, ended sessions stay
`pending_report` until an operator completes the report in
**Commercialization → Sessions → Complete report**.
## BetterDesk-Client (Flutter / UNITRONIX/BetterDesk-Client)
Target UX (same model as Web Remote):
1. During a billable session: show package badge + “Work report” action (optional draft).
2. On disconnect: prompt for work summary (required when billing requires reports).
3. If the app closes without submit: leave the same `billing_sessions` row as
`pending_report` (no duplicate). Operator finishes it in the panel Sessions tab.
### Panel / API hooks (already on BetterDesk server)
| Method | Path | Purpose |
|--------|------|---------|
| GET | `/api/billing/check?device_id=` | `package_name`, `remaining_minutes`, `allowed` |
| GET | `/api/billing/sessions/pending?device_id=` | latest `pending_report` for device |
| POST | `/api/billing/sessions/{id}/report` | `{ summary, category?, ticket_ref? }` |
Client builds should call these with the operator token used for Client API auth.
Implementation lives in the BetterDesk-Client repository (not this monorepo).