Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Numericable #132

Merged
merged 5 commits into from
Aug 13, 2015
Merged

Numericable #132

merged 5 commits into from
Aug 13, 2015

Conversation

nicofrand
Copy link
Contributor

That should fix #56.

@frankrousseau
Copy link
Contributor

Thank you for this new konnector! Before merging it, it would be better if the code follows the Cozy guidelines:
https://github.com/cozy/cozy-guidelines/#cozy-code-guidelines

What is missing:

  • replace ! by not keyword.
  • Lines should be < 80 chars.

Can you handle it?

@nicofrand
Copy link
Contributor Author

Yes I will.
Since you read it, could you tell me what was wrong with the following code please ?

Bill = cozydb.getModel 'Bill',
    vendor: {type: String, default: 'Internet'}
    type:
        type: String
        default: 'Internet'
    vendor:
        type: String
        default: 'Numéricable'
     date: Date
     amount: Number

I had to replace it with:

Bill = require '../models/bill'

I followed https://github.com/cozy-labs/konnectors/wiki#data-description-models

@frankrousseau
Copy link
Contributor

I don't know what's wrong except the fact you declared the vendor field twice. Indentation doesn't look proper too.
But the real reason is probably that the Bill model is already declared in the model folder.

@nicofrand
Copy link
Contributor Author

The indentation is only wrong because I copy/pasted this block wrong.
I am pretty sure I tried the vendor things twice too and just forgot to remove one of them once commented.

That was probably that the Bill model was already declared. Thanks, I can see the wiki has then been updated :).

Why does the Bill model uses "Digital Ocean" as the default vendor ?
How do I set my own vendor (without setting it for each bill) ?

@frankrousseau
Copy link
Contributor

Great! Thank you @nicofrand for this konnector.
Setting vendor must be done for each bill. But the save_data_and_file layer do it for you.

About the Digital Ocean as a vendor it's a mistake that will be fixed soon.

Thank you again for the bug reports.

frankrousseau pushed a commit that referenced this pull request Aug 13, 2015
@frankrousseau frankrousseau merged commit eb1a953 into cozy-labs:master Aug 13, 2015
@nicofrand
Copy link
Contributor Author

Where do you see that save_data_and_file already sets the vendor automatically ?

When it does, does it use the third parameter:
.use(saveDataAndFile(log, Bill, 'numericable', ['bill']))

I suggest to complete the wiki with those information.

@ZeHiro
Copy link
Contributor

ZeHiro commented Aug 14, 2015

@nicofrand , the third parameter will set the vendor automatically, if it is not already set in the bill object you created when you parsed them form the website.

@nicofrand
Copy link
Contributor Author

Thanks @ZeHiro , I updated the wiki so that is it clear now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants