Index: src/sections/auth/firebase/firebase-login-view.tsx
===================================================================
--- src/sections/auth/firebase/firebase-login-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/auth/firebase/firebase-login-view.tsx	(revision 3c5302a84bc603a5b071d8babfaca46443a0e1c8)
@@ -74,5 +74,5 @@
   const renderHead = (
     <Stack spacing={2} sx={{ mb: 5 }}>
-      <Typography variant="h4">Sign in to MVP Masters</Typography>
+      <Typography variant="h4">Sign in to AgencyOS</Typography>
     </Stack>
   );
Index: src/sections/invoice/invoice-new-edit-form.tsx
===================================================================
--- src/sections/invoice/invoice-new-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/invoice/invoice-new-edit-form.tsx	(revision 3c5302a84bc603a5b071d8babfaca46443a0e1c8)
@@ -209,5 +209,5 @@
       const invoicePdf = <InvoicePDF invoice={writeData as Invoice} currentStatus="pending" />;
       const blob: Blob = await pdf(invoicePdf).toBlob();
-      const storagePath: string = `invoices/${writeData.invoiceTo.name}/${id}-${writeData.invoiceNumber}.pdf`;
+      const storagePath: string = `invoices/${writeData.invoiceTo.name}-${writeData.invoiceNumber}.pdf`;
       await uploadToFirebaseStorage(blob, storagePath);
 
@@ -269,5 +269,5 @@
         const invoicePdf = <InvoicePDF invoice={writeData as Invoice} currentStatus="pending" />;
         const blob: Blob = await pdf(invoicePdf).toBlob();
-        const storagePath: string = `invoices/${data.invoiceTo.name}/${currentInvoice.id}-${data.invoiceNumber}.pdf`;
+        const storagePath: string = `invoices/${data.invoiceTo.name}-${data.invoiceNumber}.pdf`;
         await uploadToFirebaseStorage(blob, storagePath);
 
@@ -335,5 +335,5 @@
         const invoicePdf = <InvoicePDF invoice={writeData as Invoice} currentStatus="pending" />;
         const blob: Blob = await pdf(invoicePdf).toBlob();
-        const storagePath: string = `invoices/${data.invoiceTo.name}/${id}-${data.invoiceNumber}.pdf`;
+        const storagePath: string = `invoices/${data.invoiceTo.name}-${data.invoiceNumber}.pdf`;
         await uploadToFirebaseStorage(blob, storagePath);
 
Index: src/sections/invoice/view/invoice-list-view.tsx
===================================================================
--- src/sections/invoice/view/invoice-list-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/invoice/view/invoice-list-view.tsx	(revision 3c5302a84bc603a5b071d8babfaca46443a0e1c8)
@@ -49,4 +49,6 @@
 import InvoiceTableToolbar from '../invoice-table-toolbar';
 import MailCompose from '../mail-compose';
+import { useFetchAnalytics } from 'src/api/invoice/use-fetch-analytics';
+import { endpoints } from 'src/utils/axios';
 
 // ----------------------------------------------------------------------
@@ -208,13 +210,21 @@
   //   );
 
+  const {
+    analytics: analyticsData,
+    isAnalyticsLoading,
+    analyticsError,
+  } = useFetchAnalytics(filters.startDate);
+
   useEffect(() => {
-    if (tableData) {
-      const getAnalytics = async () => {
-        const analyticsStats = await getTotalAmountForAllStatuses(tableData);
-        setAnalytics(analyticsStats);
-      };
-      getAnalytics();
+    if (analyticsData) {
+      setAnalytics(analyticsData);
     }
-  }, [tableData]);
+  }, [analyticsData]);
+
+  useEffect(() => {
+    if (analyticsError) {
+      console.error('Failed to load analytics:', analyticsError);
+    }
+  }, [analyticsError]);
 
   const getPercentByStatus = (status: string) =>
@@ -272,8 +282,8 @@
       await deleteInvoiceMutation(invoice.id);
       await deleteFromFirebaseStorage(
-        `invoices/${invoice.invoiceTo.name}/${invoice.id}-${invoice.invoiceNumber}.pdf`
+        `invoices/${invoice.invoiceTo.name}-${invoice.invoiceNumber}.pdf`
       );
 
-      mutate(invoiceMutationKey);
+      mutate(endpoints.invoice);
     },
     [filters.startDate, invoiceMutationKey]
@@ -332,4 +342,8 @@
     setFilters(defaultFilters);
   }, []);
+
+  if (isAnalyticsLoading) {
+    // Show loading state
+  }
 
   return (
Index: src/sections/user/customer-new-edit-form.tsx
===================================================================
--- src/sections/user/customer-new-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/user/customer-new-edit-form.tsx	(revision 3c5302a84bc603a5b071d8babfaca46443a0e1c8)
@@ -53,5 +53,4 @@
       },
       vatNumber: currentCustomer?.vatNumber || '',
-      companyId: currentCustomer?.companyId || '',
       companyNumber: currentCustomer?.companyNumber || '',
       id: currentCustomer?.id || '',
@@ -86,6 +85,4 @@
       const logoUrl = await uploadToFirebaseStorage(logoFile, storagePath);
 
-      // const customersRef = collection(db, 'customers');
-      // await addDoc(customersRef, { ...data, logoUrl });
       await createCustomer({ ...data, logoUrl });
 
Index: src/sections/user/customer-quick-edit-form.tsx
===================================================================
--- src/sections/user/customer-quick-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/user/customer-quick-edit-form.tsx	(revision 3c5302a84bc603a5b071d8babfaca46443a0e1c8)
@@ -14,5 +14,5 @@
 import DialogContent from '@mui/material/DialogContent';
 // types
-import { Customer, customerSchema } from 'src/schemas';
+import { Customer, updateCustomerSchema } from 'src/schemas';
 // assets
 import { countries } from 'src/assets/data';
@@ -21,8 +21,5 @@
 import { useSnackbar } from 'src/components/snackbar';
 import FormProvider, { RHFSelect, RHFTextField, RHFAutocomplete } from 'src/components/hook-form';
-import { doc, setDoc } from 'firebase/firestore';
-import { db } from 'src/lib/firebase';
-import { mutate } from 'swr';
-import { collections } from 'src/lib/firestore';
+import { updateCustomer } from 'src/api/customer';
 
 // ----------------------------------------------------------------------
@@ -58,5 +55,4 @@
       },
       vatNumber: currentCustomer?.vatNumber || '',
-      companyId: currentCustomer?.companyId || '',
       companyNumber: currentCustomer?.companyNumber || '',
       id: currentCustomer?.id || '',
@@ -68,5 +64,5 @@
 
   const methods = useForm({
-    resolver: zodResolver(customerSchema),
+    resolver: zodResolver(updateCustomerSchema),
     defaultValues,
   });
@@ -80,10 +76,8 @@
   const onSubmit = handleSubmit(async (data) => {
     try {
+      console.log('currentCustomer', currentCustomer);
       if (!currentCustomer) return;
-      // await new Promise((resolve) => setTimeout(resolve, 500));
-
-      const docRef = doc(db, 'customers', currentCustomer.id!);
-      await setDoc(docRef, data, { merge: true });
-      mutate(collections.customer);
+      console.log('data', data);
+      await updateCustomer(currentCustomer.id!, data);
 
       reset();
@@ -93,4 +87,5 @@
     } catch (error) {
       console.error(error);
+      enqueueSnackbar('Update failed!', { variant: 'error' });
     }
   });
