Skip to content
Snippets Groups Projects
  1. May 09, 2024
  2. Feb 08, 2024
    • Julian Dominguez-Schatz's avatar
      Add rules with splits (#2059) · 2bb7b3c2
      Julian Dominguez-Schatz authored
      * Add split creation UI to rule creation modal
      
      * Support applying splits when rules execute
      
      * fix: deserialize transaction before running rules
      
      According to how rules are run in other places in the app, we should be
      supplying a "deserialized" (i.e., integer-for-amount and ISO date)
      transaction rather than a "serialized" (amount-plus-formatted-date) one.
      This fixes a crash in how split transactions are applied, as well as
      date-based rules not applying correctly previously (any rule with a date
      condition would never match on mobile).
      
      * Add release notes
      
      * Fix missing types pulled in from master
      
      * PR feedback: use `getActions`
      
      * PR feedback: use `flatMap`
      
      * Fix action deletion
      
      * Don't flicker upon split deletion
      
      * Let users specify parent transaction actions (e.g. linking schedules)
      
      * Support empty splits
      
      * Revert adding `no-op` action type
      
      * Support splits by percent
      
      * Fix types
      
      * Fix crash on transactions page when posting a transaction
      
      The crash would probably have occurred in other places too with
      auto-posting schedules :/
      
      * Fix a bug where schedules wouldn't be marked as completed
      
      This was because the query that we previously used didn't select parent
      transactions, so no transaction was marked as being scheduled (since
      only parent transactions have schedule IDs).
      
      * Add feature flag
      
      * Limit set actions within splits to fewer fields
      
      * Fix merge conflict
      
      * Don't run split rules if feature is disabled
      
      * Fix percent-based splits not applying
      
      * Fix crash when editing parent transaction amount
      
      * Auto-format
      
      * Attempt to fix failing tests
      
      * More test/bug fixes
      
      * Add an extra split at the end if there is a remaining amount
      
      * Make sure split has correct values for dynamic remainder
      
      * Remove extraneous console.log
      Unverified
      2bb7b3c2
  3. Jan 20, 2024
    • DJ Mountney's avatar
      Bundle loot-core types into the API (#2053) · 0045d921
      DJ Mountney authored
      
      * Bundle loot-core types into the API
      
      So we can have loot-core be the source of truth
      for some types that get passed through
      
      - Improves downstream development with API by including types
      - Use path aliases for dist vs dev tsconfigs
      - Convert api index to typescript as example
      - Permit ts-ignore for issues with our version of typescript
      
      ---------
      
      Co-authored-by: default avatarMatiss Janis Aboltins <matiss@mja.lv>
      Unverified
      0045d921
  4. Jan 18, 2024
  5. Jan 15, 2024
  6. Jan 06, 2024
  7. Dec 14, 2023
    • Julian Dominguez-Schatz's avatar
      Add schedule end date/count field (#1899) · c09a85f3
      Julian Dominguez-Schatz authored
      * Add "end" field with date/count options
      
      * Use "end" field to generate schedule
      
      * Show "end" field in recurring description
      
      * Disable weekend before/after picker when not enabled
      
      * Add release notes
      
      * Fix failing typechecks
      
      * Add some description tests
      
      * PR feedback
      
      * 'Features', not 'Feature'
      
      * Fix goal templates infinite loop
      
      * Empty commit to bump ci
      
      * Fix bug where schedule templates in the past would apply incorrectly
      
      For example, if you had a schedule which started in November 2023 for
      1.00, and you applied the schedule in October 2023, then you would end
      up with a value of 0.50 applied in October.
      
      * Fix handling of schedules with an end date
      
      This commit also includes a refactor of the skip-weekend logic: rather
      than referring only to dates with skipped weekends (which requires
      checking whether the "next date" request worked correctly), we track a
      "base date" which is the previous value of the schedule according to the
      rrule, excluding any weekend-skipping. This lets us use `addDays(baseDate, 1)`
      to get the next occurrence, regardless of the weekend behaviour.
      
      Doing things this way ensures that the loop will always make progress.
      
      * Only compute skipped weekend if weekend skips were requested
      
      * Fix typo in iterate-schedule-occurrences code
      
      We should be using `nextBaseDate` to derive the next base date, not
      `nextDate`; this is because we want the base date to be guaranteed to
      make progress in each loop iteration, so we can finish in at most 30
      iterations without duplicate base dates.
      
      * Use const
      
      * Revert const -> let for one mutable variable
      Unverified
      c09a85f3
  8. Nov 22, 2023
  9. Nov 04, 2023
  10. Aug 17, 2023
  11. Apr 23, 2023
  12. Apr 16, 2023
  13. Apr 03, 2023
    • Alberto Gasparin's avatar
      Convert loot-core to TS p1 (#841) · 79ad04dd
      Alberto Gasparin authored
      Part 1 of the conversion. Mostly renaming js to ts and making sure
      things make still sense. Added also handy TS ESLint rules.
      
      In order to support the various .web/.electron/... I ended up adopting
      `index.d.ts` as pattern to share type definition. Let me know if that
      makes sense for you too. Right now the function type definition is
      duplicated, but the solution will be importing from `index.d.ts` and
      using `const fn: FnDef = () => ...` that way we can keep all variants in
      sync from a single type file.
      
      Such rewrite however is better done in another PR otherwise we risk
      confusing git and loosing history (rename + too many changes). Another
      thing that might do in the next PR is convert all files to ESModules, as
      things get confusing between CJS exports, ESM default/named and TS adds
      extra complains.
      Unverified
      79ad04dd
  14. Feb 10, 2023
  15. Nov 13, 2022
  16. Apr 29, 2022
Loading