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
57
58
59
60
//! The receipt-claim sample: **proposed values awaiting review**, done with
//! what already exists.
//!
//! A document arrives, something reads values out of it, those values are
//! proposed but not applied, a card asks the user to confirm them, and only then
//! do they become state. It is a fair question whether the view should grow a
//! word for a value that is neither set nor unset. The answer this sample
//! argues is **no**: a proposal is domain state, and a workflow that models it
//! as such gets every property out of the vocabulary already there, while a
//! framework that grew the concept would force every projector — including the
//! ones for domains that never see a document — to reason about a state they do
//! not have.
//!
//! The five steps of the recipe, and what it costs, are in
//! [`docs/recipes.md`](https://github.com/turnframe-rs/turnframe/blob/main/docs/recipes.md).
//! Each step is proved by a test in `tests/receipt_claim.rs`.
//!
//! ```
//! use turnframe_core::case::CaseRef;
//! use turnframe_core::flow::{PhaseOwnership, WorkflowDefinition, check_view};
//! use turnframe_core::ids::CaseRevision;
//! use turnframe_test::workflows::claim::{
//! ClaimPhase, ClaimWorkflow, complete_proposal, under_review,
//! };
//!
//! let workflow = ClaimWorkflow::default();
//! let state = under_review(complete_proposal());
//! let view = workflow.project(CaseRef::new("claim", "doc-1", CaseRevision(2)), Some(&state));
//!
//! assert_eq!(view.phase, ClaimPhase::AwaitingReview);
//! assert_eq!(workflow.phase_ownership(&view.phase), PhaseOwnership::User);
//! // One obligation per proposed value, and a card to answer.
//! assert_eq!(view.obligations.len(), 3);
//! assert!(view.blocking_interaction.is_some());
//! assert!(check_view(&workflow, &view).is_ok());
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
/// An in-memory executor for the claim workflow.
pub type ClaimExecutor = crateInMemoryExecutor;