use jiff::Timestamp; use serde::Serialize; use crate::gitea::WebhookType; #[derive(Debug, Clone, Copy, PartialEq, Eq, toasty::Embed, Serialize)] #[serde(tag = "type", rename_all = "snake_case")] pub enum JobStatus { Pending, Processing, } #[derive(Debug, toasty::Model, Clone, Serialize)] pub struct Job { #[key] #[auto] pub id: u64, #[unique] pub event_id: u64, pub repo: String, pub pr: u64, #[column(type = jsonb)] pub payload: toasty::Json, #[index] pub status: JobStatus, #[auto] pub created_at: Timestamp, }