diff --git a/entity/src/actions.rs b/entity/src/actions.rs index 8840a78..c4525e2 100644 --- a/entity/src/actions.rs +++ b/entity/src/actions.rs @@ -20,8 +20,10 @@ pub struct Model { #[serde(skip_deserializing)] pub status_changed_at: DateTimeWithTimeZone, #[serde(skip_deserializing)] + #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub created_at: DateTimeWithTimeZone, #[serde(skip_deserializing)] + #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub updated_at: DateTimeWithTimeZone, } diff --git a/entity/src/coachees.rs b/entity/src/coachees.rs index 112c94f..d566809 100644 --- a/entity/src/coachees.rs +++ b/entity/src/coachees.rs @@ -7,6 +7,7 @@ use utoipa::ToSchema; #[schema(as = entity::users::Model)] // OpenAPI schema #[sea_orm(schema_name = "refactor_platform", table_name = "users")] pub struct Model { + #[serde(skip_deserializing)] #[sea_orm(primary_key)] pub id: Id, #[sea_orm(unique)] @@ -18,8 +19,10 @@ pub struct Model { pub password: String, pub github_username: Option, pub github_profile_url: Option, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub created_at: DateTimeWithTimeZone, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub updated_at: DateTimeWithTimeZone, } diff --git a/entity/src/coaches.rs b/entity/src/coaches.rs index ded5d2b..ec99ae7 100644 --- a/entity/src/coaches.rs +++ b/entity/src/coaches.rs @@ -7,6 +7,7 @@ use utoipa::ToSchema; #[schema(as = entity::users::Model)] // OpenAPI schema #[sea_orm(schema_name = "refactor_platform", table_name = "users")] pub struct Model { + #[serde(skip_deserializing)] #[sea_orm(primary_key)] pub id: Id, #[sea_orm(unique)] @@ -18,8 +19,10 @@ pub struct Model { pub password: String, pub github_username: Option, pub github_profile_url: Option, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub created_at: DateTimeWithTimeZone, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub updated_at: DateTimeWithTimeZone, } diff --git a/entity/src/coaching_relationships.rs b/entity/src/coaching_relationships.rs index 3a6720a..6e8a3f9 100644 --- a/entity/src/coaching_relationships.rs +++ b/entity/src/coaching_relationships.rs @@ -12,14 +12,17 @@ use utoipa::ToSchema; table_name = "coaching_relationships" )] pub struct Model { + #[serde(skip_deserializing)] #[sea_orm(primary_key)] pub id: Id, #[sea_orm(unique)] pub organization_id: Id, pub coach_id: Id, pub coachee_id: Id, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub created_at: DateTimeWithTimeZone, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub updated_at: DateTimeWithTimeZone, } diff --git a/entity/src/coaching_sessions.rs b/entity/src/coaching_sessions.rs index 5bf25d2..bd900ce 100644 --- a/entity/src/coaching_sessions.rs +++ b/entity/src/coaching_sessions.rs @@ -9,12 +9,17 @@ use utoipa::ToSchema; #[schema(as = entity::coaching_sessions::Model)] #[sea_orm(schema_name = "refactor_platform", table_name = "coaching_sessions")] pub struct Model { + #[serde(skip_deserializing)] #[sea_orm(primary_key)] pub id: Id, pub coaching_relationship_id: Id, pub date: DateTime, pub timezone: String, + #[serde(skip_deserializing)] + #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub created_at: DateTimeWithTimeZone, + #[serde(skip_deserializing)] + #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub updated_at: DateTimeWithTimeZone, } diff --git a/entity/src/organizations.rs b/entity/src/organizations.rs index 4d2212d..bd1795f 100644 --- a/entity/src/organizations.rs +++ b/entity/src/organizations.rs @@ -9,13 +9,16 @@ use utoipa::ToSchema; #[schema(as = entity::organizations::Model)] // OpenAPI schema #[sea_orm(schema_name = "refactor_platform", table_name = "organizations")] pub struct Model { + #[serde(skip_deserializing)] #[sea_orm(primary_key)] pub id: Id, #[sea_orm(unique)] pub name: String, pub logo: Option, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub created_at: DateTimeWithTimeZone, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub updated_at: DateTimeWithTimeZone, } diff --git a/entity/src/users.rs b/entity/src/users.rs index 41efea5..80e3987 100644 --- a/entity/src/users.rs +++ b/entity/src/users.rs @@ -11,6 +11,7 @@ use utoipa::ToSchema; #[schema(as = entity::users::Model)] // OpenAPI schema #[sea_orm(schema_name = "refactor_platform", table_name = "users")] pub struct Model { + #[serde(skip_deserializing)] #[sea_orm(primary_key)] pub id: Id, #[sea_orm(unique)] @@ -22,8 +23,10 @@ pub struct Model { pub password: String, pub github_username: Option, pub github_profile_url: Option, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub created_at: DateTimeWithTimeZone, + #[serde(skip_deserializing)] #[schema(value_type = String, format = DateTime)] // Applies to OpenAPI schema pub updated_at: DateTimeWithTimeZone, }