ddex_core/models/common/
identifier.rs

1// core/src/models/common/identifier.rs
2//! Identifier types for DDEX
3
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
7#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
8#[cfg_attr(feature = "typescript", ts(export))]
9pub struct Identifier {
10    pub id_type: IdentifierType,
11    pub namespace: Option<String>,
12    pub value: String,
13}
14
15#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
16#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
17#[cfg_attr(feature = "typescript", ts(export))]
18pub enum IdentifierType {
19    Proprietary,
20    ISRC,
21    ISWC,
22    UPC,
23    EAN,
24    GRID,
25    GRid,
26    ISNI,
27    IPI,
28}