feature: dashboard settings and invite activation flow consistency fixed. frontend warnings fixed
This commit is contained in:
5
frontend/src/types/api.ts
Normal file
5
frontend/src/types/api.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface ApiError {
|
||||
statusCode: number;
|
||||
message: string | string[];
|
||||
error?: string;
|
||||
}
|
||||
25
frontend/src/types/auth.ts
Normal file
25
frontend/src/types/auth.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { Organization, User } from './organization';
|
||||
|
||||
export interface AuthResponse {
|
||||
success: boolean;
|
||||
data: {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
user: User;
|
||||
organizations: Organization[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface TrialRegistrationData {
|
||||
email: string;
|
||||
password: string;
|
||||
name: string;
|
||||
organizationName: string;
|
||||
organizationEmail: string;
|
||||
organizationType: 'CLINIC' | 'LAB';
|
||||
}
|
||||
|
||||
export interface LoginData {
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
@@ -1,60 +1,5 @@
|
||||
// src/types/index.ts
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Organization {
|
||||
id: string;
|
||||
name: string;
|
||||
type: 'CLINIC' | 'LAB';
|
||||
isOwner: boolean;
|
||||
permissions?: string[];
|
||||
plan?: {
|
||||
name: string;
|
||||
maxUsers: number;
|
||||
};
|
||||
}
|
||||
|
||||
/** GET /auth/subscription-alert — owners only get meaningful flags */
|
||||
export interface SubscriptionAlertData {
|
||||
showWarning: boolean;
|
||||
seatsLow: boolean;
|
||||
trialEndingSoon: boolean;
|
||||
trialExpired: boolean;
|
||||
seatsUsed?: number;
|
||||
seatsLimit?: number;
|
||||
daysUntilTrialEnd?: number | null;
|
||||
trialEndsAt?: string | null;
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
success: boolean;
|
||||
data: {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
user: User;
|
||||
organizations: Organization[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface TrialRegistrationData {
|
||||
email: string;
|
||||
password: string;
|
||||
name: string;
|
||||
organizationName: string;
|
||||
organizationEmail: string;
|
||||
organizationType: 'CLINIC' | 'LAB';
|
||||
}
|
||||
|
||||
export interface LoginData {
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface ApiError {
|
||||
statusCode: number;
|
||||
message: string | string[];
|
||||
error?: string;
|
||||
}
|
||||
export * from './organization';
|
||||
export * from './subscription';
|
||||
export * from './auth';
|
||||
export * from './api';
|
||||
export * from './patient';
|
||||
20
frontend/src/types/organization.ts
Normal file
20
frontend/src/types/organization.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface OrganizationPlan {
|
||||
name: string;
|
||||
maxUsers: number;
|
||||
price?: number;
|
||||
}
|
||||
|
||||
export interface Organization {
|
||||
id: string;
|
||||
name: string;
|
||||
type: 'CLINIC' | 'LAB';
|
||||
isOwner: boolean;
|
||||
permissions?: string[];
|
||||
plan?: OrganizationPlan;
|
||||
}
|
||||
13
frontend/src/types/subscription.ts
Normal file
13
frontend/src/types/subscription.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/** GET /auth/subscription-alert — owners only get meaningful flags */
|
||||
export interface SubscriptionAlertData {
|
||||
showWarning: boolean;
|
||||
seatsLow: boolean;
|
||||
trialEndingSoon: boolean;
|
||||
trialExpired: boolean;
|
||||
seatsUsed?: number;
|
||||
seatsLimit?: number;
|
||||
daysUntilTrialEnd?: number | null;
|
||||
trialEndsAt?: string | null;
|
||||
daysUntilPlanEnd?: number | null;
|
||||
planEndsAt?: string | null;
|
||||
}
|
||||
Reference in New Issue
Block a user