Git Product home page Git Product logo

Comments (3)

jprouty avatar jprouty commented on August 10, 2024 3

I was exploring the web app today to map out the relevant graphgl queries. Here's what I see:

  • GetTransactionsList - once split, the list contains only the split transactions which are denoted with isSplitTransaction: True member. There is no transaction member that indicates the parent transaction id (originalTransaction as MM likes to call it).
  • GetTransactionDrawer - for split transactions, this query returns detailed per-transaction members to populate the drawer/side bar in the web app. Once a transaction is split, I cannot find a place in the UI such that the original transaction is shown again (unless you unsplit it - see below). The hasSplitTransactions: <bool> and splitTransactions: [] members seem to indicate that if given a parent id as the query id it would return all splits; this isn't particularly useful because the UI invokes another query, described below, for getting all of the splits for a given transaction id. Importantly, this call does indicate the parent transactions by including the originalTransaction member (real example):
"data": {
    "getTransaction": {
        "id": "123childID321", <- Fake
        ...other transaction members...
        "hasSplitTransactions": false,
        "isSplitTransaction": true,
        "splitTransactions": [],
        "originalTransaction": {
            "id": "123parentID321", <- Fake
            "date": "2024-01-02",
            "amount": -100.0,
            "merchant": {
                "id": "12321", <- Fake
                "name": "Test",
                "__typename": "Merchant"
            },
            "__typename": "Transaction"
        }
    }
}
  • TransactionSplitQuery - the UI invokes this query when bringing up the split dialog (which allows for creating, adjusting, deleting splits). Given the parent transaction id, returns a list of transaction ids that are the children splits.
  • SplitTransactionMutation - query for creating, modifying, deleting splits. All operate on the parent transaction id and are given a splitData array for how to divide the transaction. From the UI, you can only provide the new amount, merchantName, and category. If the parent transaction already has a note (or I imagine also tags - to be verified), these are cloned onto each split transaction automagically.

Deleting is the simplest: given the parent transaction id and splitData=[], delete all children transactions and return the parent transaction as the only transaction.

Creating and modifying splits are the same: given the parent transaction id and splitData=[...children splits...], where sum([s.amount for split in splitData]) == parentTranasction.amount, creates len(splitData) new transactions that are displayed in the UI in place of the parentTranasction; if parentTranasction already had splitTransactions, then replace those with the new splitData.

Next step I am translating the network captures I've made into a working version and will create a PR once things look right.

from monarchmoney.

hammem avatar hammem commented on August 10, 2024

@grablair , can you confirm @jprouty 's PR addresses this issue?

from monarchmoney.

grablair avatar grablair commented on August 10, 2024

I believe it does. We can close this and open another one if someone discovers we are missing something.

from monarchmoney.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.