1use derive_more::Display;
2use serde::{Deserialize, Serialize};
3
4macro_rules! define_ids {
6 ($($def:tt),* $(,)?) => {
7 $(define_ids!(@single $def);)*
8 };
9
10 (@single ($name:ident, $type:ty)) => {
11 #[derive(Debug, Display, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
12 #[repr(transparent)]
13 pub struct $name(pub $type);
14 };
15 (@single ($name:ident, $type:ty, noncopy)) => {
16 #[derive(Debug, Display, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
17 #[repr(transparent)]
18 pub struct $name(pub $type);
19 };
20}
21
22define_ids!(
23 (CorrespondentId, u32),
24 (CustomFieldId, u32),
25 (DocumentId, u32),
26 (DocumentTypeId, u32),
27 (NoteId, u32),
28 (SelectableOptionId, String, noncopy),
29 (ShareLinkId, u32),
30 (StoragePathId, u32),
31 (TagId, u32),
32 (TaskId, String, noncopy),
33 (UserId, u32),
34 (WorkflowActionId, u32),
35 (WorkflowId, u32),
36 (WorkflowTriggerId, u32),
37 (WebhookActionId, u32),
38);