more model refinement
This commit is contained in:
parent
cb3f76aa17
commit
abe545397b
44
MODELS.md
44
MODELS.md
|
@ -287,23 +287,14 @@ struct Article {
|
|||
A Comment represents a textual comment that a Person wants to attach contextually to an Artist, an Album, a Track, or a Playlist.
|
||||
|
||||
``` rust
|
||||
enum CommentTargetType {
|
||||
Label,
|
||||
Artist,
|
||||
Album,
|
||||
Track,
|
||||
Playlist,
|
||||
Article,
|
||||
Comment,
|
||||
}
|
||||
struct CommentTargetId {
|
||||
label_id: Option<LabelId>,
|
||||
artist_id: Option<ArtistId>,
|
||||
album_id: Option<AlbumId>,
|
||||
track_id: Option<TrackId>,
|
||||
playlist_id: Option<PlaylistId>,
|
||||
article_id: Option<ArticleId>,
|
||||
comment_id: Option<CommentId>,
|
||||
enum CommentTarget {
|
||||
Label(LabelId),
|
||||
Artist(ArtistId),
|
||||
Album(AlbumId),
|
||||
Track(TrackId),
|
||||
Playlist(PlaylistId),
|
||||
Article(ArticleId),
|
||||
Comment(CommentId),
|
||||
}
|
||||
struct CommentId {
|
||||
id: String,
|
||||
|
@ -311,8 +302,7 @@ struct CommentId {
|
|||
struct Comment {
|
||||
id: CommentId,
|
||||
body: String,
|
||||
target_type: CommentTargetType,
|
||||
target_id: CommentTargetId,
|
||||
target: CommentTarget,
|
||||
created_by: PersonId,
|
||||
created_at: chrono::DateTime,
|
||||
modified_by: Option<PersonId>,
|
||||
|
@ -436,10 +426,10 @@ A Purchase represents one or more Tracks or Albums that a Person purchases from
|
|||
|
||||
``` rust
|
||||
enum PurchaseItemType {
|
||||
Album,
|
||||
Track,
|
||||
Collection,
|
||||
OtherProduct,
|
||||
Album(AlbumId),
|
||||
Track(TrackId),
|
||||
Collection(CollectionId),
|
||||
OtherProduct(OtherProductId),
|
||||
}
|
||||
struct PurchaseItemId {
|
||||
id: String,
|
||||
|
@ -449,10 +439,7 @@ struct SkuId {
|
|||
}
|
||||
struct Sku {
|
||||
id: SkuId,
|
||||
album_id: Option<AlbumId>,
|
||||
track_id: Option<TrackId>,
|
||||
collection_id: Option<CollectionId>,
|
||||
other_product_id: Option<OtherProductId>,
|
||||
item: PurchaseItemType,
|
||||
variant: Option<String>,
|
||||
description: Option<String>,
|
||||
price: Option<rusty_money::Money>,
|
||||
|
@ -460,8 +447,7 @@ struct Sku {
|
|||
}
|
||||
struct PurchaseItem {
|
||||
id: PurchaseItemId,
|
||||
type: PurchaseItemType,
|
||||
sku: Option<SkuId>,
|
||||
sku: SkuId,
|
||||
quantity: usize,
|
||||
}
|
||||
enum PurchaseState {
|
||||
|
|
Loading…
Reference in New Issue