chore: checkpoint assessment and inbox integration
This commit is contained in:
1 parent
88a31ba0d5
commit
5c52fd8b91
31 files changed
+4608
-181
No files matched your search
@@ -26,6 +26,9 @@ var (
|
||||
// ErrAssessmentAttemptResultNotFound reports a completed attempt with no
|
||||
// persisted immutable decision snapshot.
|
||||
ErrAssessmentAttemptResultNotFound = errors.New("assessment attempt result not found")
|
||||
// ErrAssessmentCategoryConflict reports a current category that could not
|
||||
// be advanced under its owner and specialization lock.
|
||||
ErrAssessmentCategoryConflict = errors.New("assessment category changed concurrently")
|
||||
)
|
||||
|
||||
// AssessmentAttemptIdempotencyScope is the server HMAC of the operation,
|
||||
@@ -108,6 +111,26 @@ type AssessmentRootQuotaSnapshot struct {
|
||||
AvailableAt *time.Time
|
||||
}
|
||||
|
||||
// AssessmentAttemptResultCursor is the keyset boundary for owner history.
|
||||
// It is internal to the repository; the usecase wraps it in an owner-bound
|
||||
// authenticated token before accepting it from HTTP.
|
||||
type AssessmentAttemptResultCursor struct {
|
||||
DecidedAt time.Time
|
||||
AttemptID domain.AssessmentAttemptID
|
||||
}
|
||||
|
||||
// AssessmentAttemptResultRecord contains one immutable result and the owner
|
||||
// returned by the scoped query. The usecase rechecks ownership and eligibility.
|
||||
type AssessmentAttemptResultRecord struct {
|
||||
UserID uuid.UUID
|
||||
Entry domain.AssessmentAttemptResultHistoryEntry
|
||||
}
|
||||
|
||||
type AssessmentAttemptResultPage struct {
|
||||
Records []AssessmentAttemptResultRecord
|
||||
HasMore bool
|
||||
}
|
||||
|
||||
// AssessmentAttemptRepositories exposes the repository bound to a UnitOfWork
|
||||
// transaction.
|
||||
type AssessmentAttemptRepositories interface {
|
||||
@@ -223,6 +246,52 @@ type AssessmentAttemptRepository interface {
|
||||
// GetResult returns the immutable owner-scoped result snapshot.
|
||||
GetResult(ctx context.Context, userID uuid.UUID, attemptID domain.AssessmentAttemptID) (domain.AssessmentAttemptResultSnapshot, error)
|
||||
|
||||
// SaveResultHistoryEntry stores a typed v1 or v2 immutable result. V1 keeps
|
||||
// the original result document; v2 carries category decision columns.
|
||||
SaveResultHistoryEntry(ctx context.Context, userID uuid.UUID, entry domain.AssessmentAttemptResultHistoryEntry) error
|
||||
|
||||
// GetResultHistoryEntry returns the exact stored v1/v2 record without
|
||||
// reconstructing category information from current state.
|
||||
GetResultHistoryEntry(ctx context.Context, userID uuid.UUID, attemptID domain.AssessmentAttemptID) (domain.AssessmentAttemptResultHistoryEntry, error)
|
||||
|
||||
// ListCandidateAssessmentResults returns an owner-scoped keyset page and at
|
||||
// most limit entries. HasMore indicates that the repository found one more.
|
||||
ListCandidateAssessmentResults(
|
||||
ctx context.Context,
|
||||
userID uuid.UUID,
|
||||
cursor *AssessmentAttemptResultCursor,
|
||||
limit int32,
|
||||
) (AssessmentAttemptResultPage, error)
|
||||
|
||||
// LockCandidateCategory serializes one candidate/specialization upgrade.
|
||||
// Call only after consent, candidate/specialization, and attempt locks.
|
||||
LockCandidateCategory(ctx context.Context, candidateID uuid.UUID, specialization domain.SpecializationCode) error
|
||||
|
||||
GetCandidateCategory(
|
||||
ctx context.Context,
|
||||
candidateID uuid.UUID,
|
||||
specialization domain.SpecializationCode,
|
||||
) (domain.CandidateAssessmentCategory, bool, error)
|
||||
|
||||
// GetSyntheticCategoryReview requires the complete immutable opening and
|
||||
// product-policy pins; gradingPolicyID must match the opening's policy.
|
||||
GetSyntheticCategoryReview(
|
||||
ctx context.Context,
|
||||
openingID uuid.UUID,
|
||||
category domain.AssessmentCategory,
|
||||
openingManifestHash [32]byte,
|
||||
productPolicyID domain.PolicyVersionID,
|
||||
productPolicyVersion int32,
|
||||
gradingPolicyID domain.PolicyVersionID,
|
||||
) (domain.AssessmentSyntheticCategoryReview, bool, error)
|
||||
|
||||
// CreateSyntheticCategoryReview stores an operator-attributed immutable
|
||||
// attestation after the domain has validated its explicit synthetic source.
|
||||
CreateSyntheticCategoryReview(ctx context.Context, review domain.AssessmentSyntheticCategoryReview) error
|
||||
|
||||
// SaveCandidateAssessmentCategory writes only an assigned category upgrade.
|
||||
SaveCandidateAssessmentCategory(ctx context.Context, category domain.CandidateAssessmentCategory) error
|
||||
|
||||
// SaveSessionOutcome records the original 200 public projection for the
|
||||
// already-reserved idempotency scope. It shares the transaction and expiry
|
||||
// of the generic idempotency record.
|
||||
|
||||
Reference in new issue
Block a user