Add new frontend - fix 18

This commit is contained in:
Urtzi Alfaro
2025-07-23 08:38:57 +02:00
parent 05850e9ccf
commit 97e52dcfe5
4 changed files with 928 additions and 636 deletions

View File

@@ -107,7 +107,7 @@ export class NotificationService {
*/ */
async sendNotification(notification: NotificationCreate): Promise<NotificationResponse> { async sendNotification(notification: NotificationCreate): Promise<NotificationResponse> {
const response = await apiClient.post<ApiResponse<NotificationResponse>>( const response = await apiClient.post<ApiResponse<NotificationResponse>>(
'/notifications/send', '/api/v1/notifications/send',
notification notification
); );
return response.data!; return response.data!;
@@ -118,7 +118,7 @@ export class NotificationService {
*/ */
async sendBulkNotifications(request: BulkNotificationRequest): Promise<BulkNotificationStatus> { async sendBulkNotifications(request: BulkNotificationRequest): Promise<BulkNotificationStatus> {
const response = await apiClient.post<ApiResponse<BulkNotificationStatus>>( const response = await apiClient.post<ApiResponse<BulkNotificationStatus>>(
'/notifications/bulk', '/api/v1/notifications/bulk',
request request
); );
return response.data!; return response.data!;
@@ -140,7 +140,7 @@ export class NotificationService {
page: number; page: number;
pages: number; pages: number;
}> { }> {
const response = await apiClient.get<ApiResponse<any>>('/notifications/history', { params }); const response = await apiClient.get<ApiResponse<any>>('/api/v1/notifications/history', { params });
return response.data!; return response.data!;
} }
@@ -149,7 +149,7 @@ export class NotificationService {
*/ */
async getNotification(notificationId: string): Promise<NotificationResponse> { async getNotification(notificationId: string): Promise<NotificationResponse> {
const response = await apiClient.get<ApiResponse<NotificationResponse>>( const response = await apiClient.get<ApiResponse<NotificationResponse>>(
`/notifications/${notificationId}` `/api/v1/notifications/${notificationId}`
); );
return response.data!; return response.data!;
} }
@@ -159,7 +159,7 @@ export class NotificationService {
*/ */
async retryNotification(notificationId: string): Promise<NotificationResponse> { async retryNotification(notificationId: string): Promise<NotificationResponse> {
const response = await apiClient.post<ApiResponse<NotificationResponse>>( const response = await apiClient.post<ApiResponse<NotificationResponse>>(
`/notifications/${notificationId}/retry` `/api/v1/notifications/${notificationId}/retry`
); );
return response.data!; return response.data!;
} }
@@ -168,7 +168,7 @@ export class NotificationService {
* Cancel scheduled notification * Cancel scheduled notification
*/ */
async cancelNotification(notificationId: string): Promise<void> { async cancelNotification(notificationId: string): Promise<void> {
await apiClient.post(`/notifications/${notificationId}/cancel`); await apiClient.post(`/api/v1/notifications/${notificationId}/cancel`);
} }
/** /**
@@ -180,7 +180,7 @@ export class NotificationService {
type?: string; type?: string;
}): Promise<NotificationStats> { }): Promise<NotificationStats> {
const response = await apiClient.get<ApiResponse<NotificationStats>>( const response = await apiClient.get<ApiResponse<NotificationStats>>(
'/notifications/stats', '/api/v1/notifications/stats',
{ params } { params }
); );
return response.data!; return response.data!;
@@ -191,7 +191,7 @@ export class NotificationService {
*/ */
async getBulkStatus(batchId: string): Promise<BulkNotificationStatus> { async getBulkStatus(batchId: string): Promise<BulkNotificationStatus> {
const response = await apiClient.get<ApiResponse<BulkNotificationStatus>>( const response = await apiClient.get<ApiResponse<BulkNotificationStatus>>(
`/notifications/bulk/${batchId}/status` `/api/v1/notifications/bulk/${batchId}/status`
); );
return response.data!; return response.data!;
} }
@@ -210,7 +210,7 @@ export class NotificationService {
page: number; page: number;
pages: number; pages: number;
}> { }> {
const response = await apiClient.get<ApiResponse<any>>('/notifications/templates', { params }); const response = await apiClient.get<ApiResponse<any>>('/api/v1/notifications/templates', { params });
return response.data!; return response.data!;
} }
@@ -219,7 +219,7 @@ export class NotificationService {
*/ */
async getTemplate(templateId: string): Promise<NotificationTemplate> { async getTemplate(templateId: string): Promise<NotificationTemplate> {
const response = await apiClient.get<ApiResponse<NotificationTemplate>>( const response = await apiClient.get<ApiResponse<NotificationTemplate>>(
`/notifications/templates/${templateId}` `/api/v1/notifications/templates/${templateId}`
); );
return response.data!; return response.data!;
} }
@@ -236,7 +236,7 @@ export class NotificationService {
variables?: string[]; variables?: string[];
}): Promise<NotificationTemplate> { }): Promise<NotificationTemplate> {
const response = await apiClient.post<ApiResponse<NotificationTemplate>>( const response = await apiClient.post<ApiResponse<NotificationTemplate>>(
'/notifications/templates', '/api/v1/notifications/templates',
template template
); );
return response.data!; return response.data!;
@@ -250,7 +250,7 @@ export class NotificationService {
updates: Partial<NotificationTemplate> updates: Partial<NotificationTemplate>
): Promise<NotificationTemplate> { ): Promise<NotificationTemplate> {
const response = await apiClient.put<ApiResponse<NotificationTemplate>>( const response = await apiClient.put<ApiResponse<NotificationTemplate>>(
`/notifications/templates/${templateId}`, `/api/v1/notifications/templates/${templateId}`,
updates updates
); );
return response.data!; return response.data!;
@@ -260,7 +260,7 @@ export class NotificationService {
* Delete notification template * Delete notification template
*/ */
async deleteTemplate(templateId: string): Promise<void> { async deleteTemplate(templateId: string): Promise<void> {
await apiClient.delete(`/notifications/templates/${templateId}`); await apiClient.delete(`/api/v1/notifications/templates/${templateId}`);
} }
/** /**
@@ -268,7 +268,7 @@ export class NotificationService {
*/ */
async getPreferences(): Promise<NotificationSettings> { async getPreferences(): Promise<NotificationSettings> {
const response = await apiClient.get<ApiResponse<NotificationSettings>>( const response = await apiClient.get<ApiResponse<NotificationSettings>>(
'/notifications/preferences' '/api/v1/notifications/preferences'
); );
return response.data!; return response.data!;
} }
@@ -278,7 +278,7 @@ export class NotificationService {
*/ */
async updatePreferences(preferences: Partial<NotificationSettings>): Promise<NotificationSettings> { async updatePreferences(preferences: Partial<NotificationSettings>): Promise<NotificationSettings> {
const response = await apiClient.put<ApiResponse<NotificationSettings>>( const response = await apiClient.put<ApiResponse<NotificationSettings>>(
'/notifications/preferences', '/api/v1/notifications/preferences',
preferences preferences
); );
return response.data!; return response.data!;
@@ -293,7 +293,7 @@ export class NotificationService {
delivery_time_ms?: number; delivery_time_ms?: number;
}> { }> {
const response = await apiClient.post<ApiResponse<any>>( const response = await apiClient.post<ApiResponse<any>>(
'/notifications/test', '/api/v1/notifications/test',
{ type, recipient } { type, recipient }
); );
return response.data!; return response.data!;
@@ -320,7 +320,7 @@ export class NotificationService {
page: number; page: number;
pages: number; pages: number;
}> { }> {
const response = await apiClient.get<ApiResponse<any>>('/notifications/webhooks', { params }); const response = await apiClient.get<ApiResponse<any>>('/api/v1/notifications/webhooks', { params });
return response.data!; return response.data!;
} }
@@ -333,7 +333,7 @@ export class NotificationService {
webhook_url: string; webhook_url: string;
created_at: string; created_at: string;
}> { }> {
const response = await apiClient.post<ApiResponse<any>>('/notifications/subscribe', { const response = await apiClient.post<ApiResponse<any>>('/api/v1/notifications/subscribe', {
events, events,
webhook_url: webhookUrl, webhook_url: webhookUrl,
}); });
@@ -344,7 +344,7 @@ export class NotificationService {
* Unsubscribe from notification events * Unsubscribe from notification events
*/ */
async unsubscribeFromEvents(subscriptionId: string): Promise<void> { async unsubscribeFromEvents(subscriptionId: string): Promise<void> {
await apiClient.delete(`/notifications/subscribe/${subscriptionId}`); await apiClient.delete(`/api/v1/notifications/subscribe/${subscriptionId}`);
} }
} }

View File

@@ -98,7 +98,7 @@ export class TenantService {
* Corresponds to POST /tenants/register * Corresponds to POST /tenants/register
*/ */
async registerBakery(bakeryData: TenantCreate): Promise<TenantInfo> { async registerBakery(bakeryData: TenantCreate): Promise<TenantInfo> {
const response = await apiClient.post<ApiResponse<TenantInfo>>('/api/v1/tenants/register', bakeryData); const response = await apiClient.post<TenantInfo>('/api/v1/tenants/register', bakeryData);
return response.data!; return response.data!;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -32,6 +32,7 @@ PUBLIC_ROUTES = [
"/api/v1/auth/register", "/api/v1/auth/register",
"/api/v1/auth/refresh", "/api/v1/auth/refresh",
"/api/v1/auth/verify", "/api/v1/auth/verify",
"/api/v1/tenant/register",
"/api/v1/nominatim/search" "/api/v1/nominatim/search"
] ]