{"action":"created","comment":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments/51583034","id":51583034,"diff_hunk":"@@ -0,0 +1,73 @@\n+/* global describe, it, beforeEach */\n+var chai = require('chai');\n+var expect = chai.expect;\n+\n+/** import test helpers */\n+var helpers = require('./helpers');\n+var uuid    = require('../../lib/guid');\n+helpers.configure(chai);\n+\n+\n+/**\n+* The /cash/conventions API endpoint\n+*\n+* @desc This test suit is about the conventions payment in the primary cash\n+*\n+*/\n+describe('The /cash/conventions API endpoint :: ', function () {\n+  'use strict';\n+\n+  var agent = chai.request.agent(helpers.baseUrl);\n+\n+  /** login before each request */\n+  beforeEach(helpers.login(agent));\n+\n+  /** Test with the current date */\n+  var date = new Date();\n+\n+  /** Primary Cash Object */\n+  var primaryCash = {\n+      uuid        : uuid(),\n+      project_id  : 1,\n+      type        : 'E',\n+      date        : date,\n+      currency_id : 2,\n+      account_id  : 3631,\n+      cost        : 10,\n+      description : 'Test Convention Payment/' + date.toString(),\n+      cash_box_id : 2,\n+      origin_id   : 1,\n+      user_id     : 1\n+  };\n+\n+  var wrongPrimaryCash = {\n+    uuid        : uuid(),\n+    project_id  : 1,\n+    type        : 'X',\n+    date        : date,\n+    currency_id : 2,\n+    account_id  : 3631,\n+    cost        : 10\n+  };\n+\n+  it('POST /cash/conventions should create a new convention payment records in primary_cash, primary_cash_item and journal', function () {","path":"server/test/api/conventions.js","position":53,"original_position":53,"commit_id":"d026dd30ec8857f4ee5d10be54baf5f31e1e3e0c","original_commit_id":"d026dd30ec8857f4ee5d10be54baf5f31e1e3e0c","user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"body":"Try a post without a UUID as well to make sure that works.  The programmer should be able to define a UUID on the client or let the server create it.","created_at":"2016-02-02T15:28:07Z","updated_at":"2016-02-02T15:28:07Z","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/71#discussion_r51583034","pull_request_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments/51583034"},"html":{"href":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/71#discussion_r51583034"},"pull_request":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/71","id":58000527,"html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/71","diff_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/71.diff","patch_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/71.patch","issue_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/71","number":71,"state":"open","locked":false,"title":"API for conventions payments","user":{"login":"mbayopanda","id":5445251,"avatar_url":"https://avatars.githubusercontent.com/u/5445251?v=3","gravatar_id":"","url":"https://api.github.com/users/mbayopanda","html_url":"https://github.com/mbayopanda","followers_url":"https://api.github.com/users/mbayopanda/followers","following_url":"https://api.github.com/users/mbayopanda/following{/other_user}","gists_url":"https://api.github.com/users/mbayopanda/gists{/gist_id}","starred_url":"https://api.github.com/users/mbayopanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbayopanda/subscriptions","organizations_url":"https://api.github.com/users/mbayopanda/orgs","repos_url":"https://api.github.com/users/mbayopanda/repos","events_url":"https://api.github.com/users/mbayopanda/events{/privacy}","received_events_url":"https://api.github.com/users/mbayopanda/received_events","type":"User","site_admin":false},"body":"This PR add : \r\n- An API endpoint for creating a new convention payment record in the database\r\n- An integration test for Convention payment API (For the POST HTTP verb)","created_at":"2016-02-02T15:17:06Z","updated_at":"2016-02-02T15:28:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e26fa76d6ab9ea61f46baa83357faa2ad02f927c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/71/commits","review_comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/71/comments","review_comment_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/71/comments","statuses_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/d026dd30ec8857f4ee5d10be54baf5f31e1e3e0c","head":{"label":"mbayopanda:api_convention","ref":"api_convention","sha":"d026dd30ec8857f4ee5d10be54baf5f31e1e3e0c","user":{"login":"mbayopanda","id":5445251,"avatar_url":"https://avatars.githubusercontent.com/u/5445251?v=3","gravatar_id":"","url":"https://api.github.com/users/mbayopanda","html_url":"https://github.com/mbayopanda","followers_url":"https://api.github.com/users/mbayopanda/followers","following_url":"https://api.github.com/users/mbayopanda/following{/other_user}","gists_url":"https://api.github.com/users/mbayopanda/gists{/gist_id}","starred_url":"https://api.github.com/users/mbayopanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbayopanda/subscriptions","organizations_url":"https://api.github.com/users/mbayopanda/orgs","repos_url":"https://api.github.com/users/mbayopanda/repos","events_url":"https://api.github.com/users/mbayopanda/events{/privacy}","received_events_url":"https://api.github.com/users/mbayopanda/received_events","type":"User","site_admin":false},"repo":{"id":49122869,"name":"bhima-2.X","full_name":"mbayopanda/bhima-2.X","owner":{"login":"mbayopanda","id":5445251,"avatar_url":"https://avatars.githubusercontent.com/u/5445251?v=3","gravatar_id":"","url":"https://api.github.com/users/mbayopanda","html_url":"https://github.com/mbayopanda","followers_url":"https://api.github.com/users/mbayopanda/followers","following_url":"https://api.github.com/users/mbayopanda/following{/other_user}","gists_url":"https://api.github.com/users/mbayopanda/gists{/gist_id}","starred_url":"https://api.github.com/users/mbayopanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbayopanda/subscriptions","organizations_url":"https://api.github.com/users/mbayopanda/orgs","repos_url":"https://api.github.com/users/mbayopanda/repos","events_url":"https://api.github.com/users/mbayopanda/events{/privacy}","received_events_url":"https://api.github.com/users/mbayopanda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mbayopanda/bhima-2.X","description":"A fresh start for bhima to remove large commits","fork":true,"url":"https://api.github.com/repos/mbayopanda/bhima-2.X","forks_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/forks","keys_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/teams","hooks_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/hooks","issue_events_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/issues/events{/number}","events_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/events","assignees_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/assignees{/user}","branches_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/branches{/branch}","tags_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/tags","blobs_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/statuses/{sha}","languages_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/languages","stargazers_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/stargazers","contributors_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/contributors","subscribers_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/subscribers","subscription_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/subscription","commits_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/contents/{+path}","compare_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/merges","archive_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/downloads","issues_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/issues{/number}","pulls_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/pulls{/number}","milestones_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/milestones{/number}","notifications_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/labels{/name}","releases_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/releases{/id}","deployments_url":"https://api.github.com/repos/mbayopanda/bhima-2.X/deployments","created_at":"2016-01-06T08:26:46Z","updated_at":"2016-01-06T08:26:48Z","pushed_at":"2016-02-02T15:12:16Z","git_url":"git://github.com/mbayopanda/bhima-2.X.git","ssh_url":"git@github.com:mbayopanda/bhima-2.X.git","clone_url":"https://github.com/mbayopanda/bhima-2.X.git","svn_url":"https://github.com/mbayopanda/bhima-2.X","homepage":null,"size":1610,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"IMA-WorldHealth:master","ref":"master","sha":"12fad69723772665a62ab8cb6e517f34e217e153","user":{"login":"IMA-WorldHealth","id":5330583,"avatar_url":"https://avatars.githubusercontent.com/u/5330583?v=3","gravatar_id":"","url":"https://api.github.com/users/IMA-WorldHealth","html_url":"https://github.com/IMA-WorldHealth","followers_url":"https://api.github.com/users/IMA-WorldHealth/followers","following_url":"https://api.github.com/users/IMA-WorldHealth/following{/other_user}","gists_url":"https://api.github.com/users/IMA-WorldHealth/gists{/gist_id}","starred_url":"https://api.github.com/users/IMA-WorldHealth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMA-WorldHealth/subscriptions","organizations_url":"https://api.github.com/users/IMA-WorldHealth/orgs","repos_url":"https://api.github.com/users/IMA-WorldHealth/repos","events_url":"https://api.github.com/users/IMA-WorldHealth/events{/privacy}","received_events_url":"https://api.github.com/users/IMA-WorldHealth/received_events","type":"Organization","site_admin":false},"repo":{"id":49052669,"name":"bhima-2.X","full_name":"IMA-WorldHealth/bhima-2.X","owner":{"login":"IMA-WorldHealth","id":5330583,"avatar_url":"https://avatars.githubusercontent.com/u/5330583?v=3","gravatar_id":"","url":"https://api.github.com/users/IMA-WorldHealth","html_url":"https://github.com/IMA-WorldHealth","followers_url":"https://api.github.com/users/IMA-WorldHealth/followers","following_url":"https://api.github.com/users/IMA-WorldHealth/following{/other_user}","gists_url":"https://api.github.com/users/IMA-WorldHealth/gists{/gist_id}","starred_url":"https://api.github.com/users/IMA-WorldHealth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMA-WorldHealth/subscriptions","organizations_url":"https://api.github.com/users/IMA-WorldHealth/orgs","repos_url":"https://api.github.com/users/IMA-WorldHealth/repos","events_url":"https://api.github.com/users/IMA-WorldHealth/events{/privacy}","received_events_url":"https://api.github.com/users/IMA-WorldHealth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IMA-WorldHealth/bhima-2.X","description":"A fresh start for bhima to remove large commits","fork":false,"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X","forks_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/forks","keys_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/teams","hooks_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/hooks","issue_events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/events{/number}","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/events","assignees_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/assignees{/user}","branches_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/branches{/branch}","tags_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/tags","blobs_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/refs{/sha}","trees_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/{sha}","languages_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/languages","stargazers_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/stargazers","contributors_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/contributors","subscribers_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/subscribers","subscription_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/subscription","commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/commits{/sha}","git_commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/commits{/sha}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/comments{/number}","issue_comment_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/comments{/number}","contents_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/contents/{+path}","compare_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/merges","archive_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/downloads","issues_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues{/number}","pulls_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls{/number}","milestones_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/milestones{/number}","notifications_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels{/name}","releases_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/releases{/id}","deployments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/deployments","created_at":"2016-01-05T08:30:30Z","updated_at":"2016-01-11T08:15:00Z","pushed_at":"2016-02-02T15:17:06Z","git_url":"git://github.com/IMA-WorldHealth/bhima-2.X.git","ssh_url":"git@github.com:IMA-WorldHealth/bhima-2.X.git","clone_url":"https://github.com/IMA-WorldHealth/bhima-2.X.git","svn_url":"https://github.com/IMA-WorldHealth/bhima-2.X","homepage":null,"size":1629,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":30,"forks":5,"open_issues":30,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/71"},"html":{"href":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/71"},"issue":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/71"},"comments":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/d026dd30ec8857f4ee5d10be54baf5f31e1e3e0c"}}}}