Documentation
¶
Index ¶
Constants ¶
View Source
const StoreCtxKey storeCtxKey = "store"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallsFilter ¶
type CallsFilter struct {
common.Pagination
}
type IncidentOption ¶
type IncidentOption func(*incidentOptions)
func WithoutCalls ¶
func WithoutCalls() IncidentOption
type IncidentsParams ¶
type IncidentsParams struct {
common.Pagination
OrderBy *Order `json:"orderBy"`
Direction *common.SortDirection `json:"dir"`
Filter *string `json:"filter"`
Start *jsontypes.Time `json:"start"`
End *jsontypes.Time `json:"end"`
}
func (*IncidentsParams) SortDir ¶
func (p *IncidentsParams) SortDir() (string, error)
SortDir computes the sortField_order string used by the ListIncidentsP SQL query.
type Store ¶
type Store interface {
// CreateIncident creates an incident.
CreateIncident(ctx context.Context, inc incidents.Incident) (*incidents.Incident, error)
// AddToIncident adds the specified call IDs to an incident.
// If not nil, notes must be valid json.
AddRemoveIncidentCalls(ctx context.Context, incidentID uuid.UUID, addCallIDs []uuid.UUID, notes []byte, removeCallIDs []uuid.UUID) error
// UpdateNotes updates the notes for a call-incident mapping.
UpdateNotes(ctx context.Context, incidentID uuid.UUID, callID uuid.UUID, notes []byte) error
// Incidents gets incidents matching parameters and pagination.
Incidents(ctx context.Context, p IncidentsParams) (incs []Incident, totalCount int, err error)
// Incident gets a single incident.
Incident(ctx context.Context, id uuid.UUID, opts ...IncidentOption) (*incidents.Incident, error)
// IncidentCalls gets the calls in an incident.
IncidentCalls(ctx context.Context, id uuid.UUID, pag *CallsFilter) (*incidents.IncidentCalls, error)
// UpdateIncident updates an incident.
UpdateIncident(ctx context.Context, id uuid.UUID, p UpdateIncidentParams) (*incidents.Incident, error)
// DeleteIncident deletes an incident.
DeleteIncident(ctx context.Context, id uuid.UUID) error
// Owner returns an incident with only the owner filled out.
Owner(ctx context.Context, id uuid.UUID) (incidents.Incident, error)
// CallIn returns whether an incident is in an call
CallIn(ctx context.Context, inc uuid.UUID, call uuid.UUID) (bool, error)
// TGsIn returns the talkgroups referenced by an incident as a map, primarily for rbac use.
TGsIn(ctx context.Context, inc uuid.UUID) (talkgroups.PresenceMap, error)
}
Click to show internal directories.
Click to hide internal directories.