define defaults on the model, simplify create relay payload
Docker / build-and-push-image (backend, backend, coracle/caravel-backend) (push) Failing after 7m53s
Docker / build-and-push-image (frontend, frontend, coracle/caravel-frontend) (push) Successful in 3m8s

This commit is contained in:
Jon Staab
2026-05-15 11:25:25 -07:00
parent 1c3e0d619a
commit cd7b84439e
4 changed files with 63 additions and 31 deletions
+40
View File
@@ -36,6 +36,20 @@ pub struct Tenant {
pub past_due_at: Option<i64>,
}
impl Default for Tenant {
fn default() -> Self {
Self {
pubkey: String::new(),
nwc_url: String::new(),
nwc_error: None,
created_at: 0,
stripe_customer_id: String::new(),
stripe_subscription_id: None,
past_due_at: None,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow)]
pub struct Relay {
pub id: String,
@@ -58,3 +72,29 @@ pub struct Relay {
pub push_enabled: i64,
pub synced: i64,
}
impl Default for Relay {
fn default() -> Self {
Self {
id: String::new(),
tenant: String::new(),
schema: String::new(),
subdomain: String::new(),
plan: String::new(),
stripe_subscription_item_id: None,
status: RELAY_STATUS_ACTIVE.to_string(),
sync_error: String::new(),
info_name: String::new(),
info_icon: String::new(),
info_description: String::new(),
policy_public_join: 0,
policy_strip_signatures: 0,
groups_enabled: 1,
management_enabled: 1,
blossom_enabled: 0,
livekit_enabled: 0,
push_enabled: 1,
synced: 0,
}
}
}