feat(assessment): add the review band of attempt signals and the disclosed collector
This commit is contained in:
1 parent
68286af8b7
commit
b3c6dc870b
124 files changed
+13522
-633
No files matched your search
@@ -0,0 +1,53 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.31.1
|
||||
// source: assessment_signal_notice.sql
|
||||
|
||||
package sqlc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
const getAssessmentSignalNoticeAcknowledgement = `-- name: GetAssessmentSignalNoticeAcknowledgement :one
|
||||
SELECT acknowledged_at
|
||||
FROM assessment_signal_notice_acknowledgements
|
||||
WHERE
|
||||
user_id = $1
|
||||
AND notice_version = $2
|
||||
`
|
||||
|
||||
type GetAssessmentSignalNoticeAcknowledgementParams struct {
|
||||
UserID pgtype.UUID
|
||||
NoticeVersion int32
|
||||
}
|
||||
|
||||
// The caller has already checked that the user is a candidate. A missing row
|
||||
// means the notice version was not acknowledged.
|
||||
func (q *Queries) GetAssessmentSignalNoticeAcknowledgement(ctx context.Context, arg GetAssessmentSignalNoticeAcknowledgementParams) (pgtype.Timestamptz, error) {
|
||||
row := q.db.QueryRow(ctx, getAssessmentSignalNoticeAcknowledgement, arg.UserID, arg.NoticeVersion)
|
||||
var acknowledged_at pgtype.Timestamptz
|
||||
err := row.Scan(&acknowledged_at)
|
||||
return acknowledged_at, err
|
||||
}
|
||||
|
||||
const insertAssessmentSignalNoticeAcknowledgement = `-- name: InsertAssessmentSignalNoticeAcknowledgement :exec
|
||||
INSERT INTO assessment_signal_notice_acknowledgements (user_id, notice_version, acknowledged_at)
|
||||
VALUES ($1, $2, $3)
|
||||
ON CONFLICT (user_id, notice_version) DO NOTHING
|
||||
`
|
||||
|
||||
type InsertAssessmentSignalNoticeAcknowledgementParams struct {
|
||||
UserID pgtype.UUID
|
||||
NoticeVersion int32
|
||||
AcknowledgedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
// The first acknowledgement wins; a repeat keeps the stored time and inserts
|
||||
// nothing. The caller reads the stored row afterwards in the same transaction.
|
||||
func (q *Queries) InsertAssessmentSignalNoticeAcknowledgement(ctx context.Context, arg InsertAssessmentSignalNoticeAcknowledgementParams) error {
|
||||
_, err := q.db.Exec(ctx, insertAssessmentSignalNoticeAcknowledgement, arg.UserID, arg.NoticeVersion, arg.AcknowledgedAt)
|
||||
return err
|
||||
}
|
||||
Reference in new issue
Block a user