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

Fixes bills matching #1440

Merged
merged 10 commits into from
Aug 2, 2019
Merged

Fixes bills matching #1440

merged 10 commits into from
Aug 2, 2019

Conversation

drazik
Copy link
Contributor

@drazik drazik commented Jul 31, 2019

We had some cases in which our bills matching algorithm fails. This had the following causes:

  • In io.cozy.bills, the vendor property sometimes matches our brand dictionary's name property, and sometimes the konnectorSlug property. So we now try to get the brand from name and konnectorSlug instead of just name
  • The category filter was only using the automaticCategoryId and manualCategoryId. But we now have cozyCategoryId and localCategoryId. So we just use the getCategoryId helper that implements all that instead of the previously incomplete getCategoryId

I also refactored Linker::linkBillsToOperations tests so that it's easier to read and maintain. Each test case now lives inside its own file and is in a JS object format instead of text format that needs to be parsed and become less and less readable as we add new cases.

@drazik drazik requested a review from ptbrowne as a code owner July 31, 2019 15:24
@todo
Copy link

todo bot commented Jul 31, 2019

Find out why our models parent class and Document from cozy-doctypes are different

// TODO Find out why our models parent class and Document from cozy-doctypes are different
Document.registerClient(cozyClient)
Bill.registerClient(cozyClient)
class DryLinker extends Linker {
commitChanges() {


This comment was generated by todo based on a TODO comment in d8fb0c3 in #1440. cc @cozy.

@drazik drazik changed the title WIP: Fixes bills matching Fixes bills matching Aug 1, 2019
This allows us to have single test case on each file instead of a
moutain of cases in the middle of the spec file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants