forked from MountainTownTechnology/aural_isle
refines MODELS around cart functionality, moves all pricing into Sku model, adds CouponCode model
This commit is contained in:
parent
e93736be61
commit
cb3f76aa17
40
MODELS.md
40
MODELS.md
|
@ -185,7 +185,6 @@ struct Track {
|
||||||
is_available: bool,
|
is_available: bool,
|
||||||
preview_source: Option<String>,
|
preview_source: Option<String>,
|
||||||
source: String,
|
source: String,
|
||||||
price: Option<rusty_money::Money>,
|
|
||||||
created_by: PersonId,
|
created_by: PersonId,
|
||||||
created_at: chrono::DateTime,
|
created_at: chrono::DateTime,
|
||||||
modified_by: PersonId,
|
modified_by: PersonId,
|
||||||
|
@ -218,7 +217,6 @@ struct Album {
|
||||||
is_available: bool,
|
is_available: bool,
|
||||||
preview_source: Option<String>,
|
preview_source: Option<String>,
|
||||||
source: String,
|
source: String,
|
||||||
price: Option<rusty_money::Money>,
|
|
||||||
created_by: PersonId,
|
created_by: PersonId,
|
||||||
created_at: chrono::DateTime,
|
created_at: chrono::DateTime,
|
||||||
modified_by: PersonId,
|
modified_by: PersonId,
|
||||||
|
@ -405,7 +403,6 @@ struct Collection {
|
||||||
albums: Option<Vec<Album>>,
|
albums: Option<Vec<Album>>,
|
||||||
tracks: Option<Vec<Track>>,
|
tracks: Option<Vec<Track>>,
|
||||||
other_products: Option<Vec<OtherProduct>>,
|
other_products: Option<Vec<OtherProduct>>,
|
||||||
price: Option<rusty_money::Money>,
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -429,7 +426,7 @@ struct OtherProduct {
|
||||||
is_available: bool,
|
is_available: bool,
|
||||||
deleted_by: Option<PersonId>,
|
deleted_by: Option<PersonId>,
|
||||||
deleted_at: Option<chrono::DateTime>,
|
deleted_at: Option<chrono::DateTime>,
|
||||||
price: Option<rusty_money::Money>
|
requires_shipping: bool,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -457,8 +454,9 @@ struct Sku {
|
||||||
collection_id: Option<CollectionId>,
|
collection_id: Option<CollectionId>,
|
||||||
other_product_id: Option<OtherProductId>,
|
other_product_id: Option<OtherProductId>,
|
||||||
variant: Option<String>,
|
variant: Option<String>,
|
||||||
discount_percentage: Option<f64>,
|
description: Option<String>,
|
||||||
discount_flatrate: Option<rusty_money::Money>,
|
price: Option<rusty_money::Money>,
|
||||||
|
requires_shipping: bool,
|
||||||
}
|
}
|
||||||
struct PurchaseItem {
|
struct PurchaseItem {
|
||||||
id: PurchaseItemId,
|
id: PurchaseItemId,
|
||||||
|
@ -481,5 +479,35 @@ struct Purchase {
|
||||||
state: PurchaseState,
|
state: PurchaseState,
|
||||||
purchased_by: Person,
|
purchased_by: Person,
|
||||||
purchased_at: Option<chrono::DateTime>,
|
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>,
|
||||||
}
|
}
|
||||||
```
|
```
|
Loading…
Reference in New Issue