| 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, Serialize)] |
| 12 |
pub struct DbProject { |
| 13 |
|
| 14 |
pub id: ProjectId, |
| 15 |
|
| 16 |
pub user_id: UserId, |
| 17 |
|
| 18 |
pub slug: Slug, |
| 19 |
|
| 20 |
pub title: String, |
| 21 |
|
| 22 |
pub description: Option<String>, |
| 23 |
|
| 24 |
pub project_type: super::super::ProjectType, |
| 25 |
|
| 26 |
pub cover_image_url: Option<String>, |
| 27 |
|
| 28 |
pub is_public: bool, |
| 29 |
|
| 30 |
pub created_at: DateTime<Utc>, |
| 31 |
|
| 32 |
pub updated_at: DateTime<Utc>, |
| 33 |
|
| 34 |
pub cache_generation: i64, |
| 35 |
|
| 36 |
pub mt_community_id: Option<uuid::Uuid>, |
| 37 |
|
| 38 |
pub features: Vec<String>, |
| 39 |
|
| 40 |
pub pricing_model: super::super::PricingKind, |
| 41 |
|
| 42 |
pub price_cents: i32, |
| 43 |
|
| 44 |
pub pwyw_min_cents: Option<i32>, |
| 45 |
|
| 46 |
pub license_verification_enabled: bool, |
| 47 |
|
| 48 |
pub ai_tier: super::super::AiTier, |
| 49 |
|
| 50 |
pub ai_disclosure: Option<String>, |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
#[derive(Debug, Clone, FromRow, Serialize)] |
| 55 |
pub struct DbGitRepo { |
| 56 |
|
| 57 |
pub id: GitRepoId, |
| 58 |
|
| 59 |
pub user_id: UserId, |
| 60 |
|
| 61 |
pub name: String, |
| 62 |
|
| 63 |
pub project_id: Option<ProjectId>, |
| 64 |
|
| 65 |
pub created_at: DateTime<Utc>, |
| 66 |
|
| 67 |
pub visibility: super::super::Visibility, |
| 68 |
|
| 69 |
pub description: String, |
| 70 |
} |
| 71 |
|
| 72 |
|
| 73 |
#[derive(Debug, Clone, FromRow)] |
| 74 |
#[allow(dead_code)] |
| 75 |
pub struct DbProjectWithItemCount { |
| 76 |
|
| 77 |
pub id: ProjectId, |
| 78 |
|
| 79 |
pub user_id: UserId, |
| 80 |
|
| 81 |
pub slug: Slug, |
| 82 |
|
| 83 |
pub title: String, |
| 84 |
|
| 85 |
pub description: Option<String>, |
| 86 |
|
| 87 |
pub project_type: super::super::ProjectType, |
| 88 |
|
| 89 |
pub cover_image_url: Option<String>, |
| 90 |
|
| 91 |
pub is_public: bool, |
| 92 |
|
| 93 |
pub created_at: DateTime<Utc>, |
| 94 |
|
| 95 |
pub updated_at: DateTime<Utc>, |
| 96 |
|
| 97 |
pub item_count: i64, |
| 98 |
} |
| 99 |
|
| 100 |
|
| 101 |
#[derive(Debug, Clone, FromRow, Serialize)] |
| 102 |
pub struct DbProjectSection { |
| 103 |
|
| 104 |
pub id: ProjectSectionId, |
| 105 |
|
| 106 |
pub project_id: ProjectId, |
| 107 |
|
| 108 |
pub title: String, |
| 109 |
|
| 110 |
pub slug: String, |
| 111 |
|
| 112 |
pub body: String, |
| 113 |
|
| 114 |
pub sort_order: i32, |
| 115 |
|
| 116 |
pub created_at: DateTime<Utc>, |
| 117 |
|
| 118 |
pub updated_at: DateTime<Utc>, |
| 119 |
} |
| 120 |
|