Omitempty on calls queries

This commit is contained in:
Daniel Ponte 2025-02-22 15:41:18 -05:00
parent 1b6e5af87f
commit 78bd29b316

View file

@ -28,14 +28,14 @@ VALUES
` `
type AddAlertParams struct { type AddAlertParams struct {
Time pgtype.Timestamptz `json:"time"` Time pgtype.Timestamptz `json:"time,omitempty"`
TGID int `json:"tgid"` TGID int `json:"tgid,omitempty"`
SystemID int `json:"systemId"` SystemID int `json:"systemId,omitempty"`
Weight *float32 `json:"weight"` Weight *float32 `json:"weight,omitempty"`
Score *float32 `json:"score"` Score *float32 `json:"score,omitempty"`
OrigScore *float32 `json:"origScore"` OrigScore *float32 `json:"origScore,omitempty"`
Notified bool `json:"notified"` Notified bool `json:"notified,omitempty"`
Metadata []byte `json:"metadata"` Metadata []byte `json:"metadata,omitempty"`
} }
func (q *Queries) AddAlert(ctx context.Context, arg AddAlertParams) error { func (q *Queries) AddAlert(ctx context.Context, arg AddAlertParams) error {
@ -95,24 +95,24 @@ $18
` `
type AddCallParams struct { type AddCallParams struct {
ID uuid.UUID `json:"id"` ID uuid.UUID `json:"id,omitempty"`
Submitter *int32 `json:"submitter"` Submitter *int32 `json:"submitter,omitempty"`
System int `json:"system"` System int `json:"system,omitempty"`
Talkgroup int `json:"talkgroup"` Talkgroup int `json:"talkgroup,omitempty"`
CallDate pgtype.Timestamptz `json:"callDate"` CallDate pgtype.Timestamptz `json:"callDate,omitempty"`
AudioName *string `json:"audioName"` AudioName *string `json:"audioName,omitempty"`
AudioBlob []byte `json:"audioBlob"` AudioBlob []byte `json:"audioBlob,omitempty"`
AudioType *string `json:"audioType"` AudioType *string `json:"audioType,omitempty"`
AudioUrl *string `json:"audioUrl"` AudioUrl *string `json:"audioUrl,omitempty"`
Duration *int32 `json:"duration"` Duration *int32 `json:"duration,omitempty"`
Frequency int `json:"frequency"` Frequency int `json:"frequency,omitempty"`
Frequencies []int `json:"frequencies"` Frequencies []int `json:"frequencies,omitempty"`
Patches []int `json:"patches"` Patches []int `json:"patches,omitempty"`
TalkerAlias *string `json:"talkerAlias"` TalkerAlias *string `json:"talkerAlias,omitempty"`
TGLabel *string `json:"tgLabel"` TGLabel *string `json:"tgLabel,omitempty"`
TGAlphaTag *string `json:"tgAlphaTag"` TGAlphaTag *string `json:"tgAlphaTag,omitempty"`
TGGroup *string `json:"tgGroup"` TGGroup *string `json:"tgGroup,omitempty"`
Source int `json:"source"` Source int `json:"source,omitempty"`
} }
func (q *Queries) AddCall(ctx context.Context, arg AddCallParams) error { func (q *Queries) AddCall(ctx context.Context, arg AddCallParams) error {
@ -193,24 +193,24 @@ WHERE id = $1
` `
type GetCallRow struct { type GetCallRow struct {
ID uuid.UUID `json:"id"` ID uuid.UUID `json:"id,omitempty"`
Submitter *int32 `json:"submitter"` Submitter *int32 `json:"submitter,omitempty"`
System int `json:"system"` System int `json:"system,omitempty"`
Talkgroup int `json:"talkgroup"` Talkgroup int `json:"talkgroup,omitempty"`
CallDate pgtype.Timestamptz `json:"callDate"` CallDate pgtype.Timestamptz `json:"callDate,omitempty"`
AudioName *string `json:"audioName"` AudioName *string `json:"audioName,omitempty"`
AudioType *string `json:"audioType"` AudioType *string `json:"audioType,omitempty"`
AudioUrl *string `json:"audioUrl"` AudioUrl *string `json:"audioUrl,omitempty"`
Duration *int32 `json:"duration"` Duration *int32 `json:"duration,omitempty"`
Frequency int `json:"frequency"` Frequency int `json:"frequency,omitempty"`
Frequencies []int `json:"frequencies"` Frequencies []int `json:"frequencies,omitempty"`
Patches []int `json:"patches"` Patches []int `json:"patches,omitempty"`
TalkerAlias *string `json:"talkerAlias"` TalkerAlias *string `json:"talkerAlias,omitempty"`
TGLabel *string `json:"tgLabel"` TGLabel *string `json:"tgLabel,omitempty"`
TGAlphaTag *string `json:"tgAlphaTag"` TGAlphaTag *string `json:"tgAlphaTag,omitempty"`
TGGroup *string `json:"tgGroup"` TGGroup *string `json:"tgGroup,omitempty"`
Source int `json:"source"` Source int `json:"source,omitempty"`
Transcript *string `json:"transcript"` Transcript *string `json:"transcript,omitempty"`
} }
func (q *Queries) GetCall(ctx context.Context, id uuid.UUID) (GetCallRow, error) { func (q *Queries) GetCall(ctx context.Context, id uuid.UUID) (GetCallRow, error) {
@ -258,10 +258,10 @@ WHERE sc.id = $1
` `
type GetCallAudioByIDRow struct { type GetCallAudioByIDRow struct {
CallDate pgtype.Timestamptz `json:"callDate"` CallDate pgtype.Timestamptz `json:"callDate,omitempty"`
AudioName *string `json:"audioName"` AudioName *string `json:"audioName,omitempty"`
AudioType *string `json:"audioType"` AudioType *string `json:"audioType,omitempty"`
AudioBlob []byte `json:"audioBlob"` AudioBlob []byte `json:"audioBlob,omitempty"`
} }
func (q *Queries) GetCallAudioByID(ctx context.Context, id uuid.UUID) (GetCallAudioByIDRow, error) { func (q *Queries) GetCallAudioByID(ctx context.Context, id uuid.UUID) (GetCallAudioByIDRow, error) {
@ -323,12 +323,12 @@ CASE WHEN $4::TEXT[] IS NOT NULL THEN
` `
type ListCallsCountParams struct { type ListCallsCountParams struct {
Start pgtype.Timestamptz `json:"start"` Start pgtype.Timestamptz `json:"start,omitempty"`
End pgtype.Timestamptz `json:"end"` End pgtype.Timestamptz `json:"end,omitempty"`
TagsAny []string `json:"tagsAny"` TagsAny []string `json:"tagsAny,omitempty"`
TagsNot []string `json:"tagsNot"` TagsNot []string `json:"tagsNot,omitempty"`
TGFilter *string `json:"tgFilter"` TGFilter *string `json:"tgFilter,omitempty"`
LongerThan pgtype.Numeric `json:"longerThan"` LongerThan pgtype.Numeric `json:"longerThan,omitempty"`
} }
func (q *Queries) ListCallsCount(ctx context.Context, arg ListCallsCountParams) (int64, error) { func (q *Queries) ListCallsCount(ctx context.Context, arg ListCallsCountParams) (int64, error) {
@ -384,25 +384,25 @@ FETCH NEXT $9 ROWS ONLY
` `
type ListCallsPParams struct { type ListCallsPParams struct {
Start pgtype.Timestamptz `json:"start"` Start pgtype.Timestamptz `json:"start,omitempty"`
End pgtype.Timestamptz `json:"end"` End pgtype.Timestamptz `json:"end,omitempty"`
TagsAny []string `json:"tagsAny"` TagsAny []string `json:"tagsAny,omitempty"`
TagsNot []string `json:"tagsNot"` TagsNot []string `json:"tagsNot,omitempty"`
TGFilter *string `json:"tgFilter"` TGFilter *string `json:"tgFilter,omitempty"`
LongerThan pgtype.Numeric `json:"longerThan"` LongerThan pgtype.Numeric `json:"longerThan,omitempty"`
Direction string `json:"direction"` Direction string `json:"direction,omitempty"`
Offset int32 `json:"offset"` Offset int32 `json:"offset,omitempty"`
PerPage int32 `json:"perPage"` PerPage int32 `json:"perPage,omitempty"`
} }
type ListCallsPRow struct { type ListCallsPRow struct {
ID uuid.UUID `json:"id"` ID uuid.UUID `json:"id,omitempty"`
CallDate pgtype.Timestamptz `json:"callDate"` CallDate pgtype.Timestamptz `json:"callDate,omitempty"`
Duration *int32 `json:"duration"` Duration *int32 `json:"duration,omitempty"`
SystemID int `json:"systemId"` SystemID int `json:"systemId,omitempty"`
TGID int `json:"tgid"` TGID int `json:"tgid,omitempty"`
TalkerAlias *string `json:"talkerAlias"` TalkerAlias *string `json:"talkerAlias,omitempty"`
Incidents int64 `json:"incidents"` Incidents int64 `json:"incidents,omitempty"`
} }
func (q *Queries) ListCallsP(ctx context.Context, arg ListCallsPParams) ([]ListCallsPRow, error) { func (q *Queries) ListCallsP(ctx context.Context, arg ListCallsPParams) ([]ListCallsPRow, error) {