1use serde::{Deserialize, Serialize};
4use sqlx::FromRow;
5
6#[derive(Debug, Clone, FromRow, Serialize, Deserialize)]
9pub struct WorkflowRow {
10 pub id: String,
11 pub name: String,
12 pub description: Option<String>,
13 pub created_at: String,
14 pub updated_at: String,
15 pub version: i32,
16 pub definition: String, pub tags: Option<String>, }
19
20#[derive(Debug, Clone, FromRow)]
22pub struct ExecutionRow {
23 pub id: String,
24 pub workflow_id: String,
25 pub started_at: Option<String>,
26 pub completed_at: Option<String>,
27 pub state: String,
28 pub context: String, pub node_results: String, pub variables: String, pub error_message: Option<String>,
32}
33
34#[derive(Debug, Clone, FromRow)]
36pub struct UserRow {
37 pub id: String,
38 pub username: String,
39 pub email: String,
40 pub password_hash: String,
41 pub full_name: Option<String>,
42 pub created_at: String,
43 pub updated_at: String,
44 pub last_login: Option<String>,
45 pub is_active: bool,
46 pub is_verified: bool,
47}
48
49#[derive(Debug, Clone, FromRow)]
51pub struct UserRoleRow {
52 pub user_id: String,
53 pub role: String,
54 pub granted_at: String,
55}
56
57#[derive(Debug, Clone, FromRow)]
59pub struct UserPermissionRow {
60 pub user_id: String,
61 pub permission: String,
62 pub granted_at: String,
63}