Files
portal/app/resources/js/composables/mockTenantDetail.ts
T
Дмитрий cb05657f30 chore(format): prettier --write across 37 .vue/.ts files
Phase 1B audit found 48 files failing `prettier --check`. Auto-apply
via `npx prettier --write resources/js/**/*.{ts,vue,css}` produced
style-only changes:
- consistent quote style
- trailing comma normalization
- spaces around : in v-card style="position: relative" attrs
- explicit ; insertion

No semantic changes. No code-behavior changes. Production-code only;
test files batched separately into `test(frontend):` commit.

Verification:
- npx vitest run → 79/79 files, 614/614 + 3 skipped (no regression).
- npx vue-tsc --noEmit → 0 errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 20:24:33 +03:00

59 lines
1.7 KiB
TypeScript
Raw 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.
/**
* Mock-детали тенанта для AdminTenantDetailView. На API: GET /api/admin/tenants/{code}
* + GET /api/admin/tenants/{code}/balance-history + /users + /projects.
*
* Соответствует schema v8.7 §3 (tenants) + §4 (users) + §5 (projects) +
* §4.4 (balance_transactions) + §10.2 (activity_log).
*/
import type { AdminTenant } from './mockTenants';
export interface TenantUser {
id: number;
email: string;
fullName: string;
role: 'admin' | 'manager' | 'reader';
last_active_at: string;
is_active: boolean;
}
export interface TenantProject {
id: number;
name: string;
slug: string;
suppliers: number;
leadsToday: number;
desiredToday: number;
is_active: boolean;
}
export interface TenantBalanceTx {
id: string; // 'TX-2026-0509-00347'
type: 'topup' | 'lead_charge' | 'refund' | 'tariff_charge' | 'manual_adjustment';
amount: number; // signed (+ topup, charge)
description: string;
created_at: string; // ISO date
}
export interface TenantActivityEvent {
id: number;
event: string; // 'login_success' | 'deal.created' | 'webhook.received' | 'tariff.changed'
actor: string; // email or 'system'
summary: string;
created_at: string;
}
export interface AdminTenantDetail extends AdminTenant {
contact_email: string;
contact_phone: string;
legal_address: string;
created_at: string;
users: TenantUser[];
projects: TenantProject[];
balanceHistory: TenantBalanceTx[];
activity: TenantActivityEvent[];
leadsThisMonth: number;
leadsThisWeek: number;
avgLeadCost: number;
runwayDays: number; // balance / avgDailySpend
}