incident call order
This commit is contained in:
parent
5c07b8c15a
commit
e01f20f1fc
5 changed files with 55 additions and 53 deletions
|
@ -135,18 +135,18 @@ type UpsertTalkgroupBatchResults struct {
|
|||
}
|
||||
|
||||
type UpsertTalkgroupParams struct {
|
||||
SystemID int32 `json:"system_id"`
|
||||
TGID int32 `json:"tgid"`
|
||||
Name *string `json:"name"`
|
||||
AlphaTag *string `json:"alpha_tag"`
|
||||
TGGroup *string `json:"tg_group"`
|
||||
Frequency *int32 `json:"frequency"`
|
||||
Metadata jsontypes.Metadata `json:"metadata"`
|
||||
Tags []string `json:"tags"`
|
||||
Alert interface{} `json:"alert"`
|
||||
SystemID int32 `json:"system_id"`
|
||||
TGID int32 `json:"tgid"`
|
||||
Name *string `json:"name"`
|
||||
AlphaTag *string `json:"alpha_tag"`
|
||||
TGGroup *string `json:"tg_group"`
|
||||
Frequency *int32 `json:"frequency"`
|
||||
Metadata jsontypes.Metadata `json:"metadata"`
|
||||
Tags []string `json:"tags"`
|
||||
Alert interface{} `json:"alert"`
|
||||
AlertRules rules.AlertRules `json:"alert_rules"`
|
||||
Weight pgtype.Numeric `json:"weight"`
|
||||
Learned *bool `json:"learned"`
|
||||
Weight pgtype.Numeric `json:"weight"`
|
||||
Learned *bool `json:"learned"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpsertTalkgroup(ctx context.Context, arg []UpsertTalkgroupParams) *UpsertTalkgroupBatchResults {
|
||||
|
|
|
@ -180,6 +180,7 @@ FROM incidents_calls ic, LATERAL (
|
|||
FROM swept_calls sc WHERE sc.id = ic.swept_call_id
|
||||
) c
|
||||
WHERE ic.incident_id = $1
|
||||
ORDER BY ic.call_date ASC
|
||||
`
|
||||
|
||||
type GetIncidentCallsRow struct {
|
||||
|
|
|
@ -107,40 +107,40 @@ type System struct {
|
|||
}
|
||||
|
||||
type Talkgroup struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
SystemID int32 `json:"system_id,omitempty"`
|
||||
TGID int32 `json:"tgid,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
AlphaTag *string `json:"alpha_tag,omitempty"`
|
||||
TGGroup *string `json:"tg_group,omitempty"`
|
||||
Frequency *int32 `json:"frequency,omitempty"`
|
||||
Metadata jsontypes.Metadata `json:"metadata,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Alert bool `json:"alert,omitempty"`
|
||||
ID int `json:"id,omitempty"`
|
||||
SystemID int32 `json:"system_id,omitempty"`
|
||||
TGID int32 `json:"tgid,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
AlphaTag *string `json:"alpha_tag,omitempty"`
|
||||
TGGroup *string `json:"tg_group,omitempty"`
|
||||
Frequency *int32 `json:"frequency,omitempty"`
|
||||
Metadata jsontypes.Metadata `json:"metadata,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Alert bool `json:"alert,omitempty"`
|
||||
AlertRules rules.AlertRules `json:"alert_rules,omitempty"`
|
||||
Weight float32 `json:"weight,omitempty"`
|
||||
Learned bool `json:"learned,omitempty"`
|
||||
Ignored bool `json:"ignored,omitempty"`
|
||||
Weight float32 `json:"weight,omitempty"`
|
||||
Learned bool `json:"learned,omitempty"`
|
||||
Ignored bool `json:"ignored,omitempty"`
|
||||
}
|
||||
|
||||
type TalkgroupVersion struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
Time pgtype.Timestamptz `json:"time,omitempty"`
|
||||
CreatedBy *int32 `json:"created_by,omitempty"`
|
||||
Deleted *bool `json:"deleted,omitempty"`
|
||||
SystemID *int32 `json:"system_id,omitempty"`
|
||||
TGID *int32 `json:"tgid,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
AlphaTag *string `json:"alpha_tag,omitempty"`
|
||||
TGGroup *string `json:"tg_group,omitempty"`
|
||||
Frequency *int32 `json:"frequency,omitempty"`
|
||||
Metadata []byte `json:"metadata,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Alert *bool `json:"alert,omitempty"`
|
||||
ID int `json:"id,omitempty"`
|
||||
Time pgtype.Timestamptz `json:"time,omitempty"`
|
||||
CreatedBy *int32 `json:"created_by,omitempty"`
|
||||
Deleted *bool `json:"deleted,omitempty"`
|
||||
SystemID *int32 `json:"system_id,omitempty"`
|
||||
TGID *int32 `json:"tgid,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
AlphaTag *string `json:"alpha_tag,omitempty"`
|
||||
TGGroup *string `json:"tg_group,omitempty"`
|
||||
Frequency *int32 `json:"frequency,omitempty"`
|
||||
Metadata []byte `json:"metadata,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Alert *bool `json:"alert,omitempty"`
|
||||
AlertRules []byte `json:"alert_rules,omitempty"`
|
||||
Weight *float32 `json:"weight,omitempty"`
|
||||
Learned *bool `json:"learned,omitempty"`
|
||||
Ignored *bool `json:"ignored,omitempty"`
|
||||
Weight *float32 `json:"weight,omitempty"`
|
||||
Learned *bool `json:"learned,omitempty"`
|
||||
Ignored *bool `json:"ignored,omitempty"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
|
|
|
@ -738,19 +738,19 @@ RETURNING id, system_id, tgid, name, alpha_tag, tg_group, frequency, metadata, t
|
|||
`
|
||||
|
||||
type UpdateTalkgroupParams struct {
|
||||
Name *string `json:"name"`
|
||||
AlphaTag *string `json:"alpha_tag"`
|
||||
TGGroup *string `json:"tg_group"`
|
||||
Frequency *int32 `json:"frequency"`
|
||||
Metadata jsontypes.Metadata `json:"metadata"`
|
||||
Tags []string `json:"tags"`
|
||||
Alert *bool `json:"alert"`
|
||||
Name *string `json:"name"`
|
||||
AlphaTag *string `json:"alpha_tag"`
|
||||
TGGroup *string `json:"tg_group"`
|
||||
Frequency *int32 `json:"frequency"`
|
||||
Metadata jsontypes.Metadata `json:"metadata"`
|
||||
Tags []string `json:"tags"`
|
||||
Alert *bool `json:"alert"`
|
||||
AlertRules rules.AlertRules `json:"alert_rules"`
|
||||
Weight *float32 `json:"weight"`
|
||||
Learned *bool `json:"learned"`
|
||||
ID *int32 `json:"id"`
|
||||
SystemID *int32 `json:"system_id"`
|
||||
TGID *int32 `json:"tgid"`
|
||||
Weight *float32 `json:"weight"`
|
||||
Learned *bool `json:"learned"`
|
||||
ID *int32 `json:"id"`
|
||||
SystemID *int32 `json:"system_id"`
|
||||
TGID *int32 `json:"tgid"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateTalkgroup(ctx context.Context, arg UpdateTalkgroupParams) (Talkgroup, error) {
|
||||
|
|
|
@ -141,7 +141,8 @@ FROM incidents_calls ic, LATERAL (
|
|||
sc.transcript
|
||||
FROM swept_calls sc WHERE sc.id = ic.swept_call_id
|
||||
) c
|
||||
WHERE ic.incident_id = @id;
|
||||
WHERE ic.incident_id = @id
|
||||
ORDER BY ic.call_date ASC;
|
||||
|
||||
-- name: GetIncident :one
|
||||
SELECT
|
||||
|
|
Loading…
Reference in a new issue