Compare commits

..

4 Commits

Author SHA1 Message Date
cascode ab9aed00ab add rustfmt
checks / format (push) Failing after 3s Details
checks / format (pull_request) Failing after 2s Details
2023-10-21 01:34:57 -07:00
cascode e410731e99 Revert "test"
checks / format (push) Failing after 2s Details
checks / format (pull_request) Failing after 3s Details
This reverts commit 81158ca818.
2023-10-21 01:28:34 -07:00
cascode 81158ca818 test
checks / format (push) Failing after 2s Details
checks / format (pull_request) Failing after 3s Details
2023-10-21 01:26:51 -07:00
cascode 4be42a6cbe add automated format check
checks / format (push) Failing after 19s Details
checks / format (pull_request) Failing after 3s Details
2023-10-21 01:15:35 -07:00
1 changed files with 35 additions and 49 deletions

View File

@ -185,6 +185,7 @@ struct Track {
is_available: bool,
preview_source: Option<String>,
source: String,
price: Option<rusty_money::Money>,
created_by: PersonId,
created_at: chrono::DateTime,
modified_by: PersonId,
@ -217,6 +218,7 @@ struct Album {
is_available: bool,
preview_source: Option<String>,
source: String,
price: Option<rusty_money::Money>,
created_by: PersonId,
created_at: chrono::DateTime,
modified_by: PersonId,
@ -287,14 +289,23 @@ 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 CommentTarget {
Label(LabelId),
Artist(ArtistId),
Album(AlbumId),
Track(TrackId),
Playlist(PlaylistId),
Article(ArticleId),
Comment(CommentId),
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>,
}
struct CommentId {
id: String,
@ -302,7 +313,8 @@ struct CommentId {
struct Comment {
id: CommentId,
body: String,
target: CommentTarget,
target_type: CommentTargetType,
target_id: CommentTargetId,
created_by: PersonId,
created_at: chrono::DateTime,
modified_by: Option<PersonId>,
@ -393,6 +405,7 @@ struct Collection {
albums: Option<Vec<Album>>,
tracks: Option<Vec<Track>>,
other_products: Option<Vec<OtherProduct>>,
price: Option<rusty_money::Money>,
}
```
@ -416,7 +429,7 @@ struct OtherProduct {
is_available: bool,
deleted_by: Option<PersonId>,
deleted_at: Option<chrono::DateTime>,
requires_shipping: bool,
price: Option<rusty_money::Money>
}
```
@ -426,10 +439,10 @@ A Purchase represents one or more Tracks or Albums that a Person purchases from
``` rust
enum PurchaseItemType {
Album(AlbumId),
Track(TrackId),
Collection(CollectionId),
OtherProduct(OtherProductId),
Album,
Track,
Collection,
OtherProduct,
}
struct PurchaseItemId {
id: String,
@ -439,15 +452,18 @@ struct SkuId {
}
struct Sku {
id: SkuId,
item: PurchaseItemType,
album_id: Option<AlbumId>,
track_id: Option<TrackId>,
collection_id: Option<CollectionId>,
other_product_id: Option<OtherProductId>,
variant: Option<String>,
description: Option<String>,
price: Option<rusty_money::Money>,
requires_shipping: bool,
discount_percentage: Option<f64>,
discount_flatrate: Option<rusty_money::Money>,
}
struct PurchaseItem {
id: PurchaseItemId,
sku: SkuId,
type: PurchaseItemType,
sku: Option<SkuId>,
quantity: usize,
}
enum PurchaseState {
@ -465,35 +481,5 @@ struct Purchase {
state: PurchaseState,
purchased_by: Person,
purchased_at: Option<chrono::DateTime>,
fulfilled_by: Option<Person>,
fulfilled_at: Option<chrono::DateTime>,
}
```
# CouponCode
A CouponCode represents a code a Person can enter to receive a discount on a PurchateItem or on a Purchase.
``` rust
struct CouponCodeId {
id: String,
}
struct CouponCode {
id: CouponCodeId,
name: String,
code: String,
uses: usize,
max_uses: usize,
expiration: Option<chrono::DateTime>,
discount_flat: Option<rusty_money::Money>,
discount_percentage: Option<f32>,
skus: Option<Vec<SkuId>>,
is_active: bool,
created_by: PersonId,
created_at: chrono::DateTime,
modified_by: PersonId,
modified_at: chrono::DateTime,
deleted_by: Option<PersonId>,
deleted_at: Option<chrono::DateTime>,
}
```