stillbox/pkg/database/models.go

119 lines
3.7 KiB
Go
Raw Normal View History

2024-07-15 10:12:53 -04:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
2024-11-15 11:34:54 -05:00
// sqlc v1.27.0
2024-07-15 10:12:53 -04:00
package database
import (
2024-07-26 09:29:58 -04:00
"time"
2024-11-13 09:24:11 -05:00
"dynatron.me/x/stillbox/internal/jsontypes"
"dynatron.me/x/stillbox/pkg/alerting/rules"
2024-07-24 22:42:30 -04:00
"github.com/google/uuid"
2024-07-15 10:12:53 -04:00
"github.com/jackc/pgx/v5/pgtype"
)
2024-10-25 16:02:08 -04:00
type Alert struct {
2024-11-17 21:46:10 -05:00
ID int `json:"id"`
2024-10-25 16:02:08 -04:00
Time pgtype.Timestamptz `json:"time"`
2024-11-15 11:34:54 -05:00
TGID int `json:"tgid"`
SystemID int `json:"system_id"`
2024-10-25 16:02:08 -04:00
Weight *float32 `json:"weight"`
Score *float32 `json:"score"`
2024-11-02 09:41:48 -04:00
OrigScore *float32 `json:"orig_score"`
2024-11-02 14:26:58 -04:00
Notified bool `json:"notified"`
2024-10-25 16:02:08 -04:00
Metadata []byte `json:"metadata"`
}
2024-07-16 19:31:30 -04:00
type ApiKey struct {
2024-11-19 09:10:55 -05:00
ID int `json:"id"`
2024-07-27 19:25:16 -04:00
Owner int `json:"owner"`
2024-07-26 09:29:58 -04:00
CreatedAt time.Time `json:"created_at"`
2024-07-25 09:37:27 -04:00
Expires pgtype.Timestamp `json:"expires"`
Disabled *bool `json:"disabled"`
2024-08-03 00:05:02 -04:00
ApiKey string `json:"api_key"`
2024-07-15 10:12:53 -04:00
}
type Call struct {
ID uuid.UUID `json:"id"`
Submitter *int32 `json:"submitter"`
System int `json:"system"`
Talkgroup int `json:"talkgroup"`
CallDate pgtype.Timestamptz `json:"call_date"`
AudioName *string `json:"audio_name"`
AudioBlob []byte `json:"audio_blob"`
Duration *int32 `json:"duration"`
AudioType *string `json:"audio_type"`
AudioUrl *string `json:"audio_url"`
Frequency int `json:"frequency"`
Frequencies []int `json:"frequencies"`
Patches []int `json:"patches"`
2024-11-17 21:46:10 -05:00
TGLabel *string `json:"tg_label"`
TGAlphaTag *string `json:"tg_alpha_tag"`
TGGroup *string `json:"tg_group"`
Source int `json:"source"`
Transcript *string `json:"transcript"`
2024-07-16 19:31:30 -04:00
}
type Incident struct {
2024-07-25 09:37:27 -04:00
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
StartTime pgtype.Timestamp `json:"start_time"`
EndTime pgtype.Timestamp `json:"end_time"`
Location []byte `json:"location"`
Metadata []byte `json:"metadata"`
2024-07-16 19:31:30 -04:00
}
type IncidentsCall struct {
2024-07-25 09:37:27 -04:00
IncidentID uuid.UUID `json:"incident_id"`
CallID uuid.UUID `json:"call_id"`
Notes []byte `json:"notes"`
2024-07-15 19:03:48 -04:00
}
type Setting struct {
2024-07-25 09:37:27 -04:00
Name string `json:"name"`
UpdatedBy *int32 `json:"updated_by"`
Value []byte `json:"value"`
2024-07-15 19:03:48 -04:00
}
type System struct {
2024-07-25 09:37:27 -04:00
ID int `json:"id"`
Name string `json:"name"`
2024-07-15 19:03:48 -04:00
}
type Talkgroup struct {
2024-11-17 21:46:10 -05:00
ID int `json:"id"`
2024-11-13 09:24:11 -05:00
SystemID int32 `json:"system_id"`
2024-11-15 11:34:54 -05:00
TGID int32 `json:"tgid"`
2024-11-13 09:24:11 -05:00
Name *string `json:"name"`
AlphaTag *string `json:"alpha_tag"`
2024-11-17 21:46:10 -05:00
TGGroup *string `json:"tg_group"`
2024-11-13 09:24:11 -05:00
Frequency *int32 `json:"frequency"`
Metadata jsontypes.Metadata `json:"metadata"`
Tags []string `json:"tags"`
Alert bool `json:"alert"`
AlertConfig rules.AlertRules `json:"alert_config"`
Weight float32 `json:"weight"`
2024-11-17 21:46:10 -05:00
Learned bool `json:"learned"`
2024-07-15 10:12:53 -04:00
}
2024-07-27 19:25:16 -04:00
type TalkgroupsLearned struct {
2024-11-17 21:46:10 -05:00
ID int `json:"id"`
SystemID int `json:"system_id"`
TGID int `json:"tgid"`
Name string `json:"name"`
AlphaTag *string `json:"alpha_tag"`
TGGroup *string `json:"tg_group"`
Ignored *bool `json:"ignored"`
2024-07-27 19:25:16 -04:00
}
2024-07-15 10:12:53 -04:00
type User struct {
2024-11-19 09:10:55 -05:00
ID int `json:"id"`
2024-07-25 09:37:27 -04:00
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
2024-07-27 19:25:16 -04:00
IsAdmin bool `json:"is_admin"`
2024-07-25 09:37:27 -04:00
Prefs []byte `json:"prefs"`
2024-07-15 10:12:53 -04:00
}