use chrono::{DateTime, Utc};
use entity_derive::Entity;
use uuid::Uuid;
#[derive(Entity)]
#[entity(table = "events")]
pub struct Event {
#[id]
pub id: Uuid,
#[field(create, update, response)]
pub name: String,
#[field(response)]
#[map(empty_to_none)]
pub description: Option<String>,
#[field(response)]
#[map(unwrap_default)]
pub views: Option<i64>,
#[field(response)]
#[map(now)]
pub last_viewed: Option<DateTime<Utc>>,
#[field(response)]
pub score: i32,
#[field(response)]
pub plain_field: String,
#[field(response)]
#[auto]
pub created_at: DateTime<Utc>,
}
fn main() {
let _: fn(CreateEventRequest) = |_| {};
let _: fn(EventResponse) = |_| {};
fn _check_trait<T: EventRepository>() {}
}