{"action":"created","comment":{"url":"https://api.github.com/repos/18F/C2/pulls/comments/26422581","id":26422581,"diff_hunk":"@@ -0,0 +1,105 @@\n+#module Ncr\n+module Gsa18f\n+  DATA = YAML.load_file(\"#{Rails.root}/config/data/18f.yaml\")\n+\n+  class ProposalForm\n+    include SimpleFormObject\n+\n+    URGENCY = DATA['URGENCY']\n+    OFFICES = DATA['OFFICES']\n+    \n+    #18f additions\n+    #attribute :approver_email, :text\n+    attribute :requester, :user\n+    attribute :office, :string\n+    attribute :justification, :text\n+    attribute :link_to_product, :string\n+    attribute :quantity, :decimal\n+    attribute :date_requested, :string\n+    attribute :urgency, :string\n+    attribute :additional_info, :string\n+    attribute :cost_per_unit, :decimal\n+    attribute :product_name_and_description, :text\n+    attribute :origin, :string\n+\n+    validates :cost_per_unit, numericality: {\n+      greater_than_or_equal_to: 0,\n+      less_than_or_equal_to: 3000\n+    }\n+    validates :product_name_and_description, presence: true\n+\n+    # def budget_approver_email\n+    #   ENV['NCR_BUDGET_APPROVER_EMAIL'] || 'communicart.budget.approver@gmail.com'\n+    # end\n+\n+    # def finance_approver_email\n+    #   ENV['NCR_FINANCE_APPROVER_EMAIL'] || 'communicart.ofm.approver@gmail.com'\n+    # end\n+\n+    # def requires_finance_approval?\n+    #   self.expense_type == 'BA61'\n+    # end\n+\n+    def approver_emails\n+      emails = ['Richard.L.Miller@gsa.gov']\n+      emails\n+    end\n+\n+    def create_cart\n+      cart = Cart.new(\n+        name: self.product_name_and_description,\n+        proposal_attributes: {flow: 'linear'}\n+      )\n+      if cart.save\n+        self.set_props_on(cart)\n+        self.approver_emails.each do |email|\n+          cart.add_approver(email)\n+        end","path":"app/models/gsa18f/proposal_form.rb","position":57,"original_position":57,"commit_id":"ed585aa8975db498264f3bc28155740fdd39eb16","original_commit_id":"ed585aa8975db498264f3bc28155740fdd39eb16","user":{"login":"afeld","id":86842,"avatar_url":"https://avatars.githubusercontent.com/u/86842?v=3","gravatar_id":"","url":"https://api.github.com/users/afeld","html_url":"https://github.com/afeld","followers_url":"https://api.github.com/users/afeld/followers","following_url":"https://api.github.com/users/afeld/following{/other_user}","gists_url":"https://api.github.com/users/afeld/gists{/gist_id}","starred_url":"https://api.github.com/users/afeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeld/subscriptions","organizations_url":"https://api.github.com/users/afeld/orgs","repos_url":"https://api.github.com/users/afeld/repos","events_url":"https://api.github.com/users/afeld/events{/privacy}","received_events_url":"https://api.github.com/users/afeld/received_events","type":"User","site_admin":false},"body":"Can we simplify this to `cart.add_approver('Richard.L.Miller@gsa.gov')`?","created_at":"2015-03-13T21:01:18Z","updated_at":"2015-03-13T21:01:18Z","html_url":"https://github.com/18F/C2/pull/242#discussion_r26422581","pull_request_url":"https://api.github.com/repos/18F/C2/pulls/242","_links":{"self":{"href":"https://api.github.com/repos/18F/C2/pulls/comments/26422581"},"html":{"href":"https://github.com/18F/C2/pull/242#discussion_r26422581"},"pull_request":{"href":"https://api.github.com/repos/18F/C2/pulls/242"}}},"pull_request":{"url":"https://api.github.com/repos/18F/C2/pulls/242","id":31081672,"html_url":"https://github.com/18F/C2/pull/242","diff_url":"https://github.com/18F/C2/pull/242.diff","patch_url":"https://github.com/18F/C2/pull/242.patch","issue_url":"https://api.github.com/repos/18F/C2/issues/242","number":242,"state":"open","locked":false,"title":"18f purchase form","user":{"login":"nickbristow","id":5296248,"avatar_url":"https://avatars.githubusercontent.com/u/5296248?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbristow","html_url":"https://github.com/nickbristow","followers_url":"https://api.github.com/users/nickbristow/followers","following_url":"https://api.github.com/users/nickbristow/following{/other_user}","gists_url":"https://api.github.com/users/nickbristow/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbristow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbristow/subscriptions","organizations_url":"https://api.github.com/users/nickbristow/orgs","repos_url":"https://api.github.com/users/nickbristow/repos","events_url":"https://api.github.com/users/nickbristow/events{/privacy}","received_events_url":"https://api.github.com/users/nickbristow/received_events","type":"User","site_admin":false},"body":"Adds 18f form at gsa18f/proposals/new","created_at":"2015-03-12T21:53:39Z","updated_at":"2015-03-13T21:01:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc5409bd01862df37ced422d870d75f537a9213a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/C2/pulls/242/commits","review_comments_url":"https://api.github.com/repos/18F/C2/pulls/242/comments","review_comment_url":"https://api.github.com/repos/18F/C2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/C2/issues/242/comments","statuses_url":"https://api.github.com/repos/18F/C2/statuses/ed585aa8975db498264f3bc28155740fdd39eb16","head":{"label":"18F:18f_purchase_form","ref":"18f_purchase_form","sha":"ed585aa8975db498264f3bc28155740fdd39eb16","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":18201810,"name":"C2","full_name":"18F/C2","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/C2","description":"Empowering P-Card holders and GSA Advantage users to purchase as efficiently and effectively as possible.","fork":false,"url":"https://api.github.com/repos/18F/C2","forks_url":"https://api.github.com/repos/18F/C2/forks","keys_url":"https://api.github.com/repos/18F/C2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/C2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/C2/teams","hooks_url":"https://api.github.com/repos/18F/C2/hooks","issue_events_url":"https://api.github.com/repos/18F/C2/issues/events{/number}","events_url":"https://api.github.com/repos/18F/C2/events","assignees_url":"https://api.github.com/repos/18F/C2/assignees{/user}","branches_url":"https://api.github.com/repos/18F/C2/branches{/branch}","tags_url":"https://api.github.com/repos/18F/C2/tags","blobs_url":"https://api.github.com/repos/18F/C2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/C2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/C2/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/C2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/C2/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/C2/languages","stargazers_url":"https://api.github.com/repos/18F/C2/stargazers","contributors_url":"https://api.github.com/repos/18F/C2/contributors","subscribers_url":"https://api.github.com/repos/18F/C2/subscribers","subscription_url":"https://api.github.com/repos/18F/C2/subscription","commits_url":"https://api.github.com/repos/18F/C2/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/C2/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/C2/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/C2/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/C2/contents/{+path}","compare_url":"https://api.github.com/repos/18F/C2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/C2/merges","archive_url":"https://api.github.com/repos/18F/C2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/C2/downloads","issues_url":"https://api.github.com/repos/18F/C2/issues{/number}","pulls_url":"https://api.github.com/repos/18F/C2/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/C2/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/C2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/C2/labels{/name}","releases_url":"https://api.github.com/repos/18F/C2/releases{/id}","created_at":"2014-03-28T05:15:23Z","updated_at":"2015-03-12T14:02:14Z","pushed_at":"2015-03-13T19:54:37Z","git_url":"git://github.com/18F/C2.git","ssh_url":"git@github.com:18F/C2.git","clone_url":"https://github.com/18F/C2.git","svn_url":"https://github.com/18F/C2","homepage":"https://18f.github.io/C2/","size":82069,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":9,"forks":4,"open_issues":9,"watchers":6,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"20aa08ff647aa01c40a6f66b62aefbe1cde14abc","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":18201810,"name":"C2","full_name":"18F/C2","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/C2","description":"Empowering P-Card holders and GSA Advantage users to purchase as efficiently and effectively as possible.","fork":false,"url":"https://api.github.com/repos/18F/C2","forks_url":"https://api.github.com/repos/18F/C2/forks","keys_url":"https://api.github.com/repos/18F/C2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/C2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/C2/teams","hooks_url":"https://api.github.com/repos/18F/C2/hooks","issue_events_url":"https://api.github.com/repos/18F/C2/issues/events{/number}","events_url":"https://api.github.com/repos/18F/C2/events","assignees_url":"https://api.github.com/repos/18F/C2/assignees{/user}","branches_url":"https://api.github.com/repos/18F/C2/branches{/branch}","tags_url":"https://api.github.com/repos/18F/C2/tags","blobs_url":"https://api.github.com/repos/18F/C2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/C2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/C2/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/C2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/C2/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/C2/languages","stargazers_url":"https://api.github.com/repos/18F/C2/stargazers","contributors_url":"https://api.github.com/repos/18F/C2/contributors","subscribers_url":"https://api.github.com/repos/18F/C2/subscribers","subscription_url":"https://api.github.com/repos/18F/C2/subscription","commits_url":"https://api.github.com/repos/18F/C2/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/C2/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/C2/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/C2/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/C2/contents/{+path}","compare_url":"https://api.github.com/repos/18F/C2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/C2/merges","archive_url":"https://api.github.com/repos/18F/C2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/C2/downloads","issues_url":"https://api.github.com/repos/18F/C2/issues{/number}","pulls_url":"https://api.github.com/repos/18F/C2/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/C2/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/C2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/C2/labels{/name}","releases_url":"https://api.github.com/repos/18F/C2/releases{/id}","created_at":"2014-03-28T05:15:23Z","updated_at":"2015-03-12T14:02:14Z","pushed_at":"2015-03-13T19:54:37Z","git_url":"git://github.com/18F/C2.git","ssh_url":"git@github.com:18F/C2.git","clone_url":"https://github.com/18F/C2.git","svn_url":"https://github.com/18F/C2","homepage":"https://18f.github.io/C2/","size":82069,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":9,"forks":4,"open_issues":9,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/C2/pulls/242"},"html":{"href":"https://github.com/18F/C2/pull/242"},"issue":{"href":"https://api.github.com/repos/18F/C2/issues/242"},"comments":{"href":"https://api.github.com/repos/18F/C2/issues/242/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/C2/pulls/242/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/C2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/C2/pulls/242/commits"},"statuses":{"href":"https://api.github.com/repos/18F/C2/statuses/ed585aa8975db498264f3bc28155740fdd39eb16"}}}}