konduto/types/events/ticket_section.rs
1use crate::impl_nutype_error_conversion;
2use nutype::nutype;
3
4/// Seção/setor do ingresso (máximo 100 caracteres)
5///
6/// # Validações
7/// - Não pode ser vazio (após trim)
8/// - Máximo 100 caracteres
9#[nutype(
10 sanitize(trim),
11 validate(not_empty, len_char_max = 100),
12 derive(
13 Debug,
14 Clone,
15 PartialEq,
16 Eq,
17 Display,
18 AsRef,
19 Deref,
20 Serialize,
21 Deserialize,
22 )
23)]
24pub struct TicketSection(String);
25
26impl TicketSection {
27 pub fn as_str(&self) -> &str {
28 self.as_ref()
29 }
30}
31
32impl_nutype_error_conversion!(TicketSectionError);
33