Skip to main content

headless_lms_credit_registration/use_cases/verify/
mod.rs

1//! The `verify` phase: asking the study registry what became of a submission.
2//!
3//! The only way out of `submission_uncertain`. Nothing here fails a row: the attainment may exist,
4//! and a failed row is one an admin retries, which for an uncertain submission would mean sending
5//! it twice. The one way back to `import` is Suotar itself answering `notRegistered`.
6
7mod decide;
8mod lease;
9mod poll;
10mod recovery;
11
12use crate::error::CreditRegistrationResult;
13use crate::registry::StudyRegistry;
14use crate::use_cases::batch_flow::{BatchFlowContext, run_registry_batch_flow};
15use crate::workflow::Counts;
16
17use poll::VerifyPoll;
18use recovery::UncertainRecovery;
19
20pub(crate) async fn run<R: StudyRegistry>(
21    ctx: &BatchFlowContext<'_>,
22    registry: &mut R,
23) -> CreditRegistrationResult<Counts> {
24    let mut counts = run_registry_batch_flow::<VerifyPoll, _>(ctx, registry).await?;
25    counts += run_registry_batch_flow::<UncertainRecovery, _>(ctx, registry).await?;
26    Ok(counts)
27}