Constant MODELS
Source pub const MODELS: &str = r#"use chrono::{DateTime, Utc};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
/// Database entity struct
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct UserEntity {
pub id: Uuid,
pub username: String,
pub email: String,
pub password: String,
pub created_at: DateTime<Utc>,
}
/// DTO with password included
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)]
pub struct User {
pub id: String,
pub username: String,
pub email: String,
pub password: String,
pub created_at: String,
}
/// DTO without password
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)]
pub struct UserInfo {
pub id: String,
pub username: String,
pub email: String,
pub created_at: String,
}
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)]
pub struct LoginCredentials {
pub email: String,
pub password: String,
}
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)]
pub struct RegistrationCredentials {
pub username: String,
pub email: String,
pub password: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct SuccessResponse {
pub status: u16,
pub message: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct ErrorResponse {
pub status: u16,
pub message: String,
}
"#;