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);
