Index: src/api/customer.ts
===================================================================
--- src/api/customer.ts	(revision 658eaeeabe6b68a424a62ffd695452a6f1abb579)
+++ src/api/customer.ts	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
@@ -1,5 +1,5 @@
 import { useMemo } from 'react';
 // types
-import { Customer } from 'src/schemas';
+import { Customer } from 'mvpmasters-shared';
 // db
 import { endpoints, fetcher } from 'src/utils/axios';
@@ -44,22 +44,2 @@
   }
 }
-
-export async function updateCustomer(
-  id: string,
-  customerData: Partial<Customer>
-): Promise<Customer> {
-  try {
-    const response = await axios.patch<Customer>(`${endpoints.customer}/${id}`, customerData);
-
-    // Mutate the SWR cache to update the customer
-    await mutate<Customer[]>(endpoints.customer, (currentData = []) =>
-      currentData.map((customer) =>
-        customer.id === id ? { ...customer, ...response.data } : customer
-      )
-    );
-
-    return response.data;
-  } catch (error) {
-    throw error;
-  }
-}
Index: src/api/employee.ts
===================================================================
--- src/api/employee.ts	(revision 658eaeeabe6b68a424a62ffd695452a6f1abb579)
+++ 	(revision )
@@ -1,45 +1,0 @@
-import { useMemo } from 'react';
-// types
-import { Employee } from 'src/schemas';
-// db
-import { endpoints, fetcher } from 'src/utils/axios';
-import axios from 'src/utils/axios';
-// swr
-import useSWR, { mutate } from 'swr';
-
-export function useGetEmployees() {
-  const collectionName = endpoints.employee;
-
-  const { data, isLoading, error, isValidating } = useSWR(collectionName, fetcher<Employee[]>, {
-    revalidateOnFocus: false,
-  });
-
-  const memoizedValue = useMemo(
-    () => ({
-      employees: data || [],
-      employeesLoading: isLoading,
-      employeesError: error,
-      employeesValidating: isValidating,
-      employeesEmpty: !isLoading && !data?.length,
-    }),
-    [data, error, isLoading, isValidating]
-  );
-
-  return memoizedValue;
-}
-
-export async function createEmployee(employeeData: Partial<Employee>): Promise<Employee> {
-  try {
-    const response = await axios.post<Employee>(endpoints.employee, employeeData);
-
-    // Mutate the SWR cache to include the new employee
-    await mutate<Employee[]>(endpoints.employee, (currentData = []) => [
-      ...currentData,
-      response.data,
-    ]);
-
-    return response.data;
-  } catch (error) {
-    throw error;
-  }
-}
Index: src/api/invoice.ts
===================================================================
--- src/api/invoice.ts	(revision 658eaeeabe6b68a424a62ffd695452a6f1abb579)
+++ src/api/invoice.ts	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
@@ -1,11 +1,8 @@
 import { useMemo } from 'react';
 // types
-import { Invoice, UpdateInvoice } from 'src/schemas';
+import { Invoice } from 'mvpmasters-shared';
 // db
 import useSWR from 'swr';
 import { endpoints, fetcher } from 'src/utils/axios';
-import axios from 'src/utils/axios';
-import { mutate } from 'swr';
-import { useSWRConfig } from 'swr';
 
 interface InvoiceFilters {
@@ -54,102 +51,26 @@
 }
 
-export function useGetInvoice({ id }: { id: string }) {
-  const path = endpoints.invoice;
+// export function useGetInvoice({ id }: { id: string }) {
+//   const collectionName = collections.invoice;
 
-  const { data, isLoading, error, isValidating } = useSWR(
-    `${path}/${id}`,
-    () => fetcher<Invoice>(`${path}/${id}`),
-    {
-      revalidateOnFocus: false,
-    }
-  );
+//   const { data, isLoading, error, isValidating } = useSWR(
+//     [collectionName, id],
+//     () => documentFetcher<Invoice>(collectionName, id),
+//     {
+//       revalidateOnFocus: false,
+//     }
+//   );
 
-  const memoizedValue = useMemo(
-    () => ({
-      currentInvoice: data || null,
-      currentInvoiceLoading: isLoading,
-      currentInvoiceError: error,
-      currentInvoiceValidating: isValidating,
-      currentInvoiceEmpty: !isLoading && !data,
-    }),
-    [data, error, isLoading, isValidating]
-  );
+//   const memoizedValue = useMemo(
+//     () => ({
+//       currentInvoice: data || null,
+//       currentInvoiceLoading: isLoading,
+//       currentInvoiceError: error,
+//       currentInvoiceValidating: isValidating,
+//       currentInvoiceEmpty: !isLoading && !data,
+//     }),
+//     [data, error, isLoading, isValidating]
+//   );
 
-  return memoizedValue;
-}
-
-// Add this interface for the create invoice payload
-interface CreateInvoicePayload {
-  issueDate: Date;
-  dueDate: Date;
-  items: any[];
-  invoiceNumber: string;
-  invoiceFrom: any;
-  invoiceTo: any;
-  currency: string;
-  quantityType: string;
-  month: string;
-  status?: string;
-  taxes?: number;
-  discount?: number;
-  totalAmount: number;
-  pdfRef?: string;
-}
-
-export async function createInvoice(data: CreateInvoicePayload): Promise<Invoice> {
-  const response = await axios.post<Invoice>(endpoints.invoice, data);
-
-  // Mutate the SWR cache to include the new invoice
-  await mutate(
-    endpoints.invoice,
-    (existingInvoices: Invoice[] = []) => [response.data, ...existingInvoices],
-    false // Set to false to avoid revalidation since we already have the new data
-  );
-
-  return response.data;
-}
-
-export async function updateInvoice(id: string, data: Partial<UpdateInvoice>) {
-  const response = await axios.patch<Invoice>(`${endpoints.invoice}/${id}`, data);
-
-  // Mutate the individual invoice cache
-  await mutate(`${endpoints.invoice}/${id}`, response.data, false);
-
-  // Mutate the invoice list cache
-  await mutate(
-    endpoints.invoice,
-    (existingInvoices: Invoice[] = []) =>
-      existingInvoices.map((invoice) => (invoice.id === id ? response.data : invoice)),
-    false
-  );
-
-  return response.data;
-}
-
-export async function deleteInvoice(id: string) {
-  const response = await axios.delete<Invoice>(`${endpoints.invoice}/${id}`);
-
-  // Mutate the invoice list cache to remove the deleted invoice
-  await mutate(
-    endpoints.invoice,
-    (existingInvoices: Invoice[] = []) => existingInvoices.filter((invoice) => invoice.id !== id),
-    false
-  );
-
-  return response.data;
-}
-
-// Update the useDeleteInvoice hook to use the new implementation
-export function useDeleteInvoice() {
-  const deleteInvoiceMutation = async (id: string) => {
-    try {
-      await deleteInvoice(id);
-      return true;
-    } catch (error) {
-      console.error('Error deleting invoice:', error);
-      throw error;
-    }
-  };
-
-  return { deleteInvoiceMutation };
-}
+//   return memoizedValue;
+// }
Index: src/api/invoice/index.ts
===================================================================
--- src/api/invoice/index.ts	(revision 658eaeeabe6b68a424a62ffd695452a6f1abb579)
+++ 	(revision )
@@ -1,1 +1,0 @@
-export * from './use-fetch-analytics';
Index: src/api/invoice/use-fetch-analytics.ts
===================================================================
--- src/api/invoice/use-fetch-analytics.ts	(revision 658eaeeabe6b68a424a62ffd695452a6f1abb579)
+++ 	(revision )
@@ -1,45 +1,0 @@
-import useSWR from 'swr';
-import axios from 'src/utils/axios';
-import { InvoiceStatus } from 'src/schemas';
-
-interface StatusTotals {
-  EUR: number;
-  USD: number;
-}
-
-export interface AnalyticsResults {
-  total: StatusTotals;
-  processing: StatusTotals;
-  paid: StatusTotals;
-  pending: StatusTotals;
-  overdue: StatusTotals;
-  draft: StatusTotals;
-}
-
-async function fetchAnalytics(startDate: Date) {
-  const { data } = await axios.get<AnalyticsResults>('/api/invoices/totals', {
-    params: { startDate: startDate.toISOString() },
-    withCredentials: true,
-    headers: {
-      'Content-Type': 'application/json',
-    },
-  });
-  return data;
-}
-
-export function useFetchAnalytics(startDate: Date | null) {
-  const { data, error, isLoading } = useSWR(
-    startDate ? ['invoiceTotals', startDate] : null,
-    () => startDate && fetchAnalytics(startDate),
-    {
-      revalidateOnFocus: false,
-      shouldRetryOnError: false,
-    }
-  );
-
-  return {
-    analytics: data,
-    analyticsError: error,
-    isAnalyticsLoading: isLoading,
-  };
-}
Index: src/api/service.ts
===================================================================
--- src/api/service.ts	(revision 658eaeeabe6b68a424a62ffd695452a6f1abb579)
+++ src/api/service.ts	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
@@ -1,17 +1,16 @@
 import { useMemo } from 'react';
 // types
-import { Service } from 'src/schemas';
+import { Service } from 'mvpmasters-shared';
+// db
+import { collections, collectionFetcher as fetcher } from 'src/lib/firestore';
 // swr
 import useSWR from 'swr';
-import { endpoints, fetcher } from 'src/utils/axios';
 
 export function useGetServices() {
-  const { data, isLoading, error, isValidating } = useSWR<Service[]>(
-    endpoints.service,
-    () => fetcher<Service[]>(endpoints.service),
-    {
-      revalidateOnFocus: false,
-    }
-  );
+  const collectionName = collections.service;
+
+  const { data, isLoading, error, isValidating } = useSWR(collectionName, fetcher<Service>, {
+    revalidateOnFocus: false,
+  });
 
   const memoizedValue = useMemo(
Index: src/api/settings.ts
===================================================================
--- src/api/settings.ts	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/api/settings.ts	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
@@ -0,0 +1,40 @@
+import { useMemo } from 'react';
+// types
+import { Settings } from 'src/types/settings';
+// db
+import { collections, collectionFetcher as fetcher } from 'src/lib/firestore';
+// swr
+import useSWR from 'swr';
+
+export function useGetSettings() {
+  const collectionName = collections.settings;
+
+  const { data, isLoading, error, isValidating } = useSWR(collectionName, fetcher<Settings>, {
+    revalidateOnFocus: false,
+  });
+
+  const dataObject = transformArrayToObject(data);
+
+  const memoizedValue = useMemo(
+    () => ({
+      settings: dataObject || null,
+      settingsLoading: isLoading,
+      settingsError: error,
+      settingsValidating: isValidating,
+      settingsEmpty: !isLoading && !dataObject,
+    }),
+    [dataObject, error, isLoading, isValidating]
+  );
+
+  return memoizedValue;
+}
+
+const transformArrayToObject = (data?: Settings[]): Settings | undefined => {
+  if (!data) return undefined;
+
+  return data.reduce((accumulator: Settings, doc) => {
+    const { id, ...fields } = doc;
+    accumulator[id as keyof Settings] = fields;
+    return accumulator;
+  }, {} as Settings);
+};
Index: src/api/tenant.ts
===================================================================
--- src/api/tenant.ts	(revision 658eaeeabe6b68a424a62ffd695452a6f1abb579)
+++ 	(revision )
@@ -1,23 +1,0 @@
-import { useMemo } from 'react';
-import { Tenant } from 'src/schemas';
-import { endpoints, fetcher } from 'src/utils/axios';
-import useSWR from 'swr';
-
-export function useGetTenant() {
-  const { data, isLoading, error, isValidating } = useSWR(endpoints.tenant, fetcher<Tenant>, {
-    revalidateOnFocus: false,
-  });
-
-  const memoizedValue = useMemo(
-    () => ({
-      settings: data || null,
-      settingsLoading: isLoading,
-      settingsError: error,
-      settingsValidating: isValidating,
-      settingsEmpty: !isLoading && !data,
-    }),
-    [data, error, isLoading, isValidating]
-  );
-
-  return memoizedValue;
-}
Index: src/api/user.ts
===================================================================
--- src/api/user.ts	(revision 658eaeeabe6b68a424a62ffd695452a6f1abb579)
+++ 	(revision )
@@ -1,7 +1,0 @@
-import { AuthUserType } from 'src/auth/types';
-import axiosInstance from 'src/utils/axios';
-
-export async function getUser(): Promise<AuthUserType> {
-  const response = await axiosInstance.get('/api/user');
-  return response.data;
-}
