merge: P4b S5, sent tracking (branch S5, ad649be3)
The second of the paused branches. invoice.sent, Ledger::mark_sent (with its Lean step), books.mark_sent in its own group, the two attention items, schema 17. Conflicts, resolved as plan 8.0.2 says: the shared over-the-wire test file crates/ledger-cli/tests/documents.rs (S4.4's file kept whole, S5's test appended, its create call given the confirmed: true the S4.4 contract now needs), types.rs (both appends kept), docs/parity.md (the review's oracle row and S5's new row). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
commit
3a3f03d884
44 files changed
+1847
-30
No files matched your search
@@ -789,6 +789,36 @@ pub enum SentVia {
|
||||
Other(String),
|
||||
}
|
||||
|
||||
impl SentVia {
|
||||
/// Its key as the journal, the tools and the viewer name it: `email`,
|
||||
/// `mail`, `portal`, `hand`, or `other:NAME` for another channel,
|
||||
/// named (plan P4b S5).
|
||||
pub fn key(&self) -> String {
|
||||
match self {
|
||||
SentVia::Email => "email".to_string(),
|
||||
SentVia::Mail => "mail".to_string(),
|
||||
SentVia::Portal => "portal".to_string(),
|
||||
SentVia::Hand => "hand".to_string(),
|
||||
SentVia::Other(name) => format!("other:{name}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// [`Self::key`] the other way; `None` for a channel this version
|
||||
/// doesn't know (a newer version's `sent_via`).
|
||||
pub fn parse(key: &str) -> Option<SentVia> {
|
||||
match key {
|
||||
"email" => Some(SentVia::Email),
|
||||
"mail" => Some(SentVia::Mail),
|
||||
"portal" => Some(SentVia::Portal),
|
||||
"hand" => Some(SentVia::Hand),
|
||||
other => other
|
||||
.strip_prefix("other:")
|
||||
.filter(|name| !name.trim().is_empty())
|
||||
.map(|name| SentVia::Other(name.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether a send was the original or a reminder (plan P4b S5).
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
@@ -799,6 +829,26 @@ pub enum SendKind {
|
||||
Reminder,
|
||||
}
|
||||
|
||||
impl SendKind {
|
||||
/// Its key as the journal, the tools and the viewer name it.
|
||||
pub fn key(self) -> &'static str {
|
||||
match self {
|
||||
SendKind::Original => "original",
|
||||
SendKind::Reminder => "reminder",
|
||||
}
|
||||
}
|
||||
|
||||
/// [`Self::key`] the other way; `None` for a kind this version
|
||||
/// doesn't know.
|
||||
pub fn parse(key: &str) -> Option<SendKind> {
|
||||
match key {
|
||||
"original" => Some(SendKind::Original),
|
||||
"reminder" => Some(SendKind::Reminder),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// One recorded send of an invoice (plan P4b S5): who sent it, how, to
|
||||
/// whom, and the channel's own reference. A send changes no figure.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
|
||||
Reference in new issue
Block a user