minifly_core/models/
app.rs1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use uuid::Uuid;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct App {
7 pub id: Uuid,
8 pub name: String,
9 pub organization_id: String,
10 pub status: AppStatus,
11 pub created_at: DateTime<Utc>,
12 pub updated_at: DateTime<Utc>,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
16#[serde(rename_all = "lowercase")]
17pub enum AppStatus {
18 Pending,
19 Deployed,
20 Suspended,
21}
22
23#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct CreateAppRequest {
25 pub app_name: String,
26 pub org_slug: String,
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize)]
30pub struct AppResponse {
31 pub id: String,
32 pub name: String,
33 pub organization: Organization,
34 pub status: String,
35 pub created_at: String,
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
39pub struct Organization {
40 pub id: String,
41 pub slug: String,
42 pub name: String,
43}