@layerfi/components 0.1.88-alpha → 0.1.88-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.
@@ -119,7 +119,7 @@ var import_react16 = require("react");
119
119
  var import_react14 = require("react");
120
120
 
121
121
  // package.json
122
- var version = "0.1.88-alpha";
122
+ var version = "0.1.88-alpha.1";
123
123
 
124
124
  // src/models/APIError.ts
125
125
  var APIError = class _APIError extends Error {
@@ -2467,10 +2467,13 @@ var import_jsx_runtime9 = require("react/jsx-runtime");
2467
2467
  function startOfNextDay(date) {
2468
2468
  return (0, import_date_fns2.startOfDay)((0, import_date_fns2.addDays)(date, 1));
2469
2469
  }
2470
+ function clampToPresentOrPast(date, cutoff = (0, import_date_fns2.endOfDay)(/* @__PURE__ */ new Date())) {
2471
+ return (0, import_date_fns2.min)([date, cutoff]);
2472
+ }
2470
2473
  function withShiftedEnd(fn) {
2471
2474
  return ({ currentStart, currentEnd, newEnd }) => {
2472
2475
  const shiftedCurrentEnd = startOfNextDay(currentEnd);
2473
- const shiftedNewEnd = startOfNextDay(newEnd);
2476
+ const shiftedNewEnd = clampToPresentOrPast(startOfNextDay(newEnd), startOfNextDay(/* @__PURE__ */ new Date()));
2474
2477
  return fn({ currentStart, shiftedCurrentEnd, shiftedNewEnd });
2475
2478
  };
2476
2479
  }
@@ -2481,14 +2484,14 @@ var RANGE_MODE_LOOKUP = {
2481
2484
  const fullDayCount = (0, import_date_fns2.differenceInDays)(shiftedCurrentEnd, currentStart);
2482
2485
  return (0, import_date_fns2.subDays)(shiftedNewEnd, fullDayCount);
2483
2486
  }),
2484
- getEnd: ({ end }) => end
2487
+ getEnd: ({ end }) => clampToPresentOrPast((0, import_date_fns2.endOfDay)(end))
2485
2488
  },
2486
2489
  monthPicker: {
2487
2490
  getStart: ({ start }) => (0, import_date_fns2.startOfMonth)(start),
2488
2491
  getShiftedStart: withShiftedEnd(({ shiftedNewEnd }) => {
2489
2492
  return (0, import_date_fns2.subMonths)(shiftedNewEnd, 1);
2490
2493
  }),
2491
- getEnd: ({ end }) => (0, import_date_fns2.endOfMonth)(end)
2494
+ getEnd: ({ end }) => clampToPresentOrPast((0, import_date_fns2.endOfMonth)(end))
2492
2495
  },
2493
2496
  monthRangePicker: {
2494
2497
  getStart: ({ start }) => (0, import_date_fns2.startOfMonth)(start),
@@ -2496,14 +2499,14 @@ var RANGE_MODE_LOOKUP = {
2496
2499
  const fullMonthCount = (0, import_date_fns2.differenceInMonths)(shiftedCurrentEnd, currentStart);
2497
2500
  return (0, import_date_fns2.subMonths)(shiftedNewEnd, fullMonthCount);
2498
2501
  }),
2499
- getEnd: ({ end }) => (0, import_date_fns2.endOfMonth)(end)
2502
+ getEnd: ({ end }) => clampToPresentOrPast((0, import_date_fns2.endOfMonth)(end))
2500
2503
  },
2501
2504
  yearPicker: {
2502
2505
  getStart: ({ start }) => (0, import_date_fns2.startOfYear)(start),
2503
2506
  getShiftedStart: withShiftedEnd(({ shiftedNewEnd }) => {
2504
2507
  return (0, import_date_fns2.subYears)(shiftedNewEnd, 1);
2505
2508
  }),
2506
- getEnd: ({ end }) => (0, import_date_fns2.endOfYear)(end)
2509
+ getEnd: ({ end }) => clampToPresentOrPast((0, import_date_fns2.endOfYear)(end))
2507
2510
  }
2508
2511
  };
2509
2512
  function withCorrectedRange(fn) {
@@ -2520,29 +2523,29 @@ function buildStore() {
2520
2523
  return (0, import_zustand2.createStore)((set2, get2) => {
2521
2524
  const setRange = withCorrectedRange(({ start, end }) => {
2522
2525
  set2({
2523
- start: (0, import_date_fns2.startOfDay)(start),
2524
- end: (0, import_date_fns2.endOfDay)(end),
2526
+ start: RANGE_MODE_LOOKUP.dayRangePicker.getStart({ start }),
2527
+ end: RANGE_MODE_LOOKUP.dayRangePicker.getEnd({ end }),
2525
2528
  rangeDisplayMode: "dayRangePicker"
2526
2529
  });
2527
2530
  });
2528
2531
  const setMonth = ({ start }) => {
2529
2532
  set2({
2530
- start: (0, import_date_fns2.startOfMonth)(start),
2531
- end: (0, import_date_fns2.endOfMonth)(start),
2533
+ start: RANGE_MODE_LOOKUP.monthPicker.getStart({ start }),
2534
+ end: RANGE_MODE_LOOKUP.monthPicker.getEnd({ end: start }),
2532
2535
  rangeDisplayMode: "monthPicker"
2533
2536
  });
2534
2537
  };
2535
2538
  const setMonthRange = withCorrectedRange(({ start, end }) => {
2536
2539
  set2({
2537
- start: (0, import_date_fns2.startOfMonth)(start),
2538
- end: (0, import_date_fns2.endOfMonth)(end),
2540
+ start: RANGE_MODE_LOOKUP.monthRangePicker.getStart({ start }),
2541
+ end: RANGE_MODE_LOOKUP.monthRangePicker.getEnd({ end }),
2539
2542
  rangeDisplayMode: "monthRangePicker"
2540
2543
  });
2541
2544
  });
2542
2545
  const setYear = ({ start }) => {
2543
2546
  set2({
2544
- start: (0, import_date_fns2.startOfMonth)(start),
2545
- end: (0, import_date_fns2.endOfMonth)(start),
2547
+ start: RANGE_MODE_LOOKUP.yearPicker.getStart({ start }),
2548
+ end: RANGE_MODE_LOOKUP.yearPicker.getEnd({ end: start }),
2546
2549
  rangeDisplayMode: "yearPicker"
2547
2550
  });
2548
2551
  };
@@ -2570,7 +2573,7 @@ function buildStore() {
2570
2573
  };
2571
2574
  return {
2572
2575
  start: (0, import_date_fns2.startOfMonth)(now),
2573
- end: (0, import_date_fns2.endOfMonth)(now),
2576
+ end: clampToPresentOrPast((0, import_date_fns2.endOfMonth)(now)),
2574
2577
  displayMode: "dayPicker",
2575
2578
  rangeDisplayMode: "monthPicker",
2576
2579
  actions: {
@@ -2580,7 +2583,7 @@ function buildStore() {
2580
2583
  end: currentEnd,
2581
2584
  rangeDisplayMode: currentRangeDisplayMode
2582
2585
  }) => {
2583
- const newEnd = (0, import_date_fns2.endOfDay)(date);
2586
+ const newEnd = RANGE_MODE_LOOKUP.dayRangePicker.getEnd({ end: date });
2584
2587
  return {
2585
2588
  start: RANGE_MODE_LOOKUP[currentRangeDisplayMode].getShiftedStart({
2586
2589
  currentStart,
@@ -7706,20 +7709,20 @@ var ActionableList = ({
7706
7709
 
7707
7710
  // src/components/BankTransactionMobileList/utils.ts
7708
7711
  var mapCategoryToOption = (category) => {
7709
- var _a, _b;
7712
+ var _a, _b, _c;
7710
7713
  return {
7711
7714
  label: category.display_name,
7712
- id: category.id,
7715
+ id: "id" in category ? category.id : category.stable_name,
7713
7716
  description: (_a = category.description) != null ? _a : void 0,
7714
7717
  value: {
7715
7718
  type: "CATEGORY",
7716
7719
  payload: {
7717
- id: category.id,
7720
+ id: "id" in category ? category.id : "",
7718
7721
  option_type: "category" /* CATEGORY */,
7719
7722
  display_name: category.display_name,
7720
7723
  type: category.type,
7721
7724
  description: (_b = category.description) != null ? _b : void 0,
7722
- stable_name: category.stable_name,
7725
+ stable_name: "stable_name" in category ? (_c = category.stable_name) != null ? _c : "" : "",
7723
7726
  entries: category.entries,
7724
7727
  subCategories: category.subCategories
7725
7728
  }
@@ -7734,7 +7737,7 @@ var flattenCategories = (categories) => {
7734
7737
  return [
7735
7738
  {
7736
7739
  label: category.display_name,
7737
- id: category.id,
7740
+ id: "id" in category ? category.id : category.stable_name,
7738
7741
  value: {
7739
7742
  type: "GROUP",
7740
7743
  items: category.subCategories.map((x) => mapCategoryToOption(x))
@@ -7754,7 +7757,7 @@ var getAssignedValue = (bankTransaction) => {
7754
7757
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || (bankTransaction == null ? void 0 : bankTransaction.categorization_status) === "SPLIT" /* SPLIT */) {
7755
7758
  return;
7756
7759
  }
7757
- if (bankTransaction.category && bankTransaction.category.type != "Exclusion") {
7760
+ if (bankTransaction.category && bankTransaction.category.type != "ExclusionNested") {
7758
7761
  return mapCategoryToOption(bankTransaction.category);
7759
7762
  }
7760
7763
  if (hasSuggestions(bankTransaction.categorization_flow)) {
@@ -7877,16 +7880,16 @@ var import_classnames33 = __toESM(require("classnames"));
7877
7880
  var import_date_fns9 = require("date-fns");
7878
7881
  var import_jsx_runtime100 = require("react/jsx-runtime");
7879
7882
  var mapCategoryToOption2 = (category) => {
7880
- var _a;
7883
+ var _a, _b;
7881
7884
  return {
7882
7885
  type: "category" /* CATEGORY */,
7883
7886
  payload: {
7884
- id: category.id,
7887
+ id: "id" in category ? category.id : "",
7885
7888
  option_type: "category" /* CATEGORY */,
7886
7889
  display_name: category.display_name,
7887
7890
  type: category.type,
7888
7891
  description: (_a = category.description) != null ? _a : void 0,
7889
- stable_name: category.stable_name,
7892
+ stable_name: "stable_name" in category ? (_b = category.stable_name) != null ? _b : "" : "",
7890
7893
  entries: category.entries,
7891
7894
  subCategories: category.subCategories
7892
7895
  }
@@ -7900,7 +7903,7 @@ var mapCategoryToExclusionOption = (category) => {
7900
7903
  option_type: "category" /* CATEGORY */,
7901
7904
  display_name: category.display_name,
7902
7905
  type: "ExclusionNested",
7903
- stable_name: category.stable_name,
7906
+ stable_name: "",
7904
7907
  entries: category.entries,
7905
7908
  subCategories: category.subCategories
7906
7909
  }
@@ -7913,7 +7916,8 @@ var mapSuggestedMatchToOption = (record) => {
7913
7916
  id: record.id,
7914
7917
  option_type: "match" /* MATCH */,
7915
7918
  display_name: record.details.description,
7916
- amount: record.details.amount
7919
+ amount: record.details.amount,
7920
+ subCategories: null
7917
7921
  }
7918
7922
  };
7919
7923
  };
@@ -7987,7 +7991,8 @@ var allCategoriesDivider = [
7987
7991
  payload: {
7988
7992
  id: "all_categories",
7989
7993
  option_type: "hidden" /* HIDDEN */,
7990
- display_name: "ALL CATEGORIES"
7994
+ display_name: "ALL CATEGORIES",
7995
+ subCategories: null
7991
7996
  }
7992
7997
  }
7993
7998
  ]
@@ -8033,7 +8038,8 @@ var CategorySelect = ({
8033
8038
  option_type: "match" /* MATCH */,
8034
8039
  display_name: x.details.description,
8035
8040
  date: x.details.date,
8036
- amount: x.details.amount
8041
+ amount: x.details.amount,
8042
+ subCategories: null
8037
8043
  }
8038
8044
  };
8039
8045
  })
@@ -9191,7 +9197,7 @@ var ExpandedBankTransactionRow = (0, import_react59.forwardRef)(
9191
9197
  const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && ((_e = (_d = bankTransaction.categorization_flow) == null ? void 0 : _d.suggestions) == null ? void 0 : _e[0]);
9192
9198
  const [rowState, updateRowState] = (0, import_react59.useState)({
9193
9199
  splits: ((_f = bankTransaction.category) == null ? void 0 : _f.entries) ? (_g = bankTransaction.category) == null ? void 0 : _g.entries.map((c) => {
9194
- return c.type === "ExclusionSplitEntry" ? {
9200
+ return c.type === "ExclusionSplitEntry" && c.category.type === "ExclusionNested" ? {
9195
9201
  amount: c.amount || 0,
9196
9202
  inputValue: centsToDollars(c.amount),
9197
9203
  category: mapCategoryToExclusionOption(c.category)
@@ -10820,7 +10826,7 @@ var SplitForm = ({
10820
10826
  const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && ((_b = (_a = bankTransaction.categorization_flow) == null ? void 0 : _a.suggestions) == null ? void 0 : _b[0]);
10821
10827
  const [rowState, updateRowState] = (0, import_react66.useState)({
10822
10828
  splits: ((_c = bankTransaction.category) == null ? void 0 : _c.entries) ? (_d = bankTransaction.category) == null ? void 0 : _d.entries.map((c) => {
10823
- return c.type === "ExclusionSplitEntry" ? {
10829
+ return c.type === "ExclusionSplitEntry" && c.category.type === "ExclusionNested" ? {
10824
10830
  amount: c.amount || 0,
10825
10831
  inputValue: centsToDollars(c.amount),
10826
10832
  category: mapCategoryToExclusionOption(c.category)
@@ -11233,7 +11239,7 @@ var BankTransactionMobileListItem = ({
11233
11239
  const itemRef = (0, import_react69.useRef)(null);
11234
11240
  const [removeAnim, setRemoveAnim] = (0, import_react69.useState)(false);
11235
11241
  const [purpose, setPurpose] = (0, import_react69.useState)(
11236
- bankTransaction.category ? bankTransaction.category.type === "Exclusion" ? "personal" /* personal */ : bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
11242
+ bankTransaction.category ? bankTransaction.category.type === "ExclusionNested" ? "personal" /* personal */ : bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
11237
11243
  );
11238
11244
  const [open, setOpen] = (0, import_react69.useState)(isFirstItem);
11239
11245
  const [showComponent, setShowComponent] = (0, import_react69.useState)(!initialLoad);
@@ -18404,18 +18410,18 @@ var import_react122 = require("react");
18404
18410
 
18405
18411
  // src/utils/journal.ts
18406
18412
  var getAccountIdentifierPayload = (journalLineItem) => {
18407
- if (journalLineItem.account_identifier.id) {
18408
- return {
18409
- type: "AccountId",
18410
- id: journalLineItem.account_identifier.id
18411
- };
18412
- }
18413
18413
  if (journalLineItem.account_identifier.stable_name) {
18414
18414
  return {
18415
18415
  type: "StableName",
18416
18416
  stable_name: journalLineItem.account_identifier.stable_name
18417
18417
  };
18418
18418
  }
18419
+ if (journalLineItem.account_identifier.id) {
18420
+ return {
18421
+ type: "AccountId",
18422
+ id: journalLineItem.account_identifier.id
18423
+ };
18424
+ }
18419
18425
  throw new Error("Invalid account identifier");
18420
18426
  };
18421
18427
  var entryNumber = (entry) => {
@@ -19231,7 +19237,7 @@ var useJournal = () => {
19231
19237
  setForm({
19232
19238
  action: "new",
19233
19239
  data: {
19234
- entry_at: "",
19240
+ entry_at: (/* @__PURE__ */ new Date()).toISOString(),
19235
19241
  created_by: "Test API Integration",
19236
19242
  memo: "",
19237
19243
  line_items: [
@@ -19720,11 +19726,26 @@ var JournalFormEntryLines = ({
19720
19726
  const { form } = (0, import_react129.useContext)(JournalContext);
19721
19727
  const { flattenedCategories, parentOptions } = (0, import_react129.useMemo)(() => {
19722
19728
  const flattenedCategories2 = recursiveFlattenCategories(data != null ? data : []);
19723
- const parentOptions2 = flattenedCategories2.sort((a, b) => a.display_name.localeCompare(b.display_name)).map(({ display_name, id }) => {
19724
- return {
19725
- label: display_name,
19726
- value: id
19727
- };
19729
+ const parentOptions2 = [...flattenedCategories2].sort((a, b) => a.display_name.localeCompare(b.display_name)).map((account) => {
19730
+ switch (account.type) {
19731
+ case "AccountNested":
19732
+ return {
19733
+ label: account.display_name,
19734
+ value: account.id
19735
+ };
19736
+ case "OptionalAccountNested":
19737
+ return {
19738
+ label: account.display_name,
19739
+ value: account.stable_name
19740
+ };
19741
+ case "ExclusionNested":
19742
+ return {
19743
+ label: account.display_name,
19744
+ value: account.id
19745
+ };
19746
+ default:
19747
+ safeAssertUnreachable(account, "Unexpected account type");
19748
+ }
19728
19749
  });
19729
19750
  return { flattenedCategories: flattenedCategories2, parentOptions: parentOptions2 };
19730
19751
  }, [data]);
@@ -19733,27 +19754,47 @@ var JournalFormEntryLines = ({
19733
19754
  value
19734
19755
  }) => {
19735
19756
  var _a;
19736
- const relevantCategory = flattenedCategories.find((x) => x.id === value.value);
19757
+ const relevantCategory = flattenedCategories.find((x) => {
19758
+ switch (x.type) {
19759
+ case "AccountNested":
19760
+ return x.id === value.value;
19761
+ case "OptionalAccountNested":
19762
+ return x.stable_name === value.value;
19763
+ case "ExclusionNested":
19764
+ return x.id === value.value;
19765
+ default:
19766
+ safeAssertUnreachable(x, "Unexpected account type");
19767
+ }
19768
+ });
19737
19769
  if (!relevantCategory) {
19738
19770
  return;
19739
19771
  }
19772
+ const baseFields = relevantCategory.type === "OptionalAccountNested" ? {
19773
+ id: relevantCategory.stable_name,
19774
+ stable_name: relevantCategory.stable_name,
19775
+ account_type: {
19776
+ value: relevantCategory.stable_name,
19777
+ display_name: relevantCategory.display_name
19778
+ }
19779
+ } : {
19780
+ id: relevantCategory.id,
19781
+ stable_name: "stable_name" in relevantCategory ? (_a = relevantCategory.stable_name) != null ? _a : "" : "",
19782
+ account_type: {
19783
+ value: relevantCategory.id,
19784
+ display_name: relevantCategory.display_name
19785
+ }
19786
+ };
19740
19787
  return changeFormData(
19741
19788
  "parent",
19742
19789
  value,
19743
19790
  lineItemIndex,
19744
19791
  [
19745
- {
19746
- id: relevantCategory.id,
19792
+ __spreadProps(__spreadValues({}, baseFields), {
19747
19793
  name: relevantCategory.display_name,
19748
- stable_name: (_a = relevantCategory.stable_name) != null ? _a : "",
19749
- account_type: {
19750
- value: relevantCategory.id,
19751
- display_name: relevantCategory.display_name
19752
- },
19753
19794
  sub_accounts: [],
19754
19795
  balance: 0,
19755
19796
  normality: "DEBIT" /* DEBIT */
19756
- }
19797
+ })
19757
19798
  ]
19758
19799
  );
19759
19800
  };
@@ -61,7 +61,7 @@ import { useState as useState8 } from "react";
61
61
  import { useReducer, useEffect as useEffect4 } from "react";
62
62
 
63
63
  // package.json
64
- var version = "0.1.88-alpha";
64
+ var version = "0.1.88-alpha.1";
65
65
 
66
66
  // src/models/APIError.ts
67
67
  var APIError = class _APIError extends Error {
@@ -2392,6 +2392,7 @@ import {
2392
2392
  endOfDay,
2393
2393
  endOfMonth as endOfMonth2,
2394
2394
  endOfYear,
2395
+ min,
2395
2396
  startOfDay,
2396
2397
  startOfMonth as startOfMonth2,
2397
2398
  startOfYear,
@@ -2422,10 +2423,13 @@ import { jsx as jsx9 } from "react/jsx-runtime";
2422
2423
  function startOfNextDay(date) {
2423
2424
  return startOfDay(addDays(date, 1));
2424
2425
  }
2426
+ function clampToPresentOrPast(date, cutoff = endOfDay(/* @__PURE__ */ new Date())) {
2427
+ return min([date, cutoff]);
2428
+ }
2425
2429
  function withShiftedEnd(fn) {
2426
2430
  return ({ currentStart, currentEnd, newEnd }) => {
2427
2431
  const shiftedCurrentEnd = startOfNextDay(currentEnd);
2428
- const shiftedNewEnd = startOfNextDay(newEnd);
2432
+ const shiftedNewEnd = clampToPresentOrPast(startOfNextDay(newEnd), startOfNextDay(/* @__PURE__ */ new Date()));
2429
2433
  return fn({ currentStart, shiftedCurrentEnd, shiftedNewEnd });
2430
2434
  };
2431
2435
  }
@@ -2436,14 +2440,14 @@ var RANGE_MODE_LOOKUP = {
2436
2440
  const fullDayCount = differenceInDays(shiftedCurrentEnd, currentStart);
2437
2441
  return subDays(shiftedNewEnd, fullDayCount);
2438
2442
  }),
2439
- getEnd: ({ end }) => end
2443
+ getEnd: ({ end }) => clampToPresentOrPast(endOfDay(end))
2440
2444
  },
2441
2445
  monthPicker: {
2442
2446
  getStart: ({ start }) => startOfMonth2(start),
2443
2447
  getShiftedStart: withShiftedEnd(({ shiftedNewEnd }) => {
2444
2448
  return subMonths(shiftedNewEnd, 1);
2445
2449
  }),
2446
- getEnd: ({ end }) => endOfMonth2(end)
2450
+ getEnd: ({ end }) => clampToPresentOrPast(endOfMonth2(end))
2447
2451
  },
2448
2452
  monthRangePicker: {
2449
2453
  getStart: ({ start }) => startOfMonth2(start),
@@ -2451,14 +2455,14 @@ var RANGE_MODE_LOOKUP = {
2451
2455
  const fullMonthCount = differenceInMonths(shiftedCurrentEnd, currentStart);
2452
2456
  return subMonths(shiftedNewEnd, fullMonthCount);
2453
2457
  }),
2454
- getEnd: ({ end }) => endOfMonth2(end)
2458
+ getEnd: ({ end }) => clampToPresentOrPast(endOfMonth2(end))
2455
2459
  },
2456
2460
  yearPicker: {
2457
2461
  getStart: ({ start }) => startOfYear(start),
2458
2462
  getShiftedStart: withShiftedEnd(({ shiftedNewEnd }) => {
2459
2463
  return subYears(shiftedNewEnd, 1);
2460
2464
  }),
2461
- getEnd: ({ end }) => endOfYear(end)
2465
+ getEnd: ({ end }) => clampToPresentOrPast(endOfYear(end))
2462
2466
  }
2463
2467
  };
2464
2468
  function withCorrectedRange(fn) {
@@ -2475,29 +2479,29 @@ function buildStore() {
2475
2479
  return createStore2((set2, get2) => {
2476
2480
  const setRange = withCorrectedRange(({ start, end }) => {
2477
2481
  set2({
2478
- start: startOfDay(start),
2479
- end: endOfDay(end),
2482
+ start: RANGE_MODE_LOOKUP.dayRangePicker.getStart({ start }),
2483
+ end: RANGE_MODE_LOOKUP.dayRangePicker.getEnd({ end }),
2480
2484
  rangeDisplayMode: "dayRangePicker"
2481
2485
  });
2482
2486
  });
2483
2487
  const setMonth = ({ start }) => {
2484
2488
  set2({
2485
- start: startOfMonth2(start),
2486
- end: endOfMonth2(start),
2489
+ start: RANGE_MODE_LOOKUP.monthPicker.getStart({ start }),
2490
+ end: RANGE_MODE_LOOKUP.monthPicker.getEnd({ end: start }),
2487
2491
  rangeDisplayMode: "monthPicker"
2488
2492
  });
2489
2493
  };
2490
2494
  const setMonthRange = withCorrectedRange(({ start, end }) => {
2491
2495
  set2({
2492
- start: startOfMonth2(start),
2493
- end: endOfMonth2(end),
2496
+ start: RANGE_MODE_LOOKUP.monthRangePicker.getStart({ start }),
2497
+ end: RANGE_MODE_LOOKUP.monthRangePicker.getEnd({ end }),
2494
2498
  rangeDisplayMode: "monthRangePicker"
2495
2499
  });
2496
2500
  });
2497
2501
  const setYear = ({ start }) => {
2498
2502
  set2({
2499
- start: startOfMonth2(start),
2500
- end: endOfMonth2(start),
2503
+ start: RANGE_MODE_LOOKUP.yearPicker.getStart({ start }),
2504
+ end: RANGE_MODE_LOOKUP.yearPicker.getEnd({ end: start }),
2501
2505
  rangeDisplayMode: "yearPicker"
2502
2506
  });
2503
2507
  };
@@ -2525,7 +2529,7 @@ function buildStore() {
2525
2529
  };
2526
2530
  return {
2527
2531
  start: startOfMonth2(now),
2528
- end: endOfMonth2(now),
2532
+ end: clampToPresentOrPast(endOfMonth2(now)),
2529
2533
  displayMode: "dayPicker",
2530
2534
  rangeDisplayMode: "monthPicker",
2531
2535
  actions: {
@@ -2535,7 +2539,7 @@ function buildStore() {
2535
2539
  end: currentEnd,
2536
2540
  rangeDisplayMode: currentRangeDisplayMode
2537
2541
  }) => {
2538
- const newEnd = endOfDay(date);
2542
+ const newEnd = RANGE_MODE_LOOKUP.dayRangePicker.getEnd({ end: date });
2539
2543
  return {
2540
2544
  start: RANGE_MODE_LOOKUP[currentRangeDisplayMode].getShiftedStart({
2541
2545
  currentStart,
@@ -7699,20 +7703,20 @@ var ActionableList = ({
7699
7703
 
7700
7704
  // src/components/BankTransactionMobileList/utils.ts
7701
7705
  var mapCategoryToOption = (category) => {
7702
- var _a, _b;
7706
+ var _a, _b, _c;
7703
7707
  return {
7704
7708
  label: category.display_name,
7705
- id: category.id,
7709
+ id: "id" in category ? category.id : category.stable_name,
7706
7710
  description: (_a = category.description) != null ? _a : void 0,
7707
7711
  value: {
7708
7712
  type: "CATEGORY",
7709
7713
  payload: {
7710
- id: category.id,
7714
+ id: "id" in category ? category.id : "",
7711
7715
  option_type: "category" /* CATEGORY */,
7712
7716
  display_name: category.display_name,
7713
7717
  type: category.type,
7714
7718
  description: (_b = category.description) != null ? _b : void 0,
7715
- stable_name: category.stable_name,
7719
+ stable_name: "stable_name" in category ? (_c = category.stable_name) != null ? _c : "" : "",
7716
7720
  entries: category.entries,
7717
7721
  subCategories: category.subCategories
7718
7722
  }
@@ -7727,7 +7731,7 @@ var flattenCategories = (categories) => {
7727
7731
  return [
7728
7732
  {
7729
7733
  label: category.display_name,
7730
- id: category.id,
7734
+ id: "id" in category ? category.id : category.stable_name,
7731
7735
  value: {
7732
7736
  type: "GROUP",
7733
7737
  items: category.subCategories.map((x) => mapCategoryToOption(x))
@@ -7747,7 +7751,7 @@ var getAssignedValue = (bankTransaction) => {
7747
7751
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || (bankTransaction == null ? void 0 : bankTransaction.categorization_status) === "SPLIT" /* SPLIT */) {
7748
7752
  return;
7749
7753
  }
7750
- if (bankTransaction.category && bankTransaction.category.type != "Exclusion") {
7754
+ if (bankTransaction.category && bankTransaction.category.type != "ExclusionNested") {
7751
7755
  return mapCategoryToOption(bankTransaction.category);
7752
7756
  }
7753
7757
  if (hasSuggestions(bankTransaction.categorization_flow)) {
@@ -7870,16 +7874,16 @@ import classNames33 from "classnames";
7870
7874
  import { parseISO as parseISO3, format as formatTime } from "date-fns";
7871
7875
  import { jsx as jsx100, jsxs as jsxs59 } from "react/jsx-runtime";
7872
7876
  var mapCategoryToOption2 = (category) => {
7873
- var _a;
7877
+ var _a, _b;
7874
7878
  return {
7875
7879
  type: "category" /* CATEGORY */,
7876
7880
  payload: {
7877
- id: category.id,
7881
+ id: "id" in category ? category.id : "",
7878
7882
  option_type: "category" /* CATEGORY */,
7879
7883
  display_name: category.display_name,
7880
7884
  type: category.type,
7881
7885
  description: (_a = category.description) != null ? _a : void 0,
7882
- stable_name: category.stable_name,
7886
+ stable_name: "stable_name" in category ? (_b = category.stable_name) != null ? _b : "" : "",
7883
7887
  entries: category.entries,
7884
7888
  subCategories: category.subCategories
7885
7889
  }
@@ -7893,7 +7897,7 @@ var mapCategoryToExclusionOption = (category) => {
7893
7897
  option_type: "category" /* CATEGORY */,
7894
7898
  display_name: category.display_name,
7895
7899
  type: "ExclusionNested",
7896
- stable_name: category.stable_name,
7900
+ stable_name: "",
7897
7901
  entries: category.entries,
7898
7902
  subCategories: category.subCategories
7899
7903
  }
@@ -7906,7 +7910,8 @@ var mapSuggestedMatchToOption = (record) => {
7906
7910
  id: record.id,
7907
7911
  option_type: "match" /* MATCH */,
7908
7912
  display_name: record.details.description,
7909
- amount: record.details.amount
7913
+ amount: record.details.amount,
7914
+ subCategories: null
7910
7915
  }
7911
7916
  };
7912
7917
  };
@@ -7980,7 +7985,8 @@ var allCategoriesDivider = [
7980
7985
  payload: {
7981
7986
  id: "all_categories",
7982
7987
  option_type: "hidden" /* HIDDEN */,
7983
- display_name: "ALL CATEGORIES"
7988
+ display_name: "ALL CATEGORIES",
7989
+ subCategories: null
7984
7990
  }
7985
7991
  }
7986
7992
  ]
@@ -8026,7 +8032,8 @@ var CategorySelect = ({
8026
8032
  option_type: "match" /* MATCH */,
8027
8033
  display_name: x.details.description,
8028
8034
  date: x.details.date,
8029
- amount: x.details.amount
8035
+ amount: x.details.amount,
8036
+ subCategories: null
8030
8037
  }
8031
8038
  };
8032
8039
  })
@@ -9194,7 +9201,7 @@ var ExpandedBankTransactionRow = forwardRef10(
9194
9201
  const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && ((_e = (_d = bankTransaction.categorization_flow) == null ? void 0 : _d.suggestions) == null ? void 0 : _e[0]);
9195
9202
  const [rowState, updateRowState] = useState22({
9196
9203
  splits: ((_f = bankTransaction.category) == null ? void 0 : _f.entries) ? (_g = bankTransaction.category) == null ? void 0 : _g.entries.map((c) => {
9197
- return c.type === "ExclusionSplitEntry" ? {
9204
+ return c.type === "ExclusionSplitEntry" && c.category.type === "ExclusionNested" ? {
9198
9205
  amount: c.amount || 0,
9199
9206
  inputValue: centsToDollars(c.amount),
9200
9207
  category: mapCategoryToExclusionOption(c.category)
@@ -10828,7 +10835,7 @@ var SplitForm = ({
10828
10835
  const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && ((_b = (_a = bankTransaction.categorization_flow) == null ? void 0 : _a.suggestions) == null ? void 0 : _b[0]);
10829
10836
  const [rowState, updateRowState] = useState29({
10830
10837
  splits: ((_c = bankTransaction.category) == null ? void 0 : _c.entries) ? (_d = bankTransaction.category) == null ? void 0 : _d.entries.map((c) => {
10831
- return c.type === "ExclusionSplitEntry" ? {
10838
+ return c.type === "ExclusionSplitEntry" && c.category.type === "ExclusionNested" ? {
10832
10839
  amount: c.amount || 0,
10833
10840
  inputValue: centsToDollars(c.amount),
10834
10841
  category: mapCategoryToExclusionOption(c.category)
@@ -11241,7 +11248,7 @@ var BankTransactionMobileListItem = ({
11241
11248
  const itemRef = useRef16(null);
11242
11249
  const [removeAnim, setRemoveAnim] = useState32(false);
11243
11250
  const [purpose, setPurpose] = useState32(
11244
- bankTransaction.category ? bankTransaction.category.type === "Exclusion" ? "personal" /* personal */ : bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
11251
+ bankTransaction.category ? bankTransaction.category.type === "ExclusionNested" ? "personal" /* personal */ : bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
11245
11252
  );
11246
11253
  const [open, setOpen] = useState32(isFirstItem);
11247
11254
  const [showComponent, setShowComponent] = useState32(!initialLoad);
@@ -18447,18 +18454,18 @@ import { useContext as useContext35, useMemo as useMemo33 } from "react";
18447
18454
 
18448
18455
  // src/utils/journal.ts
18449
18456
  var getAccountIdentifierPayload = (journalLineItem) => {
18450
- if (journalLineItem.account_identifier.id) {
18451
- return {
18452
- type: "AccountId",
18453
- id: journalLineItem.account_identifier.id
18454
- };
18455
- }
18456
18457
  if (journalLineItem.account_identifier.stable_name) {
18457
18458
  return {
18458
18459
  type: "StableName",
18459
18460
  stable_name: journalLineItem.account_identifier.stable_name
18460
18461
  };
18461
18462
  }
18463
+ if (journalLineItem.account_identifier.id) {
18464
+ return {
18465
+ type: "AccountId",
18466
+ id: journalLineItem.account_identifier.id
18467
+ };
18468
+ }
18462
18469
  throw new Error("Invalid account identifier");
18463
18470
  };
18464
18471
  var entryNumber = (entry) => {
@@ -19274,7 +19281,7 @@ var useJournal = () => {
19274
19281
  setForm({
19275
19282
  action: "new",
19276
19283
  data: {
19277
- entry_at: "",
19284
+ entry_at: (/* @__PURE__ */ new Date()).toISOString(),
19278
19285
  created_by: "Test API Integration",
19279
19286
  memo: "",
19280
19287
  line_items: [
@@ -19763,11 +19770,26 @@ var JournalFormEntryLines = ({
19763
19770
  const { form } = useContext40(JournalContext);
19764
19771
  const { flattenedCategories, parentOptions } = useMemo36(() => {
19765
19772
  const flattenedCategories2 = recursiveFlattenCategories(data != null ? data : []);
19766
- const parentOptions2 = flattenedCategories2.sort((a, b) => a.display_name.localeCompare(b.display_name)).map(({ display_name, id }) => {
19767
- return {
19768
- label: display_name,
19769
- value: id
19770
- };
19773
+ const parentOptions2 = [...flattenedCategories2].sort((a, b) => a.display_name.localeCompare(b.display_name)).map((account) => {
19774
+ switch (account.type) {
19775
+ case "AccountNested":
19776
+ return {
19777
+ label: account.display_name,
19778
+ value: account.id
19779
+ };
19780
+ case "OptionalAccountNested":
19781
+ return {
19782
+ label: account.display_name,
19783
+ value: account.stable_name
19784
+ };
19785
+ case "ExclusionNested":
19786
+ return {
19787
+ label: account.display_name,
19788
+ value: account.id
19789
+ };
19790
+ default:
19791
+ safeAssertUnreachable(account, "Unexpected account type");
19792
+ }
19771
19793
  });
19772
19794
  return { flattenedCategories: flattenedCategories2, parentOptions: parentOptions2 };
19773
19795
  }, [data]);
@@ -19776,27 +19798,47 @@ var JournalFormEntryLines = ({
19776
19798
  value
19777
19799
  }) => {
19778
19800
  var _a;
19779
- const relevantCategory = flattenedCategories.find((x) => x.id === value.value);
19801
+ const relevantCategory = flattenedCategories.find((x) => {
19802
+ switch (x.type) {
19803
+ case "AccountNested":
19804
+ return x.id === value.value;
19805
+ case "OptionalAccountNested":
19806
+ return x.stable_name === value.value;
19807
+ case "ExclusionNested":
19808
+ return x.id === value.value;
19809
+ default:
19810
+ safeAssertUnreachable(x, "Unexpected account type");
19811
+ }
19812
+ });
19780
19813
  if (!relevantCategory) {
19781
19814
  return;
19782
19815
  }
19816
+ const baseFields = relevantCategory.type === "OptionalAccountNested" ? {
19817
+ id: relevantCategory.stable_name,
19818
+ stable_name: relevantCategory.stable_name,
19819
+ account_type: {
19820
+ value: relevantCategory.stable_name,
19821
+ display_name: relevantCategory.display_name
19822
+ }
19823
+ } : {
19824
+ id: relevantCategory.id,
19825
+ stable_name: "stable_name" in relevantCategory ? (_a = relevantCategory.stable_name) != null ? _a : "" : "",
19826
+ account_type: {
19827
+ value: relevantCategory.id,
19828
+ display_name: relevantCategory.display_name
19829
+ }
19830
+ };
19783
19831
  return changeFormData(
19784
19832
  "parent",
19785
19833
  value,
19786
19834
  lineItemIndex,
19787
19835
  [
19788
- {
19789
- id: relevantCategory.id,
19836
+ __spreadProps(__spreadValues({}, baseFields), {
19790
19837
  name: relevantCategory.display_name,
19791
- stable_name: (_a = relevantCategory.stable_name) != null ? _a : "",
19792
- account_type: {
19793
- value: relevantCategory.id,
19794
- display_name: relevantCategory.display_name
19795
- },
19796
19838
  sub_accounts: [],
19797
19839
  balance: 0,
19798
19840
  normality: "DEBIT" /* DEBIT */
19799
- }
19841
+ })
19800
19842
  ]
19801
19843
  );
19802
19844
  };
package/dist/index.d.ts CHANGED
@@ -1304,7 +1304,8 @@ declare module '@layerfi/components/components/BankTransactionMobileList/useMemo
1304
1304
 
1305
1305
  }
1306
1306
  declare module '@layerfi/components/components/BankTransactionMobileList/utils' {
1307
- import { BankTransaction, Category } from '@layerfi/components/types';
1307
+ import { BankTransaction } from '@layerfi/components/types';
1308
+ import type { CategoryWithEntries } from '@layerfi/components/types/bank_transactions';
1308
1309
  import { CategoryOptionPayload } from '@layerfi/components/components/CategorySelect/CategorySelect';
1309
1310
  export interface Option {
1310
1311
  label: string;
@@ -1318,8 +1319,8 @@ declare module '@layerfi/components/components/BankTransactionMobileList/utils'
1318
1319
  asLink?: boolean;
1319
1320
  secondary?: boolean;
1320
1321
  }
1321
- export const mapCategoryToOption: (category: Category) => Option;
1322
- export const flattenCategories: (categories: Category[]) => Option[];
1322
+ export const mapCategoryToOption: (category: CategoryWithEntries) => Option;
1323
+ export const flattenCategories: (categories: Array<CategoryWithEntries>) => Option[];
1323
1324
  export const getAssignedValue: (bankTransaction: BankTransaction) => Option | undefined;
1324
1325
 
1325
1326
  }
@@ -1358,8 +1359,9 @@ declare module '@layerfi/components/components/BankTransactionReceipts/index' {
1358
1359
 
1359
1360
  }
1360
1361
  declare module '@layerfi/components/components/BankTransactionRow/BankTransactionRow' {
1361
- import { BankTransaction, Category } from '@layerfi/components/types';
1362
+ import { BankTransaction } from '@layerfi/components/types';
1362
1363
  import { BankTransactionCTAStringOverrides, BankTransactionsMode } from '@layerfi/components/components/BankTransactions/BankTransactions';
1364
+ import type { CategoryWithEntries } from '@layerfi/components/types/bank_transactions';
1363
1365
  type Props = {
1364
1366
  index: number;
1365
1367
  editable: boolean;
@@ -1376,7 +1378,7 @@ declare module '@layerfi/components/components/BankTransactionRow/BankTransactio
1376
1378
  stringOverrides?: BankTransactionCTAStringOverrides;
1377
1379
  };
1378
1380
  export type LastSubmittedForm = 'simple' | 'match' | 'split' | undefined;
1379
- export const extractDescriptionForSplit: (category: Category) => string;
1381
+ export const extractDescriptionForSplit: (category: CategoryWithEntries) => string;
1380
1382
  export const getDefaultSelectedCategory: (bankTransaction: BankTransaction) => import("@layerfi/components/components/CategorySelect/CategorySelect").CategoryOption | undefined;
1381
1383
  export const BankTransactionRow: ({ index, editable, dateFormat, bankTransaction, mode, removeTransaction, containerWidth, initialLoad, showDescriptions, showReceiptUploads, showReceiptUploadColumn, showTooltips, stringOverrides, }: Props) => import("react/jsx-runtime").JSX.Element;
1382
1384
  export {};
@@ -1394,10 +1396,10 @@ declare module '@layerfi/components/components/BankTransactionRow/MatchBadge' {
1394
1396
 
1395
1397
  }
1396
1398
  declare module '@layerfi/components/components/BankTransactionRow/SplitTooltipDetails' {
1397
- import { Category } from '@layerfi/components/types';
1399
+ import type { CategoryWithEntries } from '@layerfi/components/types/bank_transactions';
1398
1400
  export const SplitTooltipDetails: ({ classNamePrefix, category, }: {
1399
1401
  classNamePrefix: string;
1400
- category: Category;
1402
+ category: CategoryWithEntries;
1401
1403
  }) => import("react/jsx-runtime").JSX.Element | undefined;
1402
1404
 
1403
1405
  }
@@ -1737,8 +1739,7 @@ declare module '@layerfi/components/components/Card/index' {
1737
1739
  }
1738
1740
  declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
1739
1741
  import { BankTransaction, Category } from '@layerfi/components/types';
1740
- import { SuggestedMatch } from '@layerfi/components/types/bank_transactions';
1741
- import { CategoryEntry } from '@layerfi/components/types/categories';
1742
+ import { SuggestedMatch, type CategoryWithEntries } from '@layerfi/components/types/bank_transactions';
1742
1743
  type Props = {
1743
1744
  name?: string;
1744
1745
  bankTransaction: BankTransaction;
@@ -1764,16 +1765,18 @@ declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
1764
1765
  amount?: number;
1765
1766
  type?: string;
1766
1767
  stable_name?: string;
1767
- entries?: CategoryEntry[];
1768
- subCategories?: Category[];
1768
+ entries?: CategoryWithEntries['entries'];
1769
+ subCategories: Category[] | null;
1769
1770
  }
1770
1771
  export interface CategoryOption {
1771
1772
  type: string;
1772
1773
  disabled?: boolean;
1773
1774
  payload: CategoryOptionPayload;
1774
1775
  }
1775
- export const mapCategoryToOption: (category: Category) => CategoryOption;
1776
- export const mapCategoryToExclusionOption: (category: Category) => CategoryOption;
1776
+ export const mapCategoryToOption: (category: CategoryWithEntries) => CategoryOption;
1777
+ export const mapCategoryToExclusionOption: (category: CategoryWithEntries & {
1778
+ type: "ExclusionNested";
1779
+ }) => CategoryOption;
1777
1780
  export const mapSuggestedMatchToOption: (record: SuggestedMatch) => CategoryOption;
1778
1781
  export const CategorySelect: ({ bankTransaction, name, value, onChange, disabled, className, showTooltips, excludeMatches, asDrawer, }: Props) => import("react/jsx-runtime").JSX.Element;
1779
1782
  export {};
@@ -4605,7 +4608,7 @@ declare module '@layerfi/components/contexts/JournalContext/JournalContext' {
4605
4608
  setSelectedEntryId: (id?: string) => void;
4606
4609
  closeSelectedEntry: () => void;
4607
4610
  create: (newJournalEntry: import("@layerfi/components/types/journal").NewApiJournalEntry) => void;
4608
- changeFormData: (name: string, value: string | import("@layerfi/components/types/general").BaseSelectOption | undefined | number, lineItemIndex?: number, accounts?: import("../../types/chart_of_accounts").LedgerAccountBalance[] | undefined) => void;
4611
+ changeFormData: (name: string, value: string | import("@layerfi/components/types/general").BaseSelectOption | undefined | number, lineItemIndex?: number, accounts?: import("../../types/chart_of_accounts").LedgerAccountBalance[]) => void;
4609
4612
  submitForm: () => void;
4610
4613
  cancelForm: () => void;
4611
4614
  addEntry: () => void;
@@ -5056,7 +5059,7 @@ declare module '@layerfi/components/hooks/useJournal/useJournal' {
5056
5059
  setSelectedEntryId: (id?: string) => void;
5057
5060
  closeSelectedEntry: () => void;
5058
5061
  create: (newJournalEntry: NewApiJournalEntry) => void;
5059
- changeFormData: (name: string, value: string | BaseSelectOption | undefined | number, lineItemIndex?: number, accounts?: LedgerAccountBalance[] | undefined) => void;
5062
+ changeFormData: (name: string, value: string | BaseSelectOption | undefined | number, lineItemIndex?: number, accounts?: LedgerAccountBalance[]) => void;
5060
5063
  submitForm: () => void;
5061
5064
  cancelForm: () => void;
5062
5065
  addEntry: () => void;
@@ -6143,6 +6146,14 @@ declare module '@layerfi/components/types/bank_transactions' {
6143
6146
  review = "review",
6144
6147
  categorized = "categorized"
6145
6148
  }
6149
+ export type CategoryWithEntries = Category & {
6150
+ entries?: Array<CategoryEntry>;
6151
+ };
6152
+ type CategoryEntry = {
6153
+ type?: string;
6154
+ amount?: number;
6155
+ category: CategoryWithEntries;
6156
+ };
6146
6157
  export interface BankTransaction extends Record<string, unknown> {
6147
6158
  type: 'Bank_Transaction';
6148
6159
  account_name?: string;
@@ -6158,7 +6169,7 @@ declare module '@layerfi/components/types/bank_transactions' {
6158
6169
  amount: number;
6159
6170
  direction: Direction;
6160
6171
  counterparty_name: string;
6161
- category: Category;
6172
+ category: CategoryWithEntries;
6162
6173
  categorization_status: CategorizationStatus;
6163
6174
  categorization_flow: Categorization | null;
6164
6175
  categorization_method: string;
@@ -6198,6 +6209,7 @@ declare module '@layerfi/components/types/bank_transactions' {
6198
6209
  type: 'Document_S3_Urls';
6199
6210
  documentUrls: S3PresignedUrl[];
6200
6211
  }
6212
+ export {};
6201
6213
 
6202
6214
  }
6203
6215
  declare module '@layerfi/components/types/business' {
@@ -6230,21 +6242,26 @@ declare module '@layerfi/components/types/categories' {
6230
6242
  JOURNALING = "JOURNALING",
6231
6243
  MATCHED = "MATCHED"
6232
6244
  }
6233
- export interface CategoryEntry {
6234
- type?: string;
6235
- amount?: number;
6236
- category: Category;
6237
- }
6238
- export interface Category {
6239
- id: string;
6240
- type: string;
6245
+ type BaseCategory = {
6241
6246
  display_name: string;
6242
6247
  category: string;
6243
- description?: string;
6244
- stable_name?: string;
6245
- subCategories?: Category[];
6246
- entries?: CategoryEntry[];
6247
- }
6248
+ subCategories: Array<Category> | null;
6249
+ description: string | null;
6250
+ };
6251
+ type AccountNestedCategory = {
6252
+ type: 'AccountNested';
6253
+ id: string;
6254
+ stable_name: string | null;
6255
+ } & BaseCategory;
6256
+ type OptionalAccountNestedCategory = {
6257
+ type: 'OptionalAccountNested';
6258
+ stable_name: string;
6259
+ } & BaseCategory;
6260
+ type ExclusionNestedCategory = {
6261
+ type: 'ExclusionNested';
6262
+ id: string;
6263
+ } & BaseCategory;
6264
+ export type Category = AccountNestedCategory | OptionalAccountNestedCategory | ExclusionNestedCategory;
6248
6265
  export enum CategorizationType {
6249
6266
  AUTO = "AUTO",
6250
6267
  ASK_FROM_SUGGESTIONS = "ASK_FROM_SUGGESTIONS",
@@ -6283,6 +6300,7 @@ declare module '@layerfi/components/types/categories' {
6283
6300
  };
6284
6301
  export type CategoryUpdate = SingleCategoryUpdate | SplitCategoryUpdate;
6285
6302
  export function hasSuggestions(categorization: Categorization | null): categorization is SuggestedCategorization;
6303
+ export {};
6286
6304
 
6287
6305
  }
6288
6306
  declare module '@layerfi/components/types/chart_of_accounts' {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerfi/components",
3
- "version": "0.1.88-alpha",
3
+ "version": "0.1.88-alpha.1",
4
4
  "description": "Layer React Components",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.mjs",