1use colored::*;
4use derive_more::Display;
5use lib_efo::epoch::EpochId;
6
7#[derive(Display, Clone, Debug)]
8#[allow(missing_docs, clippy::missing_docs_in_private_items)]
9pub enum SuccessMessages {
10 #[display("Switched to epoch {_0}")]
11 EpochSwitchSuccess(lib_efo::epoch::EpochId),
12
13 #[display("All future events deleted - back to epoch {_0}")]
14 DeletedAllFutureEvents(lib_efo::epoch::EpochId),
15
16 #[display("The folder was initialized as an epoch folder")]
17 FolderInitializedSuccessfully(&'static str),
18
19 #[display("Changed the summary of epoch {_0} with: '{_1}'")]
20 ChangedSummary(EpochId, String),
21
22 #[display("Successfully computed the new epoch. The current epoch is now {_1} (was {_0})")]
23 EpochNextSuccess(EpochId, EpochId),
24
25 #[display("Successfully deleted the entity {_0} ({_1} [{_2}])")]
26 DeletedEntity(String, String, String),
27
28 #[display("Successfully created the entity {_0} ({_1} [{_2}])")]
29 CreatedEntity(String, String, String),
30
31 #[display("Successfully edited the entity {_0} ({_1} [{_2}])")]
32 EditedEntity(String, String, String),
33 #[display("Showing delta between Epoch ({_0} & {_1})")]
34 DiffBetweenEpoch(lib_efo::epoch::EpochId, lib_efo::epoch::EpochId),
35}
36
37pub fn display_success(message: &SuccessMessages) {
39 println!("{}", message.to_string().cyan())
40}