Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Service] Request Counts #379

Closed
1 of 2 tasks
jmensch1 opened this issue Mar 6, 2020 · 0 comments · Fixed by #393
Closed
1 of 2 tasks

[Service] Request Counts #379

jmensch1 opened this issue Mar 6, 2020 · 0 comments · Fixed by #393
Assignees
Labels
Role: Backend Related to API or other server-side work v1 The first version of the site

Comments

@jmensch1
Copy link
Contributor

jmensch1 commented Mar 6, 2020

Description

This service can provide data for both the "How People Contact 311" and "Request Types" pie charts.

Both charts require a simple count of the number of requests, grouped by a particular field in the database. "How People Contact 311" is based on a grouping of the "requestsource" field, and "Request Types" is based on a grouping of the "requesttype" field. A single endpoint can provide both counts.

Endpoint

Accepted methods

  • GET
  • POST

Path: server:port/requestcounts

Inputs

The inputs are all of the usual filters, plus a countFields params that lists the fields we want to count by.

{
  "startDate": "2015-01-01",
  "endDate": "2015-12-31",
  "ncList": ["SUNLAND-TUJUNGA NC"],
  "requestTypes": ["Homeless Encampment", "Graffiti Removal", "Bulky Items"],
  "countFields": ["requesttype", "requestsource"]
}

Outputs

{
  "lastPulled": "NOW",
  "data": [
    {
      "field": "requesttype",
      "counts": {
        "Homeless Encampment": 300,
        "Graffiti Removal": 500,
        "Bulky Items": 200
      }
    },
    {
      "field": "requestsource",
      "counts": {
        "Mobile App": 200,
        "Self Service": 200,
        "Driver Self Report": 200,
        "Call": 200,
        "Email": 100,
        "Other":  100
      }
    }
  ]
}
@jmensch1 jmensch1 added the Role: Backend Related to API or other server-side work label Mar 6, 2020
@jmensch1 jmensch1 self-assigned this Mar 6, 2020
@jmensch1 jmensch1 linked a pull request Mar 9, 2020 that will close this issue
@ExperimentsInHonesty ExperimentsInHonesty added the v1 The first version of the site label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Role: Backend Related to API or other server-side work v1 The first version of the site
Projects
Development

Successfully merging a pull request may close this issue.

2 participants