Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API v.2] Selection of multiple categories #21

Open
maksimdzmitryew opened this issue Sep 25, 2021 · 6 comments
Open

[API v.2] Selection of multiple categories #21

maksimdzmitryew opened this issue Sep 25, 2021 · 6 comments
Assignees
Milestone

Comments

@maksimdzmitryew
Copy link
Contributor

Hi @vomikan

At the moment, I can't select more than 1 category+subcategory when filling in new transaction data. I would like to implement this on the WebApp UI but need to make sure this is supported by Desktop API.

Please, advise.

@vomikan
Copy link
Member

vomikan commented Sep 25, 2021

It's a simple code whis no multicategory support.

https://github.com/moneymanagerex/moneymanagerex/blob/master/src/webapp.cpp#L404-L411

Form a JSON with an array for split. I think it is not difficult to implement this in the near future.
At the same time, you should keep in mind compatibility with older versions.

@maksimdzmitryew
Copy link
Contributor Author

Offtopic

@vomikan What's the numbering approach that you use? I thought of "major.minor.patch" where "patch" is incremented for hot fixes. While the "minor" would go for regular updates.

And the next version would be 1.1.0 but you've incremented the last digit, not the middle.

/Offtopic

@maksimdzmitryew
Copy link
Contributor Author

@vomikan thank you for desktop code reference.

Few more Q:

  • How do I pass amount per each category?
  • By "older versions" you mean desktop versions, not webapp, right?

@vomikan
Copy link
Member

vomikan commented Sep 25, 2021

  • How do I pass amount per each category?

I suggest the amount field should be the total of the transaction.

Somthing like this:

{
 ....
  "amount": 999,
  "split": [
    {
      "Car:gas": 100
    },
    {
      "car:Wash": 900
    },
    {
      "others:discount": -1
    }
  ]
  .....
}
  • By "older versions" you mean desktop versions, not webapp, right?

yes

@gabriele-v
Copy link
Contributor

Hello @maksimdzmitryew
I'm the developer of web moneymanager (and related desktop side) but unfortunately now I don't have anymore time for it.

I think that in this case (and transfer amount) you should issue a new API version on PHP side and @vomikan should do the same on desktop API side (you have to agree on the fields type etc..). Everything is already managed in desktop version, so until the webapp stays at the expected version of the desktop, everything works. Then user will have to update both at the same time (there should be a bit of coordination between developers to have both at the same time).

Personally I think that issue a new API version is the best way if supporting the old code means having lots of tricks or not linear code.

@maksimdzmitryew
Copy link
Contributor Author

@gabriele-v thank you for your input. I appreciate you shared your thoughts. It will definitely help

@maksimdzmitryew maksimdzmitryew changed the title [Desktop API] selection of multiple categories [API v.2] selection of multiple categories Jun 26, 2022
@maksimdzmitryew maksimdzmitryew changed the title [API v.2] selection of multiple categories [API v.2] Selection of multiple categories Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants