| 1 |
|
| 2 |
|
| 3 |
use chrono::{DateTime, Utc}; |
| 4 |
use serde::Serialize; |
| 5 |
use sqlx::FromRow; |
| 6 |
|
| 7 |
use super::super::id_types::*; |
| 8 |
use super::super::validated_types::*; |
| 9 |
|
| 10 |
|
| 11 |
#[derive(Debug, Clone, FromRow)] |
| 12 |
#[allow(dead_code)] |
| 13 |
pub struct DbDiscoverItemRow { |
| 14 |
|
| 15 |
pub id: ItemId, |
| 16 |
|
| 17 |
pub title: String, |
| 18 |
|
| 19 |
pub description: Option<String>, |
| 20 |
|
| 21 |
pub price_cents: i32, |
| 22 |
|
| 23 |
pub item_type: super::super::ItemType, |
| 24 |
|
| 25 |
pub created_at: DateTime<Utc>, |
| 26 |
|
| 27 |
pub username: Username, |
| 28 |
|
| 29 |
pub project_title: String, |
| 30 |
|
| 31 |
pub sales_count: i64, |
| 32 |
|
| 33 |
pub primary_tag_name: Option<String>, |
| 34 |
|
| 35 |
pub pwyw_enabled: bool, |
| 36 |
|
| 37 |
pub pwyw_min_cents: Option<i32>, |
| 38 |
|
| 39 |
pub match_score: Option<f32>, |
| 40 |
|
| 41 |
pub ai_tier: super::super::AiTier, |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
#[derive(Debug, Clone, FromRow)] |
| 46 |
#[allow(dead_code)] |
| 47 |
pub struct DbDiscoverProjectRow { |
| 48 |
|
| 49 |
pub slug: Slug, |
| 50 |
|
| 51 |
pub title: String, |
| 52 |
|
| 53 |
pub description: Option<String>, |
| 54 |
|
| 55 |
pub project_type: super::super::ProjectType, |
| 56 |
|
| 57 |
pub created_at: DateTime<Utc>, |
| 58 |
|
| 59 |
pub username: Username, |
| 60 |
|
| 61 |
pub item_count: i64, |
| 62 |
|
| 63 |
pub match_score: Option<f32>, |
| 64 |
|
| 65 |
pub category_name: Option<String>, |
| 66 |
|
| 67 |
pub category_slug: Option<String>, |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
#[derive(Debug, Clone, FromRow)] |
| 72 |
pub struct DbItemTypeCount { |
| 73 |
|
| 74 |
pub category: String, |
| 75 |
|
| 76 |
pub count: i64, |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
#[derive(Debug, Clone, Default)] |
| 81 |
pub struct DbPriceRangeCounts { |
| 82 |
|
| 83 |
pub free: i64, |
| 84 |
|
| 85 |
pub under_25: i64, |
| 86 |
|
| 87 |
pub range_25_50: i64, |
| 88 |
|
| 89 |
pub range_50_100: i64, |
| 90 |
|
| 91 |
pub over_100: i64, |
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
#[derive(Debug, Clone, FromRow, Serialize)] |
| 96 |
pub struct DbCustomLink { |
| 97 |
|
| 98 |
pub id: CustomLinkId, |
| 99 |
|
| 100 |
pub user_id: UserId, |
| 101 |
|
| 102 |
pub url: String, |
| 103 |
|
| 104 |
pub title: String, |
| 105 |
|
| 106 |
pub description: Option<String>, |
| 107 |
|
| 108 |
pub sort_order: i32, |
| 109 |
|
| 110 |
pub created_at: DateTime<Utc>, |
| 111 |
|
| 112 |
pub updated_at: DateTime<Utc>, |
| 113 |
} |
| 114 |
|