updates tag model, adds PersonCredential model
This commit is contained in:
parent
c1626d920a
commit
c45a76d6a9
52
MODELS.md
52
MODELS.md
|
@ -32,19 +32,56 @@ struct Person {
|
|||
}
|
||||
```
|
||||
|
||||
# PersonCredential
|
||||
|
||||
A PersonCredential is an authentication method associated with a specific Person.
|
||||
|
||||
``` rust
|
||||
struct PersonCredentialId {
|
||||
id: String,
|
||||
}
|
||||
enum PersonCredentialProviderType {
|
||||
OAuth2,
|
||||
Local,
|
||||
}
|
||||
struct PersonCredentialProviderId {
|
||||
id: String,
|
||||
}
|
||||
enum PersonCredentialProvider {
|
||||
id: PersonCredentialProviderId,
|
||||
name: String,
|
||||
config: String,
|
||||
}
|
||||
struct PersonCredential {
|
||||
id: PersonCredentialId,
|
||||
person_id: PersonId,
|
||||
provider_id: PersonCredentialProviderId,
|
||||
provider_user_id: String,
|
||||
is_enabled: bool,
|
||||
}
|
||||
```
|
||||
|
||||
# Tag
|
||||
|
||||
A Tag is a classification label that a Person wants to associate to a Label, an Artist, an Album, a Track, or a Playlist, used as a way of grouping entities together via some commonality the context of which is not programmatically relevant.
|
||||
|
||||
``` rust
|
||||
struct TagId {
|
||||
host: String,
|
||||
id: String,
|
||||
}
|
||||
struct Tag {
|
||||
id: TagId,
|
||||
host: String,
|
||||
name: String,
|
||||
}
|
||||
impl Tag {
|
||||
pub fn new(host: String, name: String) -> Self {
|
||||
TagId {
|
||||
host,
|
||||
name,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_string(&self) -> String {
|
||||
format!("Tag({}::tag::{})", &self.host, &self.name)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# Label
|
||||
|
@ -191,6 +228,7 @@ struct Article {
|
|||
modified_at: chrono::DateTime,
|
||||
deleted_at: Option<chrono::DateTime>
|
||||
is_public: bool,
|
||||
is_draft: bool,
|
||||
cover: Option<String>,
|
||||
images: Option<Vec<String>>,
|
||||
tracks: Option<Vec<Track>>,
|
||||
|
@ -210,6 +248,7 @@ enum CommentTargetType {
|
|||
Album,
|
||||
Track,
|
||||
Playlist,
|
||||
Article,
|
||||
Comment,
|
||||
}
|
||||
struct CommentTargetId {
|
||||
|
@ -218,6 +257,7 @@ struct CommentTargetId {
|
|||
album_id: Option<AlbumId>,
|
||||
track_id: Option<TrackId>,
|
||||
playlist_id: Option<PlaylistId>,
|
||||
article_id: Option<ArticleId>,
|
||||
comment_id: Option<CommentId>,
|
||||
}
|
||||
struct CommentId {
|
||||
|
@ -233,6 +273,8 @@ struct Comment {
|
|||
modified_at: chrono::DateTime,
|
||||
deleted_at: Option<chrono::DateTime>
|
||||
is_public: bool,
|
||||
is_approved: bool,
|
||||
in_reply_to: Option<CommentId>,
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue