updates tag model, adds PersonCredential model

This commit is contained in:
cascode _ 2023-10-18 14:05:30 -04:00 committed by cascode
parent c1626d920a
commit c45a76d6a9
1 changed files with 47 additions and 5 deletions

View File

@ -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 # 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. 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 ``` rust
struct TagId {
host: String,
id: String,
}
struct Tag { struct Tag {
id: TagId, host: String,
name: 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 # Label
@ -191,6 +228,7 @@ struct Article {
modified_at: chrono::DateTime, modified_at: chrono::DateTime,
deleted_at: Option<chrono::DateTime> deleted_at: Option<chrono::DateTime>
is_public: bool, is_public: bool,
is_draft: bool,
cover: Option<String>, cover: Option<String>,
images: Option<Vec<String>>, images: Option<Vec<String>>,
tracks: Option<Vec<Track>>, tracks: Option<Vec<Track>>,
@ -210,6 +248,7 @@ enum CommentTargetType {
Album, Album,
Track, Track,
Playlist, Playlist,
Article,
Comment, Comment,
} }
struct CommentTargetId { struct CommentTargetId {
@ -218,6 +257,7 @@ struct CommentTargetId {
album_id: Option<AlbumId>, album_id: Option<AlbumId>,
track_id: Option<TrackId>, track_id: Option<TrackId>,
playlist_id: Option<PlaylistId>, playlist_id: Option<PlaylistId>,
article_id: Option<ArticleId>,
comment_id: Option<CommentId>, comment_id: Option<CommentId>,
} }
struct CommentId { struct CommentId {
@ -233,6 +273,8 @@ struct Comment {
modified_at: chrono::DateTime, modified_at: chrono::DateTime,
deleted_at: Option<chrono::DateTime> deleted_at: Option<chrono::DateTime>
is_public: bool, is_public: bool,
is_approved: bool,
in_reply_to: Option<CommentId>,
} }
``` ```