30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
package outbound
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// ErrAssessmentSignalNoticeNotAcknowledged reports that the account has no
|
|
// acknowledgement for the requested notice version.
|
|
var ErrAssessmentSignalNoticeNotAcknowledged = errors.New("assessment signal notice is not acknowledged")
|
|
|
|
type AssessmentSignalNoticeRepositories interface {
|
|
AssessmentSignalNotices() AssessmentSignalNoticeRepository
|
|
}
|
|
|
|
// AssessmentSignalNoticeRepository stores the record that a candidate was shown
|
|
// the notice about collected assessment signals. The record is not a consent
|
|
// and no storage rule reads it.
|
|
type AssessmentSignalNoticeRepository interface {
|
|
// Get returns the time of the first acknowledgement of the version, or
|
|
// ErrAssessmentSignalNoticeNotAcknowledged.
|
|
Get(ctx context.Context, userID uuid.UUID, version int32) (time.Time, error)
|
|
// Acknowledge stores the acknowledgement when none exists for the version
|
|
// and keeps the earlier time otherwise. It returns the stored time.
|
|
Acknowledge(ctx context.Context, userID uuid.UUID, version int32, at time.Time) (time.Time, error)
|
|
}
|