Add new frontend - fix 21

This commit is contained in:
Urtzi Alfaro
2025-07-23 15:09:33 +02:00
parent f8aefa9abe
commit 96b728441a
3 changed files with 43 additions and 42 deletions

View File

@@ -82,7 +82,7 @@ export class DataService {
*/
async validateSalesData(file: File): Promise<DataValidation> {
const response = await apiClient.upload<ApiResponse<DataValidation>>(
'/api/v1/data/validate-sales',
'/api/v1/sales/import/validate-sales',
file
);
return response.data!;

View File

@@ -6,14 +6,11 @@ import {
export interface TenantCreate {
name: string;
email: string;
phone: string;
address: string;
latitude?: number;
longitude?: number;
business_type: 'individual_bakery' | 'central_workshop';
subscription_plan?: string;
settings?: Record<string, any>;
city?: string; // Optional with default "Madrid"
postal_code: string; // Required, must match pattern ^\d{5}$
phone: string; // Required, validated for Spanish format
business_type?: string; // Optional with default "bakery", must be one of: ['bakery', 'coffee_shop', 'pastry_shop', 'restaurant']
}
export interface TenantUpdate extends Partial<TenantCreate> {
@@ -66,13 +63,20 @@ export interface TenantStats {
subscription_expires: string;
}
export interface TenantUser {
export interface TenantInfo {
id: string;
email: string;
full_name: string;
role: string;
name: string;
subdomain?: string;
business_type: string;
address: string;
city: string;
postal_code: string;
phone?: string;
is_active: boolean;
last_login: string | null;
subscription_tier: string;
model_trained: boolean;
last_training_date?: string;
owner_id: string;
created_at: string;
}