workyard_application/contracts/
participant.rs1use serde::Serialize;
2use trine::NativePath;
3use workyard_core::Participant;
4
5#[derive(Serialize)]
7pub struct ParticipantOutcome {
8 pub name: String,
10 pub path: NativePath,
12 pub phase: String,
14}
15
16impl From<Participant> for ParticipantOutcome {
17 fn from(participant: Participant) -> Self {
18 Self {
19 name: participant.name,
20 path: NativePath::new(participant.destination).expect("validated filesystem path"),
21 phase: participant.phase.as_str().into(),
22 }
23 }
24}
25
26#[derive(Serialize)]
27pub struct ParticipantChange {
28 pub participant: String,
29 pub kind: &'static str,
30}
31
32impl From<workyard_core::AmendmentChange> for ParticipantChange {
33 fn from(change: workyard_core::AmendmentChange) -> Self {
34 Self {
35 participant: change.participant,
36 kind: change.kind.as_str(),
37 }
38 }
39}