Index: src/sections/company/company-item.tsx
===================================================================
--- src/sections/company/company-item.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/company/company-item.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -4,5 +4,5 @@
 import Stack, { StackProps } from '@mui/material/Stack';
 // types
-import { Customer } from 'mvpmasters-shared';
+import { Customer } from 'src/schemas';
 // components
 import Label from 'src/components/label';
Index: src/sections/company/company-list-dialog.tsx
===================================================================
--- src/sections/company/company-list-dialog.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/company/company-list-dialog.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -9,9 +9,10 @@
 import ListItemButton, { listItemButtonClasses } from '@mui/material/ListItemButton';
 // types
-import { Customer } from 'mvpmasters-shared';
+import { Customer } from 'src/schemas';
 // components
 import Iconify from 'src/components/iconify';
 import SearchNotFound from 'src/components/search-not-found';
 import { createFullAddress } from 'src/utils/create-full-address';
+import { Tenant } from 'src/schemas';
 
 // ----------------------------------------------------------------------
@@ -19,5 +20,6 @@
 type Props = {
   title?: string;
-  list: Customer[];
+  tenant?: Tenant;
+  list?: Customer[];
   action?: React.ReactNode;
   //
@@ -26,9 +28,10 @@
   //
   selected: (selectedId: string) => boolean;
-  onSelect: (address: Customer | null) => void;
+  onSelect: (address: Customer | Tenant | null) => void;
 };
 
 export default function AddressListDialog({
   title = 'Address Book',
+  tenant,
   list,
   action,
@@ -43,5 +46,5 @@
 
   const dataFiltered = applyFilter({
-    inputData: list,
+    inputData: list || (tenant ? [tenant] : []),
     query: searchCompany,
   });
@@ -54,5 +57,5 @@
 
   const handleSelectCompany = useCallback(
-    (company: Customer | null) => {
+    (company: Customer | Tenant | null) => {
       onSelect(company);
       setSearchCompany('');
@@ -156,5 +159,5 @@
 // ----------------------------------------------------------------------
 
-function applyFilter({ inputData, query }: { inputData: Customer[]; query: string }) {
+function applyFilter({ inputData, query }: { inputData: Tenant[] | Customer[]; query: string }) {
   if (query) {
     return inputData.filter(
Index: src/sections/employee/employee-new-edit-form.tsx
===================================================================
--- src/sections/employee/employee-new-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/employee/employee-new-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,74 @@
+import { useCallback } from 'react';
+import { useForm } from 'react-hook-form';
+import { zodResolver } from '@hookform/resolvers/zod';
+// @mui
+import LoadingButton from '@mui/lab/LoadingButton';
+import Card from '@mui/material/Card';
+import Stack from '@mui/material/Stack';
+import Grid from '@mui/material/Unstable_Grid2';
+// routes
+import { paths } from 'src/routes/paths';
+import { useRouter } from 'src/routes/hooks';
+// types
+import { NewEmployee, newEmployeeSchema } from 'src/schemas';
+// components
+import { useSnackbar } from 'src/components/snackbar';
+import FormProvider, { RHFTextField, RHFUploadAvatar } from 'src/components/hook-form';
+import { createEmployee } from 'src/api/employee';
+
+export default function EmployeeNewEditForm() {
+  const router = useRouter();
+  const { enqueueSnackbar } = useSnackbar();
+
+  const methods = useForm<NewEmployee>({
+    resolver: zodResolver(newEmployeeSchema),
+    defaultValues: {
+      name: '',
+      email: '',
+      status: 'active' as const,
+      project: '',
+      iban: '',
+      photo: '',
+      cv: '',
+    },
+  });
+
+  const {
+    handleSubmit,
+    formState: { isSubmitting },
+  } = methods;
+
+  const onSubmit = handleSubmit(async (data) => {
+    try {
+      await createEmployee(data);
+      enqueueSnackbar('Create success!');
+      router.push(paths.dashboard.employee.list);
+    } catch (error) {
+      console.error(error);
+    }
+  });
+
+  return (
+    <FormProvider methods={methods} onSubmit={onSubmit}>
+      <Grid container spacing={3}>
+        <Grid xs={12} md={8}>
+          <Card sx={{ p: 3 }}>
+            <Stack spacing={3}>
+              <RHFTextField name="name" label="Full Name" />
+              <RHFTextField name="email" label="Email Address" />
+              <RHFTextField name="project" label="Project" />
+              <RHFTextField name="iban" label="IBAN" />
+              <RHFTextField name="cv" label="CV Link" />
+            </Stack>
+
+            <Stack alignItems="flex-end" sx={{ mt: 3 }}>
+              <LoadingButton type="submit" variant="contained" loading={isSubmitting}>
+                Create Employee
+              </LoadingButton>
+            </Stack>
+          </Card>
+        </Grid>
+      </Grid>
+    </FormProvider>
+  );
+}
Index: src/sections/employee/employee-quick-edit-form.tsx
===================================================================
--- src/sections/employee/employee-quick-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/employee/employee-quick-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,110 @@
+import * as Yup from 'yup';
+import { useMemo } from 'react';
+import { useForm } from 'react-hook-form';
+import { zodResolver } from '@hookform/resolvers/zod';
+// @mui
+import LoadingButton from '@mui/lab/LoadingButton';
+import Box from '@mui/material/Box';
+import Button from '@mui/material/Button';
+import Dialog from '@mui/material/Dialog';
+import MenuItem from '@mui/material/MenuItem';
+import DialogTitle from '@mui/material/DialogTitle';
+import DialogActions from '@mui/material/DialogActions';
+import DialogContent from '@mui/material/DialogContent';
+// types
+import { Employee, employeeSchema } from 'src/schemas';
+// components
+import { useSnackbar } from 'src/components/snackbar';
+import FormProvider, { RHFSelect, RHFTextField } from 'src/components/hook-form';
+
+// ----------------------------------------------------------------------
+
+type Props = {
+  open: boolean;
+  onClose: VoidFunction;
+  currentEmployee?: Employee;
+};
+
+export const EMPLOYEE_STATUS_OPTIONS = [
+  { value: 'active', label: 'Active' },
+  { value: 'inactive', label: 'Inactive' },
+];
+
+export default function EmployeeQuickEditForm({ currentEmployee, open, onClose }: Props) {
+  const { enqueueSnackbar } = useSnackbar();
+
+  const defaultValues = useMemo(
+    () => ({
+      name: currentEmployee?.name || '',
+      email: currentEmployee?.email || '',
+      status: currentEmployee?.status || 'active',
+      project: currentEmployee?.project || '',
+      iban: currentEmployee?.iban || '',
+    }),
+    [currentEmployee]
+  );
+
+  const methods = useForm({
+    resolver: zodResolver(employeeSchema),
+    defaultValues,
+  });
+
+  const {
+    reset,
+    handleSubmit,
+    formState: { isSubmitting },
+  } = methods;
+
+  const onSubmit = handleSubmit(async (data) => {
+    try {
+      await new Promise((resolve) => setTimeout(resolve, 500));
+      reset();
+      onClose();
+      enqueueSnackbar('Update success!');
+    } catch (error) {
+      console.error(error);
+    }
+  });
+
+  return (
+    <Dialog fullWidth maxWidth="xs" open={open} onClose={onClose}>
+      <FormProvider methods={methods} onSubmit={onSubmit}>
+        <DialogTitle>Quick Update</DialogTitle>
+
+        <DialogContent>
+          <Box
+            rowGap={3}
+            columnGap={2}
+            display="grid"
+            gridTemplateColumns={{
+              xs: 'repeat(1, 1fr)',
+            }}
+            sx={{ pt: 3 }}
+          >
+            <RHFTextField name="name" label="Full Name" />
+            <RHFTextField name="email" label="Email Address" />
+            <RHFTextField name="project" label="Project" />
+            <RHFTextField name="iban" label="IBAN" />
+            <RHFSelect name="status" label="Status">
+              {EMPLOYEE_STATUS_OPTIONS.map((status) => (
+                <MenuItem key={status.value} value={status.value}>
+                  {status.label}
+                </MenuItem>
+              ))}
+            </RHFSelect>
+          </Box>
+        </DialogContent>
+
+        <DialogActions>
+          <Button variant="outlined" onClick={onClose}>
+            Cancel
+          </Button>
+
+          <LoadingButton type="submit" variant="contained" loading={isSubmitting}>
+            Update
+          </LoadingButton>
+        </DialogActions>
+      </FormProvider>
+    </Dialog>
+  );
+}
Index: src/sections/employee/employee-table-filters-result.tsx
===================================================================
--- src/sections/employee/employee-table-filters-result.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/employee/employee-table-filters-result.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,86 @@
+// @mui
+import Box from '@mui/material/Box';
+import Chip from '@mui/material/Chip';
+import Paper from '@mui/material/Paper';
+import Button from '@mui/material/Button';
+import Stack, { StackProps } from '@mui/material/Stack';
+// types
+import { EmployeeTableFilters } from 'src/schemas';
+// components
+import Iconify from 'src/components/iconify';
+
+// ----------------------------------------------------------------------
+
+interface Props extends StackProps {
+  filters: EmployeeTableFilters;
+  onFilters: (name: string, value: string | string[]) => void;
+  onResetFilters: VoidFunction;
+  results: number;
+}
+
+export default function EmployeeTableFiltersResult({
+  filters,
+  onFilters,
+  onResetFilters,
+  results,
+  ...other
+}: Props) {
+  const handleRemoveStatus = () => {
+    onFilters('status', 'all');
+  };
+
+  const handleRemoveName = () => {
+    onFilters('name', '');
+  };
+
+  return (
+    <Stack spacing={1.5} {...other}>
+      <Box sx={{ typography: 'body2' }}>
+        <strong>{results}</strong>
+        <Box component="span" sx={{ color: 'text.secondary', ml: 0.25 }}>
+          results found
+        </Box>
+      </Box>
+
+      <Stack flexGrow={1} spacing={1} direction="row" flexWrap="wrap" alignItems="center">
+        {filters.status !== 'all' && (
+          <Block label="Status:">
+            <Chip size="small" label={filters.status} onDelete={handleRemoveStatus} />
+          </Block>
+        )}
+
+        {filters.name && (
+          <Block label="Name:">
+            <Chip size="small" label={filters.name} onDelete={handleRemoveName} />
+          </Block>
+        )}
+
+        <Button
+          color="error"
+          onClick={onResetFilters}
+          startIcon={<Iconify icon="solar:trash-bin-trash-bold" />}
+        >
+          Clear
+        </Button>
+      </Stack>
+    </Stack>
+  );
+}
+
+// ----------------------------------------------------------------------
+
+type BlockProps = {
+  label: string;
+  children: React.ReactNode;
+};
+
+function Block({ label, children }: BlockProps) {
+  return (
+    <Stack direction="row" alignItems="center" sx={{ typography: 'body2' }}>
+      <Box component="span" sx={{ color: 'text.secondary' }}>
+        {label}&nbsp;
+      </Box>
+      {children}
+    </Stack>
+  );
+}
Index: src/sections/employee/employee-table-row.tsx
===================================================================
--- src/sections/employee/employee-table-row.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/employee/employee-table-row.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,71 @@
+// @mui
+import Avatar from '@mui/material/Avatar';
+import Tooltip from '@mui/material/Tooltip';
+import TableRow from '@mui/material/TableRow';
+import TableCell from '@mui/material/TableCell';
+import IconButton from '@mui/material/IconButton';
+// hooks
+import { useBoolean } from 'src/hooks/use-boolean';
+// types
+import { Employee } from 'src/schemas';
+// components
+import Label from 'src/components/label';
+import Iconify from 'src/components/iconify';
+//
+import EmployeeQuickEditForm from './employee-quick-edit-form';
+
+// ----------------------------------------------------------------------
+
+type Props = {
+  selected: boolean;
+  onEditRow: VoidFunction;
+  row: Employee;
+};
+
+export default function EmployeeTableRow({ row, selected, onEditRow }: Props) {
+  const { name, photo, project, status, email } = row;
+
+  const quickEdit = useBoolean();
+
+  return (
+    <>
+      <TableRow hover selected={selected}>
+        <TableCell sx={{ display: 'flex', alignItems: 'center' }}>
+          <Avatar alt={name} src={photo || ''} sx={{ mr: 2 }} />
+          <span>{name}</span>
+        </TableCell>
+
+        <TableCell sx={{ whiteSpace: 'nowrap' }}>{email}</TableCell>
+
+        <TableCell sx={{ whiteSpace: 'nowrap' }}>{project || '-'}</TableCell>
+
+        <TableCell>
+          <Label
+            variant="soft"
+            color={
+              (status === 'active' && 'success') ||
+              (status === 'inactive' && 'warning') ||
+              'default'
+            }
+          >
+            {status}
+          </Label>
+        </TableCell>
+
+        <TableCell align="right" sx={{ px: 1, whiteSpace: 'nowrap' }}>
+          <Tooltip title="Quick Edit" placement="top" arrow>
+            <IconButton color={quickEdit.value ? 'inherit' : 'default'} onClick={quickEdit.onTrue}>
+              <Iconify icon="solar:pen-bold" />
+            </IconButton>
+          </Tooltip>
+        </TableCell>
+      </TableRow>
+
+      <EmployeeQuickEditForm
+        currentEmployee={row}
+        open={quickEdit.value}
+        onClose={quickEdit.onFalse}
+      />
+    </>
+  );
+}
Index: src/sections/employee/view/employee-create-view.tsx
===================================================================
--- src/sections/employee/view/employee-create-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/employee/view/employee-create-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,41 @@
+'use client';
+
+// @mui
+import Container from '@mui/material/Container';
+// routes
+import { paths } from 'src/routes/paths';
+// components
+import { useSettingsContext } from 'src/components/settings';
+import CustomBreadcrumbs from 'src/components/custom-breadcrumbs';
+//
+import EmployeeNewEditForm from '../employee-new-edit-form';
+
+// ----------------------------------------------------------------------
+
+export default function EmployeeCreateView() {
+  const settings = useSettingsContext();
+
+  return (
+    <Container maxWidth={settings.themeStretch ? false : 'lg'}>
+      <CustomBreadcrumbs
+        heading="Create a new employee"
+        links={[
+          {
+            name: 'Dashboard',
+            href: paths.dashboard.root,
+          },
+          {
+            name: 'Employee',
+            href: paths.dashboard.employee.list,
+          },
+          { name: 'New employee' },
+        ]}
+        sx={{
+          mb: { xs: 3, md: 5 },
+        }}
+      />
+
+      <EmployeeNewEditForm />
+    </Container>
+  );
+}
Index: src/sections/employee/view/employee-list-view.tsx
===================================================================
--- src/sections/employee/view/employee-list-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/employee/view/employee-list-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,265 @@
+'use client';
+
+import isEqual from 'lodash/isEqual';
+import { useState, useCallback } from 'react';
+// @mui
+import { alpha } from '@mui/material/styles';
+import Tab from '@mui/material/Tab';
+import Tabs from '@mui/material/Tabs';
+import Card from '@mui/material/Card';
+import Table from '@mui/material/Table';
+import Button from '@mui/material/Button';
+import Container from '@mui/material/Container';
+import TableBody from '@mui/material/TableBody';
+import TableContainer from '@mui/material/TableContainer';
+// routes
+import { paths } from 'src/routes/paths';
+import { RouterLink } from 'src/routes/components';
+// hooks
+import { useBoolean } from 'src/hooks/use-boolean';
+// components
+import Label from 'src/components/label';
+import Iconify from 'src/components/iconify';
+import Scrollbar from 'src/components/scrollbar';
+import { useSettingsContext } from 'src/components/settings';
+import CustomBreadcrumbs from 'src/components/custom-breadcrumbs';
+import {
+  useTable,
+  getComparator,
+  emptyRows,
+  TableNoData,
+  TableEmptyRows,
+  TableHeadCustom,
+  TablePaginationCustom,
+} from 'src/components/table';
+// types
+import { Employee, EmployeeTableFilters, EmployeeTableFilterValue } from 'src/schemas';
+//
+import { useGetEmployees } from 'src/api/employee';
+import EmployeeTableRow from '../employee-table-row';
+import EmployeeTableFiltersResult from '../employee-table-filters-result';
+
+const STATUS_OPTIONS = [
+  { value: 'all', label: 'All' },
+  { value: 'active', label: 'Active' },
+  { value: 'inactive', label: 'Inactive' },
+];
+
+const TABLE_HEAD = [
+  { id: 'name', label: 'Name' },
+  { id: 'email', label: 'Email' },
+  { id: 'project', label: 'Project' },
+  { id: 'status', label: 'Status', width: 100 },
+  { id: '', width: 88 },
+];
+
+const defaultFilters: EmployeeTableFilters = {
+  name: '',
+  status: 'all',
+};
+
+export default function EmployeeListView() {
+  const table = useTable({ defaultDense: true });
+  const settings = useSettingsContext();
+  const { employees } = useGetEmployees();
+  const [filters, setFilters] = useState(defaultFilters);
+
+  const dataFiltered = applyFilter({
+    inputData: employees,
+    comparator: getComparator(table.order, table.orderBy),
+    filters,
+  });
+
+  const dataInPage = dataFiltered.slice(
+    table.page * table.rowsPerPage,
+    table.page * table.rowsPerPage + table.rowsPerPage
+  );
+
+  const denseHeight = table.dense ? 52 : 72;
+
+  const canReset = !isEqual(defaultFilters, filters);
+
+  const notFound = (!dataFiltered.length && canReset) || !dataFiltered.length;
+
+  const handleFilters = useCallback(
+    (name: string, value: EmployeeTableFilterValue) => {
+      table.onResetPage();
+      setFilters((prevState: EmployeeTableFilters) => ({
+        ...prevState,
+        [name]: value,
+      }));
+    },
+    [table]
+  );
+
+  const handleFilterStatus = useCallback(
+    (event: React.SyntheticEvent, newValue: string) => {
+      handleFilters('status', newValue);
+    },
+    [handleFilters]
+  );
+
+  const handleResetFilters = useCallback(() => {
+    setFilters(defaultFilters);
+  }, []);
+
+  return (
+    <>
+      <Container maxWidth={settings.themeStretch ? false : 'lg'}>
+        <CustomBreadcrumbs
+          heading="List"
+          links={[
+            { name: 'Dashboard', href: paths.dashboard.root },
+            { name: 'Employee', href: paths.dashboard.employee.list },
+            { name: 'List' },
+          ]}
+          action={
+            <Button
+              component={RouterLink}
+              href={paths.dashboard.employee.new}
+              variant="contained"
+              startIcon={<Iconify icon="mingcute:add-line" />}
+            >
+              New Employee
+            </Button>
+          }
+          sx={{
+            mb: { xs: 3, md: 5 },
+          }}
+        />
+
+        <Card>
+          <Tabs
+            value={filters.status}
+            onChange={handleFilterStatus}
+            sx={{
+              px: 2.5,
+              boxShadow: (theme) => `inset 0 -2px 0 0 ${alpha(theme.palette.grey[500], 0.08)}`,
+            }}
+          >
+            {STATUS_OPTIONS.map((tab) => (
+              <Tab
+                key={tab.value}
+                iconPosition="end"
+                value={tab.value}
+                label={tab.label}
+                icon={
+                  <Label
+                    variant={
+                      ((tab.value === 'all' || tab.value === filters.status) && 'filled') || 'soft'
+                    }
+                    color={
+                      (tab.value === 'active' && 'success') ||
+                      (tab.value === 'inactive' && 'warning') ||
+                      'default'
+                    }
+                  >
+                    {tab.value === 'all' && employees.length}
+                    {tab.value === 'active' &&
+                      employees.filter((employee) => employee.status === 'active').length}
+                    {tab.value === 'inactive' &&
+                      employees.filter((employee) => employee.status === 'inactive').length}
+                  </Label>
+                }
+              />
+            ))}
+          </Tabs>
+
+          {canReset && (
+            <EmployeeTableFiltersResult
+              filters={filters}
+              onFilters={handleFilters}
+              onResetFilters={handleResetFilters}
+              results={dataFiltered.length}
+              sx={{ p: 2.5, pt: 0 }}
+            />
+          )}
+
+          <TableContainer sx={{ position: 'relative', overflow: 'unset' }}>
+            <Scrollbar>
+              <Table size={table.dense ? 'small' : 'medium'} sx={{ minWidth: 960 }}>
+                <TableHeadCustom
+                  order={table.order}
+                  orderBy={table.orderBy}
+                  headLabel={TABLE_HEAD}
+                  rowCount={employees.length}
+                  numSelected={table.selected.length}
+                  onSort={table.onSort}
+                />
+
+                <TableBody>
+                  {dataFiltered
+                    .slice(
+                      table.page * table.rowsPerPage,
+                      table.page * table.rowsPerPage + table.rowsPerPage
+                    )
+                    .map((row) => (
+                      <EmployeeTableRow
+                        key={row.id}
+                        row={row}
+                        selected={table.selected.includes(row.id!)}
+                        onEditRow={() => {}}
+                      />
+                    ))}
+
+                  <TableEmptyRows
+                    height={denseHeight}
+                    emptyRows={emptyRows(table.page, table.rowsPerPage, employees.length)}
+                  />
+
+                  <TableNoData notFound={notFound} />
+                </TableBody>
+              </Table>
+            </Scrollbar>
+          </TableContainer>
+
+          <TablePaginationCustom
+            count={dataFiltered.length}
+            page={table.page}
+            rowsPerPage={table.rowsPerPage}
+            onPageChange={table.onChangePage}
+            onRowsPerPageChange={table.onChangeRowsPerPage}
+            dense={table.dense}
+            onChangeDense={table.onChangeDense}
+          />
+        </Card>
+      </Container>
+    </>
+  );
+}
+
+// ----------------------------------------------------------------------
+
+function applyFilter({
+  inputData,
+  comparator,
+  filters,
+}: {
+  inputData: Employee[];
+  comparator: (a: any, b: any) => number;
+  filters: EmployeeTableFilters;
+}) {
+  const { name, status } = filters;
+
+  const stabilizedThis = inputData.map((el, index) => [el, index] as const);
+
+  stabilizedThis.sort((a, b) => {
+    const order = comparator(a[0], b[0]);
+    if (order !== 0) return order;
+    return a[1] - b[1];
+  });
+
+  inputData = stabilizedThis.map((el) => el[0]);
+
+  if (name) {
+    inputData = inputData.filter(
+      (employee) => employee.name.toLowerCase().indexOf(name.toLowerCase()) !== -1
+    );
+  }
+
+  if (status !== 'all') {
+    inputData = inputData.filter((employee) => employee.status === status);
+  }
+
+  return inputData;
+}
Index: src/sections/employee/view/index.ts
===================================================================
--- src/sections/employee/view/index.ts	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
+++ src/sections/employee/view/index.ts	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -0,0 +1,2 @@
+export { default as EmployeeListView } from './employee-list-view';
+export { default as EmployeeCreateView } from './employee-create-view';
Index: src/sections/invoice/invoice-details.tsx
===================================================================
--- src/sections/invoice/invoice-details.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-details.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -18,5 +18,5 @@
 import { fCurrency } from 'src/utils/format-number';
 // types
-import { Invoice } from 'mvpmasters-shared';
+import { Invoice } from 'src/schemas';
 // components
 import Label from 'src/components/label';
@@ -28,4 +28,5 @@
 import { getQuantityType } from 'src/utils/get-invoice-quantity-type';
 import InvoiceToolbar from './invoice-toolbar';
+import { updateInvoice } from 'src/api/invoice';
 
 // ----------------------------------------------------------------------
@@ -59,5 +60,8 @@
   const handleChangeStatus = useCallback(
     async (event: React.ChangeEvent<HTMLInputElement>) => {
-      await updateDocument(collections.invoice, invoice.id, { status: event.target.value });
+      // await updateDocument(collections.invoice, invoice.id, { status: event.target.value });
+      await updateInvoice(invoice.id, {
+        status: event.target.value as 'draft' | 'processing' | 'pending' | 'overdue' | 'paid',
+      });
       mutate([collections.invoice, invoice.id]);
     },
@@ -240,7 +244,7 @@
             {invoice.invoiceTo.name}
             <br />
-            {!!invoice.invoiceTo.companyId && (
+            {!!invoice.invoiceTo.companyNumber && (
               <>
-                Company ID: {invoice.invoiceTo.companyId}
+                Company ID: {invoice.invoiceTo.companyNumber}
                 <br />
               </>
@@ -257,5 +261,5 @@
               Date Issued
             </Typography>
-            {fDate(invoice.createDate.toDate())}
+            {fDate(invoice.createDate)}
           </Stack>
 
@@ -264,5 +268,5 @@
               Due Date
             </Typography>
-            {fDate(invoice.dueDate.toDate())}
+            {fDate(invoice.dueDate)}
           </Stack>
         </Box>
Index: src/sections/invoice/invoice-ee-pdf.tsx
===================================================================
--- src/sections/invoice/invoice-ee-pdf.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-ee-pdf.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -5,5 +5,5 @@
 import { fCurrency } from 'src/utils/format-number';
 // types
-import { Invoice } from 'mvpmasters-shared';
+import { Invoice } from 'src/schemas';
 import { createFullAddress } from 'src/utils/create-full-address';
 import { getQuantityType } from 'src/utils/get-invoice-quantity-type';
@@ -229,9 +229,9 @@
           <View style={styles.col6}>
             <Text style={[styles.subtitle1, styles.mb4]}>Date Issued</Text>
-            <Text style={styles.body2}>{fDate(createDate.toDate())}</Text>
+            <Text style={styles.body2}>{fDate(createDate)}</Text>
           </View>
           <View style={styles.col6}>
             <Text style={[styles.subtitle1, styles.mb4]}>Due date</Text>
-            <Text style={styles.body2}>{fDate(dueDate.toDate())}</Text>
+            <Text style={styles.body2}>{fDate(dueDate)}</Text>
           </View>
         </View>
Index: src/sections/invoice/invoice-mk-pdf.tsx
===================================================================
--- src/sections/invoice/invoice-mk-pdf.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-mk-pdf.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -5,5 +5,5 @@
 import { fCurrency } from 'src/utils/format-number';
 // types
-import { Invoice } from 'mvpmasters-shared';
+import { Invoice } from 'src/schemas';
 import { createFullAddress } from 'src/utils/create-full-address';
 import { getQuantityType } from 'src/utils/get-invoice-quantity-type';
@@ -179,9 +179,9 @@
           <View style={styles.col6}>
             <Text style={[styles.subtitle1, styles.mb4]}>Date Issued</Text>
-            <Text style={styles.body2}>{fDate(createDate.toDate())}</Text>
+            <Text style={styles.body2}>{fDate(createDate)}</Text>
           </View>
           <View style={styles.col6}>
             <Text style={[styles.subtitle1, styles.mb4]}>Due date</Text>
-            <Text style={styles.body2}>{fDate(dueDate.toDate())}</Text>
+            <Text style={styles.body2}>{fDate(dueDate)}</Text>
           </View>
         </View>
Index: src/sections/invoice/invoice-new-edit-address.tsx
===================================================================
--- src/sections/invoice/invoice-new-edit-address.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-new-edit-address.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -7,5 +7,5 @@
 import Typography from '@mui/material/Typography';
 // hooks
-import { useGetSettings } from 'src/api/settings';
+import { useGetTenant } from 'src/api/tenant';
 import { useBoolean } from 'src/hooks/use-boolean';
 import { useResponsive } from 'src/hooks/use-responsive';
@@ -32,5 +32,5 @@
   const { invoiceFrom, invoiceTo } = values;
 
-  const { settings } = useGetSettings();
+  const { settings: tenant } = useGetTenant();
   const { customers } = useGetCustomers();
 
@@ -100,5 +100,5 @@
       </Stack>
 
-      {settings && (
+      {tenant && (
         <CompanyListDialog
           title="Companies"
@@ -106,6 +106,6 @@
           onClose={from.onFalse}
           selected={(selectedId: string) => invoiceFrom?.id === selectedId}
-          onSelect={(company) => setValue('invoiceFrom', company)}
-          list={[settings?.company, settings?.['company-ee']]}
+          onSelect={(tenant) => setValue('invoiceFrom', tenant)}
+          tenant={tenant}
           action={
             <Button
Index: src/sections/invoice/invoice-new-edit-details.tsx
===================================================================
--- src/sections/invoice/invoice-new-edit-details.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-new-edit-details.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -14,5 +14,5 @@
 import { fCurrency } from 'src/utils/format-number';
 // types
-import { InvoiceItem } from 'mvpmasters-shared';
+import { InvoiceItem } from 'src/schemas';
 // components
 import Iconify from 'src/components/iconify';
@@ -75,14 +75,26 @@
   const handleSelectService = useCallback(
     (index: number, option: string) => {
-      setValue(
-        `items[${index}].price`,
-        invoiceServices.find((service) => service.id === option)?.price?.[
-          values.quantityType?.toLowerCase() as 'sprint' | 'hour' | 'month'
-        ]
-      );
-      setValue(
-        `items[${index}].total`,
-        values.items.map((item: InvoiceItem) => item.quantity * item.price)[index]
-      );
+      const service = invoiceServices.find((service) => service.id === option);
+      if (!service) return;
+
+      const quantityType = values.quantityType?.toLowerCase();
+      let price = 0;
+
+      switch (quantityType) {
+        case 'sprint':
+          price = service.sprint;
+          break;
+        case 'hour':
+          price = service.hour;
+          break;
+        case 'month':
+          price = service.month;
+          break;
+        default:
+          price = 0;
+      }
+
+      setValue(`items[${index}].price`, price);
+      setValue(`items[${index}].total`, values.items[index].quantity * price);
     },
     [setValue, values.items, values.quantityType, invoiceServices]
Index: src/sections/invoice/invoice-new-edit-form.tsx
===================================================================
--- src/sections/invoice/invoice-new-edit-form.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-new-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -11,5 +11,5 @@
 import { useRouter } from 'src/routes/hooks';
 // types
-import { Invoice } from 'mvpmasters-shared';
+import { CreateInvoice, Invoice } from 'src/schemas';
 // hooks
 import { useBoolean } from 'src/hooks/use-boolean';
@@ -20,19 +20,13 @@
 import uploadToFirebaseStorage from 'src/utils/upload-to-firebase-storage';
 import { pdf } from '@react-pdf/renderer';
-import { useGetSettings } from 'src/api/settings';
-import {
-  collections,
-  documents,
-  firestoreBatch,
-  generateId,
-  updateDocument,
-} from 'src/lib/firestore';
+import { useGetTenant } from 'src/api/tenant';
+import { collections, generateId, updateDocument } from 'src/lib/firestore';
 import { useGetServices } from 'src/api/service';
 import { mutate } from 'swr';
-import { Timestamp } from 'firebase/firestore';
 import InvoiceNewEditStatusDate from './invoice-new-edit-status-date';
 import InvoiceNewEditAddress from './invoice-new-edit-address';
 import InvoiceNewEditDetails from './invoice-new-edit-details';
 import InvoicePDF from './invoice-pdf';
+import { createInvoice, updateInvoice } from 'src/api/invoice';
 
 // ----------------------------------------------------------------------
@@ -58,4 +52,13 @@
 ];
 
+interface InvoiceItem {
+  service: string | null;
+  title: string;
+  price: number;
+  total: number;
+  quantity: number;
+  description: string;
+}
+
 export default function InvoiceNewEditForm({ isCopy, currentInvoice }: Props) {
   const router = useRouter();
@@ -69,5 +72,7 @@
     description: Yup.string().required('Description is required'),
     service: Yup.string().nullable(),
-    quantity: Yup.number().required('Quantity is required').min(0.5, 'Quantity must be at least 1'),
+    quantity: Yup.number()
+      .required('Quantity is required')
+      .min(0.5, 'Quantity must be at least 0.5'),
     price: Yup.number().required('Price is required').min(0, 'Price must be at least 0'),
     total: Yup.number().required('Total is required').min(0, 'Total must be at least 0'),
@@ -91,5 +96,5 @@
       .required('Quantity type is required'),
     month: Yup.string().oneOf(monthNames).required('Month is required'),
-    status: Yup.string().required(),
+    status: Yup.string().oneOf(['draft', 'processing', 'pending', 'overdue', 'paid']).required(),
     totalAmount: Yup.number().required(),
     // not required
@@ -103,5 +108,6 @@
 
   const { services: invoiceServices } = useGetServices();
-  const { settings, settingsEmpty, settingsLoading } = useGetSettings();
+  console.log('invoiceServices', invoiceServices);
+  const { settings: tenant, settingsEmpty, settingsLoading } = useGetTenant();
 
   const defaultValues = useMemo(
@@ -110,7 +116,9 @@
         !isCopy && currentInvoice?.invoiceNumber
           ? currentInvoice?.invoiceNumber
-          : incrementInvoiceNumber(settings?.invoice?.lastInvoiceNumber),
-      createDate: currentInvoice?.createDate?.toDate() || new Date(),
-      dueDate: currentInvoice?.dueDate?.toDate() || null,
+          : incrementInvoiceNumber(tenant?.lastInvoiceNumber),
+      createDate: currentInvoice?.createDate ? new Date(currentInvoice.createDate) : new Date(),
+      dueDate: currentInvoice?.dueDate
+        ? new Date(currentInvoice.dueDate)
+        : new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
       invoiceFrom: currentInvoice?.invoiceFrom || null,
       invoiceTo: currentInvoice?.invoiceTo || null,
@@ -138,5 +146,5 @@
       totalAmount: currentInvoice?.totalAmount || 0,
     }),
-    [currentInvoice, isCopy, settings]
+    [currentInvoice, isCopy, tenant]
   );
 
@@ -164,6 +172,17 @@
 
     try {
-      // generate collection id
       const id = generateId(collections.invoice);
+
+      // Ensure dates are valid Date objects
+      const createDate =
+        data.createDate instanceof Date ? data.createDate : new Date(data.createDate);
+      const dueDate = data.dueDate instanceof Date ? data.dueDate : new Date(data.dueDate);
+
+      const currentTime = new Date();
+      createDate.setHours(
+        currentTime.getHours(),
+        currentTime.getMinutes(),
+        currentTime.getSeconds()
+      );
 
       // attach serivce details
@@ -173,21 +192,16 @@
       }));
 
-      const currentTime = new Date();
-      const createDateWithCurrentTime = new Date(data.createDate); // This creates a date object using the date from data.createDate
-      // Set the time of createDateWithCurrentTime to the current hour, minutes, and seconds
-      createDateWithCurrentTime.setHours(
-        currentTime.getHours(),
-        currentTime.getMinutes(),
-        currentTime.getSeconds()
-      );
-
       // transform data
-      const writeData = {
+      const writeData: CreateInvoice = {
         ...data,
-        invoiceNumber: incrementInvoiceNumber(settings?.invoice.lastInvoiceNumber),
+        invoiceNumber: incrementInvoiceNumber(tenant?.lastInvoiceNumber),
         status: 'draft',
-        createDate: Timestamp.fromDate(createDateWithCurrentTime),
-        dueDate: Timestamp.fromDate(new Date(data.dueDate)),
-        items,
+        createDate,
+        dueDate,
+        items: items.filter((item) => item.service !== null) as CreateInvoice['items'],
+        subTotal: data.totalAmount - (data.taxes || 0) - (data.discount || 0),
+        month: data.month as Invoice['month'],
+        invoiceFrom: data.invoiceFrom!,
+        invoiceTo: data.invoiceTo!,
       };
 
@@ -199,19 +213,21 @@
 
       // write to DB
-      await firestoreBatch([
-        {
-          docPath: `${collections.invoice}/${id}`,
-          type: 'set',
-          data: {
-            ...writeData,
-            pdfRef: storagePath,
-          },
-        },
-        {
-          docPath: `${collections.settings}/${documents.settingsInvoice}`,
-          type: 'set',
-          data: { lastInvoiceNumber: writeData.invoiceNumber },
-        },
-      ]);
+      // await firestoreBatch([
+      //   {
+      //     docPath: `${collections.invoice}/${id}`,
+      //     type: 'set',
+      //     data: {
+      //       ...writeData,
+      //       pdfRef: storagePath,
+      //     },
+      //   },
+      //   {
+      //     docPath: `${collections.settings}/${documents.settingsInvoice}`,
+      //     type: 'set',
+      //     data: { lastInvoiceNumber: writeData.invoiceNumber },
+      //   },
+      // ]);
+
+      await createInvoice({ ...writeData, pdfRef: storagePath });
 
       loadingSave.onFalse();
@@ -229,4 +245,9 @@
     try {
       if (currentInvoice) {
+        // Ensure dates are valid Date objects
+        const createDate =
+          data.createDate instanceof Date ? data.createDate : new Date(data.createDate);
+        const dueDate = data.dueDate instanceof Date ? data.dueDate : new Date(data.dueDate);
+
         // attach serivce details
         const items = data.items.map((item) => ({
@@ -238,7 +259,9 @@
         const writeData = {
           ...data,
-          createDate: Timestamp.fromDate(new Date(data.createDate)),
-          dueDate: Timestamp.fromDate(new Date(data.dueDate)),
+          createDate,
+          dueDate,
           items,
+          invoiceFrom: data.invoiceFrom!,
+          invoiceTo: data.invoiceTo!,
         };
 
@@ -250,14 +273,46 @@
 
         // update DB
-        await updateDocument(collections.invoice, currentInvoice.id, {
+        // await updateDocument(collections.invoice, currentInvoice.id, {
+        //   ...writeData,
+        //   pdfRef: storagePath,
+        // });
+
+        await updateInvoice(currentInvoice.id, {
           ...writeData,
           pdfRef: storagePath,
+          status: data.status as 'draft' | 'processing' | 'pending' | 'overdue' | 'paid',
+          month: data.month as
+            | 'January'
+            | 'February'
+            | 'March'
+            | 'April'
+            | 'May'
+            | 'June'
+            | 'July'
+            | 'August'
+            | 'September'
+            | 'October'
+            | 'November'
+            | 'December',
+          items: items.filter((item) => item.service !== null) as {
+            service: { id: string; month: number; name: string; sprint: number; hour: number };
+            title: string;
+            price: number;
+            total: number;
+            quantity: number;
+            description: string;
+          }[],
         });
 
         // mutate current data
-        mutate([collections.invoice, currentInvoice.id]);
+        // mutate([collections.invoice, currentInvoice.id]);
       } else {
         // generate collection id
         const id = generateId(collections.invoice);
+
+        // Ensure dates are valid Date objects
+        const createDate =
+          data.createDate instanceof Date ? data.createDate : new Date(data.createDate);
+        const dueDate = data.dueDate instanceof Date ? data.dueDate : new Date(data.dueDate);
 
         // attach serivce details
@@ -270,7 +325,9 @@
         const writeData = {
           ...data,
-          createDate: Timestamp.fromDate(new Date(data.createDate)),
-          dueDate: Timestamp.fromDate(new Date(data.dueDate)),
+          createDate,
+          dueDate,
           items,
+          invoiceFrom: data.invoiceFrom!,
+          invoiceTo: data.invoiceTo!,
         };
 
@@ -282,19 +339,20 @@
 
         // write to DB
-        await firestoreBatch([
-          {
-            docPath: `${collections.invoice}/${id}`,
-            type: 'set',
-            data: {
-              ...writeData,
-              pdfRef: storagePath,
-            },
-          },
-          {
-            docPath: `${collections.settings}/${documents.settingsInvoice}`,
-            type: 'set',
-            data: { lastInvoiceNumber: writeData.invoiceNumber },
-          },
-        ]);
+        // await firestoreBatch([
+        //   {
+        //     docPath: `${collections.invoice}/${id}`,
+        //     type: 'set',
+        //     data: {
+        //       ...writeData,
+        //       pdfRef: storagePath,
+        //     },
+        //   },
+        //   {
+        //     docPath: `${collections.settings}/${documents.settingsInvoice}`,
+        //     type: 'set',
+        //     data: { lastInvoiceNumber: writeData.invoiceNumber },
+        //   },
+        // ]);
+        await createInvoice({ ...writeData, pdfRef: storagePath });
 
         reset();
@@ -314,5 +372,5 @@
     <FormProvider methods={methods}>
       <Card>
-        {settings?.company && <InvoiceNewEditAddress />}
+        {!!tenant && <InvoiceNewEditAddress />}
 
         <InvoiceNewEditStatusDate isCopy={isCopy} />
Index: src/sections/invoice/invoice-new-edit-status-date.tsx
===================================================================
--- src/sections/invoice/invoice-new-edit-status-date.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-new-edit-status-date.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -7,5 +7,5 @@
 import { RHFSelect, RHFTextField } from 'src/components/hook-form';
 // api
-import { useGetSettings } from 'src/api/settings';
+// import { useGetTenant } from 'src/api/settings';
 // utils
 import { incrementInvoiceNumber } from 'src/utils/increment-invoice-number';
@@ -33,5 +33,5 @@
   const values = watch();
 
-  const { settings } = useGetSettings();
+  // const { settings } = useGetTenant();
 
   return (
Index: src/sections/invoice/invoice-pdf.tsx
===================================================================
--- src/sections/invoice/invoice-pdf.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-pdf.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -1,3 +1,3 @@
-import { Invoice } from 'mvpmasters-shared';
+import { Invoice } from 'src/schemas';
 import InvoiceEEPDF from './invoice-ee-pdf';
 import InvoiceMKPDF from './invoice-mk-pdf';
Index: src/sections/invoice/invoice-table-filters-result.tsx
===================================================================
--- src/sections/invoice/invoice-table-filters-result.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-table-filters-result.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -6,5 +6,5 @@
 import Stack, { StackProps } from '@mui/material/Stack';
 // types
-import { InvoiceTableFilters, InvoiceTableFilterValue } from 'mvpmasters-shared';
+import { InvoiceTableFilters, InvoiceTableFilterValue } from 'src/schemas';
 // components
 import Iconify from 'src/components/iconify';
Index: src/sections/invoice/invoice-table-row.tsx
===================================================================
--- src/sections/invoice/invoice-table-row.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-table-row.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -16,5 +16,5 @@
 import { fNumber } from 'src/utils/format-number';
 // types
-import { Invoice } from 'mvpmasters-shared';
+import { Invoice } from 'src/schemas';
 // components
 import Label from 'src/components/label';
@@ -60,4 +60,6 @@
   } = row;
 
+  console.log(createDate);
+
   const confirmSend = useBoolean();
   const confirmDelete = useBoolean();
@@ -105,6 +107,6 @@
         <TableCell>
           <ListItemText
-            primary={format(createDate.toDate(), 'dd MMM yyyy')}
-            secondary={format(createDate.toDate(), 'p')}
+            primary={format(new Date(createDate), 'dd MMM yyyy')}
+            secondary={format(new Date(createDate), 'p')}
             primaryTypographyProps={{ typography: 'body2', noWrap: true }}
             secondaryTypographyProps={{
@@ -118,6 +120,6 @@
         <TableCell>
           <ListItemText
-            primary={format(dueDate.toDate(), 'dd MMM yyyy')}
-            secondary={format(dueDate.toDate(), 'p')}
+            primary={format(new Date(dueDate), 'dd MMM yyyy')}
+            secondary={format(new Date(dueDate), 'p')}
             primaryTypographyProps={{ typography: 'body2', noWrap: true }}
             secondaryTypographyProps={{
Index: src/sections/invoice/invoice-table-toolbar.tsx
===================================================================
--- src/sections/invoice/invoice-table-toolbar.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-table-toolbar.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -7,5 +7,5 @@
 import InputAdornment from '@mui/material/InputAdornment';
 // types
-import { InvoiceTableFilters, InvoiceTableFilterValue } from 'mvpmasters-shared';
+import { InvoiceTableFilters, InvoiceTableFilterValue } from 'src/schemas';
 // components
 import Iconify from 'src/components/iconify';
Index: src/sections/invoice/invoice-toolbar.tsx
===================================================================
--- src/sections/invoice/invoice-toolbar.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/invoice-toolbar.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -18,5 +18,5 @@
 import { useBoolean } from 'src/hooks/use-boolean';
 // types
-import { Invoice } from 'mvpmasters-shared';
+import { Invoice } from 'src/schemas';
 // components
 import Iconify from 'src/components/iconify';
Index: src/sections/invoice/mail-compose.tsx
===================================================================
--- src/sections/invoice/mail-compose.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/mail-compose.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -13,5 +13,5 @@
 import Iconify from 'src/components/iconify';
 import Editor from 'src/components/editor';
-import { Invoice } from 'mvpmasters-shared';
+import { Invoice } from 'src/schemas';
 import FormProvider from 'src/components/hook-form/form-provider';
 import { RHFTextField } from 'src/components/hook-form';
Index: src/sections/invoice/view/invoice-edit-view.tsx
===================================================================
--- src/sections/invoice/view/invoice-edit-view.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/view/invoice-edit-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -23,4 +23,5 @@
 
   const { currentInvoice } = useGetInvoice({ id });
+  console.log('currentInvoice', currentInvoice);
 
   return (
Index: src/sections/invoice/view/invoice-list-view.tsx
===================================================================
--- src/sections/invoice/view/invoice-list-view.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/invoice/view/invoice-list-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -36,14 +36,9 @@
 } from 'src/components/table';
 // types
-import {
-  Invoice,
-  InvoiceStatus,
-  InvoiceTableFilters,
-  InvoiceTableFilterValue,
-} from 'mvpmasters-shared';
+import { Invoice, InvoiceStatus, InvoiceTableFilters, InvoiceTableFilterValue } from 'src/schemas';
 //
 import deleteFromFirebaseStorage from 'src/utils/delete-from-firebase-storage';
 // fetch
-import { useGetInvoices } from 'src/api/invoice';
+import { useDeleteInvoice, useGetInvoices } from 'src/api/invoice';
 import { collections, removeDocument } from 'src/lib/firestore';
 import { mutate } from 'swr';
@@ -163,9 +158,5 @@
   const [filters, setFilters] = useState(defaultFilters);
 
-  const { invoices: tableData } = useGetInvoices({
-    where: [['createDate', '>=', filters.startDate]],
-    orderBy: 'createDate',
-    direction: 'desc',
-  });
+  const { invoices: tableData } = useGetInvoices({ startDate: filters.startDate?.toISOString() });
 
   const invoiceMutationKey = useMemo(
@@ -269,4 +260,6 @@
   );
 
+  const { deleteInvoiceMutation } = useDeleteInvoice();
+
   const handleDeleteRow = useCallback(
     async (invoice: Invoice) => {
@@ -275,19 +268,11 @@
         orderBy: 'createDate',
         direction: 'desc',
-      }); // Get the same params as used in useGetInvoices
-
-      // Optimistically update the cache before the deletion
-      // mutate(
-      //   [collections.invoice, serializedParams],
-      //   (invoices: Invoice[] = []) => invoices.filter((row) => row.id !== invoice.id),
-      //   false
-      // );
-
-      await removeDocument(collections.invoice, invoice.id);
+      });
+
+      await deleteInvoiceMutation(invoice.id);
       await deleteFromFirebaseStorage(
         `invoices/${invoice.invoiceTo.name}/${invoice.id}-${invoice.invoiceNumber}.pdf`
       );
 
-      // Optionally, rollback optimistic update or refetch data
       mutate(invoiceMutationKey);
     },
@@ -672,6 +657,6 @@
       inputData = inputData.filter(
         (invoice) =>
-          fTimestamp(invoice.createDate.toMillis()) >= fTimestamp(startDate) &&
-          fTimestamp(invoice.createDate.toMillis()) <= fTimestamp(endDate)
+          fTimestamp(invoice.createDate.getTime()) >= fTimestamp(startDate.getTime()) &&
+          fTimestamp(invoice.createDate.getTime()) <= fTimestamp(endDate.getTime())
       );
     }
Index: src/sections/user/customer-new-edit-form.tsx
===================================================================
--- src/sections/user/customer-new-edit-form.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/user/customer-new-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -18,5 +18,5 @@
 import { useRouter } from 'src/routes/hooks';
 // types
-import { Customer, NewCustomer, newCustomerSchema } from 'mvpmasters-shared';
+import { Customer, NewCustomer, newCustomerSchema } from 'src/schemas';
 // components
 import Label from 'src/components/label';
Index: src/sections/user/customer-quick-edit-form.tsx
===================================================================
--- src/sections/user/customer-quick-edit-form.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/user/customer-quick-edit-form.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -14,5 +14,5 @@
 import DialogContent from '@mui/material/DialogContent';
 // types
-import { Customer, customerSchema } from 'mvpmasters-shared';
+import { Customer, customerSchema } from 'src/schemas';
 // assets
 import { countries } from 'src/assets/data';
Index: src/sections/user/customer-table-filters-result.tsx
===================================================================
--- src/sections/user/customer-table-filters-result.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/user/customer-table-filters-result.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -9,5 +9,5 @@
 // components
 import Iconify from 'src/components/iconify';
-import { CustomerTableFilterValue, CustomerTableFilters } from 'mvpmasters-shared';
+import { CustomerTableFilterValue, CustomerTableFilters } from 'src/schemas';
 
 // ----------------------------------------------------------------------
Index: src/sections/user/customer-table-row.tsx
===================================================================
--- src/sections/user/customer-table-row.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/user/customer-table-row.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -9,5 +9,5 @@
 import { useBoolean } from 'src/hooks/use-boolean';
 // types
-import { Customer } from 'mvpmasters-shared';
+import { Customer } from 'src/schemas';
 // components
 import Label from 'src/components/label';
Index: src/sections/user/customer-table-toolbar.tsx
===================================================================
--- src/sections/user/customer-table-toolbar.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/user/customer-table-toolbar.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -12,5 +12,5 @@
 import Select, { SelectChangeEvent } from '@mui/material/Select';
 // types
-import { CustomerTableFilters, CustomerTableFilterValue } from 'mvpmasters-shared';
+import { CustomerTableFilters, CustomerTableFilterValue } from 'src/schemas';
 // components
 import Iconify from 'src/components/iconify';
Index: src/sections/user/view/customer-list-view.tsx
===================================================================
--- src/sections/user/view/customer-list-view.tsx	(revision 5d6f37a75130aab7d9a67b5b430603eff2c0ca6e)
+++ src/sections/user/view/customer-list-view.tsx	(revision 057453cdc828f504e8bcd813422d99221b3b5732)
@@ -34,5 +34,5 @@
 } from 'src/components/table';
 // types
-import { Customer, CustomerTableFilters, CustomerTableFilterValue } from 'mvpmasters-shared';
+import { Customer, CustomerTableFilters, CustomerTableFilterValue } from 'src/schemas';
 //
 import { useGetCustomers } from 'src/api/customer';
