@layerfi/components 0.1.107-alpha → 0.1.107-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -469,9 +469,8 @@ declare module '@layerfi/components/api/layer/linked_accounts' {
469
469
 
470
470
  }
471
471
  declare module '@layerfi/components/api/layer/profit_and_loss' {
472
- import { ProfitAndLoss } from '@layerfi/components/types';
473
472
  import { S3PresignedUrl } from '@layerfi/components/types/general';
474
- import type { ProfitAndLossComparison, ProfitAndLossComparisonRequestBody, ProfitAndLossSummaries } from '@layerfi/components/types/profit_and_loss';
473
+ import type { ProfitAndLossComparison, ProfitAndLossComparisonRequestBody } from '@layerfi/components/types/profit_and_loss';
475
474
  type BaseProfitAndLossParams = {
476
475
  businessId: string;
477
476
  startDate?: Date;
@@ -482,14 +481,9 @@ declare module '@layerfi/components/api/layer/profit_and_loss' {
482
481
  tagValues?: string;
483
482
  reportingBasis?: string;
484
483
  };
485
- type GetProfitAndLossParams = BaseProfitAndLossParams;
486
484
  type GetProfitAndLossCsvParams = BaseProfitAndLossParams & {
487
485
  moneyFormat?: string;
488
486
  };
489
- export const getProfitAndLoss: (apiUrl: string, accessToken: string | undefined, params: GetProfitAndLossParams) => () => Promise<{
490
- data?: ProfitAndLoss;
491
- error?: unknown;
492
- }>;
493
487
  export const compareProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
494
488
  params?: Record<string, string | undefined> | undefined;
495
489
  body?: ProfitAndLossComparisonRequestBody | undefined;
@@ -497,12 +491,6 @@ declare module '@layerfi/components/api/layer/profit_and_loss' {
497
491
  data?: ProfitAndLossComparison;
498
492
  error?: unknown;
499
493
  }>;
500
- export const getProfitAndLossSummaries: (baseUrl: string, accessToken: string | undefined, options?: {
501
- params?: Record<string, string | undefined> | undefined;
502
- } | undefined) => () => Promise<{
503
- data?: ProfitAndLossSummaries;
504
- error?: unknown;
505
- }>;
506
494
  export const getProfitAndLossCsv: (apiUrl: string, accessToken: string | undefined, params: GetProfitAndLossCsvParams) => () => Promise<{
507
495
  data?: S3PresignedUrl;
508
496
  error?: unknown;
@@ -794,25 +782,6 @@ declare module '@layerfi/components/api/layer' {
794
782
  } | undefined) => () => Promise<{
795
783
  data: import("@layerfi/components/types").LedgerAccountsEntry;
796
784
  }>;
797
- getProfitAndLoss: (apiUrl: string, accessToken: string | undefined, params: {
798
- businessId: string;
799
- startDate?: Date;
800
- endDate?: Date;
801
- month?: string;
802
- year?: string;
803
- tagKey?: string;
804
- tagValues?: string;
805
- reportingBasis?: string;
806
- }) => () => Promise<{
807
- data?: import("@layerfi/components/types").ProfitAndLoss;
808
- error?: unknown;
809
- }>;
810
- getProfitAndLossSummaries: (baseUrl: string, accessToken: string | undefined, options?: {
811
- params?: Record<string, string | undefined> | undefined;
812
- } | undefined) => () => Promise<{
813
- data?: import("@layerfi/components/types/profit_and_loss").ProfitAndLossSummaries;
814
- error?: unknown;
815
- }>;
816
785
  getProfitAndLossCsv: (apiUrl: string, accessToken: string | undefined, params: {
817
786
  businessId: string;
818
787
  startDate?: Date;
@@ -1100,8 +1069,9 @@ declare module '@layerfi/components/components/BadgeLoader/BadgeLoader' {
1100
1069
  children?: ReactNode;
1101
1070
  size?: number;
1102
1071
  variant?: 'default' | 'info' | 'success' | 'error' | 'warning';
1072
+ showLoading?: boolean;
1103
1073
  }
1104
- export const BadgeLoader: ({ children, variant }: BadgeLoaderProps) => import("react/jsx-runtime").JSX.Element;
1074
+ export const BadgeLoader: ({ children, showLoading, variant }: BadgeLoaderProps) => import("react/jsx-runtime").JSX.Element;
1105
1075
 
1106
1076
  }
1107
1077
  declare module '@layerfi/components/components/BadgeLoader/index' {
@@ -1527,6 +1497,10 @@ declare module '@layerfi/components/components/BankTransactions/BankTransactionM
1527
1497
  memo: string | null | undefined;
1528
1498
  }> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
1529
1499
  memo: string | null | undefined;
1500
+ }> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
1501
+ memo: string | null | undefined;
1502
+ }> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
1503
+ memo: string | null | undefined;
1530
1504
  }> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
1531
1505
  memo: string | null | undefined;
1532
1506
  }> | undefined, unknown>;
@@ -1700,12 +1674,14 @@ declare module '@layerfi/components/components/BaseDetailView/BaseDetailView' {
1700
1674
  import type { PropsWithChildren } from 'react';
1701
1675
  export type BaseDetailViewProps = PropsWithChildren<{
1702
1676
  name: string;
1677
+ borderless?: boolean;
1703
1678
  onGoBack: () => void;
1704
1679
  slots: {
1705
1680
  Header: React.FC;
1681
+ BackIcon?: React.FC;
1706
1682
  };
1707
1683
  }>;
1708
- export const BaseDetailView: ({ name, onGoBack, slots, children }: BaseDetailViewProps) => import("react/jsx-runtime").JSX.Element;
1684
+ export const BaseDetailView: ({ name, onGoBack, slots, children, borderless }: BaseDetailViewProps) => import("react/jsx-runtime").JSX.Element;
1709
1685
 
1710
1686
  }
1711
1687
  declare module '@layerfi/components/components/Bills/BillSummary' {
@@ -1822,7 +1798,6 @@ declare module '@layerfi/components/components/Bills/BillsTableWithPanel' {
1822
1798
  }
1823
1799
  declare module '@layerfi/components/components/Bills/useBillForm' {
1824
1800
  import { Bill, BillLineItem } from '@layerfi/components/types/bills';
1825
- import { FormValidateOrFn, FormAsyncValidateOrFn } from '@tanstack/react-form';
1826
1801
  import { Vendor } from '@layerfi/components/types/vendors';
1827
1802
  export type BillForm = {
1828
1803
  bill_number?: string;
@@ -1835,10 +1810,10 @@ declare module '@layerfi/components/components/Bills/useBillForm' {
1835
1810
  };
1836
1811
  export type EditableBill = Partial<Bill>;
1837
1812
  export const useBillForm: (bill?: EditableBill) => {
1838
- form: import("@tanstack/react-form").ReactFormExtendedApi<BillForm, FormValidateOrFn<BillForm>, FormValidateOrFn<BillForm>, FormAsyncValidateOrFn<BillForm>, FormValidateOrFn<BillForm>, FormAsyncValidateOrFn<BillForm>, FormValidateOrFn<BillForm>, FormAsyncValidateOrFn<BillForm>, FormAsyncValidateOrFn<BillForm>, FormAsyncValidateOrFn<BillForm>>;
1813
+ form: import("@tanstack/react-form").ReactFormExtendedApi<BillForm, import("@tanstack/react-form").FormValidateOrFn<BillForm>, import("@tanstack/react-form").FormValidateOrFn<BillForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<BillForm>, import("@tanstack/react-form").FormValidateOrFn<BillForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<BillForm>, import("@tanstack/react-form").FormValidateOrFn<BillForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<BillForm>, import("@tanstack/react-form").FormValidateOrFn<BillForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<BillForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<BillForm>, unknown>;
1839
1814
  isDirty: boolean;
1840
1815
  submitError: string | undefined;
1841
- formErrorMap: import("@tanstack/react-form").ValidationErrorMap<undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined>;
1816
+ formErrorMap: import("@tanstack/react-form").ValidationErrorMap<undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined>;
1842
1817
  };
1843
1818
 
1844
1819
  }
@@ -1950,7 +1925,6 @@ declare module '@layerfi/components/components/BusinessForm/BusinessForm' {
1950
1925
 
1951
1926
  }
1952
1927
  declare module '@layerfi/components/components/BusinessForm/useBusinessForm' {
1953
- import { FormValidateOrFn, FormAsyncValidateOrFn } from '@tanstack/react-form';
1954
1928
  import { USStateCode } from '@layerfi/components/types/location';
1955
1929
  import { EntityType } from '@layerfi/components/types/business';
1956
1930
  type BusinessFormData = {
@@ -1968,7 +1942,7 @@ declare module '@layerfi/components/components/BusinessForm/useBusinessForm' {
1968
1942
  onSuccess?: () => void;
1969
1943
  };
1970
1944
  export const useBusinessForm: ({ onSuccess }: UseBusinessFormProps) => {
1971
- form: import("@tanstack/react-form").ReactFormExtendedApi<BusinessFormData, FormValidateOrFn<BusinessFormData>, FormValidateOrFn<BusinessFormData>, FormAsyncValidateOrFn<BusinessFormData>, FormValidateOrFn<BusinessFormData>, FormAsyncValidateOrFn<BusinessFormData>, FormValidateOrFn<BusinessFormData>, FormAsyncValidateOrFn<BusinessFormData>, FormAsyncValidateOrFn<BusinessFormData>, FormAsyncValidateOrFn<BusinessFormData>>;
1945
+ form: import("@tanstack/react-form").ReactFormExtendedApi<BusinessFormData, import("@tanstack/react-form").FormValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<BusinessFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<BusinessFormData>, unknown>;
1972
1946
  submitError: string | undefined;
1973
1947
  isFormValid: boolean;
1974
1948
  };
@@ -2596,7 +2570,6 @@ declare module '@layerfi/components/components/CustomAccountForm/CustomAccountFo
2596
2570
 
2597
2571
  }
2598
2572
  declare module '@layerfi/components/components/CustomAccountForm/useCustomAccountForm' {
2599
- import { FormValidateOrFn, FormAsyncValidateOrFn } from '@tanstack/react-form';
2600
2573
  import { CustomAccount, CustomAccountSubtype, CustomAccountType } from '@layerfi/components/hooks/customAccounts/types';
2601
2574
  export const getCustomAccountTypeFromSubtype: (subtype: CustomAccountSubtype) => CustomAccountType;
2602
2575
  type CustomAccountFormData = {
@@ -2608,7 +2581,7 @@ declare module '@layerfi/components/components/CustomAccountForm/useCustomAccoun
2608
2581
  onSuccess?: (account: CustomAccount) => void;
2609
2582
  };
2610
2583
  export const useCustomAccountForm: ({ onSuccess }: UseCustomAccountFormProps) => {
2611
- form: import("@tanstack/react-form").ReactFormExtendedApi<CustomAccountFormData, FormValidateOrFn<CustomAccountFormData>, FormValidateOrFn<CustomAccountFormData>, FormValidateOrFn<CustomAccountFormData>, FormValidateOrFn<CustomAccountFormData>, FormAsyncValidateOrFn<CustomAccountFormData>, FormValidateOrFn<CustomAccountFormData>, FormAsyncValidateOrFn<CustomAccountFormData>, FormAsyncValidateOrFn<CustomAccountFormData>, FormAsyncValidateOrFn<CustomAccountFormData>>;
2584
+ form: import("@tanstack/react-form").ReactFormExtendedApi<CustomAccountFormData, import("@tanstack/react-form").FormValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<CustomAccountFormData>, import("@tanstack/react-form").FormAsyncValidateOrFn<CustomAccountFormData>, unknown>;
2612
2585
  submitError: string | undefined;
2613
2586
  isFormValid: boolean;
2614
2587
  };
@@ -2782,6 +2755,7 @@ declare module '@layerfi/components/components/DatePicker/index' {
2782
2755
 
2783
2756
  }
2784
2757
  declare module '@layerfi/components/components/DateTime/DateTime' {
2758
+ import { TextStyleProps } from '@layerfi/components/components/ui/Typography/Text';
2785
2759
  interface DateTimeProps {
2786
2760
  value: string;
2787
2761
  format?: string;
@@ -2789,14 +2763,46 @@ declare module '@layerfi/components/components/DateTime/DateTime' {
2789
2763
  timeFormat?: string;
2790
2764
  onlyDate?: boolean;
2791
2765
  onlyTime?: boolean;
2766
+ slotProps?: {
2767
+ Date?: TextStyleProps;
2768
+ Time?: TextStyleProps;
2769
+ };
2792
2770
  }
2793
- export const DateTime: ({ value, format, dateFormat, timeFormat, onlyDate, onlyTime, }: DateTimeProps) => import("react/jsx-runtime").JSX.Element;
2771
+ export const DateTime: ({ value, format, dateFormat, timeFormat, onlyDate, onlyTime, slotProps, }: DateTimeProps) => import("react/jsx-runtime").JSX.Element;
2794
2772
  export {};
2795
2773
 
2796
2774
  }
2797
2775
  declare module '@layerfi/components/components/DateTime/index' {
2798
2776
  export { DateTime } from '@layerfi/components/components/DateTime/DateTime';
2799
2777
 
2778
+ }
2779
+ declare module '@layerfi/components/components/DetailReportBreadcrumb/DetailReportBreadcrumb' {
2780
+ export interface BreadcrumbItem {
2781
+ name: string;
2782
+ display_name: string;
2783
+ }
2784
+ export interface DetailReportBreadcrumbProps {
2785
+ breadcrumbs: BreadcrumbItem[];
2786
+ subtitle?: string;
2787
+ onBreadcrumbClick?: (lineItemName: string) => void;
2788
+ }
2789
+ export const DetailReportBreadcrumb: ({ breadcrumbs, subtitle, onBreadcrumbClick, }: DetailReportBreadcrumbProps) => import("react/jsx-runtime").JSX.Element;
2790
+
2791
+ }
2792
+ declare module '@layerfi/components/components/DetailReportHeader/DetailReportHeader' {
2793
+ import { ReactNode } from 'react';
2794
+ export interface DetailReportHeaderProps {
2795
+ title: ReactNode;
2796
+ onClose: () => void;
2797
+ className?: string;
2798
+ }
2799
+ export const DetailReportHeader: ({ title, onClose, className, }: DetailReportHeaderProps) => import("react/jsx-runtime").JSX.Element;
2800
+
2801
+ }
2802
+ declare module '@layerfi/components/components/DetailReportHeader/index' {
2803
+ export { DetailReportHeader } from '@layerfi/components/components/DetailReportHeader/DetailReportHeader';
2804
+ export type { DetailReportHeaderProps } from '@layerfi/components/components/DetailReportHeader/DetailReportHeader';
2805
+
2800
2806
  }
2801
2807
  declare module '@layerfi/components/components/DetailsList/DetailsList' {
2802
2808
  import { ReactNode } from 'react';
@@ -3270,13 +3276,7 @@ declare module '@layerfi/components/components/Integrations/IntegrationsQuickboo
3270
3276
 
3271
3277
  }
3272
3278
  declare module '@layerfi/components/components/Invoices/InvoiceDetail/InvoiceDetail' {
3273
- import { type InvoiceFormMode } from '@layerfi/components/components/Invoices/InvoiceForm/InvoiceForm';
3274
- import type { Invoice } from '@layerfi/components/features/invoices/invoiceSchemas';
3275
- export type InvoiceDetailProps = InvoiceFormMode & {
3276
- onSuccess?: (invoice: Invoice) => void;
3277
- onGoBack: () => void;
3278
- };
3279
- export const InvoiceDetail: (props: InvoiceDetailProps) => import("react/jsx-runtime").JSX.Element;
3279
+ export const InvoiceDetail: () => import("react/jsx-runtime").JSX.Element;
3280
3280
 
3281
3281
  }
3282
3282
  declare module '@layerfi/components/components/Invoices/InvoiceForm/InvoiceForm' {
@@ -3290,9 +3290,9 @@ declare module '@layerfi/components/components/Invoices/InvoiceForm/InvoiceForm'
3290
3290
  } | {
3291
3291
  mode: UpsertInvoiceMode.Create;
3292
3292
  };
3293
- export type InvoiceFormProps = InvoiceFormMode & {
3293
+ export type InvoiceFormProps = {
3294
3294
  isReadOnly: boolean;
3295
- onSuccess?: (invoice: Invoice) => void;
3295
+ onSuccess: (invoice: Invoice) => void;
3296
3296
  onChangeFormState?: (formState: InvoiceFormState) => void;
3297
3297
  };
3298
3298
  export const InvoiceForm: React.ForwardRefExoticComponent<InvoiceFormProps & React.RefAttributes<unknown>>;
@@ -3300,16 +3300,14 @@ declare module '@layerfi/components/components/Invoices/InvoiceForm/InvoiceForm'
3300
3300
  }
3301
3301
  declare module '@layerfi/components/components/Invoices/InvoiceForm/formUtils' {
3302
3302
  import { type Invoice, type InvoiceForm, type InvoiceFormLineItem } from '@layerfi/components/features/invoices/invoiceSchemas';
3303
- import { ValidationErrorMap } from '@tanstack/react-form';
3304
3303
  export type InvoiceFormState = {
3305
- isFormValid: boolean;
3304
+ isDirty: boolean;
3306
3305
  isSubmitting: boolean;
3307
- submitError: string | undefined;
3308
3306
  };
3309
- export const getEmptyLineItem: () => InvoiceFormLineItem;
3307
+ export const EMPTY_LINE_ITEM: InvoiceFormLineItem;
3310
3308
  export const getInvoiceFormDefaultValues: () => InvoiceForm;
3311
3309
  export const getInvoiceFormInitialValues: (invoice: Invoice) => InvoiceForm;
3312
- export const validateOnSubmit: ({ value: invoice }: {
3310
+ export const validateInvoiceForm: ({ value: invoice }: {
3313
3311
  value: InvoiceForm;
3314
3312
  }) => ({
3315
3313
  customer: string;
@@ -3342,7 +3340,6 @@ declare module '@layerfi/components/components/Invoices/InvoiceForm/formUtils' {
3342
3340
  sentAt?: undefined;
3343
3341
  dueAt?: undefined;
3344
3342
  })[] | null;
3345
- export function flattenValidationErrors(errors: ValidationErrorMap): string[];
3346
3343
  export const convertInvoiceFormToParams: (form: InvoiceForm) => unknown;
3347
3344
 
3348
3345
  }
@@ -3375,16 +3372,17 @@ declare module '@layerfi/components/components/Invoices/InvoiceForm/totalsUtils'
3375
3372
  declare module '@layerfi/components/components/Invoices/InvoiceForm/useInvoiceForm' {
3376
3373
  import { type Invoice, type InvoiceForm } from '@layerfi/components/features/invoices/invoiceSchemas';
3377
3374
  import { UpsertInvoiceMode } from '@layerfi/components/features/invoices/api/useUpsertInvoice';
3375
+ type onSuccessFn = (invoice: Invoice) => void;
3378
3376
  type UseInvoiceFormProps = {
3379
- onSuccess?: (invoice: Invoice) => void;
3377
+ onSuccess: onSuccessFn;
3380
3378
  mode: UpsertInvoiceMode.Create;
3381
3379
  } | {
3382
- onSuccess?: (invoice: Invoice) => void;
3380
+ onSuccess: onSuccessFn;
3383
3381
  mode: UpsertInvoiceMode.Update;
3384
3382
  invoice: Invoice;
3385
3383
  };
3386
3384
  export const useInvoiceForm: (props: UseInvoiceFormProps) => {
3387
- form: import("@tanstack/react-form/dist/esm/createFormHook").AppFieldExtendedReactFormApi<InvoiceForm, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, unknown, {
3385
+ form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<InvoiceForm, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, import("@tanstack/react-form").FormAsyncValidateOrFn<InvoiceForm>, unknown, {
3388
3386
  readonly BaseFormTextField: typeof import("@layerfi/components/features/forms/components/BaseFormTextField").BaseFormTextField;
3389
3387
  readonly FormBigDecimalField: typeof import("@layerfi/components/features/forms/components/FormBigDecimalField").FormBigDecimalField;
3390
3388
  readonly FormCheckboxField: typeof import("@layerfi/components/features/forms/components/FormCheckboxField").FormCheckboxField;
@@ -3393,9 +3391,8 @@ declare module '@layerfi/components/components/Invoices/InvoiceForm/useInvoiceFo
3393
3391
  readonly FormTextField: typeof import("@layerfi/components/features/forms/components/FormTextField").FormTextField;
3394
3392
  }, {}>;
3395
3393
  formState: {
3396
- isFormValid: boolean;
3394
+ isDirty: boolean;
3397
3395
  isSubmitting: boolean;
3398
- submitError: string | undefined;
3399
3396
  };
3400
3397
  totals: {
3401
3398
  subtotal: import("effect/BigDecimal").BigDecimal;
@@ -3404,6 +3401,138 @@ declare module '@layerfi/components/components/Invoices/InvoiceForm/useInvoiceFo
3404
3401
  taxes: import("effect/BigDecimal").BigDecimal;
3405
3402
  grandTotal: import("effect/BigDecimal").BigDecimal;
3406
3403
  };
3404
+ submitError: string | undefined;
3405
+ };
3406
+ export {};
3407
+
3408
+ }
3409
+ declare module '@layerfi/components/components/Invoices/InvoiceOverview/InvoiceOverview' {
3410
+ export const InvoiceOverview: () => import("react/jsx-runtime").JSX.Element;
3411
+
3412
+ }
3413
+ declare module '@layerfi/components/components/Invoices/InvoicePaymentForm/InvoicePaymentForm' {
3414
+ import type { Invoice, InvoicePayment } from '@layerfi/components/features/invoices/invoiceSchemas';
3415
+ import type { UpsertDedicatedInvoicePaymentMode } from '@layerfi/components/features/invoices/api/useUpsertDedicatedInvoicePayment';
3416
+ export type InvoicePaymentFormMode = {
3417
+ mode: UpsertDedicatedInvoicePaymentMode.Update;
3418
+ invoice: Invoice;
3419
+ invoicePayment: InvoicePayment;
3420
+ } | {
3421
+ mode: UpsertDedicatedInvoicePaymentMode.Create;
3422
+ invoice: Invoice;
3423
+ };
3424
+ export type InvoicePaymentFormProps = InvoicePaymentFormMode & {
3425
+ isReadOnly?: boolean;
3426
+ onSuccess: (invoicePayment: InvoicePayment) => void;
3427
+ };
3428
+ export const InvoicePaymentForm: (props: InvoicePaymentFormProps) => import("react/jsx-runtime").JSX.Element;
3429
+
3430
+ }
3431
+ declare module '@layerfi/components/components/Invoices/InvoicePaymentForm/formUtils' {
3432
+ import { type DedicatedInvoicePaymentForm, type Invoice } from '@layerfi/components/features/invoices/invoiceSchemas';
3433
+ export const getInvoicePaymentFormDefaultValues: (invoice: Invoice) => DedicatedInvoicePaymentForm;
3434
+ export const validateInvoicePaymentForm: ({ invoicePayment, invoice }: {
3435
+ invoicePayment: DedicatedInvoicePaymentForm;
3436
+ invoice: Invoice;
3437
+ }) => ({
3438
+ amount: string;
3439
+ paidAt?: undefined;
3440
+ method?: undefined;
3441
+ } | {
3442
+ paidAt: string;
3443
+ amount?: undefined;
3444
+ method?: undefined;
3445
+ } | {
3446
+ method: string;
3447
+ amount?: undefined;
3448
+ paidAt?: undefined;
3449
+ })[] | null;
3450
+ export const convertInvoicePaymentFormToParams: (form: DedicatedInvoicePaymentForm) => unknown;
3451
+
3452
+ }
3453
+ declare module '@layerfi/components/components/Invoices/InvoicePaymentForm/useInvoicePaymentForm' {
3454
+ import { type InvoicePayment, type Invoice } from '@layerfi/components/features/invoices/invoiceSchemas';
3455
+ type onSuccessFn = (invoicePayment: InvoicePayment) => void;
3456
+ type UseInvoicePaymentFormProps = {
3457
+ onSuccess: onSuccessFn;
3458
+ invoice: Invoice;
3459
+ };
3460
+ export const useInvoicePaymentForm: (props: UseInvoicePaymentFormProps) => {
3461
+ form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<{
3462
+ readonly memo: string;
3463
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3464
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3465
+ readonly referenceNumber: string;
3466
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3467
+ }, import("@tanstack/react-form").FormValidateOrFn<{
3468
+ readonly memo: string;
3469
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3470
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3471
+ readonly referenceNumber: string;
3472
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3473
+ }>, import("@tanstack/react-form").FormValidateOrFn<{
3474
+ readonly memo: string;
3475
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3476
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3477
+ readonly referenceNumber: string;
3478
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3479
+ }>, import("@tanstack/react-form").FormAsyncValidateOrFn<{
3480
+ readonly memo: string;
3481
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3482
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3483
+ readonly referenceNumber: string;
3484
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3485
+ }>, import("@tanstack/react-form").FormValidateOrFn<{
3486
+ readonly memo: string;
3487
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3488
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3489
+ readonly referenceNumber: string;
3490
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3491
+ }>, import("@tanstack/react-form").FormAsyncValidateOrFn<{
3492
+ readonly memo: string;
3493
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3494
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3495
+ readonly referenceNumber: string;
3496
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3497
+ }>, import("@tanstack/react-form").FormValidateOrFn<{
3498
+ readonly memo: string;
3499
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3500
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3501
+ readonly referenceNumber: string;
3502
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3503
+ }>, import("@tanstack/react-form").FormAsyncValidateOrFn<{
3504
+ readonly memo: string;
3505
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3506
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3507
+ readonly referenceNumber: string;
3508
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3509
+ }>, import("@tanstack/react-form").FormValidateOrFn<{
3510
+ readonly memo: string;
3511
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3512
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3513
+ readonly referenceNumber: string;
3514
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3515
+ }>, import("@tanstack/react-form").FormAsyncValidateOrFn<{
3516
+ readonly memo: string;
3517
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3518
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3519
+ readonly referenceNumber: string;
3520
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3521
+ }>, import("@tanstack/react-form").FormAsyncValidateOrFn<{
3522
+ readonly memo: string;
3523
+ readonly amount: import("effect/BigDecimal").BigDecimal;
3524
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod | null;
3525
+ readonly referenceNumber: string;
3526
+ readonly paidAt: import("@internationalized/date").ZonedDateTime;
3527
+ }>, unknown, {
3528
+ readonly BaseFormTextField: typeof import("@layerfi/components/features/forms/components/BaseFormTextField").BaseFormTextField;
3529
+ readonly FormBigDecimalField: typeof import("@layerfi/components/features/forms/components/FormBigDecimalField").FormBigDecimalField;
3530
+ readonly FormCheckboxField: typeof import("@layerfi/components/features/forms/components/FormCheckboxField").FormCheckboxField;
3531
+ readonly FormDateField: typeof import("@layerfi/components/features/forms/components/FormDateField").FormDateField;
3532
+ readonly FormTextAreaField: typeof import("@layerfi/components/features/forms/components/FormTextAreaField").FormTextAreaField;
3533
+ readonly FormTextField: typeof import("@layerfi/components/features/forms/components/FormTextField").FormTextField;
3534
+ }, {}>;
3535
+ submitError: string | undefined;
3407
3536
  };
3408
3537
  export {};
3409
3538
 
@@ -3415,6 +3544,32 @@ declare module '@layerfi/components/components/Invoices/InvoiceStatusCell/Invoic
3415
3544
  inline?: boolean;
3416
3545
  }) => import("react/jsx-runtime").JSX.Element;
3417
3546
 
3547
+ }
3548
+ declare module '@layerfi/components/components/Invoices/InvoiceSummaryStats/InvoiceSummaryStats' {
3549
+ export const InvoiceSummaryStats: () => import("react/jsx-runtime").JSX.Element;
3550
+
3551
+ }
3552
+ declare module '@layerfi/components/components/Invoices/InvoiceTable/InvoiceTable' {
3553
+ enum InvoiceStatusFilter {
3554
+ All = "All",
3555
+ Unpaid = "Unpaid",
3556
+ Overdue = "Overdue",
3557
+ Sent = "Sent",
3558
+ Paid = "Paid",
3559
+ WrittenOff = "Written Off",
3560
+ Voided = "Voided"
3561
+ }
3562
+ export type InvoiceStatusOption = {
3563
+ label: string;
3564
+ value: InvoiceStatusFilter;
3565
+ };
3566
+ export const ALL_OPTION: {
3567
+ label: string;
3568
+ value: InvoiceStatusFilter;
3569
+ };
3570
+ export const InvoiceTable: () => import("react/jsx-runtime").JSX.Element;
3571
+ export {};
3572
+
3418
3573
  }
3419
3574
  declare module '@layerfi/components/components/Invoices/InvoiceTermsComboBox/InvoiceTermsComboBox' {
3420
3575
  import { ZonedDateTime } from '@internationalized/date';
@@ -3445,17 +3600,7 @@ declare module '@layerfi/components/components/Invoices/Invoices' {
3445
3600
  showTitle?: boolean;
3446
3601
  stringOverrides?: InvoicesStringOverrides;
3447
3602
  }
3448
- export const unstable_Invoices: ({ showTitle, stringOverrides, }: InvoicesProps) => import("react/jsx-runtime").JSX.Element;
3449
- export {};
3450
-
3451
- }
3452
- declare module '@layerfi/components/components/Invoices/InvoicesTable/InvoicesTable' {
3453
- import { type Invoice } from '@layerfi/components/features/invoices/invoiceSchemas';
3454
- interface InvoicesTableProps {
3455
- onCreateInvoice: () => void;
3456
- onSelectInvoice: (invoice: Invoice) => void;
3457
- }
3458
- export const InvoicesTable: ({ onCreateInvoice, onSelectInvoice }: InvoicesTableProps) => import("react/jsx-runtime").JSX.Element;
3603
+ export const unstable_Invoices: ({ showTitle, stringOverrides }: InvoicesProps) => import("react/jsx-runtime").JSX.Element;
3459
3604
  export {};
3460
3605
 
3461
3606
  }
@@ -4034,6 +4179,32 @@ declare module '@layerfi/components/components/Panel/Panel' {
4034
4179
  declare module '@layerfi/components/components/Panel/index' {
4035
4180
  export { Panel } from '@layerfi/components/components/Panel/Panel';
4036
4181
 
4182
+ }
4183
+ declare module '@layerfi/components/components/PaymentMethod/PaymentMethodComboBox' {
4184
+ import { PaymentMethod } from '@layerfi/components/components/PaymentMethod/schemas';
4185
+ type PaymentMethodComboBoxProps = {
4186
+ value: PaymentMethod | null;
4187
+ onValueChange: (value: PaymentMethod | null) => void;
4188
+ isReadOnly?: boolean;
4189
+ className?: string;
4190
+ inline?: boolean;
4191
+ };
4192
+ export const PaymentMethodComboBox: ({ value, onValueChange, isReadOnly, className, inline }: PaymentMethodComboBoxProps) => import("react/jsx-runtime").JSX.Element;
4193
+ export {};
4194
+
4195
+ }
4196
+ declare module '@layerfi/components/components/PaymentMethod/schemas' {
4197
+ import { Schema } from 'effect';
4198
+ export enum PaymentMethod {
4199
+ Cash = "CASH",
4200
+ Check = "CHECK",
4201
+ CreditCard = "CREDIT_CARD",
4202
+ Ach = "ACH",
4203
+ Other = "Other"
4204
+ }
4205
+ export const PaymentMethodSchema: Schema.Enums<typeof PaymentMethod>;
4206
+ export const TransformedPaymentMethodSchema: Schema.transform<typeof Schema.NonEmptyTrimmedString, Schema.SchemaClass<PaymentMethod, PaymentMethod, never>>;
4207
+
4037
4208
  }
4038
4209
  declare module '@layerfi/components/components/PeriodPicker/PeriodPicker' {
4039
4210
  export type PeriodPickerOption = 'month' | 'quarter' | 'year' | '2_months' | '3_months' | '6_months' | '12_months' | '2_quarters' | '3_quarters' | '4_quarters' | '8_quarters' | '2_years' | '3_years';
@@ -4130,14 +4301,97 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
4130
4301
  ({ withReportsModeProvider, ...restProps }: Props): import("react/jsx-runtime").JSX.Element;
4131
4302
  Chart: ({ forceRerenderOnDataChange, tagFilter, }: import("@layerfi/components/components/ProfitAndLossChart/ProfitAndLossChart").Props) => import("react/jsx-runtime").JSX.Element;
4132
4303
  Context: import("react").Context<{
4133
- data: import("@layerfi/components/types").ProfitAndLoss | undefined;
4134
- filteredDataRevenue: never[] | import("@layerfi/components/types/line_item").LineBaseItem[];
4304
+ data: {
4305
+ readonly businessId: string;
4306
+ readonly startDate: Date;
4307
+ readonly endDate: Date;
4308
+ readonly income: {
4309
+ readonly value: number;
4310
+ readonly name: string;
4311
+ readonly displayName: string;
4312
+ readonly isContra: boolean;
4313
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4314
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4315
+ };
4316
+ readonly costOfGoodsSold: {
4317
+ readonly value: number;
4318
+ readonly name: string;
4319
+ readonly displayName: string;
4320
+ readonly isContra: boolean;
4321
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4322
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4323
+ };
4324
+ readonly grossProfit: number;
4325
+ readonly profitBeforeTaxes: number;
4326
+ readonly taxes: {
4327
+ readonly value: number;
4328
+ readonly name: string;
4329
+ readonly displayName: string;
4330
+ readonly isContra: boolean;
4331
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4332
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4333
+ };
4334
+ readonly netProfit: number;
4335
+ readonly fullyCategorized: boolean;
4336
+ readonly uncategorizedInflows?: {
4337
+ readonly value: number;
4338
+ readonly name: string;
4339
+ readonly displayName: string;
4340
+ readonly isContra: boolean;
4341
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4342
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4343
+ } | undefined;
4344
+ readonly uncategorizedOutflows?: {
4345
+ readonly value: number;
4346
+ readonly name: string;
4347
+ readonly displayName: string;
4348
+ readonly isContra: boolean;
4349
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4350
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4351
+ } | undefined;
4352
+ readonly grossProfitPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
4353
+ readonly profitBeforeTaxesPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
4354
+ readonly netProfitPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
4355
+ readonly expenses: {
4356
+ readonly value: number;
4357
+ readonly name: string;
4358
+ readonly displayName: string;
4359
+ readonly isContra: boolean;
4360
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4361
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4362
+ };
4363
+ readonly customLineItems: {
4364
+ readonly value: number;
4365
+ readonly name: string;
4366
+ readonly displayName: string;
4367
+ readonly isContra: boolean;
4368
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4369
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4370
+ } | null;
4371
+ readonly otherOutflows: {
4372
+ readonly value: number;
4373
+ readonly name: string;
4374
+ readonly displayName: string;
4375
+ readonly isContra: boolean;
4376
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4377
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4378
+ } | null;
4379
+ readonly personalExpenses: {
4380
+ readonly value: number;
4381
+ readonly name: string;
4382
+ readonly displayName: string;
4383
+ readonly isContra: boolean;
4384
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
4385
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
4386
+ } | null;
4387
+ } | undefined;
4388
+ filteredDataRevenue: never[] | import("@layerfi/components/utils/profitAndLossUtils").PnlChartLineItem[];
4135
4389
  filteredTotalRevenue: number | undefined;
4136
- filteredDataExpenses: never[] | import("@layerfi/components/types/line_item").LineBaseItem[];
4390
+ filteredDataExpenses: never[] | import("@layerfi/components/utils/profitAndLossUtils").PnlChartLineItem[];
4137
4391
  filteredTotalExpenses: number | undefined;
4138
4392
  isLoading: boolean;
4139
4393
  isValidating: boolean;
4140
- error: unknown;
4394
+ isError: boolean;
4141
4395
  refetch: () => void;
4142
4396
  sidebarScope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").SidebarScope;
4143
4397
  setSidebarScope: import("react").Dispatch<import("react").SetStateAction<import("../../hooks/useProfitAndLoss/useProfitAndLoss").SidebarScope>>;
@@ -4237,12 +4491,47 @@ declare module '@layerfi/components/components/ProfitAndLossDatePicker/ProfitAnd
4237
4491
  declare module '@layerfi/components/components/ProfitAndLossDatePicker/index' {
4238
4492
  export { ProfitAndLossDatePicker } from '@layerfi/components/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker';
4239
4493
 
4494
+ }
4495
+ declare module '@layerfi/components/components/ProfitAndLossDetailLinesDownloadButton/ProfitAndLossDetailLinesDownloadButton' {
4496
+ type ProfitAndLossDetailLinesDownloadButtonProps = {
4497
+ pnlStructureLineItemName: string;
4498
+ iconOnly?: boolean;
4499
+ };
4500
+ export function ProfitAndLossDetailLinesDownloadButton({ pnlStructureLineItemName, iconOnly, }: ProfitAndLossDetailLinesDownloadButtonProps): import("react/jsx-runtime").JSX.Element;
4501
+ export {};
4502
+
4503
+ }
4504
+ declare module '@layerfi/components/components/ProfitAndLossDetailLinesDownloadButton/index' {
4505
+ export { ProfitAndLossDetailLinesDownloadButton } from '@layerfi/components/components/ProfitAndLossDetailLinesDownloadButton/ProfitAndLossDetailLinesDownloadButton';
4506
+
4507
+ }
4508
+ declare module '@layerfi/components/components/ProfitAndLossDetailReport/ProfitAndLossDetailReport' {
4509
+ import { BreadcrumbItem } from '@layerfi/components/components/DetailReportBreadcrumb/DetailReportBreadcrumb';
4510
+ export interface ProfitAndLossDetailReportStringOverrides {
4511
+ title?: string;
4512
+ dateColumnHeader?: string;
4513
+ typeColumnHeader?: string;
4514
+ accountColumnHeader?: string;
4515
+ descriptionColumnHeader?: string;
4516
+ amountColumnHeader?: string;
4517
+ balanceColumnHeader?: string;
4518
+ sourceDetailsTitle?: string;
4519
+ }
4520
+ export interface ProfitAndLossDetailReportProps {
4521
+ lineItemName: string;
4522
+ breadcrumbPath?: BreadcrumbItem[];
4523
+ onClose: () => void;
4524
+ onBreadcrumbClick?: (lineItemName: string) => void;
4525
+ stringOverrides?: ProfitAndLossDetailReportStringOverrides;
4526
+ }
4527
+ export const ProfitAndLossDetailReport: ({ lineItemName, breadcrumbPath, onClose, onBreadcrumbClick, stringOverrides, }: ProfitAndLossDetailReportProps) => import("react/jsx-runtime").JSX.Element;
4528
+
4240
4529
  }
4241
4530
  declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/DetailedChart' {
4242
4531
  import { SidebarScope } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
4243
- import { LineBaseItem } from '@layerfi/components/types/line_item';
4532
+ import type { PnlChartLineItem } from '@layerfi/components/utils/profitAndLossUtils';
4244
4533
  interface DetailedChartProps {
4245
- filteredData: LineBaseItem[];
4534
+ filteredData: PnlChartLineItem[];
4246
4535
  filteredTotal?: number;
4247
4536
  hoveredItem?: string;
4248
4537
  setHoveredItem: (name?: string) => void;
@@ -4259,14 +4548,14 @@ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Detai
4259
4548
  declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/DetailedTable' {
4260
4549
  import { Scope, SidebarScope, ProfitAndLossFilters } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
4261
4550
  import { SortDirection } from '@layerfi/components/types';
4262
- import { LineBaseItem } from '@layerfi/components/types/line_item';
4551
+ import type { PnlChartLineItem } from '@layerfi/components/utils/profitAndLossUtils';
4263
4552
  export interface DetailedTableStringOverrides {
4264
4553
  categoryColumnHeader?: string;
4265
4554
  typeColumnHeader?: string;
4266
4555
  valueColumnHeader?: string;
4267
4556
  }
4268
4557
  export interface DetailedTableProps {
4269
- filteredData: LineBaseItem[];
4558
+ filteredData: PnlChartLineItem[];
4270
4559
  hoveredItem?: string;
4271
4560
  setHoveredItem: (name?: string) => void;
4272
4561
  sidebarScope: SidebarScope;
@@ -4279,15 +4568,15 @@ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Detai
4279
4568
  color: string;
4280
4569
  opacity: number;
4281
4570
  }
4282
- export const mapTypesToColors: (data: LineBaseItem[], colorList?: string[]) => TypeColorMapping[];
4571
+ export const mapTypesToColors: (data: PnlChartLineItem[], colorList?: string[]) => TypeColorMapping[];
4283
4572
  export const DetailedTable: ({ filteredData, sidebarScope, filters, sortBy, hoveredItem, setHoveredItem, chartColorsList, stringOverrides, }: DetailedTableProps) => import("react/jsx-runtime").JSX.Element;
4284
4573
 
4285
4574
  }
4286
4575
  declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Filters' {
4287
4576
  import { Scope, SidebarScope, ProfitAndLossFilters } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
4288
- import { LineBaseItem } from '@layerfi/components/types/line_item';
4577
+ import type { PnlChartLineItem } from '@layerfi/components/utils/profitAndLossUtils';
4289
4578
  export interface FiltersProps {
4290
- filteredData: LineBaseItem[];
4579
+ filteredData: PnlChartLineItem[];
4291
4580
  sidebarScope: SidebarScope;
4292
4581
  filters: ProfitAndLossFilters;
4293
4582
  setFilterTypes: (scope: Scope, types: string[]) => void;
@@ -4415,16 +4704,16 @@ declare module '@layerfi/components/components/ProfitAndLossSummaries/internal/P
4415
4704
 
4416
4705
  }
4417
4706
  declare module '@layerfi/components/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesMiniChart' {
4707
+ import type { ProfitAndLoss } from '@layerfi/components/hooks/useProfitAndLoss/schemas';
4418
4708
  import type { Scope } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
4419
- import type { ProfitAndLoss } from '@layerfi/components/types';
4420
- import type { LineBaseItem } from '@layerfi/components/types/line_item';
4709
+ import { type PnlChartLineItem } from '@layerfi/components/utils/profitAndLossUtils';
4421
4710
  import { Variants } from '@layerfi/components/utils/styleUtils/sizeVariants';
4422
4711
  export function toMiniChartData({ scope, data, }: {
4423
4712
  scope: Scope;
4424
4713
  data?: ProfitAndLoss;
4425
- }): LineBaseItem[];
4714
+ }): PnlChartLineItem[];
4426
4715
  type ProfitAndLossMiniChartProps = {
4427
- data: LineBaseItem[];
4716
+ data: PnlChartLineItem[];
4428
4717
  chartColorsList?: string[];
4429
4718
  variants?: Variants;
4430
4719
  };
@@ -4458,6 +4747,7 @@ declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossC
4458
4747
 
4459
4748
  }
4460
4749
  declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableComponent' {
4750
+ import { BreadcrumbItem } from '@layerfi/components/components/DetailReportBreadcrumb/DetailReportBreadcrumb';
4461
4751
  export interface ProfitAndLossTableStringOverrides {
4462
4752
  grossProfitLabel?: string;
4463
4753
  profitBeforeTaxesLabel?: string;
@@ -4467,20 +4757,15 @@ declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossT
4467
4757
  lockExpanded?: boolean;
4468
4758
  asContainer?: boolean;
4469
4759
  stringOverrides?: ProfitAndLossTableStringOverrides;
4760
+ onLineItemClick?: (lineItemName: string, breadcrumbPath: BreadcrumbItem[]) => void;
4470
4761
  };
4471
- export const ProfitAndLossTableComponent: ({ asContainer, stringOverrides, }: ProfitAndLossTableProps) => import("react/jsx-runtime").JSX.Element;
4762
+ export const ProfitAndLossTableComponent: ({ asContainer, stringOverrides, onLineItemClick, }: ProfitAndLossTableProps) => import("react/jsx-runtime").JSX.Element;
4472
4763
 
4473
4764
  }
4474
4765
  declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableWithProvider' {
4475
4766
  import { ProfitAndLossTableProps } from '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableComponent';
4476
4767
  export const ProfitAndLossTableWithProvider: (props: ProfitAndLossTableProps) => import("react/jsx-runtime").JSX.Element;
4477
4768
 
4478
- }
4479
- declare module '@layerfi/components/components/ProfitAndLossTable/empty_profit_and_loss_report' {
4480
- import { ProfitAndLoss } from '@layerfi/components/types';
4481
- const _default: ProfitAndLoss;
4482
- export default _default;
4483
-
4484
4769
  }
4485
4770
  declare module '@layerfi/components/components/ProfitAndLossTable/index' {
4486
4771
  export { ProfitAndLossTableWithProvider as ProfitAndLossTable } from '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableWithProvider';
@@ -4560,12 +4845,18 @@ declare module '@layerfi/components/components/SkeletonBalanceSheetRow/index' {
4560
4845
 
4561
4846
  }
4562
4847
  declare module '@layerfi/components/components/SkeletonLoader/SkeletonLoader' {
4848
+ import type { PropsWithChildren } from 'react';
4563
4849
  export interface SkeletonLoaderProps {
4564
4850
  width?: string;
4565
4851
  height?: string;
4566
4852
  className?: string;
4567
4853
  }
4568
4854
  export const SkeletonLoader: ({ height, width, className, }: SkeletonLoaderProps) => import("react/jsx-runtime").JSX.Element;
4855
+ type FallbackWithSkeletonLoader = PropsWithChildren<SkeletonLoaderProps> & {
4856
+ isLoading: boolean;
4857
+ };
4858
+ export const FallbackWithSkeletonLoader: ({ height, width, isLoading, children, className, }: FallbackWithSkeletonLoader) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
4859
+ export {};
4569
4860
 
4570
4861
  }
4571
4862
  declare module '@layerfi/components/components/SkeletonLoader/index' {
@@ -5249,6 +5540,9 @@ declare module '@layerfi/components/components/UploadTransactions/template' {
5249
5540
  export const templateHeaders: {
5250
5541
  [K in keyof CustomAccountTransactionRow]: string;
5251
5542
  };
5543
+ export const allHeaders: {
5544
+ [K in keyof CustomAccountTransactionRow]: string;
5545
+ };
5252
5546
  export const templateExampleTransactions: CustomAccountTransactionRow[];
5253
5547
 
5254
5548
  }
@@ -5323,6 +5617,30 @@ declare module '@layerfi/components/components/ViewHeader/ViewHeader' {
5323
5617
  declare module '@layerfi/components/components/ViewHeader/index' {
5324
5618
  export { ViewHeader } from '@layerfi/components/components/ViewHeader/ViewHeader';
5325
5619
 
5620
+ }
5621
+ declare module '@layerfi/components/components/VirtualizedDataTable/VirtualizedDataTable' {
5622
+ import type { ColumnConfig } from '@layerfi/components/components/DataTable/DataTable';
5623
+ export interface VirtualizedDataTableProps<TData extends {
5624
+ id: string;
5625
+ }, TColumns extends string> {
5626
+ columnConfig: ColumnConfig<TData, TColumns>;
5627
+ data: TData[] | undefined;
5628
+ componentName: string;
5629
+ ariaLabel: string;
5630
+ isLoading: boolean;
5631
+ isError: boolean;
5632
+ slots: {
5633
+ EmptyState: React.FC;
5634
+ ErrorState: React.FC;
5635
+ };
5636
+ height?: number;
5637
+ rowHeight?: number;
5638
+ overscan?: number;
5639
+ }
5640
+ export const VirtualizedDataTable: <TData extends {
5641
+ id: string;
5642
+ }, TColumns extends string>({ columnConfig, data, isLoading, isError, componentName, ariaLabel, slots, height, rowHeight, overscan, }: VirtualizedDataTableProps<TData, TColumns>) => import("react/jsx-runtime").JSX.Element;
5643
+
5326
5644
  }
5327
5645
  declare module '@layerfi/components/components/Wizard/Wizard' {
5328
5646
  import { type PropsWithChildren, type ReactNode } from 'react';
@@ -5521,18 +5839,7 @@ declare module '@layerfi/components/components/ui/ListBox/ListBox' {
5521
5839
  }) => ReturnType<typeof InternalListBoxSection>;
5522
5840
  export const ListBoxSectionHeader: import("react").ForwardRefExoticComponent<Omit<Omit<Pick<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "id" | "slot"> & {
5523
5841
  nonAria?: true;
5524
- } & {
5525
- align?: "center" | "right";
5526
- ellipsis?: true;
5527
- noWrap?: true;
5528
- pb?: import("@layerfi/components/components/ui/sharedUITypes").Spacing;
5529
- pbe?: import("@layerfi/components/components/ui/sharedUITypes").Spacing;
5530
- pbs?: import("@layerfi/components/components/ui/sharedUITypes").Spacing;
5531
- size?: "xs" | "sm" | "md" | "lg";
5532
- status?: "error";
5533
- variant?: "placeholder" | "subtle";
5534
- weight?: "normal" | "bold";
5535
- } & {
5842
+ } & import("@layerfi/components/components/ui/Typography/Text").TextStyleProps & {
5536
5843
  children?: import("react").ReactNode | undefined;
5537
5844
  } & import("react").RefAttributes<HTMLElement>, "slot">, "ref"> & import("react").RefAttributes<HTMLElement>>;
5538
5845
  type ListBoxItemProps<T extends Record<string, unknown>> = Omit<ReactAriaListBoxItemProps<T>, 'className'>;
@@ -5557,24 +5864,42 @@ declare module '@layerfi/components/components/ui/Menu/Menu' {
5557
5864
  children?: import("react").ReactNode | undefined;
5558
5865
  } & Pick<ReactAriaMenuItemProps<object>, "textValue" | "onAction"> & import("react").RefAttributes<HTMLDivElement>>;
5559
5866
 
5867
+ }
5868
+ declare module '@layerfi/components/components/ui/Meter/Meter' {
5869
+ import { MeterProps as ReactAriaMeterProps } from 'react-aria-components';
5870
+ export const Meter: import("react").ForwardRefExoticComponent<Omit<ReactAriaMeterProps, "children" | "className"> & {
5871
+ label: string;
5872
+ meterOnly?: boolean;
5873
+ className?: string;
5874
+ } & import("react").RefAttributes<HTMLDivElement>>;
5875
+
5560
5876
  }
5561
5877
  declare module '@layerfi/components/components/ui/Modal/Modal' {
5562
5878
  import { type ComponentProps } from 'react';
5563
5879
  import { type DialogProps, type ModalOverlayProps } from 'react-aria-components';
5564
5880
  type ModalSize = 'md' | 'lg';
5565
- const ModalOverlay: import("react").ForwardRefExoticComponent<Omit<ModalOverlayProps, "className"> & import("react").RefAttributes<HTMLDivElement>>;
5881
+ type ModalVariant = 'center' | 'drawer';
5882
+ const ModalOverlay: import("react").ForwardRefExoticComponent<Omit<ModalOverlayProps, "className"> & {
5883
+ variant: ModalVariant;
5884
+ } & import("react").RefAttributes<HTMLDivElement>>;
5566
5885
  const InternalModal: import("react").ForwardRefExoticComponent<{
5567
5886
  size?: ModalSize;
5568
5887
  flexBlock?: boolean;
5888
+ variant?: ModalVariant;
5569
5889
  } & {
5570
5890
  children?: import("react").ReactNode | undefined;
5571
5891
  } & import("react").RefAttributes<HTMLDivElement>>;
5572
- const Dialog: import("react").ForwardRefExoticComponent<Omit<DialogProps, "className"> & import("react").RefAttributes<HTMLElement>>;
5892
+ const Dialog: import("react").ForwardRefExoticComponent<Omit<DialogProps, "className"> & {
5893
+ variant: ModalVariant;
5894
+ } & import("react").RefAttributes<HTMLElement>>;
5573
5895
  type AllowedModalOverlayProps = Pick<ComponentProps<typeof ModalOverlay>, 'isOpen' | 'onOpenChange'>;
5574
5896
  type AllowedInternalModalProps = Pick<ComponentProps<typeof InternalModal>, 'flexBlock' | 'size'>;
5575
5897
  type AllowedDialogProps = Pick<ComponentProps<typeof Dialog>, 'children' | 'role' | 'aria-label'>;
5576
5898
  export type ModalProps = AllowedModalOverlayProps & AllowedInternalModalProps & AllowedDialogProps;
5577
5899
  export function Modal({ isOpen, size, flexBlock, onOpenChange, children, 'aria-label': ariaLabel, role, }: ModalProps): import("react/jsx-runtime").JSX.Element;
5900
+ type AllowedInternalDrawerProps = Pick<ComponentProps<typeof InternalModal>, 'size'>;
5901
+ export type DrawerProps = AllowedModalOverlayProps & AllowedInternalDrawerProps & AllowedDialogProps;
5902
+ export function Drawer({ isOpen, onOpenChange, size, children, 'aria-label': ariaLabel, role, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
5578
5903
  export {};
5579
5904
 
5580
5905
  }
@@ -5600,18 +5925,7 @@ declare module '@layerfi/components/components/ui/Modal/ModalSlots' {
5600
5925
  }, "ref"> & import("react").RefAttributes<HTMLHeadingElement>, "slot" | "level">, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
5601
5926
  export const ModalDescription: import("react").ForwardRefExoticComponent<Omit<Omit<Pick<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "id" | "slot"> & {
5602
5927
  nonAria?: true;
5603
- } & {
5604
- align?: "center" | "right";
5605
- ellipsis?: true;
5606
- noWrap?: true;
5607
- pb?: import("@layerfi/components/components/ui/sharedUITypes").Spacing;
5608
- pbe?: import("@layerfi/components/components/ui/sharedUITypes").Spacing;
5609
- pbs?: import("@layerfi/components/components/ui/sharedUITypes").Spacing;
5610
- size?: "xs" | "sm" | "md" | "lg";
5611
- status?: "error";
5612
- variant?: "placeholder" | "subtle";
5613
- weight?: "normal" | "bold";
5614
- } & {
5928
+ } & import("@layerfi/components/components/ui/Typography/Text").TextStyleProps & {
5615
5929
  children?: import("react").ReactNode | undefined;
5616
5930
  } & import("react").RefAttributes<HTMLParagraphElement>, "slot">, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
5617
5931
  export function ModalContent({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -5781,14 +6095,14 @@ declare module '@layerfi/components/components/ui/Typography/MoneyText' {
5781
6095
  }
5782
6096
  declare module '@layerfi/components/components/ui/Typography/Text' {
5783
6097
  import type { Spacing } from '@layerfi/components/components/ui/sharedUITypes';
5784
- type TextStyleProps = {
6098
+ export type TextStyleProps = {
5785
6099
  align?: 'center' | 'right';
5786
6100
  ellipsis?: true;
5787
6101
  noWrap?: true;
5788
6102
  pb?: Spacing;
5789
6103
  pbe?: Spacing;
5790
6104
  pbs?: Spacing;
5791
- size?: 'xs' | 'sm' | 'md' | 'lg';
6105
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5792
6106
  status?: 'error';
5793
6107
  variant?: 'placeholder' | 'subtle';
5794
6108
  weight?: 'normal' | 'bold';
@@ -6158,6 +6472,7 @@ declare module '@layerfi/components/contexts/ChartOfAccountsContext/ChartOfAccou
6158
6472
  apiError: string | undefined;
6159
6473
  addAccount: () => void;
6160
6474
  editAccount: (id: string) => void;
6475
+ deleteAccount: (accountId: string) => Promise<void>;
6161
6476
  cancelForm: () => void;
6162
6477
  changeFormData: (fieldName: string, value: string | import("@layerfi/components/types/general").BaseSelectOption | undefined) => void;
6163
6478
  submitForm: () => void;
@@ -6748,7 +7063,7 @@ declare module '@layerfi/components/features/forms/components/FormBigDecimalFiel
6748
7063
  import { BigDecimal as BD } from 'effect';
6749
7064
  import { type BaseFormTextFieldProps } from '@layerfi/components/features/forms/components/BaseFormTextField';
6750
7065
  type FormBigDecimalFieldProps = Omit<BaseFormTextFieldProps, 'inputMode' | 'isTextArea'> & {
6751
- maxValue?: number;
7066
+ maxValue?: BD.BigDecimal;
6752
7067
  minDecimalPlaces?: number;
6753
7068
  maxDecimalPlaces?: number;
6754
7069
  allowNegative?: boolean;
@@ -6807,8 +7122,8 @@ declare module '@layerfi/components/features/forms/hooks/useForm' {
6807
7122
  import { FormDateField } from '@layerfi/components/features/forms/components/FormDateField';
6808
7123
  import { FormTextAreaField } from '@layerfi/components/features/forms/components/FormTextAreaField';
6809
7124
  import { FormTextField } from '@layerfi/components/features/forms/components/FormTextField';
6810
- export const fieldContext: import("react").Context<import("@tanstack/react-form").AnyFieldApi>, useFieldContext: <TData>() => import("@tanstack/react-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, formContext: import("react").Context<import("@tanstack/react-form").AnyFormApi>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any>;
6811
- export function useAppForm<T>(props: FormOptions<T, FormValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormAsyncValidateOrFn<T>, unknown>): import("@tanstack/react-form/dist/esm/createFormHook").AppFieldExtendedReactFormApi<T, FormValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormAsyncValidateOrFn<T>, unknown, {
7125
+ export const fieldContext: import("react").Context<import("@tanstack/react-form").AnyFieldApi>, useFieldContext: <TData>() => import("@tanstack/react-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, formContext: import("react").Context<import("@tanstack/react-form").AnyFormApi>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
7126
+ export function useAppForm<T extends Record<string, unknown>>(props: FormOptions<T, FormValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormAsyncValidateOrFn<T>, unknown>): import("@tanstack/react-form").AppFieldExtendedReactFormApi<T, FormValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormAsyncValidateOrFn<T>, unknown, {
6812
7127
  readonly BaseFormTextField: typeof BaseFormTextField;
6813
7128
  readonly FormBigDecimalField: typeof FormBigDecimalField;
6814
7129
  readonly FormCheckboxField: typeof FormCheckboxField;
@@ -6816,6 +7131,7 @@ declare module '@layerfi/components/features/forms/hooks/useForm' {
6816
7131
  readonly FormTextAreaField: typeof FormTextAreaField;
6817
7132
  readonly FormTextField: typeof FormTextField;
6818
7133
  }, {}>;
7134
+ export function useForm<T extends Record<string, unknown>>(props: FormOptions<T, FormValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormAsyncValidateOrFn<T>, unknown>): import("@tanstack/react-form").ReactFormExtendedApi<T, FormValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormValidateOrFn<T>, FormAsyncValidateOrFn<T>, FormAsyncValidateOrFn<T>, unknown>;
6819
7135
 
6820
7136
  }
6821
7137
  declare module '@layerfi/components/features/forms/types' {
@@ -6828,6 +7144,35 @@ declare module '@layerfi/components/features/forms/types' {
6828
7144
  isReadOnly?: boolean;
6829
7145
  }
6830
7146
 
7147
+ }
7148
+ declare module '@layerfi/components/features/invoices/api/useInvoiceSummaryStats' {
7149
+ import { type SWRResponse } from 'swr';
7150
+ import { type InvoiceSummaryStatsResponse } from '@layerfi/components/features/invoices/invoiceSchemas';
7151
+ export const INVOICE_SUMMARY_STATS_TAG_KEY = "#invoices-summary-stats";
7152
+ class InvoiceSummaryStatsSWRResponse {
7153
+ private swrResponse;
7154
+ constructor(swrResponse: SWRResponse<InvoiceSummaryStatsResponse>);
7155
+ get data(): {
7156
+ readonly invoices: {
7157
+ readonly overdueCount: number;
7158
+ readonly overdueTotal: bigint;
7159
+ readonly sentCount: number;
7160
+ readonly sentTotal: bigint;
7161
+ };
7162
+ readonly invoicePayments: {
7163
+ readonly sumTotal: bigint;
7164
+ };
7165
+ } | undefined;
7166
+ get isLoading(): boolean;
7167
+ get isValidating(): boolean;
7168
+ get isError(): boolean;
7169
+ }
7170
+ export function useInvoiceSummaryStats(): InvoiceSummaryStatsSWRResponse;
7171
+ export const useInvoiceSummaryStatsCacheActions: () => {
7172
+ forceReloadInvoiceSummaryStats: () => Promise<undefined[]>;
7173
+ };
7174
+ export {};
7175
+
6831
7176
  }
6832
7177
  declare module '@layerfi/components/features/invoices/api/useListInvoices' {
6833
7178
  import { type SWRInfiniteResponse } from 'swr/infinite';
@@ -6880,10 +7225,10 @@ declare module '@layerfi/components/features/invoices/api/useListInvoices' {
6880
7225
  readonly externalId: string | null;
6881
7226
  readonly memo: string | null;
6882
7227
  readonly description: string | null;
7228
+ readonly invoiceId: string;
6883
7229
  readonly product: string | null;
6884
7230
  readonly subtotal: number;
6885
7231
  readonly quantity: import("effect/BigDecimal").BigDecimal;
6886
- readonly invoiceId: string;
6887
7232
  readonly unitPrice: number;
6888
7233
  readonly discountAmount: number;
6889
7234
  readonly salesTaxTotal: number;
@@ -6893,10 +7238,10 @@ declare module '@layerfi/components/features/invoices/api/useListInvoices' {
6893
7238
  readonly external_id: string | null;
6894
7239
  readonly memo: string | null;
6895
7240
  readonly description: string | null;
7241
+ readonly invoice_id: string;
6896
7242
  readonly product: string | null;
6897
7243
  readonly subtotal: number;
6898
7244
  readonly quantity: string;
6899
- readonly invoice_id: string;
6900
7245
  readonly unit_price: number;
6901
7246
  readonly discount_amount: number;
6902
7247
  readonly sales_taxes_total: number;
@@ -6945,29 +7290,29 @@ declare module '@layerfi/components/features/invoices/api/useListInvoices' {
6945
7290
  } | undefined;
6946
7291
  } | null;
6947
7292
  readonly businessId: string;
6948
- readonly updatedAt: Date | null;
6949
- readonly subtotal: number;
6950
- readonly paidAt: Date | null;
6951
- readonly totalAmount: number;
6952
- readonly sentAt: Date | null;
6953
- readonly dueAt: Date | null;
6954
- readonly voidedAt: Date | null;
6955
- readonly invoiceNumber: string | null;
6956
- readonly recipientName: string | null;
6957
7293
  readonly lineItems: readonly {
6958
7294
  readonly id: string;
6959
7295
  readonly externalId: string | null;
6960
7296
  readonly memo: string | null;
6961
7297
  readonly description: string | null;
7298
+ readonly invoiceId: string;
6962
7299
  readonly product: string | null;
6963
7300
  readonly subtotal: number;
6964
7301
  readonly quantity: import("effect/BigDecimal").BigDecimal;
6965
- readonly invoiceId: string;
6966
7302
  readonly unitPrice: number;
6967
7303
  readonly discountAmount: number;
6968
7304
  readonly salesTaxTotal: number;
6969
7305
  readonly totalAmount: number;
6970
7306
  }[];
7307
+ readonly invoiceNumber: string | null;
7308
+ readonly recipientName: string | null;
7309
+ readonly updatedAt: Date | null;
7310
+ readonly subtotal: number;
7311
+ readonly paidAt: Date | null;
7312
+ readonly totalAmount: number;
7313
+ readonly sentAt: Date | null;
7314
+ readonly dueAt: Date | null;
7315
+ readonly voidedAt: Date | null;
6971
7316
  readonly additionalDiscount: number;
6972
7317
  readonly additionalSalesTaxesTotal: number;
6973
7318
  readonly outstandingBalance: number;
@@ -7004,29 +7349,29 @@ declare module '@layerfi/components/features/invoices/api/useListInvoices' {
7004
7349
  } | undefined;
7005
7350
  } | null;
7006
7351
  readonly businessId: string;
7007
- readonly updatedAt: Date | null;
7008
- readonly subtotal: number;
7009
- readonly paidAt: Date | null;
7010
- readonly totalAmount: number;
7011
- readonly sentAt: Date | null;
7012
- readonly dueAt: Date | null;
7013
- readonly voidedAt: Date | null;
7014
- readonly invoiceNumber: string | null;
7015
- readonly recipientName: string | null;
7016
7352
  readonly lineItems: readonly {
7017
7353
  readonly id: string;
7018
7354
  readonly externalId: string | null;
7019
7355
  readonly memo: string | null;
7020
7356
  readonly description: string | null;
7357
+ readonly invoiceId: string;
7021
7358
  readonly product: string | null;
7022
7359
  readonly subtotal: number;
7023
7360
  readonly quantity: import("effect/BigDecimal").BigDecimal;
7024
- readonly invoiceId: string;
7025
7361
  readonly unitPrice: number;
7026
7362
  readonly discountAmount: number;
7027
7363
  readonly salesTaxTotal: number;
7028
7364
  readonly totalAmount: number;
7029
7365
  }[];
7366
+ readonly invoiceNumber: string | null;
7367
+ readonly recipientName: string | null;
7368
+ readonly updatedAt: Date | null;
7369
+ readonly subtotal: number;
7370
+ readonly paidAt: Date | null;
7371
+ readonly totalAmount: number;
7372
+ readonly sentAt: Date | null;
7373
+ readonly dueAt: Date | null;
7374
+ readonly voidedAt: Date | null;
7030
7375
  readonly additionalDiscount: number;
7031
7376
  readonly additionalSalesTaxesTotal: number;
7032
7377
  readonly outstandingBalance: number;
@@ -7065,33 +7410,33 @@ declare module '@layerfi/components/features/invoices/api/useListInvoices' {
7065
7410
  } | undefined;
7066
7411
  } | null;
7067
7412
  readonly businessId: string;
7068
- readonly updatedAt: Date | null;
7069
- readonly subtotal: number;
7070
- readonly paidAt: Date | null;
7071
- readonly totalAmount: number;
7072
- readonly sentAt: Date | null;
7073
- readonly dueAt: Date | null;
7074
- readonly voidedAt: Date | null;
7075
- readonly invoiceNumber: string | null;
7076
- readonly recipientName: string | null;
7077
7413
  readonly lineItems: readonly {
7078
7414
  readonly id: string;
7079
7415
  readonly externalId: string | null;
7080
7416
  readonly memo: string | null;
7081
7417
  readonly description: string | null;
7418
+ readonly invoiceId: string;
7082
7419
  readonly product: string | null;
7083
7420
  readonly subtotal: number;
7084
7421
  readonly quantity: import("effect/BigDecimal").BigDecimal;
7085
- readonly invoiceId: string;
7086
7422
  readonly unitPrice: number;
7087
7423
  readonly discountAmount: number;
7088
7424
  readonly salesTaxTotal: number;
7089
7425
  readonly totalAmount: number;
7090
7426
  }[];
7091
- readonly additionalDiscount: number;
7092
- readonly additionalSalesTaxesTotal: number;
7093
- readonly outstandingBalance: number;
7094
- readonly importedAt: Date;
7427
+ readonly invoiceNumber: string | null;
7428
+ readonly recipientName: string | null;
7429
+ readonly updatedAt: Date | null;
7430
+ readonly subtotal: number;
7431
+ readonly paidAt: Date | null;
7432
+ readonly totalAmount: number;
7433
+ readonly sentAt: Date | null;
7434
+ readonly dueAt: Date | null;
7435
+ readonly voidedAt: Date | null;
7436
+ readonly additionalDiscount: number;
7437
+ readonly additionalSalesTaxesTotal: number;
7438
+ readonly outstandingBalance: number;
7439
+ readonly importedAt: Date;
7095
7440
  }[];
7096
7441
  readonly meta: {
7097
7442
  readonly pagination: {
@@ -7126,29 +7471,29 @@ declare module '@layerfi/components/features/invoices/api/useListInvoices' {
7126
7471
  } | undefined;
7127
7472
  } | null;
7128
7473
  readonly businessId: string;
7129
- readonly updatedAt: Date | null;
7130
- readonly subtotal: number;
7131
- readonly paidAt: Date | null;
7132
- readonly totalAmount: number;
7133
- readonly sentAt: Date | null;
7134
- readonly dueAt: Date | null;
7135
- readonly voidedAt: Date | null;
7136
- readonly invoiceNumber: string | null;
7137
- readonly recipientName: string | null;
7138
7474
  readonly lineItems: readonly {
7139
7475
  readonly id: string;
7140
7476
  readonly externalId: string | null;
7141
7477
  readonly memo: string | null;
7142
7478
  readonly description: string | null;
7479
+ readonly invoiceId: string;
7143
7480
  readonly product: string | null;
7144
7481
  readonly subtotal: number;
7145
7482
  readonly quantity: import("effect/BigDecimal").BigDecimal;
7146
- readonly invoiceId: string;
7147
7483
  readonly unitPrice: number;
7148
7484
  readonly discountAmount: number;
7149
7485
  readonly salesTaxTotal: number;
7150
7486
  readonly totalAmount: number;
7151
7487
  }[];
7488
+ readonly invoiceNumber: string | null;
7489
+ readonly recipientName: string | null;
7490
+ readonly updatedAt: Date | null;
7491
+ readonly subtotal: number;
7492
+ readonly paidAt: Date | null;
7493
+ readonly totalAmount: number;
7494
+ readonly sentAt: Date | null;
7495
+ readonly dueAt: Date | null;
7496
+ readonly voidedAt: Date | null;
7152
7497
  readonly additionalDiscount: number;
7153
7498
  readonly additionalSalesTaxesTotal: number;
7154
7499
  readonly outstandingBalance: number;
@@ -7163,13 +7508,363 @@ declare module '@layerfi/components/features/invoices/api/useListInvoices' {
7163
7508
  };
7164
7509
  }>;
7165
7510
  export function useListInvoices({ status, dueAtStart, dueAtEnd, sortBy, sortOrder, limit, showTotalCount, }?: ListInvoicesOptions): ListInvoicesSWRResponse;
7166
- export function useInvoicesInvalidator(): {
7167
- invalidateInvoices: () => Promise<undefined[]>;
7168
- debouncedInvalidateInvoices: import("lodash").DebouncedFunc<() => Promise<undefined[]>>;
7511
+ export function useInvoicesGlobalCacheActions(): {
7512
+ patchInvoiceByKey: (updatedInvoice: Invoice) => Promise<({
7513
+ readonly data: readonly {
7514
+ readonly id: string;
7515
+ readonly externalId: string | null;
7516
+ readonly status: InvoiceStatus;
7517
+ readonly memo: string | null;
7518
+ readonly customer: {
7519
+ readonly id: string;
7520
+ readonly externalId: string | null;
7521
+ readonly individualName: string | null;
7522
+ readonly companyName: string | null;
7523
+ readonly email: string | null;
7524
+ readonly mobilePhone: string | null;
7525
+ readonly officePhone: string | null;
7526
+ readonly addressString: string | null;
7527
+ readonly status: "ACTIVE" | "ARCHIVED";
7528
+ readonly memo: string | null;
7529
+ readonly _local?: {
7530
+ readonly isOptimistic: boolean;
7531
+ } | undefined;
7532
+ } | null;
7533
+ readonly businessId: string;
7534
+ readonly lineItems: readonly {
7535
+ readonly id: string;
7536
+ readonly externalId: string | null;
7537
+ readonly memo: string | null;
7538
+ readonly description: string | null;
7539
+ readonly invoiceId: string;
7540
+ readonly product: string | null;
7541
+ readonly subtotal: number;
7542
+ readonly quantity: import("effect/BigDecimal").BigDecimal;
7543
+ readonly unitPrice: number;
7544
+ readonly discountAmount: number;
7545
+ readonly salesTaxTotal: number;
7546
+ readonly totalAmount: number;
7547
+ }[];
7548
+ readonly invoiceNumber: string | null;
7549
+ readonly recipientName: string | null;
7550
+ readonly updatedAt: Date | null;
7551
+ readonly subtotal: number;
7552
+ readonly paidAt: Date | null;
7553
+ readonly totalAmount: number;
7554
+ readonly sentAt: Date | null;
7555
+ readonly dueAt: Date | null;
7556
+ readonly voidedAt: Date | null;
7557
+ readonly additionalDiscount: number;
7558
+ readonly additionalSalesTaxesTotal: number;
7559
+ readonly outstandingBalance: number;
7560
+ readonly importedAt: Date;
7561
+ }[];
7562
+ readonly meta: {
7563
+ readonly pagination: {
7564
+ readonly cursor: string | null;
7565
+ readonly totalCount: number | undefined;
7566
+ readonly hasMore: boolean;
7567
+ };
7568
+ };
7569
+ } | {
7570
+ readonly data: readonly {
7571
+ readonly id: string;
7572
+ readonly externalId: string | null;
7573
+ readonly status: InvoiceStatus;
7574
+ readonly memo: string | null;
7575
+ readonly customer: {
7576
+ readonly id: string;
7577
+ readonly externalId: string | null;
7578
+ readonly individualName: string | null;
7579
+ readonly companyName: string | null;
7580
+ readonly email: string | null;
7581
+ readonly mobilePhone: string | null;
7582
+ readonly officePhone: string | null;
7583
+ readonly addressString: string | null;
7584
+ readonly status: "ACTIVE" | "ARCHIVED";
7585
+ readonly memo: string | null;
7586
+ readonly _local?: {
7587
+ readonly isOptimistic: boolean;
7588
+ } | undefined;
7589
+ } | null;
7590
+ readonly businessId: string;
7591
+ readonly lineItems: readonly {
7592
+ readonly id: string;
7593
+ readonly externalId: string | null;
7594
+ readonly memo: string | null;
7595
+ readonly description: string | null;
7596
+ readonly invoiceId: string;
7597
+ readonly product: string | null;
7598
+ readonly subtotal: number;
7599
+ readonly quantity: import("effect/BigDecimal").BigDecimal;
7600
+ readonly unitPrice: number;
7601
+ readonly discountAmount: number;
7602
+ readonly salesTaxTotal: number;
7603
+ readonly totalAmount: number;
7604
+ }[];
7605
+ readonly invoiceNumber: string | null;
7606
+ readonly recipientName: string | null;
7607
+ readonly updatedAt: Date | null;
7608
+ readonly subtotal: number;
7609
+ readonly paidAt: Date | null;
7610
+ readonly totalAmount: number;
7611
+ readonly sentAt: Date | null;
7612
+ readonly dueAt: Date | null;
7613
+ readonly voidedAt: Date | null;
7614
+ readonly additionalDiscount: number;
7615
+ readonly additionalSalesTaxesTotal: number;
7616
+ readonly outstandingBalance: number;
7617
+ readonly importedAt: Date;
7618
+ }[];
7619
+ readonly meta: {
7620
+ readonly pagination: {
7621
+ readonly cursor: string | null;
7622
+ readonly totalCount: number | undefined;
7623
+ readonly hasMore: boolean;
7624
+ };
7625
+ };
7626
+ }[] | undefined)[]>;
7627
+ patchInvoiceWithTransformation: (transformation: (invoice: Invoice) => Invoice) => Promise<({
7628
+ readonly data: readonly {
7629
+ readonly id: string;
7630
+ readonly externalId: string | null;
7631
+ readonly status: InvoiceStatus;
7632
+ readonly memo: string | null;
7633
+ readonly customer: {
7634
+ readonly id: string;
7635
+ readonly externalId: string | null;
7636
+ readonly individualName: string | null;
7637
+ readonly companyName: string | null;
7638
+ readonly email: string | null;
7639
+ readonly mobilePhone: string | null;
7640
+ readonly officePhone: string | null;
7641
+ readonly addressString: string | null;
7642
+ readonly status: "ACTIVE" | "ARCHIVED";
7643
+ readonly memo: string | null;
7644
+ readonly _local?: {
7645
+ readonly isOptimistic: boolean;
7646
+ } | undefined;
7647
+ } | null;
7648
+ readonly businessId: string;
7649
+ readonly lineItems: readonly {
7650
+ readonly id: string;
7651
+ readonly externalId: string | null;
7652
+ readonly memo: string | null;
7653
+ readonly description: string | null;
7654
+ readonly invoiceId: string;
7655
+ readonly product: string | null;
7656
+ readonly subtotal: number;
7657
+ readonly quantity: import("effect/BigDecimal").BigDecimal;
7658
+ readonly unitPrice: number;
7659
+ readonly discountAmount: number;
7660
+ readonly salesTaxTotal: number;
7661
+ readonly totalAmount: number;
7662
+ }[];
7663
+ readonly invoiceNumber: string | null;
7664
+ readonly recipientName: string | null;
7665
+ readonly updatedAt: Date | null;
7666
+ readonly subtotal: number;
7667
+ readonly paidAt: Date | null;
7668
+ readonly totalAmount: number;
7669
+ readonly sentAt: Date | null;
7670
+ readonly dueAt: Date | null;
7671
+ readonly voidedAt: Date | null;
7672
+ readonly additionalDiscount: number;
7673
+ readonly additionalSalesTaxesTotal: number;
7674
+ readonly outstandingBalance: number;
7675
+ readonly importedAt: Date;
7676
+ }[];
7677
+ readonly meta: {
7678
+ readonly pagination: {
7679
+ readonly cursor: string | null;
7680
+ readonly totalCount: number | undefined;
7681
+ readonly hasMore: boolean;
7682
+ };
7683
+ };
7684
+ } | {
7685
+ readonly data: readonly {
7686
+ readonly id: string;
7687
+ readonly externalId: string | null;
7688
+ readonly status: InvoiceStatus;
7689
+ readonly memo: string | null;
7690
+ readonly customer: {
7691
+ readonly id: string;
7692
+ readonly externalId: string | null;
7693
+ readonly individualName: string | null;
7694
+ readonly companyName: string | null;
7695
+ readonly email: string | null;
7696
+ readonly mobilePhone: string | null;
7697
+ readonly officePhone: string | null;
7698
+ readonly addressString: string | null;
7699
+ readonly status: "ACTIVE" | "ARCHIVED";
7700
+ readonly memo: string | null;
7701
+ readonly _local?: {
7702
+ readonly isOptimistic: boolean;
7703
+ } | undefined;
7704
+ } | null;
7705
+ readonly businessId: string;
7706
+ readonly lineItems: readonly {
7707
+ readonly id: string;
7708
+ readonly externalId: string | null;
7709
+ readonly memo: string | null;
7710
+ readonly description: string | null;
7711
+ readonly invoiceId: string;
7712
+ readonly product: string | null;
7713
+ readonly subtotal: number;
7714
+ readonly quantity: import("effect/BigDecimal").BigDecimal;
7715
+ readonly unitPrice: number;
7716
+ readonly discountAmount: number;
7717
+ readonly salesTaxTotal: number;
7718
+ readonly totalAmount: number;
7719
+ }[];
7720
+ readonly invoiceNumber: string | null;
7721
+ readonly recipientName: string | null;
7722
+ readonly updatedAt: Date | null;
7723
+ readonly subtotal: number;
7724
+ readonly paidAt: Date | null;
7725
+ readonly totalAmount: number;
7726
+ readonly sentAt: Date | null;
7727
+ readonly dueAt: Date | null;
7728
+ readonly voidedAt: Date | null;
7729
+ readonly additionalDiscount: number;
7730
+ readonly additionalSalesTaxesTotal: number;
7731
+ readonly outstandingBalance: number;
7732
+ readonly importedAt: Date;
7733
+ }[];
7734
+ readonly meta: {
7735
+ readonly pagination: {
7736
+ readonly cursor: string | null;
7737
+ readonly totalCount: number | undefined;
7738
+ readonly hasMore: boolean;
7739
+ };
7740
+ };
7741
+ }[] | undefined)[]>;
7742
+ forceReloadInvoices: () => Promise<undefined[]>;
7169
7743
  };
7170
- export function useInvoicesOptimisticUpdater(): {
7171
- optimisticallyUpdateInvoices: (transformInvoice: (invoice: Invoice) => Invoice) => Promise<undefined[]>;
7744
+ export {};
7745
+
7746
+ }
7747
+ declare module '@layerfi/components/features/invoices/api/useUpsertDedicatedInvoicePayment' {
7748
+ import type { Key } from 'swr';
7749
+ import { type SWRMutationResponse } from 'swr/mutation';
7750
+ import { InvoiceStatus, type Invoice, type InvoicePayment, type UpsertDedicatedInvoicePaymentSchema } from '@layerfi/components/features/invoices/invoiceSchemas';
7751
+ import { Schema } from 'effect';
7752
+ export enum UpsertDedicatedInvoicePaymentMode {
7753
+ Create = "Create",
7754
+ Update = "Update"
7755
+ }
7756
+ type UpsertDedicatedInvoicePaymentBody = typeof UpsertDedicatedInvoicePaymentSchema.Encoded;
7757
+ const UpsertDedicatedInvoicePaymentReturnSchema: Schema.Struct<{
7758
+ data: Schema.Struct<{
7759
+ amount: typeof Schema.Number;
7760
+ method: Schema.transform<typeof Schema.NonEmptyTrimmedString, Schema.SchemaClass<import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod, import("../../../components/PaymentMethod/schemas").PaymentMethod, never>>;
7761
+ at: Schema.propertySignature<typeof Schema.Date>;
7762
+ referenceNumber: Schema.PropertySignature<":", string | null, "reference_number", ":", string | null, false, never>;
7763
+ memo: Schema.NullOr<typeof Schema.String>;
7764
+ }>;
7765
+ }>;
7766
+ type UpsertDedicatedInvoicePaymentReturn = typeof UpsertDedicatedInvoicePaymentReturnSchema.Type;
7767
+ type UpsertDedicatedInvoicePaymentSWRMutationResponse = SWRMutationResponse<UpsertDedicatedInvoicePaymentReturn, unknown, Key, UpsertDedicatedInvoicePaymentBody>;
7768
+ class UpsertDedicatedInvoicePaymentSWRResponse {
7769
+ private swrResponse;
7770
+ constructor(swrResponse: UpsertDedicatedInvoicePaymentSWRMutationResponse);
7771
+ get data(): {
7772
+ readonly data: {
7773
+ readonly at: Date;
7774
+ readonly memo: string | null;
7775
+ readonly amount: number;
7776
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod;
7777
+ readonly referenceNumber: string | null;
7778
+ };
7779
+ } | undefined;
7780
+ get trigger(): import("swr/mutation").TriggerWithArgs<{
7781
+ readonly data: {
7782
+ readonly at: Date;
7783
+ readonly memo: string | null;
7784
+ readonly amount: number;
7785
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod;
7786
+ readonly referenceNumber: string | null;
7787
+ };
7788
+ }, unknown, Key, {
7789
+ readonly amount: number;
7790
+ readonly method: import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod;
7791
+ readonly memo?: string | undefined;
7792
+ readonly reference_number?: string | undefined;
7793
+ readonly paid_at?: string | undefined;
7794
+ }>;
7795
+ get isMutating(): boolean;
7796
+ get isError(): boolean;
7797
+ }
7798
+ const CreateParamsSchema: Schema.Struct<{
7799
+ businessId: typeof Schema.String;
7800
+ invoiceId: typeof Schema.String;
7801
+ }>;
7802
+ const UpdateParamsSchema: Schema.Struct<{
7803
+ businessId: typeof Schema.String;
7804
+ invoiceId: typeof Schema.String;
7805
+ invoicePaymentId: typeof Schema.String;
7806
+ }>;
7807
+ export type CreateParams = typeof CreateParamsSchema.Type;
7808
+ export type UpdateParams = typeof UpdateParamsSchema.Type;
7809
+ export type UpsertParams = CreateParams | UpdateParams;
7810
+ export const updateInvoiceWithPayment: (invoice: Invoice, invoicePayment: InvoicePayment) => {
7811
+ status: InvoiceStatus;
7812
+ outstandingBalance: number;
7813
+ id: string;
7814
+ externalId: string | null;
7815
+ memo: string | null;
7816
+ customer: {
7817
+ readonly id: string;
7818
+ readonly externalId: string | null;
7819
+ readonly individualName: string | null;
7820
+ readonly companyName: string | null;
7821
+ readonly email: string | null;
7822
+ readonly mobilePhone: string | null;
7823
+ readonly officePhone: string | null;
7824
+ readonly addressString: string | null;
7825
+ readonly status: "ACTIVE" | "ARCHIVED";
7826
+ readonly memo: string | null;
7827
+ readonly _local?: {
7828
+ readonly isOptimistic: boolean;
7829
+ } | undefined;
7830
+ } | null;
7831
+ businessId: string;
7832
+ lineItems: readonly {
7833
+ readonly id: string;
7834
+ readonly externalId: string | null;
7835
+ readonly memo: string | null;
7836
+ readonly description: string | null;
7837
+ readonly invoiceId: string;
7838
+ readonly product: string | null;
7839
+ readonly subtotal: number;
7840
+ readonly quantity: import("effect/BigDecimal").BigDecimal;
7841
+ readonly unitPrice: number;
7842
+ readonly discountAmount: number;
7843
+ readonly salesTaxTotal: number;
7844
+ readonly totalAmount: number;
7845
+ }[];
7846
+ invoiceNumber: string | null;
7847
+ recipientName: string | null;
7848
+ updatedAt: Date | null;
7849
+ subtotal: number;
7850
+ paidAt: Date | null;
7851
+ totalAmount: number;
7852
+ sentAt: Date | null;
7853
+ dueAt: Date | null;
7854
+ voidedAt: Date | null;
7855
+ additionalDiscount: number;
7856
+ additionalSalesTaxesTotal: number;
7857
+ importedAt: Date;
7858
+ };
7859
+ type UseUpsertDedicatedInvoicePaymentProps = {
7860
+ mode: UpsertDedicatedInvoicePaymentMode.Create;
7861
+ invoiceId: string;
7862
+ } | {
7863
+ mode: UpsertDedicatedInvoicePaymentMode.Update;
7864
+ invoiceId: string;
7865
+ invoicePaymentId: string;
7172
7866
  };
7867
+ export const useUpsertDedicatedInvoicePayment: (props: UseUpsertDedicatedInvoicePaymentProps) => UpsertDedicatedInvoicePaymentSWRResponse;
7173
7868
  export {};
7174
7869
 
7175
7870
  }
@@ -7215,10 +7910,10 @@ declare module '@layerfi/components/features/invoices/api/useUpsertInvoice' {
7215
7910
  readonly externalId: string | null;
7216
7911
  readonly memo: string | null;
7217
7912
  readonly description: string | null;
7913
+ readonly invoiceId: string;
7218
7914
  readonly product: string | null;
7219
7915
  readonly subtotal: number;
7220
7916
  readonly quantity: import("effect/BigDecimal").BigDecimal;
7221
- readonly invoiceId: string;
7222
7917
  readonly unitPrice: number;
7223
7918
  readonly discountAmount: number;
7224
7919
  readonly salesTaxTotal: number;
@@ -7228,10 +7923,10 @@ declare module '@layerfi/components/features/invoices/api/useUpsertInvoice' {
7228
7923
  readonly external_id: string | null;
7229
7924
  readonly memo: string | null;
7230
7925
  readonly description: string | null;
7926
+ readonly invoice_id: string;
7231
7927
  readonly product: string | null;
7232
7928
  readonly subtotal: number;
7233
7929
  readonly quantity: string;
7234
- readonly invoice_id: string;
7235
7930
  readonly unit_price: number;
7236
7931
  readonly discount_amount: number;
7237
7932
  readonly sales_taxes_total: number;
@@ -7274,29 +7969,29 @@ declare module '@layerfi/components/features/invoices/api/useUpsertInvoice' {
7274
7969
  } | undefined;
7275
7970
  } | null;
7276
7971
  readonly businessId: string;
7277
- readonly updatedAt: Date | null;
7278
- readonly subtotal: number;
7279
- readonly paidAt: Date | null;
7280
- readonly totalAmount: number;
7281
- readonly sentAt: Date | null;
7282
- readonly dueAt: Date | null;
7283
- readonly voidedAt: Date | null;
7284
- readonly invoiceNumber: string | null;
7285
- readonly recipientName: string | null;
7286
7972
  readonly lineItems: readonly {
7287
7973
  readonly id: string;
7288
7974
  readonly externalId: string | null;
7289
7975
  readonly memo: string | null;
7290
7976
  readonly description: string | null;
7977
+ readonly invoiceId: string;
7291
7978
  readonly product: string | null;
7292
7979
  readonly subtotal: number;
7293
7980
  readonly quantity: import("effect/BigDecimal").BigDecimal;
7294
- readonly invoiceId: string;
7295
7981
  readonly unitPrice: number;
7296
7982
  readonly discountAmount: number;
7297
7983
  readonly salesTaxTotal: number;
7298
7984
  readonly totalAmount: number;
7299
7985
  }[];
7986
+ readonly invoiceNumber: string | null;
7987
+ readonly recipientName: string | null;
7988
+ readonly updatedAt: Date | null;
7989
+ readonly subtotal: number;
7990
+ readonly paidAt: Date | null;
7991
+ readonly totalAmount: number;
7992
+ readonly sentAt: Date | null;
7993
+ readonly dueAt: Date | null;
7994
+ readonly voidedAt: Date | null;
7300
7995
  readonly additionalDiscount: number;
7301
7996
  readonly additionalSalesTaxesTotal: number;
7302
7997
  readonly outstandingBalance: number;
@@ -7325,29 +8020,29 @@ declare module '@layerfi/components/features/invoices/api/useUpsertInvoice' {
7325
8020
  } | undefined;
7326
8021
  } | null;
7327
8022
  readonly businessId: string;
7328
- readonly updatedAt: Date | null;
7329
- readonly subtotal: number;
7330
- readonly paidAt: Date | null;
7331
- readonly totalAmount: number;
7332
- readonly sentAt: Date | null;
7333
- readonly dueAt: Date | null;
7334
- readonly voidedAt: Date | null;
7335
- readonly invoiceNumber: string | null;
7336
- readonly recipientName: string | null;
7337
8023
  readonly lineItems: readonly {
7338
8024
  readonly id: string;
7339
8025
  readonly externalId: string | null;
7340
8026
  readonly memo: string | null;
7341
8027
  readonly description: string | null;
8028
+ readonly invoiceId: string;
7342
8029
  readonly product: string | null;
7343
8030
  readonly subtotal: number;
7344
8031
  readonly quantity: import("effect/BigDecimal").BigDecimal;
7345
- readonly invoiceId: string;
7346
8032
  readonly unitPrice: number;
7347
8033
  readonly discountAmount: number;
7348
8034
  readonly salesTaxTotal: number;
7349
8035
  readonly totalAmount: number;
7350
8036
  }[];
8037
+ readonly invoiceNumber: string | null;
8038
+ readonly recipientName: string | null;
8039
+ readonly updatedAt: Date | null;
8040
+ readonly subtotal: number;
8041
+ readonly paidAt: Date | null;
8042
+ readonly totalAmount: number;
8043
+ readonly sentAt: Date | null;
8044
+ readonly dueAt: Date | null;
8045
+ readonly voidedAt: Date | null;
7351
8046
  readonly additionalDiscount: number;
7352
8047
  readonly additionalSalesTaxesTotal: number;
7353
8048
  readonly outstandingBalance: number;
@@ -7355,9 +8050,6 @@ declare module '@layerfi/components/features/invoices/api/useUpsertInvoice' {
7355
8050
  };
7356
8051
  }, unknown, Key, {
7357
8052
  readonly memo: string | null;
7358
- readonly sent_at: string;
7359
- readonly due_at: string;
7360
- readonly invoice_number: string | undefined;
7361
8053
  readonly line_items: readonly {
7362
8054
  readonly description: string;
7363
8055
  readonly product: string;
@@ -7367,6 +8059,9 @@ declare module '@layerfi/components/features/invoices/api/useUpsertInvoice' {
7367
8059
  readonly amount: number;
7368
8060
  }[] | undefined;
7369
8061
  }[];
8062
+ readonly invoice_number: string | undefined;
8063
+ readonly sent_at: string;
8064
+ readonly due_at: string;
7370
8065
  readonly additional_discount: number | undefined;
7371
8066
  readonly customer_id: string;
7372
8067
  }>;
@@ -7451,10 +8146,10 @@ declare module '@layerfi/components/features/invoices/invoiceSchemas' {
7451
8146
  readonly externalId: string | null;
7452
8147
  readonly memo: string | null;
7453
8148
  readonly description: string | null;
8149
+ readonly invoiceId: string;
7454
8150
  readonly product: string | null;
7455
8151
  readonly subtotal: number;
7456
8152
  readonly quantity: import("effect/BigDecimal").BigDecimal;
7457
- readonly invoiceId: string;
7458
8153
  readonly unitPrice: number;
7459
8154
  readonly discountAmount: number;
7460
8155
  readonly salesTaxTotal: number;
@@ -7464,10 +8159,10 @@ declare module '@layerfi/components/features/invoices/invoiceSchemas' {
7464
8159
  readonly external_id: string | null;
7465
8160
  readonly memo: string | null;
7466
8161
  readonly description: string | null;
8162
+ readonly invoice_id: string;
7467
8163
  readonly product: string | null;
7468
8164
  readonly subtotal: number;
7469
8165
  readonly quantity: string;
7470
- readonly invoice_id: string;
7471
8166
  readonly unit_price: number;
7472
8167
  readonly discount_amount: number;
7473
8168
  readonly sales_taxes_total: number;
@@ -7533,6 +8228,14 @@ declare module '@layerfi/components/features/invoices/invoiceSchemas' {
7533
8228
  isTaxable: typeof Schema.Boolean;
7534
8229
  }>;
7535
8230
  export type InvoiceFormLineItem = typeof InvoiceFormLineItemSchema.Type;
8231
+ export const InvoiceFormLineItemEquivalence: import("effect/Equivalence").Equivalence<{
8232
+ readonly description: string;
8233
+ readonly amount: import("effect/BigDecimal").BigDecimal;
8234
+ readonly product: string;
8235
+ readonly quantity: import("effect/BigDecimal").BigDecimal;
8236
+ readonly unitPrice: import("effect/BigDecimal").BigDecimal;
8237
+ readonly isTaxable: boolean;
8238
+ }>;
7536
8239
  export const InvoiceFormSchema: Schema.Struct<{
7537
8240
  terms: Schema.Enums<typeof InvoiceTermsValues>;
7538
8241
  sentAt: Schema.NullOr<Schema.declare<import("@internationalized/date").ZonedDateTime, import("@internationalized/date").ZonedDateTime, readonly [], never>>;
@@ -7567,9 +8270,58 @@ declare module '@layerfi/components/features/invoices/invoiceSchemas' {
7567
8270
  taxRate: typeof Schema.BigDecimal;
7568
8271
  memo: typeof Schema.String;
7569
8272
  }>;
7570
- export type InvoiceForm = Omit<typeof InvoiceFormSchema.Type, 'lineItems'> & {
7571
- lineItems: InvoiceFormLineItem[];
7572
- };
8273
+ export type InvoiceForm = Omit<typeof InvoiceFormSchema.Type, 'lineItems'> & {
8274
+ lineItems: InvoiceFormLineItem[];
8275
+ };
8276
+ export const InvoiceSummaryStatsResponseSchema: Schema.Struct<{
8277
+ invoices: Schema.Struct<{
8278
+ overdueCount: Schema.PropertySignature<":", number, "overdue_count", ":", number, false, never>;
8279
+ overdueTotal: Schema.PropertySignature<":", bigint, "overdue_total", ":", number, false, never>;
8280
+ sentCount: Schema.PropertySignature<":", number, "sent_count", ":", number, false, never>;
8281
+ sentTotal: Schema.PropertySignature<":", bigint, "sent_total", ":", number, false, never>;
8282
+ }>;
8283
+ invoicePayments: Schema.PropertySignature<":", {
8284
+ readonly sumTotal: bigint;
8285
+ }, "invoice_payments", ":", {
8286
+ readonly sum_total: number;
8287
+ }, false, never>;
8288
+ }>;
8289
+ export type InvoiceSummaryStatsResponse = typeof InvoiceSummaryStatsResponseSchema.Type;
8290
+ export const UpsertDedicatedInvoicePaymentSchema: Schema.Struct<{
8291
+ amount: typeof Schema.Number;
8292
+ method: Schema.Enums<typeof import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod>;
8293
+ paidAt: Schema.PropertySignature<"?:", Date | undefined, "paid_at", "?:", string | undefined, false, never>;
8294
+ referenceNumber: Schema.PropertySignature<"?:", string | undefined, "reference_number", "?:", string | undefined, false, never>;
8295
+ memo: Schema.optional<typeof Schema.String>;
8296
+ }>;
8297
+ export type UpsertDedicatedInvoicePayment = typeof UpsertDedicatedInvoicePaymentSchema.Type;
8298
+ export const DedicatedInvoicePaymentFormSchema: Schema.Struct<{
8299
+ amount: typeof Schema.BigDecimal;
8300
+ method: Schema.NullOr<Schema.Enums<typeof import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod>>;
8301
+ paidAt: Schema.declare<import("@internationalized/date").ZonedDateTime, import("@internationalized/date").ZonedDateTime, readonly [], never>;
8302
+ referenceNumber: typeof Schema.String;
8303
+ memo: typeof Schema.String;
8304
+ }>;
8305
+ export type DedicatedInvoicePaymentForm = typeof DedicatedInvoicePaymentFormSchema.Type;
8306
+ export const InvoicePaymentSchema: Schema.Struct<{
8307
+ amount: typeof Schema.Number;
8308
+ method: Schema.transform<typeof Schema.NonEmptyTrimmedString, Schema.SchemaClass<import("@layerfi/components/components/PaymentMethod/schemas").PaymentMethod, import("../../components/PaymentMethod/schemas").PaymentMethod, never>>;
8309
+ at: Schema.propertySignature<typeof Schema.Date>;
8310
+ referenceNumber: Schema.PropertySignature<":", string | null, "reference_number", ":", string | null, false, never>;
8311
+ memo: Schema.NullOr<typeof Schema.String>;
8312
+ }>;
8313
+ export type InvoicePayment = typeof InvoicePaymentSchema.Type;
8314
+
8315
+ }
8316
+ declare module '@layerfi/components/features/ledger/accounts/[ledgerAccountId]/api/useDeleteLedgerAccount' {
8317
+ export function useDeleteAccountFromLedger(): import("swr/mutation").SWRMutationResponse<Record<string, never>, any, () => {
8318
+ readonly accessToken: string;
8319
+ readonly apiUrl: string;
8320
+ readonly businessId: string;
8321
+ readonly tags: readonly ["#delete-account-from-ledger"];
8322
+ } | undefined, {
8323
+ accountId: string;
8324
+ }>;
7573
8325
 
7574
8326
  }
7575
8327
  declare module '@layerfi/components/features/ledger/accounts/[ledgerAccountId]/api/useListLedgerAccountLines' {
@@ -8713,6 +9465,7 @@ declare module '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts'
8713
9465
  apiError: string | undefined;
8714
9466
  addAccount: () => void;
8715
9467
  editAccount: (id: string) => void;
9468
+ deleteAccount: (accountId: string) => Promise<void>;
8716
9469
  cancelForm: () => void;
8717
9470
  changeFormData: (fieldName: string, value: string | BaseSelectOption | undefined) => void;
8718
9471
  submitForm: () => void;
@@ -8953,6 +9706,564 @@ declare module '@layerfi/components/hooks/usePaginationRange/usePaginationRange'
8953
9706
  export type UsePaginationReturn = (Dots | number)[];
8954
9707
  export const usePaginationRange: ({ totalCount, pageSize, siblingCount, currentPage, }: UsePaginationProps) => UsePaginationReturn;
8955
9708
 
9709
+ }
9710
+ declare module '@layerfi/components/hooks/useProfitAndLoss/schemas' {
9711
+ import { Schema } from 'effect';
9712
+ import { Direction } from '@layerfi/components/types';
9713
+ export const LedgerEntrySourceSchema: Schema.Union<[Schema.Struct<{
9714
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9715
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9716
+ type: Schema.Literal<["Transaction_Ledger_Entry_Source"]>;
9717
+ transactionId: Schema.PropertySignature<":", string, "transaction_id", ":", string, false, never>;
9718
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9719
+ accountName: Schema.PropertySignature<"?:", string | undefined, "account_name", "?:", string | undefined, false, never>;
9720
+ date: typeof Schema.String;
9721
+ amount: typeof Schema.Number;
9722
+ direction: Schema.Enums<typeof Direction>;
9723
+ counterparty: Schema.optional<typeof Schema.String>;
9724
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9725
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9726
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9727
+ }>, Schema.Struct<{
9728
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9729
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9730
+ type: Schema.Literal<["Invoice_Ledger_Entry_Source"]>;
9731
+ invoiceId: Schema.PropertySignature<":", string, "invoice_id", ":", string, false, never>;
9732
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9733
+ invoiceNumber: Schema.PropertySignature<":", string | null, "invoice_number", ":", string | null, false, never>;
9734
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
9735
+ customerDescription: Schema.PropertySignature<"?:", string | undefined, "customer_description", "?:", string | undefined, false, never>;
9736
+ date: typeof Schema.String;
9737
+ amount: typeof Schema.Number;
9738
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9739
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9740
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9741
+ }>, Schema.Struct<{
9742
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9743
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9744
+ type: Schema.Literal<["Manual_Ledger_Entry_Source"]>;
9745
+ manualEntryId: Schema.PropertySignature<":", string, "manual_entry_id", ":", string, false, never>;
9746
+ memo: Schema.NullOr<typeof Schema.String>;
9747
+ createdBy: Schema.PropertySignature<":", string, "created_by", ":", string, false, never>;
9748
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9749
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9750
+ }>, Schema.Struct<{
9751
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9752
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9753
+ type: Schema.Literal<["Invoice_Payment_Ledger_Entry_Source"]>;
9754
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9755
+ invoiceId: Schema.PropertySignature<":", string, "invoice_id", ":", string, false, never>;
9756
+ invoiceNumber: Schema.PropertySignature<":", string | null, "invoice_number", ":", string | null, false, never>;
9757
+ amount: typeof Schema.Number;
9758
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9759
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9760
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9761
+ }>, Schema.Struct<{
9762
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9763
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9764
+ type: Schema.Literal<["Refund_Ledger_Entry_Source"]>;
9765
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9766
+ refundId: Schema.PropertySignature<":", string, "refund_id", ":", string, false, never>;
9767
+ refundedToCustomerAmount: Schema.PropertySignature<":", number, "refunded_to_customer_amount", ":", number, false, never>;
9768
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
9769
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9770
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9771
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9772
+ }>, Schema.Struct<{
9773
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9774
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9775
+ type: Schema.Literal<["Refund_Payment_Ledger_Entry_Source"]>;
9776
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9777
+ refundId: Schema.PropertySignature<":", string, "refund_id", ":", string, false, never>;
9778
+ refundPaymentId: Schema.PropertySignature<":", string, "refund_payment_id", ":", string, false, never>;
9779
+ refundedToCustomerAmount: Schema.PropertySignature<":", number, "refunded_to_customer_amount", ":", number, false, never>;
9780
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
9781
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9782
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9783
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9784
+ }>, Schema.Struct<{
9785
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9786
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9787
+ type: Schema.Literal<["Opening_Balance_Ledger_Entry_Source"]>;
9788
+ accountName: Schema.PropertySignature<"?:", string | undefined, "account_name", "?:", string | undefined, false, never>;
9789
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9790
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9791
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9792
+ }>, Schema.Struct<{
9793
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9794
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9795
+ type: Schema.Literal<["Payout_Ledger_Entry_Source"]>;
9796
+ payoutId: Schema.PropertySignature<":", string, "payout_id", ":", string, false, never>;
9797
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9798
+ paidOutAmount: Schema.PropertySignature<":", number, "paid_out_amount", ":", number, false, never>;
9799
+ processor: typeof Schema.String;
9800
+ completedAt: Schema.PropertySignature<":", string, "completed_at", ":", string, false, never>;
9801
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9802
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9803
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9804
+ }>]>;
9805
+ export const AccountSchema: Schema.Struct<{
9806
+ id: typeof Schema.String;
9807
+ name: typeof Schema.String;
9808
+ stableName: Schema.PropertySignature<":", string, "stable_name", ":", string, false, never>;
9809
+ normality: typeof Schema.String;
9810
+ accountType: Schema.PropertySignature<":", {
9811
+ readonly value: string;
9812
+ readonly displayName: string;
9813
+ }, "account_type", ":", {
9814
+ readonly value: string;
9815
+ readonly display_name: string;
9816
+ }, false, never>;
9817
+ accountSubtype: Schema.PropertySignature<":", {
9818
+ readonly value: string;
9819
+ readonly displayName: string;
9820
+ }, "account_subtype", ":", {
9821
+ readonly value: string;
9822
+ readonly display_name: string;
9823
+ }, false, never>;
9824
+ }>;
9825
+ export const PnlDetailLineSchema: Schema.Struct<{
9826
+ id: typeof Schema.String;
9827
+ entryId: Schema.PropertySignature<":", string, "entry_id", ":", string, false, never>;
9828
+ account: Schema.Struct<{
9829
+ id: typeof Schema.String;
9830
+ name: typeof Schema.String;
9831
+ stableName: Schema.PropertySignature<":", string, "stable_name", ":", string, false, never>;
9832
+ normality: typeof Schema.String;
9833
+ accountType: Schema.PropertySignature<":", {
9834
+ readonly value: string;
9835
+ readonly displayName: string;
9836
+ }, "account_type", ":", {
9837
+ readonly value: string;
9838
+ readonly display_name: string;
9839
+ }, false, never>;
9840
+ accountSubtype: Schema.PropertySignature<":", {
9841
+ readonly value: string;
9842
+ readonly displayName: string;
9843
+ }, "account_subtype", ":", {
9844
+ readonly value: string;
9845
+ readonly display_name: string;
9846
+ }, false, never>;
9847
+ }>;
9848
+ amount: typeof Schema.Number;
9849
+ direction: Schema.Enums<typeof Direction>;
9850
+ date: typeof Schema.String;
9851
+ source: Schema.optional<Schema.Union<[Schema.Struct<{
9852
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9853
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9854
+ type: Schema.Literal<["Transaction_Ledger_Entry_Source"]>;
9855
+ transactionId: Schema.PropertySignature<":", string, "transaction_id", ":", string, false, never>;
9856
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9857
+ accountName: Schema.PropertySignature<"?:", string | undefined, "account_name", "?:", string | undefined, false, never>;
9858
+ date: typeof Schema.String;
9859
+ amount: typeof Schema.Number;
9860
+ direction: Schema.Enums<typeof Direction>;
9861
+ counterparty: Schema.optional<typeof Schema.String>;
9862
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9863
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9864
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9865
+ }>, Schema.Struct<{
9866
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9867
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9868
+ type: Schema.Literal<["Invoice_Ledger_Entry_Source"]>;
9869
+ invoiceId: Schema.PropertySignature<":", string, "invoice_id", ":", string, false, never>;
9870
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9871
+ invoiceNumber: Schema.PropertySignature<":", string | null, "invoice_number", ":", string | null, false, never>;
9872
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
9873
+ customerDescription: Schema.PropertySignature<"?:", string | undefined, "customer_description", "?:", string | undefined, false, never>;
9874
+ date: typeof Schema.String;
9875
+ amount: typeof Schema.Number;
9876
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9877
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9878
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9879
+ }>, Schema.Struct<{
9880
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9881
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9882
+ type: Schema.Literal<["Manual_Ledger_Entry_Source"]>;
9883
+ manualEntryId: Schema.PropertySignature<":", string, "manual_entry_id", ":", string, false, never>;
9884
+ memo: Schema.NullOr<typeof Schema.String>;
9885
+ createdBy: Schema.PropertySignature<":", string, "created_by", ":", string, false, never>;
9886
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9887
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9888
+ }>, Schema.Struct<{
9889
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9890
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9891
+ type: Schema.Literal<["Invoice_Payment_Ledger_Entry_Source"]>;
9892
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9893
+ invoiceId: Schema.PropertySignature<":", string, "invoice_id", ":", string, false, never>;
9894
+ invoiceNumber: Schema.PropertySignature<":", string | null, "invoice_number", ":", string | null, false, never>;
9895
+ amount: typeof Schema.Number;
9896
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9897
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9898
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9899
+ }>, Schema.Struct<{
9900
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9901
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9902
+ type: Schema.Literal<["Refund_Ledger_Entry_Source"]>;
9903
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9904
+ refundId: Schema.PropertySignature<":", string, "refund_id", ":", string, false, never>;
9905
+ refundedToCustomerAmount: Schema.PropertySignature<":", number, "refunded_to_customer_amount", ":", number, false, never>;
9906
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
9907
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9908
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9909
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9910
+ }>, Schema.Struct<{
9911
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9912
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9913
+ type: Schema.Literal<["Refund_Payment_Ledger_Entry_Source"]>;
9914
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9915
+ refundId: Schema.PropertySignature<":", string, "refund_id", ":", string, false, never>;
9916
+ refundPaymentId: Schema.PropertySignature<":", string, "refund_payment_id", ":", string, false, never>;
9917
+ refundedToCustomerAmount: Schema.PropertySignature<":", number, "refunded_to_customer_amount", ":", number, false, never>;
9918
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
9919
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9920
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9921
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9922
+ }>, Schema.Struct<{
9923
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9924
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9925
+ type: Schema.Literal<["Opening_Balance_Ledger_Entry_Source"]>;
9926
+ accountName: Schema.PropertySignature<"?:", string | undefined, "account_name", "?:", string | undefined, false, never>;
9927
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9928
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9929
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9930
+ }>, Schema.Struct<{
9931
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9932
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9933
+ type: Schema.Literal<["Payout_Ledger_Entry_Source"]>;
9934
+ payoutId: Schema.PropertySignature<":", string, "payout_id", ":", string, false, never>;
9935
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9936
+ paidOutAmount: Schema.PropertySignature<":", number, "paid_out_amount", ":", number, false, never>;
9937
+ processor: typeof Schema.String;
9938
+ completedAt: Schema.PropertySignature<":", string, "completed_at", ":", string, false, never>;
9939
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9940
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9941
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9942
+ }>]>>;
9943
+ }>;
9944
+ export const PnlDetailLinesDataSchema: Schema.Struct<{
9945
+ type: typeof Schema.String;
9946
+ businessId: Schema.PropertySignature<":", string, "business_id", ":", string, false, never>;
9947
+ startDate: Schema.PropertySignature<":", string, "start_date", ":", string, false, never>;
9948
+ endDate: Schema.PropertySignature<":", string, "end_date", ":", string, false, never>;
9949
+ pnlStructureLineItemName: Schema.PropertySignature<":", string, "pnl_structure_line_item_name", ":", string, false, never>;
9950
+ reportingBasis: Schema.PropertySignature<"?:", string | null | undefined, "reporting_basis", "?:", string | null | undefined, false, never>;
9951
+ pnlStructure: Schema.PropertySignature<"?:", string | null | undefined, "pnl_structure", "?:", string | null | undefined, false, never>;
9952
+ tagFilter: Schema.PropertySignature<":", {
9953
+ readonly values: readonly string[];
9954
+ readonly key: string;
9955
+ } | null, "tag_filter", ":", {
9956
+ readonly values: readonly string[];
9957
+ readonly key: string;
9958
+ } | null, false, never>;
9959
+ lines: Schema.Array$<Schema.Struct<{
9960
+ id: typeof Schema.String;
9961
+ entryId: Schema.PropertySignature<":", string, "entry_id", ":", string, false, never>;
9962
+ account: Schema.Struct<{
9963
+ id: typeof Schema.String;
9964
+ name: typeof Schema.String;
9965
+ stableName: Schema.PropertySignature<":", string, "stable_name", ":", string, false, never>;
9966
+ normality: typeof Schema.String;
9967
+ accountType: Schema.PropertySignature<":", {
9968
+ readonly value: string;
9969
+ readonly displayName: string;
9970
+ }, "account_type", ":", {
9971
+ readonly value: string;
9972
+ readonly display_name: string;
9973
+ }, false, never>;
9974
+ accountSubtype: Schema.PropertySignature<":", {
9975
+ readonly value: string;
9976
+ readonly displayName: string;
9977
+ }, "account_subtype", ":", {
9978
+ readonly value: string;
9979
+ readonly display_name: string;
9980
+ }, false, never>;
9981
+ }>;
9982
+ amount: typeof Schema.Number;
9983
+ direction: Schema.Enums<typeof Direction>;
9984
+ date: typeof Schema.String;
9985
+ source: Schema.optional<Schema.Union<[Schema.Struct<{
9986
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
9987
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
9988
+ type: Schema.Literal<["Transaction_Ledger_Entry_Source"]>;
9989
+ transactionId: Schema.PropertySignature<":", string, "transaction_id", ":", string, false, never>;
9990
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
9991
+ accountName: Schema.PropertySignature<"?:", string | undefined, "account_name", "?:", string | undefined, false, never>;
9992
+ date: typeof Schema.String;
9993
+ amount: typeof Schema.Number;
9994
+ direction: Schema.Enums<typeof Direction>;
9995
+ counterparty: Schema.optional<typeof Schema.String>;
9996
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
9997
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
9998
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
9999
+ }>, Schema.Struct<{
10000
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
10001
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
10002
+ type: Schema.Literal<["Invoice_Ledger_Entry_Source"]>;
10003
+ invoiceId: Schema.PropertySignature<":", string, "invoice_id", ":", string, false, never>;
10004
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
10005
+ invoiceNumber: Schema.PropertySignature<":", string | null, "invoice_number", ":", string | null, false, never>;
10006
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
10007
+ customerDescription: Schema.PropertySignature<"?:", string | undefined, "customer_description", "?:", string | undefined, false, never>;
10008
+ date: typeof Schema.String;
10009
+ amount: typeof Schema.Number;
10010
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
10011
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
10012
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
10013
+ }>, Schema.Struct<{
10014
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
10015
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
10016
+ type: Schema.Literal<["Manual_Ledger_Entry_Source"]>;
10017
+ manualEntryId: Schema.PropertySignature<":", string, "manual_entry_id", ":", string, false, never>;
10018
+ memo: Schema.NullOr<typeof Schema.String>;
10019
+ createdBy: Schema.PropertySignature<":", string, "created_by", ":", string, false, never>;
10020
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
10021
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
10022
+ }>, Schema.Struct<{
10023
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
10024
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
10025
+ type: Schema.Literal<["Invoice_Payment_Ledger_Entry_Source"]>;
10026
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
10027
+ invoiceId: Schema.PropertySignature<":", string, "invoice_id", ":", string, false, never>;
10028
+ invoiceNumber: Schema.PropertySignature<":", string | null, "invoice_number", ":", string | null, false, never>;
10029
+ amount: typeof Schema.Number;
10030
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
10031
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
10032
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
10033
+ }>, Schema.Struct<{
10034
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
10035
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
10036
+ type: Schema.Literal<["Refund_Ledger_Entry_Source"]>;
10037
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
10038
+ refundId: Schema.PropertySignature<":", string, "refund_id", ":", string, false, never>;
10039
+ refundedToCustomerAmount: Schema.PropertySignature<":", number, "refunded_to_customer_amount", ":", number, false, never>;
10040
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
10041
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
10042
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
10043
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
10044
+ }>, Schema.Struct<{
10045
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
10046
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
10047
+ type: Schema.Literal<["Refund_Payment_Ledger_Entry_Source"]>;
10048
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
10049
+ refundId: Schema.PropertySignature<":", string, "refund_id", ":", string, false, never>;
10050
+ refundPaymentId: Schema.PropertySignature<":", string, "refund_payment_id", ":", string, false, never>;
10051
+ refundedToCustomerAmount: Schema.PropertySignature<":", number, "refunded_to_customer_amount", ":", number, false, never>;
10052
+ recipientName: Schema.PropertySignature<":", string, "recipient_name", ":", string, false, never>;
10053
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
10054
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
10055
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
10056
+ }>, Schema.Struct<{
10057
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
10058
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
10059
+ type: Schema.Literal<["Opening_Balance_Ledger_Entry_Source"]>;
10060
+ accountName: Schema.PropertySignature<"?:", string | undefined, "account_name", "?:", string | undefined, false, never>;
10061
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
10062
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
10063
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
10064
+ }>, Schema.Struct<{
10065
+ displayDescription: Schema.PropertySignature<":", string, "display_description", ":", string, false, never>;
10066
+ entityName: Schema.PropertySignature<":", string, "entity_name", ":", string, false, never>;
10067
+ type: Schema.Literal<["Payout_Ledger_Entry_Source"]>;
10068
+ payoutId: Schema.PropertySignature<":", string, "payout_id", ":", string, false, never>;
10069
+ externalId: Schema.PropertySignature<":", string, "external_id", ":", string, false, never>;
10070
+ paidOutAmount: Schema.PropertySignature<":", number, "paid_out_amount", ":", number, false, never>;
10071
+ processor: typeof Schema.String;
10072
+ completedAt: Schema.PropertySignature<":", string, "completed_at", ":", string, false, never>;
10073
+ memo: Schema.optional<Schema.NullOr<typeof Schema.String>>;
10074
+ metadata: Schema.optional<Schema.NullOr<typeof Schema.Unknown>>;
10075
+ referenceNumber: Schema.PropertySignature<"?:", string | null | undefined, "reference_number", "?:", string | null | undefined, false, never>;
10076
+ }>]>>;
10077
+ }>>;
10078
+ }>;
10079
+ export const ProfitAndLossSummarySchema: Schema.Struct<{
10080
+ year: typeof Schema.Number;
10081
+ month: typeof Schema.Number;
10082
+ income: typeof Schema.Number;
10083
+ costOfGoodsSold: typeof Schema.Number;
10084
+ grossProfit: typeof Schema.Number;
10085
+ operatingExpenses: typeof Schema.Number;
10086
+ profitBeforeTaxes: typeof Schema.Number;
10087
+ taxes: typeof Schema.Number;
10088
+ netProfit: typeof Schema.Number;
10089
+ fullyCategorized: typeof Schema.Boolean;
10090
+ totalExpenses: typeof Schema.Number;
10091
+ uncategorizedInflows: typeof Schema.Number;
10092
+ uncategorizedOutflows: typeof Schema.Number;
10093
+ uncategorizedTransactions: Schema.PropertySignature<":", number, "uncategorized_transactions", ":", number, false, never>;
10094
+ categorizedTransactions: Schema.PropertySignature<":", number, "categorized_transactions", ":", number, false, never>;
10095
+ }>;
10096
+ export type ProfitAndLossSummary = typeof ProfitAndLossSummarySchema.Type;
10097
+ export const ProfitAndLossSummariesSchema: Schema.Struct<{
10098
+ type: Schema.Literal<["Profit_And_Loss_Summaries"]>;
10099
+ months: Schema.Array$<Schema.Struct<{
10100
+ year: typeof Schema.Number;
10101
+ month: typeof Schema.Number;
10102
+ income: typeof Schema.Number;
10103
+ costOfGoodsSold: typeof Schema.Number;
10104
+ grossProfit: typeof Schema.Number;
10105
+ operatingExpenses: typeof Schema.Number;
10106
+ profitBeforeTaxes: typeof Schema.Number;
10107
+ taxes: typeof Schema.Number;
10108
+ netProfit: typeof Schema.Number;
10109
+ fullyCategorized: typeof Schema.Boolean;
10110
+ totalExpenses: typeof Schema.Number;
10111
+ uncategorizedInflows: typeof Schema.Number;
10112
+ uncategorizedOutflows: typeof Schema.Number;
10113
+ uncategorizedTransactions: Schema.PropertySignature<":", number, "uncategorized_transactions", ":", number, false, never>;
10114
+ categorizedTransactions: Schema.PropertySignature<":", number, "categorized_transactions", ":", number, false, never>;
10115
+ }>>;
10116
+ }>;
10117
+ export type ProfitAndLossSummaries = typeof ProfitAndLossSummariesSchema.Type;
10118
+ export const ProfitAndLossSummariesRequestParamsSchema: Schema.Struct<{
10119
+ startYear: typeof Schema.Number;
10120
+ startMonth: typeof Schema.Number;
10121
+ endYear: typeof Schema.Number;
10122
+ endMonth: typeof Schema.Number;
10123
+ businessId: typeof Schema.String;
10124
+ tagKey: Schema.optional<typeof Schema.String>;
10125
+ tagValues: Schema.optional<typeof Schema.String>;
10126
+ reportingBasis: Schema.optional<typeof Schema.String>;
10127
+ }>;
10128
+ export type ProfitAndLossSummariesRequestParams = typeof ProfitAndLossSummariesRequestParamsSchema.Type;
10129
+ export const ProfitAndLossReportRequestParamsSchema: Schema.Struct<{
10130
+ startDate: typeof Schema.Date;
10131
+ endDate: typeof Schema.Date;
10132
+ includeUncategorized: Schema.optional<typeof Schema.Boolean>;
10133
+ businessId: typeof Schema.String;
10134
+ tagKey: Schema.optional<typeof Schema.String>;
10135
+ tagValues: Schema.optional<typeof Schema.String>;
10136
+ reportingBasis: Schema.optional<typeof Schema.String>;
10137
+ }>;
10138
+ export type ProfitAndLossReportRequestParams = typeof ProfitAndLossReportRequestParamsSchema.Type;
10139
+ export const ProfitAndLossReportSchema: Schema.Struct<{
10140
+ businessId: Schema.PropertySignature<":", string, "business_id", ":", string, false, never>;
10141
+ startDate: Schema.PropertySignature<":", Date, "start_date", ":", string, false, never>;
10142
+ endDate: Schema.PropertySignature<":", Date, "end_date", ":", string, false, never>;
10143
+ fullyCategorized: Schema.PropertySignature<":", boolean, "fully_categorized", ":", boolean, false, never>;
10144
+ grossProfit: Schema.PropertySignature<":", number, "gross_profit", ":", number, false, never>;
10145
+ grossProfitPercentDelta: Schema.PropertySignature<":", import("effect/BigDecimal").BigDecimal | undefined, "gross_profit_percent_delta", ":", string | undefined, false, never>;
10146
+ profitBeforeTaxes: Schema.PropertySignature<":", number, "profit_before_taxes", ":", number, false, never>;
10147
+ profitBeforeTaxesPercentDelta: Schema.PropertySignature<":", import("effect/BigDecimal").BigDecimal | undefined, "profit_before_taxes_percent_delta", ":", string | undefined, false, never>;
10148
+ netProfit: Schema.PropertySignature<":", number, "net_profit", ":", number, false, never>;
10149
+ netProfitPercentDelta: Schema.PropertySignature<":", import("effect/BigDecimal").BigDecimal | undefined, "net_profit_percent_delta", ":", string | undefined, false, never>;
10150
+ income: Schema.Struct<{
10151
+ lineItems: Schema.PropertySignature<":", readonly import("@layerfi/components/utils/schema/utils").LineItem[], "line_items", ":", readonly import("../../utils/schema/utils").LineItemEncoded[], false, never>;
10152
+ name: typeof Schema.String;
10153
+ displayName: Schema.PropertySignature<":", string, "display_name", ":", string, false, never>;
10154
+ value: typeof Schema.Number;
10155
+ isContra: Schema.PropertySignature<":", boolean, "is_contra", ":", boolean, false, never>;
10156
+ percentDelta: Schema.PropertySignature<"?:", import("effect/BigDecimal").BigDecimal | undefined, "percent_delta", "?:", string | undefined, false, never>;
10157
+ }>;
10158
+ costOfGoodsSold: Schema.PropertySignature<":", {
10159
+ readonly value: number;
10160
+ readonly name: string;
10161
+ readonly displayName: string;
10162
+ readonly isContra: boolean;
10163
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10164
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10165
+ }, "cost_of_goods_sold", ":", {
10166
+ readonly value: number;
10167
+ readonly name: string;
10168
+ readonly display_name: string;
10169
+ readonly is_contra: boolean;
10170
+ readonly line_items: readonly import("@layerfi/components/utils/schema/utils").LineItemEncoded[];
10171
+ readonly percent_delta?: string | undefined;
10172
+ }, false, never>;
10173
+ expenses: Schema.Struct<{
10174
+ lineItems: Schema.PropertySignature<":", readonly import("@layerfi/components/utils/schema/utils").LineItem[], "line_items", ":", readonly import("../../utils/schema/utils").LineItemEncoded[], false, never>;
10175
+ name: typeof Schema.String;
10176
+ displayName: Schema.PropertySignature<":", string, "display_name", ":", string, false, never>;
10177
+ value: typeof Schema.Number;
10178
+ isContra: Schema.PropertySignature<":", boolean, "is_contra", ":", boolean, false, never>;
10179
+ percentDelta: Schema.PropertySignature<"?:", import("effect/BigDecimal").BigDecimal | undefined, "percent_delta", "?:", string | undefined, false, never>;
10180
+ }>;
10181
+ taxes: Schema.Struct<{
10182
+ lineItems: Schema.PropertySignature<":", readonly import("@layerfi/components/utils/schema/utils").LineItem[], "line_items", ":", readonly import("../../utils/schema/utils").LineItemEncoded[], false, never>;
10183
+ name: typeof Schema.String;
10184
+ displayName: Schema.PropertySignature<":", string, "display_name", ":", string, false, never>;
10185
+ value: typeof Schema.Number;
10186
+ isContra: Schema.PropertySignature<":", boolean, "is_contra", ":", boolean, false, never>;
10187
+ percentDelta: Schema.PropertySignature<"?:", import("effect/BigDecimal").BigDecimal | undefined, "percent_delta", "?:", string | undefined, false, never>;
10188
+ }>;
10189
+ customLineItems: Schema.PropertySignature<":", {
10190
+ readonly value: number;
10191
+ readonly name: string;
10192
+ readonly displayName: string;
10193
+ readonly isContra: boolean;
10194
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10195
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10196
+ } | null, "custom_line_items", ":", {
10197
+ readonly value: number;
10198
+ readonly name: string;
10199
+ readonly display_name: string;
10200
+ readonly is_contra: boolean;
10201
+ readonly line_items: readonly import("@layerfi/components/utils/schema/utils").LineItemEncoded[];
10202
+ readonly percent_delta?: string | undefined;
10203
+ } | null, false, never>;
10204
+ otherOutflows: Schema.PropertySignature<":", {
10205
+ readonly value: number;
10206
+ readonly name: string;
10207
+ readonly displayName: string;
10208
+ readonly isContra: boolean;
10209
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10210
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10211
+ } | null, "other_outflows", ":", {
10212
+ readonly value: number;
10213
+ readonly name: string;
10214
+ readonly display_name: string;
10215
+ readonly is_contra: boolean;
10216
+ readonly line_items: readonly import("@layerfi/components/utils/schema/utils").LineItemEncoded[];
10217
+ readonly percent_delta?: string | undefined;
10218
+ } | null, false, never>;
10219
+ uncategorizedOutflows: Schema.PropertySignature<"?:", {
10220
+ readonly value: number;
10221
+ readonly name: string;
10222
+ readonly displayName: string;
10223
+ readonly isContra: boolean;
10224
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10225
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10226
+ } | undefined, "uncategorized_outflows", "?:", {
10227
+ readonly value: number;
10228
+ readonly name: string;
10229
+ readonly display_name: string;
10230
+ readonly is_contra: boolean;
10231
+ readonly line_items: readonly import("@layerfi/components/utils/schema/utils").LineItemEncoded[];
10232
+ readonly percent_delta?: string | undefined;
10233
+ } | undefined, false, never>;
10234
+ uncategorizedInflows: Schema.PropertySignature<"?:", {
10235
+ readonly value: number;
10236
+ readonly name: string;
10237
+ readonly displayName: string;
10238
+ readonly isContra: boolean;
10239
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10240
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10241
+ } | undefined, "uncategorized_inflows", "?:", {
10242
+ readonly value: number;
10243
+ readonly name: string;
10244
+ readonly display_name: string;
10245
+ readonly is_contra: boolean;
10246
+ readonly line_items: readonly import("@layerfi/components/utils/schema/utils").LineItemEncoded[];
10247
+ readonly percent_delta?: string | undefined;
10248
+ } | undefined, false, never>;
10249
+ personalExpenses: Schema.PropertySignature<":", {
10250
+ readonly value: number;
10251
+ readonly name: string;
10252
+ readonly displayName: string;
10253
+ readonly isContra: boolean;
10254
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10255
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10256
+ } | null, "personal_expenses", ":", {
10257
+ readonly value: number;
10258
+ readonly name: string;
10259
+ readonly display_name: string;
10260
+ readonly is_contra: boolean;
10261
+ readonly line_items: readonly import("@layerfi/components/utils/schema/utils").LineItemEncoded[];
10262
+ readonly percent_delta?: string | undefined;
10263
+ } | null, false, never>;
10264
+ }>;
10265
+ export type ProfitAndLoss = typeof ProfitAndLossReportSchema.Type;
10266
+
8956
10267
  }
8957
10268
  declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
8958
10269
  import { ReportingBasis, SortDirection } from '@layerfi/components/types';
@@ -8973,14 +10284,97 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
8973
10284
  };
8974
10285
  export type ProfitAndLossFilters = Record<Scope, ProfitAndLossFilter | undefined>;
8975
10286
  export const useProfitAndLoss: ({ tagFilter, reportingBasis, }: UseProfitAndLossOptions) => {
8976
- data: import("@layerfi/components/types").ProfitAndLoss | undefined;
8977
- filteredDataRevenue: never[] | import("@layerfi/components/types/line_item").LineBaseItem[];
10287
+ data: {
10288
+ readonly businessId: string;
10289
+ readonly startDate: Date;
10290
+ readonly endDate: Date;
10291
+ readonly income: {
10292
+ readonly value: number;
10293
+ readonly name: string;
10294
+ readonly displayName: string;
10295
+ readonly isContra: boolean;
10296
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10297
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10298
+ };
10299
+ readonly costOfGoodsSold: {
10300
+ readonly value: number;
10301
+ readonly name: string;
10302
+ readonly displayName: string;
10303
+ readonly isContra: boolean;
10304
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10305
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10306
+ };
10307
+ readonly grossProfit: number;
10308
+ readonly profitBeforeTaxes: number;
10309
+ readonly taxes: {
10310
+ readonly value: number;
10311
+ readonly name: string;
10312
+ readonly displayName: string;
10313
+ readonly isContra: boolean;
10314
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10315
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10316
+ };
10317
+ readonly netProfit: number;
10318
+ readonly fullyCategorized: boolean;
10319
+ readonly uncategorizedInflows?: {
10320
+ readonly value: number;
10321
+ readonly name: string;
10322
+ readonly displayName: string;
10323
+ readonly isContra: boolean;
10324
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10325
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10326
+ } | undefined;
10327
+ readonly uncategorizedOutflows?: {
10328
+ readonly value: number;
10329
+ readonly name: string;
10330
+ readonly displayName: string;
10331
+ readonly isContra: boolean;
10332
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10333
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10334
+ } | undefined;
10335
+ readonly grossProfitPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10336
+ readonly profitBeforeTaxesPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10337
+ readonly netProfitPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10338
+ readonly expenses: {
10339
+ readonly value: number;
10340
+ readonly name: string;
10341
+ readonly displayName: string;
10342
+ readonly isContra: boolean;
10343
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10344
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10345
+ };
10346
+ readonly customLineItems: {
10347
+ readonly value: number;
10348
+ readonly name: string;
10349
+ readonly displayName: string;
10350
+ readonly isContra: boolean;
10351
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10352
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10353
+ } | null;
10354
+ readonly otherOutflows: {
10355
+ readonly value: number;
10356
+ readonly name: string;
10357
+ readonly displayName: string;
10358
+ readonly isContra: boolean;
10359
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10360
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10361
+ } | null;
10362
+ readonly personalExpenses: {
10363
+ readonly value: number;
10364
+ readonly name: string;
10365
+ readonly displayName: string;
10366
+ readonly isContra: boolean;
10367
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10368
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10369
+ } | null;
10370
+ } | undefined;
10371
+ filteredDataRevenue: never[] | import("@layerfi/components/utils/profitAndLossUtils").PnlChartLineItem[];
8978
10372
  filteredTotalRevenue: number | undefined;
8979
- filteredDataExpenses: never[] | import("@layerfi/components/types/line_item").LineBaseItem[];
10373
+ filteredDataExpenses: never[] | import("@layerfi/components/utils/profitAndLossUtils").PnlChartLineItem[];
8980
10374
  filteredTotalExpenses: number | undefined;
8981
10375
  isLoading: boolean;
8982
10376
  isValidating: boolean;
8983
- error: unknown;
10377
+ isError: boolean;
8984
10378
  refetch: () => void;
8985
10379
  sidebarScope: SidebarScope;
8986
10380
  setSidebarScope: import("react").Dispatch<import("react").SetStateAction<SidebarScope>>;
@@ -8995,11 +10389,221 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
8995
10389
  };
8996
10390
  export {};
8997
10391
 
10392
+ }
10393
+ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossDetailLines' {
10394
+ import { type SWRResponse } from 'swr';
10395
+ import { ReportingBasis } from '@layerfi/components/types';
10396
+ import { LedgerEntrySourceSchema, PnlDetailLineSchema, PnlDetailLinesDataSchema } from '@layerfi/components/hooks/useProfitAndLoss/schemas';
10397
+ export const LIST_PNL_DETAIL_LINES_TAG_KEY = "#list-pnl-detail-lines";
10398
+ type PnlStructureLineItemName = string;
10399
+ export type PnlDetailLinesBaseParams = {
10400
+ businessId: string;
10401
+ startDate: Date;
10402
+ endDate: Date;
10403
+ pnlStructureLineItemName: PnlStructureLineItemName;
10404
+ };
10405
+ export type PnlDetailLinesFilterParams = {
10406
+ tagFilter?: {
10407
+ key: string;
10408
+ values: string[];
10409
+ };
10410
+ reportingBasis?: ReportingBasis;
10411
+ pnlStructure?: string;
10412
+ };
10413
+ export type PnlDetailLine = typeof PnlDetailLineSchema.Type;
10414
+ export type LedgerEntrySourceType = typeof LedgerEntrySourceSchema.Type;
10415
+ export type PnlDetailLinesReturn = typeof PnlDetailLinesDataSchema.Type;
10416
+ class PnlDetailLinesSWRResponse {
10417
+ private swrResponse;
10418
+ constructor(swrResponse: SWRResponse<PnlDetailLinesReturn>);
10419
+ get data(): PnlDetailLinesReturn | undefined;
10420
+ get isLoading(): boolean;
10421
+ get isValidating(): boolean;
10422
+ get isError(): boolean;
10423
+ get refetch(): import("swr").KeyedMutator<{
10424
+ readonly type: string;
10425
+ readonly businessId: string;
10426
+ readonly startDate: string;
10427
+ readonly endDate: string;
10428
+ readonly reportingBasis?: string | null | undefined;
10429
+ readonly pnlStructureLineItemName: string;
10430
+ readonly pnlStructure?: string | null | undefined;
10431
+ readonly tagFilter: {
10432
+ readonly values: readonly string[];
10433
+ readonly key: string;
10434
+ } | null;
10435
+ readonly lines: readonly {
10436
+ readonly id: string;
10437
+ readonly date: string;
10438
+ readonly source?: {
10439
+ readonly type: "Transaction_Ledger_Entry_Source";
10440
+ readonly externalId: string;
10441
+ readonly memo?: string | null | undefined;
10442
+ readonly date: string;
10443
+ readonly amount: number;
10444
+ readonly direction: import("@layerfi/components/types").Direction;
10445
+ readonly displayDescription: string;
10446
+ readonly entityName: string;
10447
+ readonly transactionId: string;
10448
+ readonly accountName?: string | undefined;
10449
+ readonly counterparty?: string | undefined;
10450
+ readonly metadata?: unknown;
10451
+ readonly referenceNumber?: string | null | undefined;
10452
+ } | {
10453
+ readonly type: "Invoice_Ledger_Entry_Source";
10454
+ readonly externalId: string;
10455
+ readonly memo?: string | null | undefined;
10456
+ readonly date: string;
10457
+ readonly amount: number;
10458
+ readonly displayDescription: string;
10459
+ readonly entityName: string;
10460
+ readonly metadata?: unknown;
10461
+ readonly referenceNumber?: string | null | undefined;
10462
+ readonly invoiceId: string;
10463
+ readonly invoiceNumber: string | null;
10464
+ readonly recipientName: string;
10465
+ readonly customerDescription?: string | undefined;
10466
+ } | {
10467
+ readonly type: "Manual_Ledger_Entry_Source";
10468
+ readonly memo: string | null;
10469
+ readonly displayDescription: string;
10470
+ readonly entityName: string;
10471
+ readonly metadata?: unknown;
10472
+ readonly referenceNumber?: string | null | undefined;
10473
+ readonly manualEntryId: string;
10474
+ readonly createdBy: string;
10475
+ } | {
10476
+ readonly type: "Invoice_Payment_Ledger_Entry_Source";
10477
+ readonly externalId: string;
10478
+ readonly memo?: string | null | undefined;
10479
+ readonly amount: number;
10480
+ readonly displayDescription: string;
10481
+ readonly entityName: string;
10482
+ readonly metadata?: unknown;
10483
+ readonly referenceNumber?: string | null | undefined;
10484
+ readonly invoiceId: string;
10485
+ readonly invoiceNumber: string | null;
10486
+ } | {
10487
+ readonly type: "Refund_Ledger_Entry_Source";
10488
+ readonly externalId: string;
10489
+ readonly memo?: string | null | undefined;
10490
+ readonly displayDescription: string;
10491
+ readonly entityName: string;
10492
+ readonly metadata?: unknown;
10493
+ readonly referenceNumber?: string | null | undefined;
10494
+ readonly recipientName: string;
10495
+ readonly refundId: string;
10496
+ readonly refundedToCustomerAmount: number;
10497
+ } | {
10498
+ readonly type: "Refund_Payment_Ledger_Entry_Source";
10499
+ readonly externalId: string;
10500
+ readonly memo?: string | null | undefined;
10501
+ readonly displayDescription: string;
10502
+ readonly entityName: string;
10503
+ readonly metadata?: unknown;
10504
+ readonly referenceNumber?: string | null | undefined;
10505
+ readonly recipientName: string;
10506
+ readonly refundId: string;
10507
+ readonly refundedToCustomerAmount: number;
10508
+ readonly refundPaymentId: string;
10509
+ } | {
10510
+ readonly type: "Opening_Balance_Ledger_Entry_Source";
10511
+ readonly memo?: string | null | undefined;
10512
+ readonly displayDescription: string;
10513
+ readonly entityName: string;
10514
+ readonly accountName?: string | undefined;
10515
+ readonly metadata?: unknown;
10516
+ readonly referenceNumber?: string | null | undefined;
10517
+ } | {
10518
+ readonly type: "Payout_Ledger_Entry_Source";
10519
+ readonly externalId: string;
10520
+ readonly memo?: string | null | undefined;
10521
+ readonly displayDescription: string;
10522
+ readonly entityName: string;
10523
+ readonly metadata?: unknown;
10524
+ readonly referenceNumber?: string | null | undefined;
10525
+ readonly payoutId: string;
10526
+ readonly paidOutAmount: number;
10527
+ readonly processor: string;
10528
+ readonly completedAt: string;
10529
+ } | undefined;
10530
+ readonly amount: number;
10531
+ readonly direction: import("@layerfi/components/types").Direction;
10532
+ readonly entryId: string;
10533
+ readonly account: {
10534
+ readonly id: string;
10535
+ readonly name: string;
10536
+ readonly normality: string;
10537
+ readonly stableName: string;
10538
+ readonly accountType: {
10539
+ readonly value: string;
10540
+ readonly displayName: string;
10541
+ };
10542
+ readonly accountSubtype: {
10543
+ readonly value: string;
10544
+ readonly displayName: string;
10545
+ };
10546
+ };
10547
+ }[];
10548
+ }>;
10549
+ }
10550
+ export function useProfitAndLossDetailLines({ startDate, endDate, pnlStructureLineItemName, tagFilter, reportingBasis, pnlStructure, }: PnlDetailLinesBaseParams & PnlDetailLinesFilterParams): PnlDetailLinesSWRResponse;
10551
+ export function usePnlDetailLinesInvalidator(): {
10552
+ invalidatePnlDetailLines: () => Promise<undefined[]>;
10553
+ debouncedInvalidatePnlDetailLines: import("lodash").DebouncedFunc<() => Promise<undefined[]>>;
10554
+ };
10555
+ export type GetProfitAndLossDetailLinesParams = {
10556
+ businessId: string;
10557
+ startDate: Date;
10558
+ endDate: Date;
10559
+ pnlStructureLineItemName: string;
10560
+ tagKey?: string;
10561
+ tagValues?: string;
10562
+ reportingBasis?: string;
10563
+ pnlStructure?: string;
10564
+ };
10565
+ export const getProfitAndLossDetailLines: (apiUrl: string, accessToken: string | undefined, params: GetProfitAndLossDetailLinesParams) => () => Promise<{
10566
+ data?: PnlDetailLinesReturn;
10567
+ params: GetProfitAndLossDetailLinesParams;
10568
+ }>;
10569
+ export {};
10570
+
10571
+ }
10572
+ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossDetailLinesExport' {
10573
+ import type { S3PresignedUrl } from '@layerfi/components/types/general';
10574
+ import type { Awaitable } from '@layerfi/components/types/utility/promises';
10575
+ import { PnlDetailLinesBaseParams, PnlDetailLinesFilterParams } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossDetailLines';
10576
+ type UseProfitAndLossDetailLinesExportOptions = PnlDetailLinesBaseParams & PnlDetailLinesFilterParams & {
10577
+ onSuccess?: (url: S3PresignedUrl) => Awaitable<unknown>;
10578
+ };
10579
+ export function useProfitAndLossDetailLinesExport({ startDate, endDate, pnlStructureLineItemName, tagFilter, reportingBasis, pnlStructure, onSuccess, }: UseProfitAndLossDetailLinesExportOptions): import("swr/mutation").SWRMutationResponse<unknown, any, () => {
10580
+ accessToken: string;
10581
+ apiUrl: string;
10582
+ businessId: string;
10583
+ startDate: Date;
10584
+ endDate: Date;
10585
+ pnlStructureLineItemName: string;
10586
+ tagFilter: {
10587
+ key: string;
10588
+ values: string[];
10589
+ } | undefined;
10590
+ reportingBasis: import("@layerfi/components/types").ReportingBasis | undefined;
10591
+ pnlStructure: string | undefined;
10592
+ tags: string[];
10593
+ } | undefined, never>;
10594
+ export {};
10595
+
10596
+ }
10597
+ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossGlobalInvalidator' {
10598
+ export const useProfitAndLossGlobalInvalidator: () => {
10599
+ invalidateProfitAndLoss: () => Promise<void>;
10600
+ debouncedInvalidateProfitAndLoss: import("lodash").DebouncedFunc<() => Promise<undefined[]>>;
10601
+ };
10602
+
8998
10603
  }
8999
10604
  declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossLTM' {
9000
10605
  import { ReportingBasis } from '@layerfi/components/types';
9001
- import { LoadedStatus } from '@layerfi/components/types/general';
9002
- import { ProfitAndLossSummary } from '@layerfi/components/types/profit_and_loss';
10606
+ import type { ProfitAndLossSummary } from '@layerfi/components/hooks/useProfitAndLoss/schemas';
9003
10607
  type UseProfitAndLossLTMProps = {
9004
10608
  currentDate: Date;
9005
10609
  tagFilter?: {
@@ -9013,10 +10617,9 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossLTM'
9013
10617
  }
9014
10618
  type UseProfitAndLossLTMReturn = (props?: UseProfitAndLossLTMProps) => {
9015
10619
  data: ProfitAndLossSummaryData[];
9016
- isLoading?: boolean;
9017
- loaded?: LoadedStatus;
9018
- error?: unknown;
9019
- pullData: (date: Date) => void;
10620
+ isLoading: boolean;
10621
+ isError: boolean;
10622
+ setDate: (date: Date) => void;
9020
10623
  refetch: () => void;
9021
10624
  };
9022
10625
  /**
@@ -9027,27 +10630,251 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossLTM'
9027
10630
  export {};
9028
10631
 
9029
10632
  }
9030
- declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossQuery' {
9031
- import { ProfitAndLoss, ReportingBasis } from '@layerfi/components/types';
9032
- type UseProfitAndLossQueryProps = {
9033
- startDate: Date;
9034
- endDate: Date;
9035
- tagFilter?: {
9036
- key: string;
9037
- values: string[];
9038
- };
9039
- reportingBasis?: ReportingBasis;
10633
+ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossReport' {
10634
+ import { type SWRResponse } from 'swr';
10635
+ import { ProfitAndLoss, ProfitAndLossReportRequestParams } from '@layerfi/components/hooks/useProfitAndLoss/schemas';
10636
+ export const PNL_REPORT_TAG_KEY = "#profit-and-loss-report";
10637
+ class ProfitAndLossReportSWRResponse {
10638
+ private swrResponse;
10639
+ constructor(swrResponse: SWRResponse<ProfitAndLoss>);
10640
+ get data(): {
10641
+ readonly businessId: string;
10642
+ readonly startDate: Date;
10643
+ readonly endDate: Date;
10644
+ readonly income: {
10645
+ readonly value: number;
10646
+ readonly name: string;
10647
+ readonly displayName: string;
10648
+ readonly isContra: boolean;
10649
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10650
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10651
+ };
10652
+ readonly costOfGoodsSold: {
10653
+ readonly value: number;
10654
+ readonly name: string;
10655
+ readonly displayName: string;
10656
+ readonly isContra: boolean;
10657
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10658
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10659
+ };
10660
+ readonly grossProfit: number;
10661
+ readonly profitBeforeTaxes: number;
10662
+ readonly taxes: {
10663
+ readonly value: number;
10664
+ readonly name: string;
10665
+ readonly displayName: string;
10666
+ readonly isContra: boolean;
10667
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10668
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10669
+ };
10670
+ readonly netProfit: number;
10671
+ readonly fullyCategorized: boolean;
10672
+ readonly uncategorizedInflows?: {
10673
+ readonly value: number;
10674
+ readonly name: string;
10675
+ readonly displayName: string;
10676
+ readonly isContra: boolean;
10677
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10678
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10679
+ } | undefined;
10680
+ readonly uncategorizedOutflows?: {
10681
+ readonly value: number;
10682
+ readonly name: string;
10683
+ readonly displayName: string;
10684
+ readonly isContra: boolean;
10685
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10686
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10687
+ } | undefined;
10688
+ readonly grossProfitPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10689
+ readonly profitBeforeTaxesPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10690
+ readonly netProfitPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10691
+ readonly expenses: {
10692
+ readonly value: number;
10693
+ readonly name: string;
10694
+ readonly displayName: string;
10695
+ readonly isContra: boolean;
10696
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10697
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10698
+ };
10699
+ readonly customLineItems: {
10700
+ readonly value: number;
10701
+ readonly name: string;
10702
+ readonly displayName: string;
10703
+ readonly isContra: boolean;
10704
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10705
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10706
+ } | null;
10707
+ readonly otherOutflows: {
10708
+ readonly value: number;
10709
+ readonly name: string;
10710
+ readonly displayName: string;
10711
+ readonly isContra: boolean;
10712
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10713
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10714
+ } | null;
10715
+ readonly personalExpenses: {
10716
+ readonly value: number;
10717
+ readonly name: string;
10718
+ readonly displayName: string;
10719
+ readonly isContra: boolean;
10720
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10721
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10722
+ } | null;
10723
+ } | undefined;
10724
+ get isLoading(): boolean;
10725
+ get isValidating(): boolean;
10726
+ get isError(): boolean;
10727
+ get mutate(): import("swr").KeyedMutator<{
10728
+ readonly businessId: string;
10729
+ readonly startDate: Date;
10730
+ readonly endDate: Date;
10731
+ readonly income: {
10732
+ readonly value: number;
10733
+ readonly name: string;
10734
+ readonly displayName: string;
10735
+ readonly isContra: boolean;
10736
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10737
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10738
+ };
10739
+ readonly costOfGoodsSold: {
10740
+ readonly value: number;
10741
+ readonly name: string;
10742
+ readonly displayName: string;
10743
+ readonly isContra: boolean;
10744
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10745
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10746
+ };
10747
+ readonly grossProfit: number;
10748
+ readonly profitBeforeTaxes: number;
10749
+ readonly taxes: {
10750
+ readonly value: number;
10751
+ readonly name: string;
10752
+ readonly displayName: string;
10753
+ readonly isContra: boolean;
10754
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10755
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10756
+ };
10757
+ readonly netProfit: number;
10758
+ readonly fullyCategorized: boolean;
10759
+ readonly uncategorizedInflows?: {
10760
+ readonly value: number;
10761
+ readonly name: string;
10762
+ readonly displayName: string;
10763
+ readonly isContra: boolean;
10764
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10765
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10766
+ } | undefined;
10767
+ readonly uncategorizedOutflows?: {
10768
+ readonly value: number;
10769
+ readonly name: string;
10770
+ readonly displayName: string;
10771
+ readonly isContra: boolean;
10772
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10773
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10774
+ } | undefined;
10775
+ readonly grossProfitPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10776
+ readonly profitBeforeTaxesPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10777
+ readonly netProfitPercentDelta: import("effect/BigDecimal").BigDecimal | undefined;
10778
+ readonly expenses: {
10779
+ readonly value: number;
10780
+ readonly name: string;
10781
+ readonly displayName: string;
10782
+ readonly isContra: boolean;
10783
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10784
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10785
+ };
10786
+ readonly customLineItems: {
10787
+ readonly value: number;
10788
+ readonly name: string;
10789
+ readonly displayName: string;
10790
+ readonly isContra: boolean;
10791
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10792
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10793
+ } | null;
10794
+ readonly otherOutflows: {
10795
+ readonly value: number;
10796
+ readonly name: string;
10797
+ readonly displayName: string;
10798
+ readonly isContra: boolean;
10799
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10800
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10801
+ } | null;
10802
+ readonly personalExpenses: {
10803
+ readonly value: number;
10804
+ readonly name: string;
10805
+ readonly displayName: string;
10806
+ readonly isContra: boolean;
10807
+ readonly percentDelta?: import("effect/BigDecimal").BigDecimal | undefined;
10808
+ readonly lineItems: readonly import("@layerfi/components/utils/schema/utils").LineItem[];
10809
+ } | null;
10810
+ }>;
10811
+ }
10812
+ type UseProfitAndLossReportProps = Omit<ProfitAndLossReportRequestParams, 'businessId'>;
10813
+ export function useProfitAndLossReport({ startDate, endDate, tagKey, tagValues, reportingBasis, includeUncategorized }: UseProfitAndLossReportProps): ProfitAndLossReportSWRResponse;
10814
+ export const useProfitAndLossReportCacheActions: () => {
10815
+ invalidateProfitAndLossReport: () => Promise<undefined[]>;
10816
+ debouncedInvalidateProfitAndLossReport: import("lodash").DebouncedFunc<() => Promise<undefined[]>>;
9040
10817
  };
9041
- type UseProfitAndLossQueryReturn = (props?: UseProfitAndLossQueryProps) => {
9042
- data?: ProfitAndLoss;
9043
- isLoading: boolean;
9044
- isValidating: boolean;
9045
- error: unknown;
9046
- refetch: () => void;
9047
- startDate: Date;
9048
- endDate: Date;
10818
+ export {};
10819
+
10820
+ }
10821
+ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossSummaries' {
10822
+ import { type SWRResponse } from 'swr';
10823
+ import { type ProfitAndLossSummaries, ProfitAndLossSummariesRequestParams } from '@layerfi/components/hooks/useProfitAndLoss/schemas';
10824
+ export const PNL_SUMMARIES_TAG_KEY = "#profit-and-loss-summaries";
10825
+ class ProfitAndLossSummariesSWRResponse {
10826
+ private swrResponse;
10827
+ constructor(swrResponse: SWRResponse<ProfitAndLossSummaries>);
10828
+ get data(): {
10829
+ readonly type: "Profit_And_Loss_Summaries";
10830
+ readonly months: readonly {
10831
+ readonly month: number;
10832
+ readonly year: number;
10833
+ readonly income: number;
10834
+ readonly costOfGoodsSold: number;
10835
+ readonly grossProfit: number;
10836
+ readonly operatingExpenses: number;
10837
+ readonly profitBeforeTaxes: number;
10838
+ readonly taxes: number;
10839
+ readonly netProfit: number;
10840
+ readonly fullyCategorized: boolean;
10841
+ readonly totalExpenses: number;
10842
+ readonly uncategorizedInflows: number;
10843
+ readonly uncategorizedOutflows: number;
10844
+ readonly uncategorizedTransactions: number;
10845
+ readonly categorizedTransactions: number;
10846
+ }[];
10847
+ } | undefined;
10848
+ get isLoading(): boolean;
10849
+ get isValidating(): boolean;
10850
+ get isError(): boolean;
10851
+ get mutate(): import("swr").KeyedMutator<{
10852
+ readonly type: "Profit_And_Loss_Summaries";
10853
+ readonly months: readonly {
10854
+ readonly month: number;
10855
+ readonly year: number;
10856
+ readonly income: number;
10857
+ readonly costOfGoodsSold: number;
10858
+ readonly grossProfit: number;
10859
+ readonly operatingExpenses: number;
10860
+ readonly profitBeforeTaxes: number;
10861
+ readonly taxes: number;
10862
+ readonly netProfit: number;
10863
+ readonly fullyCategorized: boolean;
10864
+ readonly totalExpenses: number;
10865
+ readonly uncategorizedInflows: number;
10866
+ readonly uncategorizedOutflows: number;
10867
+ readonly uncategorizedTransactions: number;
10868
+ readonly categorizedTransactions: number;
10869
+ }[];
10870
+ }>;
10871
+ }
10872
+ type UseProfitAndLossSummariesProps = Omit<ProfitAndLossSummariesRequestParams, 'businessId'>;
10873
+ export function useProfitAndLossSummaries({ startYear, startMonth, endYear, endMonth, tagKey, tagValues, reportingBasis }: UseProfitAndLossSummariesProps): ProfitAndLossSummariesSWRResponse;
10874
+ export const useProfitAndLossSummariesCacheActions: () => {
10875
+ invalidateProfitAndLossSummaries: () => Promise<undefined[]>;
10876
+ debouncedInvalidateProfitAndLossSummaries: import("lodash").DebouncedFunc<() => Promise<undefined[]>>;
9049
10877
  };
9050
- export const useProfitAndLossQuery: UseProfitAndLossQueryReturn;
9051
10878
  export {};
9052
10879
 
9053
10880
  }
@@ -9874,6 +11701,40 @@ declare module '@layerfi/components/providers/GlobalDateStore/useGlobalDateRange
9874
11701
  onChangeDateOrDateRange: (dates: Date | [Date, Date | null]) => void;
9875
11702
  };
9876
11703
 
11704
+ }
11705
+ declare module '@layerfi/components/providers/InvoiceStore/InvoiceStoreProvider' {
11706
+ import { type PropsWithChildren } from 'react';
11707
+ import type { Invoice } from '@layerfi/components/features/invoices/invoiceSchemas';
11708
+ import { type InvoiceStatusOption } from '@layerfi/components/components/Invoices/InvoiceTable/InvoiceTable';
11709
+ import type { InvoiceFormMode } from '@layerfi/components/components/Invoices/InvoiceForm/InvoiceForm';
11710
+ type InvoiceTableQuery = {
11711
+ status: InvoiceStatusOption;
11712
+ };
11713
+ export enum InvoiceRoute {
11714
+ Table = "Table",
11715
+ Detail = "Detail"
11716
+ }
11717
+ type InvoiceDetailRouteState = {
11718
+ route: InvoiceRoute.Detail;
11719
+ } & InvoiceFormMode;
11720
+ type InvoiceTableRouteState = {
11721
+ route: InvoiceRoute.Table;
11722
+ };
11723
+ type InvoiceRouteState = InvoiceDetailRouteState | InvoiceTableRouteState;
11724
+ export function useInvoiceRouteState(): InvoiceRouteState;
11725
+ export function useInvoiceDetail(): InvoiceFormMode;
11726
+ export function useInvoiceTableQuery(): {
11727
+ query: InvoiceTableQuery;
11728
+ setQuery: (patchQuery: Partial<InvoiceTableQuery>) => void;
11729
+ };
11730
+ export function useInvoiceNavigation(): {
11731
+ toCreateInvoice: () => void;
11732
+ toInvoiceTable: () => void;
11733
+ toViewInvoice: (invoice: Invoice) => void;
11734
+ };
11735
+ export function InvoiceStoreProvider(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
11736
+ export {};
11737
+
9877
11738
  }
9878
11739
  declare module '@layerfi/components/providers/LayerProvider/LayerProvider' {
9879
11740
  import { PropsWithChildren } from 'react';
@@ -10371,6 +12232,7 @@ declare module '@layerfi/components/types/chart_of_accounts' {
10371
12232
  account_subtype?: ApiAccountType;
10372
12233
  normality: Direction;
10373
12234
  balance: number;
12235
+ is_deletable: boolean;
10374
12236
  sub_accounts: LedgerAccountBalance[];
10375
12237
  };
10376
12238
  export type AugmentedLedgerAccountBalance = LedgerAccountBalance & {
@@ -10743,20 +12605,12 @@ declare module '@layerfi/components/types/ledger_accounts' {
10743
12605
  }
10744
12606
  declare module '@layerfi/components/types/line_item' {
10745
12607
  export interface LineItem {
10746
- name?: string;
12608
+ name: string;
10747
12609
  display_name: string;
10748
12610
  value: number | undefined;
10749
12611
  line_items?: LineItem[] | null;
10750
12612
  is_contra?: boolean;
10751
12613
  }
10752
- export interface LineBaseItem {
10753
- name?: string;
10754
- display_name: string;
10755
- value: number;
10756
- type: string;
10757
- share?: number;
10758
- hidden?: boolean;
10759
- }
10760
12614
 
10761
12615
  }
10762
12616
  declare module '@layerfi/components/types/linked_accounts' {
@@ -10995,25 +12849,8 @@ declare module '@layerfi/components/types/location' {
10995
12849
  declare module '@layerfi/components/types/profit_and_loss' {
10996
12850
  import type { ReportingBasis } from '@layerfi/components/types';
10997
12851
  import { ReadonlyArrayWithAtLeastOne } from '@layerfi/components/utils/array/getArrayWithAtLeastOneOrFallback';
10998
- import { LineItem } from '@layerfi/components/types/line_item';
12852
+ import { LineItem } from '@layerfi/components/utils/schema/utils';
10999
12853
  import { TagViewConfig } from '@layerfi/components/types/tags';
11000
- export interface ProfitAndLoss {
11001
- type: 'Profit_And_Loss';
11002
- business_id: string;
11003
- start_date: string;
11004
- end_date: string;
11005
- income: LineItem;
11006
- cost_of_goods_sold?: LineItem | null;
11007
- gross_profit: number;
11008
- expenses: LineItem;
11009
- profit_before_taxes: number;
11010
- taxes: LineItem;
11011
- net_profit: number;
11012
- other_outflows?: LineItem | null;
11013
- personal_expenses?: LineItem | null;
11014
- fully_categorized: boolean;
11015
- custom_line_items?: LineItem | null;
11016
- }
11017
12854
  export interface TagComparisonOption {
11018
12855
  displayName: string;
11019
12856
  tagFilterConfig: TagViewConfig;
@@ -11086,28 +12923,6 @@ declare module '@layerfi/components/types/profit_and_loss' {
11086
12923
  };
11087
12924
  pnl: ProfitAndLossComparisonPnl;
11088
12925
  }
11089
- export interface ProfitAndLossSummary {
11090
- year: number;
11091
- month: number;
11092
- income: number;
11093
- costOfGoodsSold: number;
11094
- grossProfit: number;
11095
- operatingExpenses: number;
11096
- profitBeforeTaxes: number;
11097
- taxes: number;
11098
- netProfit: number;
11099
- fullyCategorized: boolean;
11100
- totalExpenses: number;
11101
- uncategorizedInflows: number;
11102
- uncategorizedOutflows: number;
11103
- totalExpensesInverse?: number;
11104
- uncategorizedOutflowsInverse?: number;
11105
- uncategorized_transactions: number;
11106
- }
11107
- export interface ProfitAndLossSummaries {
11108
- type: 'Profit_And_Loss_Summaries';
11109
- months: ProfitAndLossSummary[];
11110
- }
11111
12926
  export {};
11112
12927
 
11113
12928
  }
@@ -11328,7 +13143,6 @@ declare module '@layerfi/components/types' {
11328
13143
  export { OAuthResponse } from '@layerfi/components/types/authentication';
11329
13144
  export { LayerContextValues, LayerContextActionName, LayerContextAction, LayerContextHelpers, } from '@layerfi/components/types/layer_context';
11330
13145
  export { Metadata } from '@layerfi/components/types/api';
11331
- export { ProfitAndLoss } from '@layerfi/components/types/profit_and_loss';
11332
13146
  export { LineItem } from '@layerfi/components/types/line_item';
11333
13147
  export { BalanceSheet } from '@layerfi/components/types/balance_sheet';
11334
13148
  export { StatementOfCashFlow } from '@layerfi/components/types/statement_of_cash_flow';
@@ -11420,15 +13234,17 @@ declare module '@layerfi/components/utils/bigDecimalUtils' {
11420
13234
  * Example: 123.45 → 12345
11421
13235
  */
11422
13236
  export const convertBigDecimalToCents: (amount: BD.BigDecimal) => number;
13237
+ export const convertBigIntCentsToBigDecimal: (cents: bigint) => BD.BigDecimal;
11423
13238
  export const convertCentsToBigDecimal: (cents: number) => BD.BigDecimal;
13239
+ export const convertDecimalToPercent: (decimal: BD.BigDecimal) => BD.BigDecimal;
11424
13240
  export const convertPercentToDecimal: (percent: BD.BigDecimal) => BD.BigDecimal;
11425
13241
  export const roundDecimalToCents: (decimal: BD.BigDecimal) => BD.BigDecimal;
11426
13242
  export const safeDivide: (dividend: BD.BigDecimal, divisor: BD.BigDecimal) => BD.BigDecimal;
11427
13243
  export const negate: (value: BD.BigDecimal) => BD.BigDecimal;
11428
13244
  export function formatBigDecimalToString(value: BD.BigDecimal, options?: {
11429
- mode: 'percent' | 'currency' | 'decimal';
11430
- minDecimalPlaces: number;
11431
- maxDecimalPlaces: number;
13245
+ mode?: 'percent' | 'currency' | 'decimal';
13246
+ minDecimalPlaces?: number;
13247
+ maxDecimalPlaces?: number;
11432
13248
  }): string;
11433
13249
 
11434
13250
  }
@@ -11521,8 +13337,10 @@ declare module '@layerfi/components/utils/delay/runDelayed' {
11521
13337
 
11522
13338
  }
11523
13339
  declare module '@layerfi/components/utils/form' {
13340
+ import { ValidationErrorMap } from '@tanstack/react-form';
11524
13341
  export const notEmpty: (value?: string | null) => boolean;
11525
13342
  export const validateEmailFormat: (email?: string, required?: boolean) => boolean;
13343
+ export function flattenValidationErrors(errors: ValidationErrorMap): string[];
11526
13344
 
11527
13345
  }
11528
13346
  declare module '@layerfi/components/utils/format' {
@@ -11590,7 +13408,7 @@ declare module '@layerfi/components/utils/journal' {
11590
13408
  }
11591
13409
  declare module '@layerfi/components/utils/profitAndLossComparisonUtils' {
11592
13410
  import { DateRangePickerMode } from '@layerfi/components/providers/GlobalDateStore/GlobalDateStoreProvider';
11593
- import { LineItem } from '@layerfi/components/types';
13411
+ import { LineItem } from '@layerfi/components/utils/schema/utils';
11594
13412
  export const generateComparisonPeriods: (startDate: Date, numberOfPeriods: number, rangeDisplayMode: DateRangePickerMode) => {
11595
13413
  date: Date;
11596
13414
  label: string;
@@ -11600,13 +13418,18 @@ declare module '@layerfi/components/utils/profitAndLossComparisonUtils' {
11600
13418
 
11601
13419
  }
11602
13420
  declare module '@layerfi/components/utils/profitAndLossUtils' {
13421
+ import type { ProfitAndLoss } from '@layerfi/components/hooks/useProfitAndLoss/schemas';
11603
13422
  import { SidebarScope } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
11604
- import { LineBaseItem } from '@layerfi/components/types/line_item';
11605
- import { ProfitAndLoss } from '@layerfi/components/types/profit_and_loss';
11606
- export const collectExpensesItems: (data: ProfitAndLoss) => LineBaseItem[];
11607
- export const collectRevenueItems: (data: ProfitAndLoss) => LineBaseItem[];
13423
+ import type { LineItem } from '@layerfi/components/utils/schema/utils';
13424
+ export type PnlChartLineItem = LineItem & {
13425
+ type: string;
13426
+ isHidden?: boolean;
13427
+ share?: number;
13428
+ };
13429
+ export const collectExpensesItems: (data: ProfitAndLoss) => PnlChartLineItem[];
13430
+ export const collectRevenueItems: (data: ProfitAndLoss) => PnlChartLineItem[];
11608
13431
  export const humanizeTitle: (sidebarView: SidebarScope) => "Expenses" | "Revenue" | "Profit & Loss";
11609
- export const applyShare: (items: LineBaseItem[], total: number) => LineBaseItem[];
13432
+ export const applyShare: (items: PnlChartLineItem[], total: number) => PnlChartLineItem[];
11610
13433
 
11611
13434
  }
11612
13435
  declare module '@layerfi/components/utils/request/toDefinedSearchParameters' {
@@ -11618,6 +13441,28 @@ declare module '@layerfi/components/utils/schema/utils' {
11618
13441
  import { Schema } from 'effect';
11619
13442
  import { ZonedDateTime } from '@internationalized/date';
11620
13443
  export const ZonedDateTimeFromSelf: Schema.declare<ZonedDateTime, ZonedDateTime, readonly [], never>;
13444
+ const lineItemFields: {
13445
+ name: typeof Schema.String;
13446
+ displayName: Schema.PropertySignature<":", string, "display_name", ":", string, false, never>;
13447
+ value: typeof Schema.Number;
13448
+ isContra: Schema.PropertySignature<":", boolean, "is_contra", ":", boolean, false, never>;
13449
+ percentDelta: Schema.PropertySignature<"?:", import("effect/BigDecimal").BigDecimal | undefined, "percent_delta", "?:", string | undefined, false, never>;
13450
+ };
13451
+ export interface LineItem extends Schema.Struct.Type<typeof lineItemFields> {
13452
+ lineItems: ReadonlyArray<LineItem>;
13453
+ }
13454
+ export interface LineItemEncoded extends Schema.Struct.Encoded<typeof lineItemFields> {
13455
+ readonly line_items: ReadonlyArray<LineItemEncoded>;
13456
+ }
13457
+ export const LineItemSchema: Schema.Struct<{
13458
+ lineItems: Schema.PropertySignature<":", readonly LineItem[], "line_items", ":", readonly LineItemEncoded[], false, never>;
13459
+ name: typeof Schema.String;
13460
+ displayName: Schema.PropertySignature<":", string, "display_name", ":", string, false, never>;
13461
+ value: typeof Schema.Number;
13462
+ isContra: Schema.PropertySignature<":", boolean, "is_contra", ":", boolean, false, never>;
13463
+ percentDelta: Schema.PropertySignature<"?:", import("effect/BigDecimal").BigDecimal | undefined, "percent_delta", "?:", string | undefined, false, never>;
13464
+ }>;
13465
+ export {};
11621
13466
 
11622
13467
  }
11623
13468
  declare module '@layerfi/components/utils/styleUtils/sizeVariants' {
@@ -11650,6 +13495,20 @@ declare module '@layerfi/components/utils/switch/assertUnreachable' {
11650
13495
  message?: string;
11651
13496
  }): never;
11652
13497
 
13498
+ }
13499
+ declare module '@layerfi/components/utils/swr/compareWithStableHash' {
13500
+ /**
13501
+ * https://github.com/shuding/stable-hash/blob/main/src/index.ts
13502
+ *
13503
+ * This stable hash algorithm is (mostly) the default that is used by SWR.
13504
+ * We added special consideration for BigDecimal values to compare them by
13505
+ * using the BigDecimal.toString() method under the hood rather than going
13506
+ * through the default object handling which accesses every key, creating
13507
+ * an infinitely deeply nested BigDecimal (because BigDecimal.normalized
13508
+ * is also a BigDecimal, and accessing this key instantiates it).
13509
+ */
13510
+ export const compareWithStableHash: (a?: unknown, b?: unknown) => boolean;
13511
+
11653
13512
  }
11654
13513
  declare module '@layerfi/components/utils/swr/defaultSWRConfig' {
11655
13514
  export const DEFAULT_SWR_CONFIG: {
@@ -11657,18 +13516,32 @@ declare module '@layerfi/components/utils/swr/defaultSWRConfig' {
11657
13516
  readonly revalidateIfStale: true;
11658
13517
  readonly revalidateOnFocus: false;
11659
13518
  readonly revalidateOnReconnect: false;
13519
+ readonly compare: (a?: unknown, b?: unknown) => boolean;
11660
13520
  };
11661
13521
 
11662
13522
  }
11663
- declare module '@layerfi/components/utils/swr/useGlobalInvalidator' {
11664
- type GlobalInvalidateOptions = {
13523
+ declare module '@layerfi/components/utils/swr/getRelevantCacheKeys' {
13524
+ import { type Cache } from 'swr';
13525
+ type GetRelevantCacheKeysParameters = {
13526
+ cache: Cache<unknown>;
13527
+ predicate: (tags: ReadonlyArray<string>) => boolean;
11665
13528
  withPrecedingOptimisticUpdate?: boolean;
11666
13529
  };
11667
- export function useGlobalInvalidator(): {
11668
- invalidate: (predicate: (tags: ReadonlyArray<string>) => boolean, { withPrecedingOptimisticUpdate }?: GlobalInvalidateOptions) => Promise<undefined[]>;
11669
- };
11670
- export function useGlobalOptimisticUpdater(): {
11671
- optimisticUpdate: <unsafe_TData>(predicate: (tags: ReadonlyArray<string>) => boolean, optimisticUpdateCallback: (displayedData: unsafe_TData) => unsafe_TData) => Promise<undefined[]>;
13530
+ export function getRelevantCacheKeys({ cache, predicate, withPrecedingOptimisticUpdate, }: GetRelevantCacheKeysParameters): string[];
13531
+ export {};
13532
+
13533
+ }
13534
+ declare module '@layerfi/components/utils/swr/useGlobalCacheActions' {
13535
+ type PredicateFn = (tags: ReadonlyArray<string>) => boolean;
13536
+ export function useGlobalCacheActions(): {
13537
+ invalidate: (predicate: PredicateFn, { withPrecedingOptimisticUpdate }?: {
13538
+ withPrecedingOptimisticUpdate?: boolean;
13539
+ }) => Promise<undefined[]>;
13540
+ patchCache: <unsafe_TData>(predicate: PredicateFn, transformData: (currentData?: unsafe_TData) => unsafe_TData, { withRevalidate }?: {
13541
+ withRevalidate: boolean;
13542
+ }) => Promise<(Awaited<unsafe_TData> | undefined)[]>;
13543
+ optimisticUpdate: <unsafe_TData>(predicate: PredicateFn, optimisticUpdateCallback: (displayedData: unsafe_TData) => unsafe_TData) => Promise<undefined[]>;
13544
+ forceReload: (predicate: PredicateFn) => Promise<undefined[]>;
11672
13545
  };
11673
13546
  export {};
11674
13547