Documentation ¶
Index ¶
- Constants
- func IsValidServiceCode(ServiceCode string) bool
- type AccountIDNotFoundErr
- type AttributeValue
- type AuditEntry
- type City
- type CityNotFoundErr
- type Feedback
- type FeedbackResponse
- type Media
- type OnboardingRequest
- type OnboardingResponse
- type Request
- type RequestIdNotFoundErr
- type RequestResponse
- type Service
- type ServiceAttribute
- type ServiceCodeNotFoundErr
- type ServiceDefinition
- type User
- type UserIDAlreadyExistsErr
- type UserResponse
Constants ¶
const ( ServicesTable = "Services" RequestsTable = "Requests" CitiesTable = "Cities" UsersTable = "Users" FeedbackTable = "Feedback" OnboardingTable = "OnboardingRequests" )
Names of Open311 tables in dynamoDB
const ( RequestOpen = "open" // request has been reported RequestAccepted = "accepted" // city worker has accepted responsibility to fix issue RequestInProgress = "inProgress" // request is actively being worked RequestClosed = "closed" // request has been resolved )
constants to define Open311 Request status strings
const AwsRegion = endpoints.UsEast1RegionID // "us-east-1" - US East (N. Virginia).
AwsRegion is the AWS Standard region in which the dynamo tables are created
Variables ¶
This section is empty.
Functions ¶
func IsValidServiceCode ¶
Types ¶
type AccountIDNotFoundErr ¶
type AccountIDNotFoundErr struct {
// contains filtered or unexported fields
}
func (*AccountIDNotFoundErr) Error ¶
func (e *AccountIDNotFoundErr) Error() string
type AttributeValue ¶
Possible value for ServiceAttribute that defines lists
type AuditEntry ¶
type CityNotFoundErr ¶
type CityNotFoundErr struct {
// contains filtered or unexported fields
}
func (*CityNotFoundErr) Error ¶
func (e *CityNotFoundErr) Error() string
type FeedbackResponse ¶
type FeedbackResponse struct {
ID string `json:"id"`
}
func AddFeedback ¶
func AddFeedback(feedback Feedback) (FeedbackResponse, error)
type OnboardingRequest ¶
type OnboardingResponse ¶
type OnboardingResponse struct {
ID string `json:"id "`
}
func AddOnboardingRequest ¶
func AddOnboardingRequest(request OnboardingRequest, accountID string) (OnboardingResponse, error)
type Request ¶
type Request struct { ServiceRequestID string `json:"service_request_id"` // The unique ID of the service request created. Status string `json:"status"` // The current status of the service request. StatusNotes string `json:"status_notes"` // Explanation of why status was changed to current state or more details on current status than conveyed with status alone. ServiceName string `json:"service_name"` // The human readable name of the service request type ServiceCode string `json:"service_code"` // The unique identifier for the service request type Description string `json:"description"` // A full description of the request or report submitted. AgencyResponsible string `json:"agency_responsible"` // The agency responsible for fulfilling or otherwise addressing the service request. ServiceNotice string `json:"service_notice"` // Information about the action expected to fulfill the request or otherwise address the information reported. RequestedDateTime string `json:"requested_datetime"` // The date and time (RFC3339) when the service request was made. UpdatedDateTime string `json:"update_datetime"` // The date and time (RFC3339) when the service request was last modified. For requests with status=closed, this will be the date the request was closed. ExpectedDateTime string `json:"expected_datetime"` // The date and time (RFC3339) when the service request can be expected to be fulfilled. This may be based on a service-specific service level agreement. Address string `json:"address"` // Human readable address or description of location. AddressID string `json:"address_id"` // The internal address ID used by a jurisdictions master address repository or other addressing system. ZipCode int32 `json:"zipcode"` // The postal code for the location of the service request. Latitude float32 `json:"lat"` // latitude using the (WGS84) projection. Longitude float32 `json:"lon"` // longitude using the (WGS84) projection. MediaURL string `json:"media_url"` // Media URL AuditLog []AuditEntry `json:"audit_log"` // Slice of AuditEntry items - Log to keep track of all changes to a Request over time Values []AttributeValue `json:"values"` // Enables future expansion }
Issues that have been reported as service requests. Location is submitted via lat/long or address
func GetRequest ¶
GetRequest takes a service_request_id, looks up that request in DynamoDB and returns the corresponding Open311 Request struct. If the service_request_id is not in the database, a RequestIdNotFoundErr error is set
func GetRequests ¶
GetRequests returns slice of all Open311 Requests in DynamoBD Requests Table
type RequestIdNotFoundErr ¶
type RequestIdNotFoundErr struct {
// contains filtered or unexported fields
}
func (*RequestIdNotFoundErr) Error ¶
func (e *RequestIdNotFoundErr) Error() string
type RequestResponse ¶
type RequestResponse struct { ServiceRequestID string `json:"service_request_id"` // The unique ID of the service request created. ServiceNotice string `json:"service_notice"` // Information about the action expected to fulfill the request or otherwise address the information reported AccountID string `json:"account_id"` // Unique ID for the user account of the person submitting the request }
func SubmitRequest ¶
func SubmitRequest(request Request, accountID string) (RequestResponse, error)
SubmitRequest initializes a new Open311 request. This function generates a requestID, assigns the request creation time, initializes the request to 'open' sets the service name and group responsible to resolve and stores in DynamoDB requests table.
func UpdateRequest ¶
func UpdateRequest(request Request, accountID string) (RequestResponse, error)
UpdateRequest takes an existing request and updates the DynamoDB with the new values after setting the 'UpdatedDateTime'
type Service ¶
type Service struct { ServiceCode string `json:"service_code"` ServiceName string `json:"service_name"` Description string `json:"description"` Metadata bool `json:"metadata"` Type string `json:"type"` Keywords []string `json:"keywords"` Group string `json:"group"` }
Service is an Open311 struct representing a service offered by a city
func GetService ¶
GetService takes a service code UUID, looks up that service in DynamoDB and returns the corresponding Open311 Service struct. If the requested service code is not in the database, a ServiceCodeNotFoundErr error is set
func GetServices ¶
GetServices provides a list of acceptable 311 service request types and their associated service codes. These request types can be unique to the city/jurisdiction.
type ServiceAttribute ¶
type ServiceAttribute struct { Code string `json:"code"` DataType string `json:"datatype"` Variable bool `json:"variable"` Required bool `json:"required"` Order int32 `json:"order"` Description string `json:"description"` DataTypeDescription string `json:"datatype_description"` Values []AttributeValue `json:"values"` }
Single attribute extension for a service
type ServiceCodeNotFoundErr ¶
type ServiceCodeNotFoundErr struct {
// contains filtered or unexported fields
}
func (*ServiceCodeNotFoundErr) Error ¶
func (e *ServiceCodeNotFoundErr) Error() string
type ServiceDefinition ¶
type ServiceDefinition struct { ServiceCode string `json:"service_code"` Attributes []ServiceAttribute `json:"attributes"` }
ServiceDefinition defines attributes associated with a service code. These attributes can be unique to the city/jurisdiction. These are necessary if the Service selected has metadata set as true from the GET Services response
type User ¶
type User struct { AccountID string `json:"account_id"` // Unique ID of Open311 User Groups []string `json:"group_ids"` // Slice of agencies or groups to which a user belongs SubmittedRequests []string `json:"submitted_request_ids"` // Slice of requests user has made WatchedRequests []string `json:"watched_request_ids"` // Slice of request user is watching }
type UserIDAlreadyExistsErr ¶
type UserIDAlreadyExistsErr struct {
// contains filtered or unexported fields
}
func (*UserIDAlreadyExistsErr) Error ¶
func (e *UserIDAlreadyExistsErr) Error() string
type UserResponse ¶
type UserResponse struct {
AccountID string `json:"account_id"` // Unique ID for the user account
}