{"action":"created","issue":{"url":"https://api.github.com/repos/Bounties-Network/BountiesAPI/issues/3","repository_url":"https://api.github.com/repos/Bounties-Network/BountiesAPI","labels_url":"https://api.github.com/repos/Bounties-Network/BountiesAPI/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Bounties-Network/BountiesAPI/issues/3/comments","events_url":"https://api.github.com/repos/Bounties-Network/BountiesAPI/issues/3/events","html_url":"https://github.com/Bounties-Network/BountiesAPI/issues/3","id":307856297,"number":3,"title":"Feature: Analytics Endpoint V1","user":{"login":"villanuevawill","id":7415822,"avatar_url":"https://avatars1.githubusercontent.com/u/7415822?v=4","gravatar_id":"","url":"https://api.github.com/users/villanuevawill","html_url":"https://github.com/villanuevawill","followers_url":"https://api.github.com/users/villanuevawill/followers","following_url":"https://api.github.com/users/villanuevawill/following{/other_user}","gists_url":"https://api.github.com/users/villanuevawill/gists{/gist_id}","starred_url":"https://api.github.com/users/villanuevawill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/villanuevawill/subscriptions","organizations_url":"https://api.github.com/users/villanuevawill/orgs","repos_url":"https://api.github.com/users/villanuevawill/repos","events_url":"https://api.github.com/users/villanuevawill/events{/privacy}","received_events_url":"https://api.github.com/users/villanuevawill/received_events","type":"User","site_admin":false},"labels":[{"id":868646378,"url":"https://api.github.com/repos/Bounties-Network/BountiesAPI/labels/enhancement","name":"enhancement","color":"a2eeef","default":true},{"id":868646381,"url":"https://api.github.com/repos/Bounties-Network/BountiesAPI/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-03-23T00:01:52Z","updated_at":"2018-04-07T22:49:57Z","closed_at":null,"author_association":"COLLABORATOR","body":"This is the first bounty in an upcoming set of bounties focused around building an analytics dashboard for projects that utilize the [standard bounties contract](https://github.com/Bounties-Network/StandardBounties) such as gitcoin, and other upcoming open source sites.\r\n\r\nThis first task begins the work of exposing endpoints around daily stats for a range of time.  Ultimately, these will be used to build a react frontend connected to highcharts or other charting libraries.  The data is already stored in PSQL, it just needs to be served up via the format requested below. This task ultimately requires just one endpoint to be built for now.\r\n\r\n## Requirements\r\n- endpoint should accept a start and end-date filter -  `?publish_date__range=2016-01-01,2016-02-01` format\r\n- Results need to be returned as **daily**.  Daily represents 00:00 - 23:59 UTC time.  The current day will of course be a partial day.\r\n- endpoint should live in the newly added analytics directory/application - https://github.com/Bounties-Network/BountiesAPI/tree/master/bounties_api/analytics\r\n- Url should be prefaced with /analytics route\r\n- A new model should be introduced. This model should include a date field, along with the names of the requested stats.  For now, I only foresee one model being created.\r\n- A management job should be created. This job should be intended to run daily. Don't worry about setting up the scheduling - I'll put that work in after the PR. To see an example job/management command: https://github.com/Bounties-Network/BountiesAPI/blob/master/bounties_api/std_bounties/management/commands/get_token_values.py\r\n- The job should fill in empty dates. For example, if the model and table is newly created and empty, the job should insert records for every day. Basically, the job should do calculations from the latest insertion date, but should not repeat work if the date has already been included.\r\n- The endpoint should be an APIView - similar to these - https://github.com/Bounties-Network/BountiesAPI/blob/master/bounties_api/std_bounties/views.py#L83\r\n- The job should already have the previous days pre-calculated. However, the endpoint will need to calculate the statistics for the current day (since it is ongoing) and add that to the dataset (**hint: a shared function should be used here**)\r\n- This is time-series data!  This means, the endpoint should return the values on each stat for each day in-between the range. **IN addition** to the timeseries data - it should also return the aggregates.\r\n- Pep8 compliance required\r\n\r\n## Statistics\r\n- Total number of bounties issued\r\n- Total number of fulfillments submitted\r\n- Total number of fulfillments accepted\r\n- Total number of fulfillments without acceptance\r\n- Total fulfiller acceptance rate\r\n- Total bounty fulfilled rate\r\n- Average fulfiller acceptance rate\r\n- Average bounty fulfilled rate\r\n- Average fulfillment amount (for now just eth volume, ignore noneth on this one)\r\n- Total fulfillment amount\r\n- Number of bounties in each bountyStage (each stage count would be a separate field on the model)\r\n\r\nAll of the above should be a separate field on one model that the job writes to. For the current day, this should be calculated in realtime. These should all be exposed on one api endpoint.\r\n\r\n## Definition of Done\r\n- All requirements are completed above with the endpoint functional.\r\n\r\n## Reviewers\r\nMyself and @mbeylin \r\n\r\n## Review Requirements\r\n- A WIP pull request along the way with initial progress\r\n- Key questions posted here\r\n- Conversational and longer discussions should be directed to the bounties network slack in this channel: https://bountiesnetwork.slack.com/messages/community-dev"},"comment":{"url":"https://api.github.com/repos/Bounties-Network/BountiesAPI/issues/comments/379504699","html_url":"https://github.com/Bounties-Network/BountiesAPI/issues/3#issuecomment-379504699","issue_url":"https://api.github.com/repos/Bounties-Network/BountiesAPI/issues/3","id":379504699,"user":{"login":"vs77bb","id":23297747,"avatar_url":"https://avatars1.githubusercontent.com/u/23297747?v=4","gravatar_id":"","url":"https://api.github.com/users/vs77bb","html_url":"https://github.com/vs77bb","followers_url":"https://api.github.com/users/vs77bb/followers","following_url":"https://api.github.com/users/vs77bb/following{/other_user}","gists_url":"https://api.github.com/users/vs77bb/gists{/gist_id}","starred_url":"https://api.github.com/users/vs77bb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vs77bb/subscriptions","organizations_url":"https://api.github.com/users/vs77bb/orgs","repos_url":"https://api.github.com/users/vs77bb/repos","events_url":"https://api.github.com/users/vs77bb/events{/privacy}","received_events_url":"https://api.github.com/users/vs77bb/received_events","type":"User","site_admin":false},"created_at":"2018-04-07T22:49:57Z","updated_at":"2018-04-07T22:49:57Z","author_association":"NONE","body":"@leonprou @villanuevawill Poking in... you guys still working on this? Let me know if you need me to pub this out 🙂 "}}
{"actor":{"display_login":"vs77bb"}}