Index: src/api/customer.ts
===================================================================
--- src/api/customer.ts	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/api/customer.ts	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -1,5 +1,5 @@
 import { useMemo } from 'react';
 // types
-import { Customer } from 'mvpmasters-shared';
+import { Customer } from 'src/schemas';
 // db
 import { endpoints, fetcher } from 'src/utils/axios';
Index: src/api/employee.ts
===================================================================
--- src/api/employee.ts	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/api/employee.ts	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,45 @@
+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 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/api/invoice.ts	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -1,8 +1,11 @@
 import { useMemo } from 'react';
 // types
-import { Invoice } from 'mvpmasters-shared';
+import { Invoice, UpdateInvoice } from 'src/schemas';
 // 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 {
@@ -51,26 +54,102 @@
 }
 
-// export function useGetInvoice({ id }: { id: string }) {
-//   const collectionName = collections.invoice;
+export function useGetInvoice({ id }: { id: string }) {
+  const path = endpoints.invoice;
 
-//   const { data, isLoading, error, isValidating } = useSWR(
-//     [collectionName, id],
-//     () => documentFetcher<Invoice>(collectionName, id),
-//     {
-//       revalidateOnFocus: false,
-//     }
-//   );
+  const { data, isLoading, error, isValidating } = useSWR(
+    `${path}/${id}`,
+    () => fetcher<Invoice>(`${path}/${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;
-// }
+  return memoizedValue;
+}
+
+// Add this interface for the create invoice payload
+interface CreateInvoicePayload {
+  createDate: 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 };
+}
Index: src/api/service.ts
===================================================================
--- src/api/service.ts	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/api/service.ts	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -1,16 +1,17 @@
 import { useMemo } from 'react';
 // types
-import { Service } from 'mvpmasters-shared';
-// db
-import { collections, collectionFetcher as fetcher } from 'src/lib/firestore';
+import { Service } from 'src/schemas';
 // swr
 import useSWR from 'swr';
+import { endpoints, fetcher } from 'src/utils/axios';
 
 export function useGetServices() {
-  const collectionName = collections.service;
-
-  const { data, isLoading, error, isValidating } = useSWR(collectionName, fetcher<Service>, {
-    revalidateOnFocus: false,
-  });
+  const { data, isLoading, error, isValidating } = useSWR<Service[]>(
+    endpoints.service,
+    () => fetcher<Service[]>(endpoints.service),
+    {
+      revalidateOnFocus: false,
+    }
+  );
 
   const memoizedValue = useMemo(
Index: src/api/settings.ts
===================================================================
--- src/api/settings.ts	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ 	(revision )
@@ -1,40 +1,0 @@
-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 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/api/tenant.ts	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,23 @@
+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;
+}
