Removing Dummy

This commit is contained in:
eraden 2022-11-16 22:32:17 +01:00
parent 59034ea1e0
commit 2b2cdd1916
3 changed files with 0 additions and 190 deletions

View File

@ -102,7 +102,6 @@ impl From<crate::AccountAddress> for AccountAddress {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
#[serde(transparent)] #[serde(transparent)]
pub struct Orders(pub Vec<Order>); pub struct Orders(pub Vec<Order>);
@ -163,7 +162,6 @@ impl From<(crate::Order, Vec<crate::OrderItem>)> for Order {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Order { pub struct Order {
pub id: crate::OrderId, pub id: crate::OrderId,
@ -174,7 +172,6 @@ pub struct Order {
pub address_id: OrderAddressId, pub address_id: OrderAddressId,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ShoppingCartItem { pub struct ShoppingCartItem {
pub id: ShoppingCartItemId, pub id: ShoppingCartItemId,
@ -204,7 +201,6 @@ impl From<crate::ShoppingCartItem> for ShoppingCartItem {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ShoppingCart { pub struct ShoppingCart {
pub id: ShoppingCartId, pub id: ShoppingCartId,
@ -256,7 +252,6 @@ impl From<(crate::ShoppingCart, Vec<crate::ShoppingCartItem>)> for ShoppingCart
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Serialize, Deserialize, Debug, Hash)] #[derive(Serialize, Deserialize, Debug, Hash)]
pub struct Photo { pub struct Photo {
pub id: crate::PhotoId, pub id: crate::PhotoId,
@ -265,7 +260,6 @@ pub struct Photo {
pub unique_name: crate::UniqueName, pub unique_name: crate::UniqueName,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Clone, Debug, Hash, PartialOrd, PartialEq, Eq, Deserialize, Serialize)] #[derive(Clone, Debug, Hash, PartialOrd, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub struct Category { pub struct Category {
@ -284,7 +278,6 @@ impl From<&crate::Category> for Category {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Serialize, Deserialize, Debug, Hash)] #[derive(Serialize, Deserialize, Debug, Hash)]
pub struct Product { pub struct Product {
pub id: crate::ProductId, pub id: crate::ProductId,
@ -374,7 +367,6 @@ impl<'path>
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Serialize, Deserialize, Debug, Deref)] #[derive(Serialize, Deserialize, Debug, Deref)]
#[serde(transparent)] #[serde(transparent)]
pub struct Products(pub Vec<Product>); pub struct Products(pub Vec<Product>);

View File

@ -1,127 +0,0 @@
use fake::faker::internet::en::{FreeEmail, Password as FakePass, Username};
use fake::faker::phone_number::en::PhoneNumber;
use fake::Fake;
use crate::*;
impl<T> fake::Dummy<T> for Login {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
Self(Username().fake())
}
}
impl<T> fake::Dummy<T> for Email {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
Self(FreeEmail().fake())
}
}
impl<T> fake::Dummy<T> for Phone {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
Self(PhoneNumber().fake())
}
}
impl<T> fake::Dummy<T> for ProductShortDesc {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
use fake::faker::lorem::en::Words;
let words: Vec<String> = Words(5..20).fake();
Self(words.join(" "))
}
}
impl<T> fake::Dummy<T> for ProductLongDesc {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
use fake::faker::lorem::en::Paragraphs;
let words: Vec<String> = (3..5)
.into_iter()
.map(|_| {
let words: Vec<String> = Paragraphs(4..8).fake();
words.join(" ")
})
.collect();
Self(words.join("\n"))
}
}
impl<T> fake::Dummy<T> for Password {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
let pass: String = FakePass(6..20).fake();
Self(pass)
}
}
impl<T> fake::Dummy<T> for PassHash {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
let pass: Password = fake::Faker.fake();
Self(
pass.encrypt(
&password_hash::SaltString::new("a7sydd98asd98ahsda9shdahd98ahsd9aysd9aysd9y")
.unwrap(),
)
.unwrap(),
)
}
}
impl<T> fake::Dummy<T> for ProductName {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
use fake::faker::lorem::en::Words;
let name: Vec<String> = Words(5..8).fake();
Self(name.join(" "))
}
}
impl<T> fake::Dummy<T> for Price {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
let price = rand::random::<u8>() as i32 * 100i32 + rand::random::<u8>() as i32;
let price: i32 = price as i32;
Self(NonNegative(price))
}
}
impl<T> fake::Dummy<T> for NonNegative {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
let price = rand::random::<u8>() as i32 * 100i32 + rand::random::<u8>() as i32;
let price: i32 = price as i32;
Self(price)
}
}
impl<T> fake::Dummy<T> for crate::Name {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
use fake::faker::name::raw::*;
use fake::locales::*;
Self(Name(EN).fake())
}
}
impl<T> fake::Dummy<T> for crate::Street {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
use fake::faker::address::raw::*;
use fake::locales::*;
Self(StreetName(EN).fake())
}
}
impl<T> fake::Dummy<T> for crate::City {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
use fake::faker::address::raw::*;
use fake::locales::*;
Self(CityName(EN).fake())
}
}
impl<T> fake::Dummy<T> for crate::Country {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
use fake::faker::address::raw::*;
use fake::locales::*;
Self(CountryName(EN).fake())
}
}
impl<T> fake::Dummy<T> for crate::Zip {
fn dummy_with_rng<R: Rng + ?Sized>(_config: &T, _rng: &mut R) -> Self {
use fake::faker::address::raw::*;
use fake::locales::*;
Self(ZipCode(EN).fake())
}
}

View File

@ -2,8 +2,6 @@
pub mod api; pub mod api;
#[cfg(feature = "dummy")]
mod dummy;
pub mod encrypt; pub mod encrypt;
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
@ -124,7 +122,6 @@ pub const CATEGORIES: [Category; 9] = [
}, },
]; ];
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))] #[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, Display, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, Display, Deserialize, Serialize)]
@ -144,7 +141,6 @@ pub enum OrderStatus {
Refunded, Refunded,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))] #[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, Display, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, Display, Deserialize, Serialize)]
@ -171,7 +167,6 @@ impl Role {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Display, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Display, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
@ -206,7 +201,6 @@ impl QuantityUnit {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))] #[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, Display, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, Display, Deserialize, Serialize)]
@ -222,7 +216,6 @@ impl Default for PaymentMethod {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))] #[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, Display, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, Display, Deserialize, Serialize)]
@ -232,7 +225,6 @@ pub enum ShoppingCartState {
Closed, Closed,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))] #[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))]
#[derive(Copy, Clone, Debug, Hash, Display, Deserialize, Serialize, PartialEq, Eq)] #[derive(Copy, Clone, Debug, Hash, Display, Deserialize, Serialize, PartialEq, Eq)]
@ -261,7 +253,6 @@ impl Audience {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))] #[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))]
#[derive(Copy, Clone, Debug, Display, Deserialize, Serialize, PartialEq, Eq)] #[derive(Copy, Clone, Debug, Display, Deserialize, Serialize, PartialEq, Eq)]
@ -394,7 +385,6 @@ impl Offset {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq, Copy, Clone, Hash, Deref, From)] #[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq, Copy, Clone, Hash, Deref, From)]
@ -632,7 +622,6 @@ impl<'de> serde::Deserialize<'de> for NonNegative {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive( #[derive(
Debug, Copy, Clone, Hash, PartialOrd, PartialEq, Eq, Serialize, Deserialize, Display, From, Debug, Copy, Clone, Hash, PartialOrd, PartialEq, Eq, Serialize, Deserialize, Display, From,
)] )]
@ -704,7 +693,6 @@ impl TryFrom<i32> for Day {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[derive(Hash, Debug, PartialOrd, PartialEq, Eq, Serialize, Deserialize)] #[derive(Hash, Debug, PartialOrd, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)] #[serde(transparent)]
pub struct Days(pub Vec<Day>); pub struct Days(pub Vec<Day>);
@ -801,7 +789,6 @@ impl Password {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Serialize, Deserialize, Debug, Clone, Deref, From, Display)] #[derive(Serialize, Deserialize, Debug, Clone, Deref, From, Display)]
@ -832,7 +819,6 @@ impl PartialEq<PasswordConfirmation> for Password {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive( #[derive(
@ -841,7 +827,6 @@ impl PartialEq<PasswordConfirmation> for Password {
#[serde(transparent)] #[serde(transparent)]
pub struct AccountId(RecordId); pub struct AccountId(RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct FullAccount { pub struct FullAccount {
@ -854,7 +839,6 @@ pub struct FullAccount {
pub state: AccountState, pub state: AccountState,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Account { pub struct Account {
@ -889,7 +873,6 @@ impl From<FullAccount> for Account {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Deref, From)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Deref, From)]
@ -964,7 +947,6 @@ impl ProductLongDesc {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)] #[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)]
@ -993,7 +975,6 @@ pub mod v2 {
RecordId, StockId, UniqueName, RecordId, StockId, UniqueName,
}; };
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)] #[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)]
@ -1014,7 +995,6 @@ pub mod v2 {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Deref, From)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Deref, From)]
@ -1043,7 +1023,6 @@ pub mod v2 {
pub variants: Vec<DetailedProductVariant>, pub variants: Vec<DetailedProductVariant>,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct Product { pub struct Product {
@ -1053,7 +1032,6 @@ pub mod v2 {
pub deliver_days_flag: Days, pub deliver_days_flag: Days,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProductVariant { pub struct ProductVariant {
@ -1065,7 +1043,6 @@ pub mod v2 {
pub price: Price, pub price: Price,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Stock { pub struct Stock {
@ -1075,7 +1052,6 @@ pub mod v2 {
pub quantity_unit: QuantityUnit, pub quantity_unit: QuantityUnit,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct Photo { pub struct Photo {
@ -1085,7 +1061,6 @@ pub mod v2 {
pub unique_name: UniqueName, pub unique_name: UniqueName,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProductLinkedPhoto { pub struct ProductLinkedPhoto {
@ -1096,7 +1071,6 @@ pub mod v2 {
pub product_variant_id: ProductVariantId, pub product_variant_id: ProductVariantId,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProductPhoto { pub struct ProductPhoto {
@ -1106,7 +1080,6 @@ pub mod v2 {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct Product { pub struct Product {
@ -1119,14 +1092,12 @@ pub struct Product {
pub deliver_days_flag: Days, pub deliver_days_flag: Days,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
#[serde(transparent)] #[serde(transparent)]
pub struct StockId(pub RecordId); pub struct StockId(pub RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Stock { pub struct Stock {
@ -1136,21 +1107,18 @@ pub struct Stock {
pub quantity_unit: QuantityUnit, pub quantity_unit: QuantityUnit,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Display, Deref)] #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Display, Deref)]
#[serde(transparent)] #[serde(transparent)]
pub struct OrderAddressId(RecordId); pub struct OrderAddressId(RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Display, Deref)] #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Display, Deref)]
#[serde(transparent)] #[serde(transparent)]
pub struct OrderId(RecordId); pub struct OrderId(RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Display, Deref)] #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Display, Deref)]
@ -1167,7 +1135,6 @@ impl ExtOrderId {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Order { pub struct Order {
@ -1186,7 +1153,6 @@ pub struct Order {
pub address_id: OrderAddressId, pub address_id: OrderAddressId,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
pub struct PublicOrder { pub struct PublicOrder {
@ -1219,13 +1185,11 @@ impl From<Order> for PublicOrder {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Deref)] #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Deref)]
pub struct OrderItemId(pub RecordId); pub struct OrderItemId(pub RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct OrderItem { pub struct OrderItem {
@ -1236,14 +1200,12 @@ pub struct OrderItem {
pub quantity_unit: QuantityUnit, pub quantity_unit: QuantityUnit,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Serialize, Deserialize, PartialEq, Eq, Copy, Clone, Debug, Deref, Display)] #[derive(Serialize, Deserialize, PartialEq, Eq, Copy, Clone, Debug, Deref, Display)]
#[serde(transparent)] #[serde(transparent)]
pub struct ShoppingCartId(pub RecordId); pub struct ShoppingCartId(pub RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ShoppingCart { pub struct ShoppingCart {
@ -1254,7 +1216,6 @@ pub struct ShoppingCart {
pub checkout_notes: Option<String>, pub checkout_notes: Option<String>,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(PartialEq, Eq, Copy, Clone, Debug, Serialize, Deserialize, Deref, Display)] #[derive(PartialEq, Eq, Copy, Clone, Debug, Serialize, Deserialize, Deref, Display)]
@ -1277,14 +1238,12 @@ impl ShoppingCartItem {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Serialize, Deserialize, Copy, Clone, PartialEq, Eq, Deref, Display, Debug)] #[derive(Serialize, Deserialize, Copy, Clone, PartialEq, Eq, Deref, Display, Debug)]
#[serde(transparent)] #[serde(transparent)]
pub struct TokenId(RecordId); pub struct TokenId(RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Token { pub struct Token {
@ -1316,7 +1275,6 @@ impl Token {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)]
@ -1334,7 +1292,6 @@ impl From<RefreshTokenString> for AccessTokenString {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)]
@ -1352,7 +1309,6 @@ impl RefreshTokenString {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)]
@ -1364,7 +1320,6 @@ impl LocalPath {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)]
@ -1376,7 +1331,6 @@ impl UniqueName {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)]
@ -1388,7 +1342,6 @@ impl FileName {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive( #[derive(
@ -1407,13 +1360,11 @@ impl FileName {
)] )]
pub struct PhotoId(RecordId); pub struct PhotoId(RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Debug, Hash, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Deref, Display, From)]
pub struct ProductPhotoId(RecordId); pub struct ProductPhotoId(RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct Photo { pub struct Photo {
@ -1423,7 +1374,6 @@ pub struct Photo {
pub unique_name: UniqueName, pub unique_name: UniqueName,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProductLinkedPhoto { pub struct ProductLinkedPhoto {
@ -1434,7 +1384,6 @@ pub struct ProductLinkedPhoto {
pub product_id: ProductId, pub product_id: ProductId,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProductPhoto { pub struct ProductPhoto {
@ -1443,7 +1392,6 @@ pub struct ProductPhoto {
pub photo_id: PhotoId, pub photo_id: PhotoId,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
@ -1454,7 +1402,6 @@ pub enum ShippingMethod {
Manual, Manual,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive( #[derive(
@ -1604,7 +1551,6 @@ impl Zip {
} }
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug)] #[derive(Serialize, Deserialize, PartialEq, Eq, Debug)]
pub struct AccountAddress { pub struct AccountAddress {
@ -1620,7 +1566,6 @@ pub struct AccountAddress {
pub is_default: bool, pub is_default: bool,
} }
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct OrderAddress { pub struct OrderAddress {