1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! The traveler sample: the flat onboarding slice.
//!
//! Where the trip proves the awkward case, the traveler proves the ordinary one: three
//! fields, no parameterized obligation, every value given in text, and a card that confirms
//! the activation once every field is settled. [`TravelerWorkflow::with_cards`] also puts a
//! card in front of deletion and a new contact address, for testing cards.
//!
//! A collected field has three states: never asked, answered, and declined. [`FieldState`]
//! makes the third real, the projection closes the obligation and keeps the reason in a
//! notice code, and [`DeclineReason::worth_asking_again`] says which refusals can change.
//! The recipe is in
//! [`docs/recipes.md`](https://github.com/turnframe-rs/turnframe/blob/main/docs/recipes.md),
//! and `tests/three_valued_field.rs` proves it.
//!
//! ```
//! use turnframe_core::case::CaseRef;
//! use turnframe_core::flow::{PhaseOwnership, WorkflowDefinition};
//! use turnframe_core::ids::CaseRevision;
//! use turnframe_test::workflows::traveler::{TravelerPhase, TravelerWorkflow, awaiting_activation};
//!
//! let workflow = TravelerWorkflow::new();
//! let view = workflow.project(
//! CaseRef::new("traveler", "c-1", CaseRevision(3)),
//! Some(&awaiting_activation()),
//! );
//!
//! assert_eq!(view.phase, TravelerPhase::AwaitingActivation);
//! assert_eq!(workflow.phase_ownership(&view.phase), PhaseOwnership::User);
//! assert!(view.blocking_interaction.is_some());
//! ```
//!
pub use ;
pub use ;
pub use ;
pub use ;
/// An in-memory executor for the traveler workflow.
pub type TravelerExecutor = crateInMemoryExecutor;