more updates to MODELS

This commit is contained in:
cascode _ 2023-10-19 16:17:48 -04:00 committed by cascode
parent 459f9e8f87
commit 3f3a42f10b
1 changed files with 45 additions and 6 deletions

View File

@ -354,6 +354,34 @@ struct Image {
} }
``` ```
# Video
A Video represents a video file that a Person wants to reference from a Label, an Artist, an Album, a Track, a Playlist, or an Article.
``` rust
struct VideoId {
id: String,
}
struct Video {
id: VideoId,
name: Option<String>,
path: String,
url: String,
width: usize,
height: usize,
duration: chrono::Duration,
alt_text: String,
is_public: bool,
allow_hotlinking: bool,
created_by: PersonId,
created_at: chrono::DateTime,
modified_by: PersonId,
modified_at: chrono::DateTime,
deleted_by: Option<PersonId>,
deleted_at: Option<chrono::DateTime>,
}
```
# Collection # Collection
A Collection represents one or more Albums and/or Tracks that are offered together as a package for Purchase A Collection represents one or more Albums and/or Tracks that are offered together as a package for Purchase
@ -366,17 +394,18 @@ struct Collection {
id: CollectionId, id: CollectionId,
name: String, name: String,
description: String, description: String,
created_by: Person, created_by: PersonId,
created_at: chrono::DateTime, created_at: chrono::DateTime,
modified_by: Person, modified_by: Person,
modified_at: chrono::DateTime, modified_at: chrono::DateTime,
is_public: bool, is_public: bool,
is_available: bool, is_available: bool,
deleted_by: Option<Person>, deleted_by: Option<PersonId>,
deleted_at: Option<chrono::DateTime>, deleted_at: Option<chrono::DateTime>,
albums: Option<Vec<Album>>, albums: Option<Vec<Album>>,
tracks: Option<Vec<Track>>, tracks: Option<Vec<Track>>,
price: Oprion<rusty_money::Money>, other_products: Option<Vec<OtherProduct>>,
price: Option<rusty_money::Money>,
} }
``` ```
@ -392,7 +421,15 @@ struct OtherProduct {
id: OtherProductId, id: OtherProductId,
name: String, name: String,
description: String, description: String,
created_by: PersonId,
created_at: chrono::DateTime,
modified_by: PersonId,
modified_at: chrono::DateTime,
is_public: bool,
is_available: bool,
deleted_by: Option<PersonId>,
deleted_at: Option<chrono::DateTime>,
price: Option<rusty_money::Money>
} }
``` ```
@ -419,13 +456,15 @@ struct Sku {
track_id: Option<TrackId>, track_id: Option<TrackId>,
collection_id: Option<CollectionId>, collection_id: Option<CollectionId>,
other_product_id: Option<OtherProductId>, other_product_id: Option<OtherProductId>,
variant: Option<String>,
discount_percentage: Option<f64>,
discount_flatrate: Option<rusty_money::Money>,
} }
struct PurchaseItem { struct PurchaseItem {
id: PurchaseItemId, id: PurchaseItemId,
type: PurchaseItemType, type: PurchaseItemType,
sku: SkuId, sku: Option<SkuId>,
quantity: usize, quantity: usize,
discount_percentage: usize,
} }
enum PurchaseState { enum PurchaseState {
InCart, InCart,