Files
flatrender/services/identity/FlatRender.IdentitySvc/Models/Admin.cs
T
soroush.asadi 81912cac66
Build backend images / build content-svc (push) Failing after 14s
Build backend images / build file-svc (push) Failing after 1m28s
Build backend images / build gateway (push) Failing after 1m43s
Build backend images / build identity-svc (push) Failing after 3m0s
Build backend images / build notification-svc (push) Failing after 51s
Build backend images / build render-svc (push) Failing after 1m3s
Build backend images / build studio-svc (push) Failing after 1m1s
feat(render): full-screen render page, one-active-render limit, app-wide progress
Concurrent-render ceiling (a user runs 1 render at a time unless granted more):
- Identity: TokenService emits max_renders claim from User.ParallelRenderingCeiling
- Identity: admin POST /v1/users/{id}/render-slots (AdminService.SetRenderSlotsAsync,
  clamped 1..50) — gamification or admin raises a user's ceiling
- render-svc: middleware reads max_renders (default 1); CreateJob rejects with 409
  active_render_limit when active jobs >= ceiling
- render-svc: db.CountActiveJobs + ListActiveJobs; GET /v1/renders/active returns
  in-flight renders + can_start_new

Full-screen render page (replaces the modal):
- /studio/render/[projectId]: config (resolution/fps) → live preview + progress →
  download; resumes this project's in-flight render on mount; blocks when another
  render is active; reads ?preset=
- StudioTopBar export menu now navigates to the page; RenderModal deleted (dead)

App-wide minimal progress:
- GlobalRenderProgress pill mounted in the locale layout for authed users; polls
  /api/render/active every 4s, shows thumbnail + step + % on every page, click →
  the render page; hidden on the render page and when idle

Admin: UserActions gains a "concurrent render slots" control.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 16:48:05 +03:30

41 lines
2.1 KiB
C#

namespace FlatRender.IdentitySvc.Models;
// ── CRM analytics (acquisition / conversion funnel) ──────────────────────────
public record CrmDailyPoint(string Date, int Signups, int Buyers, long RevenueMinor);
public record CrmAnalyticsResponse(
int TotalSignups,
int Buyers,
int NonBuyers,
double ConversionRate,
long RevenueMinor,
int PayingUsersAllTime,
List<CrmDailyPoint> Daily
);
// ── OAuth provider config ─────────────────────────────────────────────────────
public record OAuthConfigResponse(string Provider, string? ClientId, string? RedirectUri, bool Enabled, bool HasSecret);
public record UpsertOAuthConfigRequest(string? ClientId, string? ClientSecret, string? RedirectUri, bool Enabled);
// ── Plan statistics breakdown ────────────────────────────────────────────────
public record PlanStatRow(string PlanName, int Total, int Active, long RevenueMinor);
// ── CRM notes / tags per customer ────────────────────────────────────────────
public record UserCrmResponse(string[] Tags, string? Note, string Status);
public record UpsertUserCrmRequest(string[]? Tags, string? Note, string? Status);
// ── User admin power-actions ─────────────────────────────────────────────────
public record SetBalanceRequest(long AmountMinor, bool Add); // Add=false → set absolute
public record ResetPasswordRequest(string NewPassword);
public record AddChargeRequest(int Seconds, int RenderCount); // grant render seconds / daily renders
public record GrantPlanDaysRequest(Guid PlanId, int Days);
public record SetFlagRequest(bool Enabled);
public record SetRenderSlotsRequest(int Ceiling); // concurrent-render ceiling