feat(support): verify the manual assessment request after a C3 refusal
This commit is contained in:
1 parent
6bfd7098c3
commit
68286af8b7
20 files changed
+680
-74
No files matched your search
@@ -27,9 +27,11 @@ import (
|
||||
"lincodex/backend/internal/adapter/secondary/prometheus"
|
||||
"lincodex/backend/internal/domain"
|
||||
"lincodex/backend/internal/usecase/assessment"
|
||||
"lincodex/backend/internal/usecase/consent"
|
||||
"lincodex/backend/internal/usecase/health"
|
||||
"lincodex/backend/internal/usecase/identity"
|
||||
"lincodex/backend/internal/usecase/policy"
|
||||
questionnaireusecase "lincodex/backend/internal/usecase/questionnaire"
|
||||
"lincodex/backend/internal/usecase/supportcase"
|
||||
)
|
||||
|
||||
@@ -38,6 +40,7 @@ const supportCaseHTTPTimeout = 5 * time.Minute
|
||||
type supportCaseHTTPHarness struct {
|
||||
*sessionHTTPHarness
|
||||
supportClock *testClock
|
||||
keyring *identity.Keyring
|
||||
}
|
||||
|
||||
func TestSupportCasesOverHTTP(t *testing.T) {
|
||||
@@ -628,14 +631,21 @@ func createSupportCaseHTTPEmployer(
|
||||
}
|
||||
|
||||
type supportCaseHTTPResponse struct {
|
||||
ID string `json:"id"`
|
||||
Number string `json:"number"`
|
||||
Type string `json:"type"`
|
||||
Status string `json:"status"`
|
||||
Description string `json:"description"`
|
||||
RubricVersion *int32 `json:"rubric_version"`
|
||||
History []struct {
|
||||
Kind string `json:"kind"`
|
||||
ID string `json:"id"`
|
||||
Number string `json:"number"`
|
||||
Type string `json:"type"`
|
||||
Status string `json:"status"`
|
||||
Description string `json:"description"`
|
||||
RubricVersion *int32 `json:"rubric_version"`
|
||||
Decision *json.RawMessage `json:"decision"`
|
||||
AssessmentTarget *struct {
|
||||
Specialization string `json:"specialization"`
|
||||
Grade string `json:"grade"`
|
||||
} `json:"assessment_target"`
|
||||
History []struct {
|
||||
Kind string `json:"kind"`
|
||||
Actor string `json:"actor"`
|
||||
Status string `json:"status"`
|
||||
} `json:"history"`
|
||||
ResponseTarget struct {
|
||||
Kind string `json:"kind"`
|
||||
@@ -690,8 +700,21 @@ func newSupportCaseHTTPHarness(ctx context.Context, t *testing.T, env *testEnvir
|
||||
v1.WithSessionService(sessions), v1.WithPublicOrigin(env.Config.AppPublicURL),
|
||||
)
|
||||
supportHandler := v1.NewSupportHandler(service)
|
||||
// Consent, questionnaire, and assessment routes share the support clock and
|
||||
// policy so one test can drive a C3 revocation, a failed attempt, and a
|
||||
// manual assessment request through the real router.
|
||||
consentHandler := v1.NewConsentHandler(
|
||||
consent.NewQueryService(postgresadapter.NewConsentStore(pool), time.Now), consent.NewService(transactor, time.Now),
|
||||
)
|
||||
questionnaireHandler := v1.NewQuestionnaireHandler(questionnaireusecase.NewService(transactor, supportClock.Now))
|
||||
attemptService, err := assessment.NewAttemptService(transactor, transactor, keyring, supportClock.Now)
|
||||
if err != nil {
|
||||
t.Fatalf("NewAttemptService() error = %v", err)
|
||||
}
|
||||
handler := v1.NewHandler(healthHandler, responder,
|
||||
v1.WithIdentity(identityHandler), v1.WithSupport(supportHandler),
|
||||
v1.WithConsent(consentHandler), v1.WithQuestionnaire(questionnaireHandler),
|
||||
v1.WithAssessment(v1.NewAssessmentHandler(attemptService)),
|
||||
)
|
||||
router, err := httpadapter.NewRouter(healthHandler, handler, identityHandler.SessionSecurity(), responder,
|
||||
prometheus.New(), logger, nil)
|
||||
@@ -701,6 +724,7 @@ func newSupportCaseHTTPHarness(ctx context.Context, t *testing.T, env *testEnvir
|
||||
return &supportCaseHTTPHarness{
|
||||
sessionHTTPHarness: &sessionHTTPHarness{pool: pool, store: store, router: router, credentials: credentials, clock: clock, logs: logs},
|
||||
supportClock: supportClock,
|
||||
keyring: keyring,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user