From 259bdb1479a82a1c96ea85e6a067ba4ddf0faa62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoni=20Nu=C3=B1ez=20Romeu?= Date: Mon, 6 Jul 2026 10:58:00 +0200 Subject: [PATCH] feat: add TypeScript types for mobile app --- frontend-mobile/types/index.ts | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 frontend-mobile/types/index.ts diff --git a/frontend-mobile/types/index.ts b/frontend-mobile/types/index.ts new file mode 100644 index 0000000..9a119e7 --- /dev/null +++ b/frontend-mobile/types/index.ts @@ -0,0 +1,51 @@ +export interface Medicine { + nregistro: string; + nombre: string; + principioActivo: string; + laboratorio: string; + formaFarmaceutica: string; + precio: number | null; + stock: number; + disponibilidad: 'disponible' | 'sin_stock' | 'bajo_stock'; +} + +export interface Pharmacy { + id: number; + name: string; + address: string; + phone: string; + latitude: number; + longitude: number; +} + +export interface PharmacyMedicine { + id: number; + pharmacy_id: number; + medicine_nregistro: string; + medicine_name: string; + price: number; + stock: number; + pharmacy?: Pharmacy; +} + +export interface User { + id: number; + username: string; + is_admin: boolean; +} + +export interface AuthResponse { + user: User; + token: string; +} + +export interface SearchResponse { + medicines: Medicine[]; + total: number; +} + +export interface ApiResponse { + data: T; + success: boolean; + error?: string; +} \ No newline at end of file