From 520730c5d2596708fed54d82582cfcc3b994cb73 Mon Sep 17 00:00:00 2001 From: Sundog Date: Wed, 18 Oct 2023 14:05:30 -0400 Subject: [PATCH] updates tag model, adds PersonCredential model --- MODELS.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/MODELS.md b/MODELS.md index d056bad..6d871e1 100644 --- a/MODELS.md +++ b/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 is_public: bool, + is_draft: bool, cover: Option, images: Option>, tracks: Option>, @@ -210,6 +248,7 @@ enum CommentTargetType { Album, Track, Playlist, + Article, Comment, } struct CommentTargetId { @@ -218,6 +257,7 @@ struct CommentTargetId { album_id: Option, track_id: Option, playlist_id: Option, + article_id: Option, comment_id: Option, } struct CommentId { @@ -233,6 +273,8 @@ struct Comment { modified_at: chrono::DateTime, deleted_at: Option is_public: bool, + is_approved: bool, + in_reply_to: Option, } ```