Skip to content

Commit

Permalink
Merge pull request alexrobaina#258 from alexrobaina/feat/add-inventar…
Browse files Browse the repository at this point in the history
…y-page

feature finished
  • Loading branch information
alexrobaina authored Jun 5, 2024
2 parents 9051c9c + 8c75a4e commit daebf27
Show file tree
Hide file tree
Showing 38 changed files with 1,424 additions and 197 deletions.
25 changes: 25 additions & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"community": "Community",
"welcome": "Welcome to Pet's Love!",
"type": "Type",
"selectType": "Select Type",
"welcomeDescription": "This information will be used to provide you with the best experience",
"inventory": "Inventory",
"placeholderDescription": "Add a description",
"username": "Username",
"usernamePlaceholder": "Add an username",
"selectTole": "Select your role",
"placeholderTitle": "Add a title",
"searchPets": "Search Pets",
"dashboard": "Dashboard",
"settings": "Settings",
Expand All @@ -13,6 +23,8 @@
"males": "Males",
"females": "Females",
"dog": "Dog",
"itemName": "Item name",
"itemDescription": "Item description",
"cat": "Cat",
"exotic": "Exotic",
"male": "Male",
Expand All @@ -24,6 +36,19 @@
"category": "Categoría",
"gender": "Gender",
"age": "Age",
"inventoryType": {
"MEDICINE": "Medicine",
"FOOD": "Food",
"TOYS": "Toys",
"ACCESSORIES": "Accessories",
"HEALTH_WELLNESS": "Health & Wellness",
"HOUSING": "Housing",
"LITTER_WASTE_MANAGEMENT": "Litter & Waste Management",
"APPAREL": "Apparel",
"FEEDING_SUPPLIES": "Feeding Supplies",
"TRAVEL_OUTDOOR": "Travel & Outdoor",
"TRAINING_BEHAVIOR": "Training & Behavior"
},
"size": "Size",
"status": "Status",
"pets": "Pets",
Expand Down
30 changes: 30 additions & 0 deletions public/locales/en/inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"inventoryName": "Product name",
"createInventory": "Create Product",
"inventory": "Inventory",
"quantity": "Quantity",
"addInventory": "Add Product",
"editInventory": "Edit Product",
"inventoryNotFound": "Product not found",
"listOfInventory": "List of Products",
"dontHaveInventory": "You don't have any products",
"itemQuantity": "Product Quantity",
"itemPrice": "Product Price",
"filterByName": "Filter by Product Name",
"filterByType": "Filter by Product Type",
"filterByQuantity": "Filter by Product Quantity",
"itemName": "Product Name",
"inventoryType": {
"MEDICINE": "Medicine",
"FOOD": "Food",
"TOYS": "Toys",
"ACCESSORIES": "Accessories",
"HEALTH_WELLNESS": "Health & Wellness",
"HOUSING": "Housing",
"LITTER_WASTE_MANAGEMENT": "Litter & Waste Management",
"APPAREL": "Apparel",
"FEEDING_SUPPLIES": "Feeding Supplies",
"TRAVEL_OUTDOOR": "Travel & Outdoor",
"TRAINING_BEHAVIOR": "Training & Behavior"
}
}
39 changes: 20 additions & 19 deletions public/locales/en/profilePet.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"QRCode": "QR Code",
"QRCodeDescription": "Scan the QR code to view the pet's profile",
"petGuardians": "Pet Guardians",
"shelterDescription": "Shelter of this pet Click to see more information about this shelter",
"adopterDescription": "Adopter of this pet Click to see more information about this adopter",
"veterinarianDescription": "Veterinarian of this pet Click to see more information about this veterinarian",
"medicalRecord": "Medical Record",
"addMedicalRecord": "Add Medical Record",
"vaccine": "Vaccine",
"diagnosis": "Diagnosis",
"treatment": "Treatment",
"clinicName": "Clinic Name",
"attachments": "Attachments",
"medications": "Medications",
"description": "Description",
"createdAt": "Created At",
"last": "Last"

}
"QRCode": "QR Code",
"QRCodeDescription": "Scan the QR code to view the pet's profile",
"petGuardians": "Pet Guardians",
"shelterDescription": "Shelter of this pet Click to see more information about this shelter",
"adopterDescription": "Adopter of this pet Click to see more information about this adopter",
"veterinarianDescription": "Veterinarian of this pet Click to see more information about this veterinarian",
"medicalRecord": "Medical Record",
"addMedicalRecord": "Add Medical Record",
"vaccine": "Vaccine",
"diagnosis": "Diagnosis",
"treatment": "Treatment",
"clinicName": "Clinic Name",
"attachments": "Attachments",
"medications": "Medications",
"createdAt": "Created At",
"diagnosisPlaceholder": "Enter diagnosis",
"treatmentPlaceholder": "Enter treatment",
"placeholderNotes": "Enter notes",
"last": "Last"
}
24 changes: 24 additions & 0 deletions public/locales/es/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"community": "Comunidad",
"welcome": "Bienvenido a Pet's Love",
"welcomeDescription": "Esta informacion es importante para que tengas una excelente experiencia de usuario",
"placeholderDescription": "Agrega una descripción",
"username": "Nombre de usuario",
"usernamePlaceholder": "Agrega tu nombre de usuario",
"type": "Tipo",
"selectType": "Selecciona un tipo",
"inventory": "Inventario",
"searchPets": "Buscar mascotas",
"birds": "Aves",
"dashboard": "Panel de control",
Expand All @@ -12,6 +20,19 @@
"exotics": "Exoticos",
"males": "Machos",
"females": "Hembras",
"inventoryType": {
"MEDICINE": "Medicina",
"FOOD": "Comida",
"TOYS": "Juguetes",
"ACCESSORIES": "Accesorios",
"HEALTH_WELLNESS": "Salud y Bienestar",
"HOUSING": "Vivienda",
"LITTER_WASTE_MANAGEMENT": "Arena y Gestión de Residuos",
"APPAREL": "Ropa",
"FEEDING_SUPPLIES": "Suministros de Alimentación",
"TRAVEL_OUTDOOR": "Viajes y Aire Libre",
"TRAINING_BEHAVIOR": "Entrenamiento y Comportamiento"
},
"dog": "Perro",
"cat": "Gato",
"exotic": "Exotico",
Expand Down Expand Up @@ -95,6 +116,9 @@
"myPets": "Mis mascotas",
"start": "Start",
"end": "End",
"placeholderTitle": "Agrega un título",
"itemName": "Nombre del item",
"itemDescription": "Descripción del item",
"selectTime": "Seleccionar hora",
"edit": "Editar",
"editAppointment": "Editar cita",
Expand Down
30 changes: 30 additions & 0 deletions public/locales/es/inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"inventoryName": "Nombre del Inventario",
"quantity": "Cantidad",
"price": "Precio",
"addInventory": "Agregar Producto",
"editInventory": "Editar Producto",
"itemName": "Nombre del Artículo",
"inventoryNotFound": "Producto No Encontrado",
"listOfInventory": "Lista de Artículos del Inventario",
"selectType": "Seleccionar Tipo",
"dontHaveInventory": "No tienes inventario",
"itemQuantity": "Cantidad de Artículos",
"filterByName": "Filtrar por Nombre",
"filterByType": "Filtrar por Tipo",
"filterByQuantity": "Filtrar por Cantidad",
"itemPrice": "Precio del Artículo",
"inventoryType": {
"MEDICINE": "Medicina",
"FOOD": "Comida",
"TOYS": "Juguetes",
"ACCESSORIES": "Accesorios",
"HEALTH_WELLNESS": "Salud y Bienestar",
"HOUSING": "Vivienda",
"LITTER_WASTE_MANAGEMENT": "Arena y Gestión de Residuos",
"APPAREL": "Ropa",
"FEEDING_SUPPLIES": "Suministros de Alimentación",
"TRAVEL_OUTDOOR": "Viajes y Aire Libre",
"TRAINING_BEHAVIOR": "Entrenamiento y Comportamiento"
}
}
38 changes: 20 additions & 18 deletions public/locales/es/profilePet.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"QRCode": "Código QR",
"QRCodeDescription": "Escanee el código QR con su dispositivo móvil para acceder a esta página",
"petGuardians": "Guardianes de mascotas",
"shelterDescription": "Regufio donde recide la mascota, Click para ir al refugio",
"adopterDescription": "Adoptante de la mascota, Click para su perfil",
"veterinarianDescription": "Veterinario de la mascota, Click para su perfil",
"medicalRecord": "Historial médico",
"addMedicalRecord": "Añadir historial médico",
"vaccine": "Vacuna",
"diagnosis": "Diagnóstico",
"treatment": "Tratamiento",
"clinicName": "Nombre de la clínica",
"attachments": "Adjuntos",
"medications": "Medicamentos",
"description": "Descripción",
"createdAt": "Creado el",
"last": "Last"
}
"QRCode": "Código QR",
"QRCodeDescription": "Escanee el código QR con su dispositivo móvil para acceder a esta página",
"petGuardians": "Guardianes de mascotas",
"shelterDescription": "Regufio donde recide la mascota, Click para ir al refugio",
"adopterDescription": "Adoptante de la mascota, Click para su perfil",
"veterinarianDescription": "Veterinario de la mascota, Click para su perfil",
"medicalRecord": "Historial médico",
"addMedicalRecord": "Añadir historial médico",
"vaccine": "Vacuna",
"diagnosis": "Diagnóstico",
"treatment": "Tratamiento",
"clinicName": "Nombre de la clínica",
"attachments": "Adjuntos",
"medications": "Medicamentos",
"createdAt": "Creado el",
"treatmentPlaceholder": "Escriba el tratamiento",
"diagnosisPlaceholder": "Escriba el diagnóstico",
"placeholderNotes": "Escriba las notas",
"last": "Last"
}
24 changes: 24 additions & 0 deletions public/locales/fr/common.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
{
"community": "Communauté",
"searchPets": "Rechercher des animaux",
"welcome": "Bienvenue chez Pet's Love !",
"welcomeDescription": "Ces informations seront utilisées pour vous offrir la meilleure expérience",
"placeholderDescription": "Dites-nous en plus sur vous",
"username": "nom d'utilisateur",
"usernamePlaceholder": "Ajouter un nom d'utilisateur",
"birds": "Oiseaux",
"dashboard": "Tableau de bord",
"settings": "Paramètres",
"inventory": "Inventaire",
"type": "Type",
"selectType": "Sélectionner Type",
"itemDescription": "Description de l'élément",
"logout": "déconnexion",
"resetFilters": "Effacer les filtres",
"searchByName": "Recherche par nom",
"placeholderTitle": "Ajouter un titre",
"itemName": "Nom de l'élément",
"dogs": "Chiens",
"cats": "Chats",
"inventoryType": {
"MEDICINE": "Médicament",
"FOOD": "Nourriture",
"TOYS": "Jouets",
"ACCESSORIES": "Accessoires",
"HEALTH_WELLNESS": "Santé et Bien-être",
"HOUSING": "Hébergement",
"LITTER_WASTE_MANAGEMENT": "Litière et Gestion des Déchets",
"APPAREL": "Vêtements",
"FEEDING_SUPPLIES": "Alimentation et Fournitures",
"TRAVEL_OUTDOOR": "Voyage et Plein Air",
"TRAINING_BEHAVIOR": "Formation et Comportement"
},
"exotics": "Exotiques",
"males": "Mâles",
"females": "Femelles",
Expand Down
30 changes: 30 additions & 0 deletions public/locales/fr/inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"inventoryName": "Nom de l'Inventaire",
"quantity": "Quantité",
"price": "Prix",
"description": "Description",
"addInventory": "Ajouter Inventaire",
"editInventory": "Modifier Inventaire",
"inventoryNotFound": "Inventaire Non Trouvé",
"listOfInventory": "Liste des Articles de l'Inventaire",
"dontHaveInventory": "Vous n'avez pas d'Inventaire",
"itemQuantity": "Quantité de l'Article",
"itemName": "Nom de l'Article",
"filterByName": "Filtrer par Nom",
"filterByType": "Filtrer par Type",
"filterByQuantity": "Filtrer par Quantité",
"itemPrice": "Prix de l'Article",
"inventoryType": {
"MEDICINE": "Médicament",
"FOOD": "Nourriture",
"TOYS": "Jouets",
"ACCESSORIES": "Accessoires",
"HEALTH_WELLNESS": "Santé et Bien-être",
"HOUSING": "Hébergement",
"LITTER_WASTE_MANAGEMENT": "Litière et Gestion des Déchets",
"APPAREL": "Vêtements",
"FEEDING_SUPPLIES": "Alimentation et Fournitures",
"TRAVEL_OUTDOOR": "Voyage et Plein Air",
"TRAINING_BEHAVIOR": "Formation et Comportement"
}
}
38 changes: 20 additions & 18 deletions public/locales/fr/profilePet.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"QRCode": "Code QR",
"QRCodeDescription": "Scannez le code QR pour voir le profil de l'animal",
"petGuardians": "Gardiens de l'animal",
"shelterDescription": "Refuge de cet animal Cliquez pour voir plus d'informations sur ce refuge",
"adopterDescription": "Adoptant de cet animal Cliquez pour voir plus d'informations sur cet adoptant",
"veterinarianDescription": "Vétérinaire de cet animal Cliquez pour voir plus d'informations sur ce vétérinaire",
"medicalRecord": "Dossier médical",
"addMedicalRecord": "Ajouter un dossier médical",
"vaccine": "Vaccin",
"diagnosis": "Diagnostic",
"treatment": "Traitement",
"clinicName": "Nom de la clinique",
"attachments": "Pièces jointes",
"medications": "Médicaments",
"description": "Description",
"createdAt": "Créé le",
"last": "Dernier"
}
"QRCode": "Code QR",
"QRCodeDescription": "Scannez le code QR pour voir le profil de l'animal",
"petGuardians": "Gardiens de l'animal",
"shelterDescription": "Refuge de cet animal Cliquez pour voir plus d'informations sur ce refuge",
"adopterDescription": "Adoptant de cet animal Cliquez pour voir plus d'informations sur cet adoptant",
"veterinarianDescription": "Vétérinaire de cet animal Cliquez pour voir plus d'informations sur ce vétérinaire",
"medicalRecord": "Dossier médical",
"addMedicalRecord": "Ajouter un dossier médical",
"vaccine": "Vaccin",
"diagnosis": "Diagnostic",
"treatment": "Traitement",
"clinicName": "Nom de la clinique",
"treatmentPlaceholder": "Entrez le traitement",
"attachments": "Pièces jointes",
"medications": "Médicaments",
"diagnosisPlaceholder": "Entrez le diagnostic",
"createdAt": "Créé le",
"placeholderNotes": "Entrez des notes",
"last": "Dernier"
}
7 changes: 6 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import { ToastContainer } from 'react-toastify'
import Navigation from './components/Navigation'
import { UserRoleSelectorModal } from './components/UserRoleSelectorModal'
import { AdoptionPetPage } from './pages/AdoptionPetPage'
import { AppointmentsPage } from './pages/AppointmentsPage'
import { CommunityPage } from './pages/CommunityPage'
import { ComponentsUiPage } from './pages/ComponentsUiPage'
import { DashboardPage } from './pages/DashboardPage'
import { InventoryPage } from './pages/InventoryPage'
import { ProfilePetPage } from './pages/ProfilePetPage'
import { SettingsPage } from './pages/SettingsPage'
import { UserProfilePage } from './pages/UserProfilePage'
import { AppointmentsPage } from './pages/AppointmentsPage'
import { AppContext, AppContextProps } from './services/AppContext'

import './api/axiosInstance'
Expand Down Expand Up @@ -58,6 +59,10 @@ const router = createBrowserRouter([
path: '/appointments',
element: <AppointmentsPage />,
},
{
path: '/inventory',
element: <InventoryPage />,
},
{
path: '/',
element: <DashboardPage />,
Expand Down
13 changes: 11 additions & 2 deletions src/api/appointments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ import axios from 'axios'

const API_URL = '/api/v1/appointments'

export const createAppointment = async (data: unknown) => {
export const createAppointment = async (data: any) => {
try {
const response = await axios.post(API_URL, data)
let formattedData = {}
Object.entries(data).map(([key, value]) => {
if (value === '' || value === null) return null
formattedData = {
...formattedData,
[key]: value,
}
})

const response = await axios.post(API_URL, formattedData)
return response.data
} catch (error) {
return error
Expand Down
Loading

0 comments on commit daebf27

Please sign in to comment.