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