more updates to MODELS
This commit is contained in:
parent
459f9e8f87
commit
3f3a42f10b
51
MODELS.md
51
MODELS.md
|
@ -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
|
||||
|
||||
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,
|
||||
name: String,
|
||||
description: String,
|
||||
created_by: Person,
|
||||
created_by: PersonId,
|
||||
created_at: chrono::DateTime,
|
||||
modified_by: Person,
|
||||
modified_at: chrono::DateTime,
|
||||
is_public: bool,
|
||||
is_available: bool,
|
||||
deleted_by: Option<Person>,
|
||||
deleted_by: Option<PersonId>,
|
||||
deleted_at: Option<chrono::DateTime>,
|
||||
albums: Option<Vec<Album>>,
|
||||
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,
|
||||
name: 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>,
|
||||
collection_id: Option<CollectionId>,
|
||||
other_product_id: Option<OtherProductId>,
|
||||
variant: Option<String>,
|
||||
discount_percentage: Option<f64>,
|
||||
discount_flatrate: Option<rusty_money::Money>,
|
||||
}
|
||||
struct PurchaseItem {
|
||||
id: PurchaseItemId,
|
||||
type: PurchaseItemType,
|
||||
sku: SkuId,
|
||||
sku: Option<SkuId>,
|
||||
quantity: usize,
|
||||
discount_percentage: usize,
|
||||
}
|
||||
enum PurchaseState {
|
||||
InCart,
|
||||
|
|
Loading…
Reference in New Issue