{"action":"created","comment":{"url":"https://api.github.com/repos/cozy-labs/konnectors/pulls/comments/86568388","pull_request_review_id":7221961,"id":86568388,"diff_hunk":"@@ -0,0 +1,1347 @@\n+xml2js = require 'xml2js'\n+request = require 'request'\n+async = require 'async'\n+moment = require 'moment'\n+cozydb = require 'cozydb'\n+File = require '../models/file'\n+\n+parser = new xml2js.Parser()\n+builder = new xml2js.Builder headless: true\n+\n+# TODO :\n+# Move updateOrCreate in a lib\n+# multi account\n+# multi contract\n+\n+# Models\n+Client = cozydb.getModel 'Client',\n+    clientId: String\n+    vendor: String\n+    numeroAcc: String\n+    address: Object\n+    name: Object\n+    email: String\n+    telMobile: String\n+    telHome: String\n+    loginEmail: String\n+    coHolder: Object\n+    commercialContact: Object\n+    docTypeVersion: String\n+\n+Contract = cozydb.getModel 'Contract',\n+    clientId: String\n+    vendor: String\n+    number: String\n+    start: String\n+    end: String\n+    status: String\n+    terminationGrounds: String\n+    pdl: String\n+    energie: String\n+    nomOffre: String\n+    numeroDepannage: String\n+    puissance: String\n+    structureTarifaire: String\n+    optionPrix: String\n+    compteur: Object\n+    consommationAnnuelle: Number\n+    horrairesHeureCreuses: String\n+    releve: Object\n+    services: [Object]\n+    docTypeVersion: String\n+\n+PaymentTerms = cozydb.getModel 'PaymentTerms',\n+    vendor: String\n+    clientId: String\n+    bankDetails: Object\n+    solde: Number\n+    typeEncaissement: String\n+    modifIbanAutorisee: Boolean\n+    dernierReglement: Object\n+    periodiciteFacture: String\n+    dateProchaineFacture: String\n+    idPayeur: String\n+    payeurDivergent: Boolean\n+    paymentSchedules: [Object]\n+    docTypeVersion: String\n+\n+Home = cozydb.getModel 'Home',\n+    pdl: String\n+    beginTs: String\n+    isProfileValidated: Boolean\n+    housingType: String\n+    residenceType: String\n+    occupationType: String\n+    constructionDate: String\n+    isBBC: Boolean\n+    surface: Number\n+    occupantsCount: Number\n+    principalHeatingSystemType: String\n+    sanitoryHotWaterType: String\n+    docTypeVersion: String\n+\n+ConsumptionStatement = cozydb.getModel 'ConsumptionStatement',","path":"server/konnectors/edf.coffee","position":83,"original_position":83,"commit_id":"b700b4f95d9d9e6746fcf8fd6c58a005aa975454","original_commit_id":"bbf60037e8d5d054a71072c91770300b05540297","user":{"login":"Phyks","id":3856586,"avatar_url":"https://avatars.githubusercontent.com/u/3856586?v=3","gravatar_id":"","url":"https://api.github.com/users/Phyks","html_url":"https://github.com/Phyks","followers_url":"https://api.github.com/users/Phyks/followers","following_url":"https://api.github.com/users/Phyks/following{/other_user}","gists_url":"https://api.github.com/users/Phyks/gists{/gist_id}","starred_url":"https://api.github.com/users/Phyks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phyks/subscriptions","organizations_url":"https://api.github.com/users/Phyks/orgs","repos_url":"https://api.github.com/users/Phyks/repos","events_url":"https://api.github.com/users/Phyks/events{/privacy}","received_events_url":"https://api.github.com/users/Phyks/received_events","type":"User","site_admin":false},"body":"Sure, but energy consumption is nothing more than a number (quantity of energy), a date and a rate (cost per unit amount). I think with these only 3 fields I am able to describe well my energy consumption. But with the same 3 fields, I am also able to describe well any phone call, etc.","created_at":"2016-11-04T15:24:00Z","updated_at":"2016-11-04T15:24:00Z","html_url":"https://github.com/cozy-labs/konnectors/pull/574#discussion_r86568388","pull_request_url":"https://api.github.com/repos/cozy-labs/konnectors/pulls/574","_links":{"self":{"href":"https://api.github.com/repos/cozy-labs/konnectors/pulls/comments/86568388"},"html":{"href":"https://github.com/cozy-labs/konnectors/pull/574#discussion_r86568388"},"pull_request":{"href":"https://api.github.com/repos/cozy-labs/konnectors/pulls/574"}}},"pull_request":{"url":"https://api.github.com/repos/cozy-labs/konnectors/pulls/574","id":92176341,"html_url":"https://github.com/cozy-labs/konnectors/pull/574","diff_url":"https://github.com/cozy-labs/konnectors/pull/574.diff","patch_url":"https://github.com/cozy-labs/konnectors/pull/574.patch","issue_url":"https://api.github.com/repos/cozy-labs/konnectors/issues/574","number":574,"state":"open","locked":false,"title":"Add MesInfos EDF Konnectors","user":{"login":"jacquarg","id":1233038,"avatar_url":"https://avatars.githubusercontent.com/u/1233038?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquarg","html_url":"https://github.com/jacquarg","followers_url":"https://api.github.com/users/jacquarg/followers","following_url":"https://api.github.com/users/jacquarg/following{/other_user}","gists_url":"https://api.github.com/users/jacquarg/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquarg/subscriptions","organizations_url":"https://api.github.com/users/jacquarg/orgs","repos_url":"https://api.github.com/users/jacquarg/repos","events_url":"https://api.github.com/users/jacquarg/events{/privacy}","received_events_url":"https://api.github.com/users/jacquarg/received_events","type":"User","site_admin":false},"body":"WIP : needs some clientId from EDF, which should come soon to work properly.","created_at":"2016-11-03T15:24:21Z","updated_at":"2016-11-04T15:24:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9cd1b61e79643308ad87464f4e3c646a0a440dc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cozy-labs/konnectors/pulls/574/commits","review_comments_url":"https://api.github.com/repos/cozy-labs/konnectors/pulls/574/comments","review_comment_url":"https://api.github.com/repos/cozy-labs/konnectors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cozy-labs/konnectors/issues/574/comments","statuses_url":"https://api.github.com/repos/cozy-labs/konnectors/statuses/b700b4f95d9d9e6746fcf8fd6c58a005aa975454","head":{"label":"jacquarg:mesinfos_edf_pub","ref":"mesinfos_edf_pub","sha":"b700b4f95d9d9e6746fcf8fd6c58a005aa975454","user":{"login":"jacquarg","id":1233038,"avatar_url":"https://avatars.githubusercontent.com/u/1233038?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquarg","html_url":"https://github.com/jacquarg","followers_url":"https://api.github.com/users/jacquarg/followers","following_url":"https://api.github.com/users/jacquarg/following{/other_user}","gists_url":"https://api.github.com/users/jacquarg/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquarg/subscriptions","organizations_url":"https://api.github.com/users/jacquarg/orgs","repos_url":"https://api.github.com/users/jacquarg/repos","events_url":"https://api.github.com/users/jacquarg/events{/privacy}","received_events_url":"https://api.github.com/users/jacquarg/received_events","type":"User","site_admin":false},"repo":{"id":39819484,"name":"konnectors","full_name":"jacquarg/konnectors","owner":{"login":"jacquarg","id":1233038,"avatar_url":"https://avatars.githubusercontent.com/u/1233038?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquarg","html_url":"https://github.com/jacquarg","followers_url":"https://api.github.com/users/jacquarg/followers","following_url":"https://api.github.com/users/jacquarg/following{/other_user}","gists_url":"https://api.github.com/users/jacquarg/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquarg/subscriptions","organizations_url":"https://api.github.com/users/jacquarg/orgs","repos_url":"https://api.github.com/users/jacquarg/repos","events_url":"https://api.github.com/users/jacquarg/events{/privacy}","received_events_url":"https://api.github.com/users/jacquarg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacquarg/konnectors","description":"Import data in your Cozy","fork":true,"url":"https://api.github.com/repos/jacquarg/konnectors","forks_url":"https://api.github.com/repos/jacquarg/konnectors/forks","keys_url":"https://api.github.com/repos/jacquarg/konnectors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquarg/konnectors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquarg/konnectors/teams","hooks_url":"https://api.github.com/repos/jacquarg/konnectors/hooks","issue_events_url":"https://api.github.com/repos/jacquarg/konnectors/issues/events{/number}","events_url":"https://api.github.com/repos/jacquarg/konnectors/events","assignees_url":"https://api.github.com/repos/jacquarg/konnectors/assignees{/user}","branches_url":"https://api.github.com/repos/jacquarg/konnectors/branches{/branch}","tags_url":"https://api.github.com/repos/jacquarg/konnectors/tags","blobs_url":"https://api.github.com/repos/jacquarg/konnectors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquarg/konnectors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquarg/konnectors/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquarg/konnectors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquarg/konnectors/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquarg/konnectors/languages","stargazers_url":"https://api.github.com/repos/jacquarg/konnectors/stargazers","contributors_url":"https://api.github.com/repos/jacquarg/konnectors/contributors","subscribers_url":"https://api.github.com/repos/jacquarg/konnectors/subscribers","subscription_url":"https://api.github.com/repos/jacquarg/konnectors/subscription","commits_url":"https://api.github.com/repos/jacquarg/konnectors/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquarg/konnectors/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquarg/konnectors/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquarg/konnectors/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacquarg/konnectors/contents/{+path}","compare_url":"https://api.github.com/repos/jacquarg/konnectors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquarg/konnectors/merges","archive_url":"https://api.github.com/repos/jacquarg/konnectors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquarg/konnectors/downloads","issues_url":"https://api.github.com/repos/jacquarg/konnectors/issues{/number}","pulls_url":"https://api.github.com/repos/jacquarg/konnectors/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquarg/konnectors/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquarg/konnectors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquarg/konnectors/labels{/name}","releases_url":"https://api.github.com/repos/jacquarg/konnectors/releases{/id}","deployments_url":"https://api.github.com/repos/jacquarg/konnectors/deployments","created_at":"2015-07-28T07:27:50Z","updated_at":"2015-07-28T07:27:50Z","pushed_at":"2016-11-04T13:30:34Z","git_url":"git://github.com/jacquarg/konnectors.git","ssh_url":"git@github.com:jacquarg/konnectors.git","clone_url":"https://github.com/jacquarg/konnectors.git","svn_url":"https://github.com/jacquarg/konnectors","homepage":null,"size":5551,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cozy-labs:master","ref":"master","sha":"04258108bd545c1efb582065261a9c1a9d376f47","user":{"login":"cozy-labs","id":8415593,"avatar_url":"https://avatars.githubusercontent.com/u/8415593?v=3","gravatar_id":"","url":"https://api.github.com/users/cozy-labs","html_url":"https://github.com/cozy-labs","followers_url":"https://api.github.com/users/cozy-labs/followers","following_url":"https://api.github.com/users/cozy-labs/following{/other_user}","gists_url":"https://api.github.com/users/cozy-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy-labs/subscriptions","organizations_url":"https://api.github.com/users/cozy-labs/orgs","repos_url":"https://api.github.com/users/cozy-labs/repos","events_url":"https://api.github.com/users/cozy-labs/events{/privacy}","received_events_url":"https://api.github.com/users/cozy-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":15378288,"name":"konnectors","full_name":"cozy-labs/konnectors","owner":{"login":"cozy-labs","id":8415593,"avatar_url":"https://avatars.githubusercontent.com/u/8415593?v=3","gravatar_id":"","url":"https://api.github.com/users/cozy-labs","html_url":"https://github.com/cozy-labs","followers_url":"https://api.github.com/users/cozy-labs/followers","following_url":"https://api.github.com/users/cozy-labs/following{/other_user}","gists_url":"https://api.github.com/users/cozy-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy-labs/subscriptions","organizations_url":"https://api.github.com/users/cozy-labs/orgs","repos_url":"https://api.github.com/users/cozy-labs/repos","events_url":"https://api.github.com/users/cozy-labs/events{/privacy}","received_events_url":"https://api.github.com/users/cozy-labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cozy-labs/konnectors","description":"Import data in your Cozy","fork":false,"url":"https://api.github.com/repos/cozy-labs/konnectors","forks_url":"https://api.github.com/repos/cozy-labs/konnectors/forks","keys_url":"https://api.github.com/repos/cozy-labs/konnectors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cozy-labs/konnectors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cozy-labs/konnectors/teams","hooks_url":"https://api.github.com/repos/cozy-labs/konnectors/hooks","issue_events_url":"https://api.github.com/repos/cozy-labs/konnectors/issues/events{/number}","events_url":"https://api.github.com/repos/cozy-labs/konnectors/events","assignees_url":"https://api.github.com/repos/cozy-labs/konnectors/assignees{/user}","branches_url":"https://api.github.com/repos/cozy-labs/konnectors/branches{/branch}","tags_url":"https://api.github.com/repos/cozy-labs/konnectors/tags","blobs_url":"https://api.github.com/repos/cozy-labs/konnectors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cozy-labs/konnectors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cozy-labs/konnectors/git/refs{/sha}","trees_url":"https://api.github.com/repos/cozy-labs/konnectors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cozy-labs/konnectors/statuses/{sha}","languages_url":"https://api.github.com/repos/cozy-labs/konnectors/languages","stargazers_url":"https://api.github.com/repos/cozy-labs/konnectors/stargazers","contributors_url":"https://api.github.com/repos/cozy-labs/konnectors/contributors","subscribers_url":"https://api.github.com/repos/cozy-labs/konnectors/subscribers","subscription_url":"https://api.github.com/repos/cozy-labs/konnectors/subscription","commits_url":"https://api.github.com/repos/cozy-labs/konnectors/commits{/sha}","git_commits_url":"https://api.github.com/repos/cozy-labs/konnectors/git/commits{/sha}","comments_url":"https://api.github.com/repos/cozy-labs/konnectors/comments{/number}","issue_comment_url":"https://api.github.com/repos/cozy-labs/konnectors/issues/comments{/number}","contents_url":"https://api.github.com/repos/cozy-labs/konnectors/contents/{+path}","compare_url":"https://api.github.com/repos/cozy-labs/konnectors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cozy-labs/konnectors/merges","archive_url":"https://api.github.com/repos/cozy-labs/konnectors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cozy-labs/konnectors/downloads","issues_url":"https://api.github.com/repos/cozy-labs/konnectors/issues{/number}","pulls_url":"https://api.github.com/repos/cozy-labs/konnectors/pulls{/number}","milestones_url":"https://api.github.com/repos/cozy-labs/konnectors/milestones{/number}","notifications_url":"https://api.github.com/repos/cozy-labs/konnectors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cozy-labs/konnectors/labels{/name}","releases_url":"https://api.github.com/repos/cozy-labs/konnectors/releases{/id}","deployments_url":"https://api.github.com/repos/cozy-labs/konnectors/deployments","created_at":"2013-12-22T16:24:12Z","updated_at":"2016-10-22T07:51:33Z","pushed_at":"2016-11-04T15:21:05Z","git_url":"git://github.com/cozy-labs/konnectors.git","ssh_url":"git@github.com:cozy-labs/konnectors.git","clone_url":"https://github.com/cozy-labs/konnectors.git","svn_url":"https://github.com/cozy-labs/konnectors","homepage":null,"size":7355,"stargazers_count":22,"watchers_count":22,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":107,"forks":39,"open_issues":107,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cozy-labs/konnectors/pulls/574"},"html":{"href":"https://github.com/cozy-labs/konnectors/pull/574"},"issue":{"href":"https://api.github.com/repos/cozy-labs/konnectors/issues/574"},"comments":{"href":"https://api.github.com/repos/cozy-labs/konnectors/issues/574/comments"},"review_comments":{"href":"https://api.github.com/repos/cozy-labs/konnectors/pulls/574/comments"},"review_comment":{"href":"https://api.github.com/repos/cozy-labs/konnectors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cozy-labs/konnectors/pulls/574/commits"},"statuses":{"href":"https://api.github.com/repos/cozy-labs/konnectors/statuses/b700b4f95d9d9e6746fcf8fd6c58a005aa975454"}}}}
{"actor":{"display_login":"Phyks"}}