Adding to macros and refactoring
This commit is contained in:
@@ -1,13 +1,11 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
pub const MESSAGE_EVENT_RESPONSE_STATUS_INSTANT: &str = "INSTANT";
|
pub const MESSAGE_EVENT_RESPONSE_STATUS_INSTANT: &str = "INSTANT";
|
||||||
pub const MESSAGE_EVENT_RESPONSE_STATUS_SCHEDULED: &str = "SCHEDULED";
|
pub const MESSAGE_EVENT_RESPONSE_STATUS_SCHEDULED: &str = "SCHEDULED";
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
|
||||||
pub struct MessageEventResponse {
|
pub struct MessageEventResponse {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
pub scheduled_message_event_id: uuid::Uuid,
|
pub scheduled_message_event_id: uuid::Uuid,
|
||||||
// Json field
|
/// Stores a json response of the sent message
|
||||||
pub response: String,
|
pub response: String,
|
||||||
pub user_id: uuid::Uuid,
|
pub user_id: uuid::Uuid,
|
||||||
pub contact_id: uuid::Uuid,
|
pub contact_id: uuid::Uuid,
|
||||||
|
|||||||
+1
-3
@@ -1,9 +1,7 @@
|
|||||||
pub mod event;
|
pub mod event;
|
||||||
pub mod scheduling;
|
pub mod scheduling;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
|
||||||
pub struct Message {
|
pub struct Message {
|
||||||
#[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
|
#[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
|
||||||
pub id: Option<uuid::Uuid>,
|
pub id: Option<uuid::Uuid>,
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
|
||||||
pub struct ScheduledMessageEvent {
|
pub struct ScheduledMessageEvent {
|
||||||
id: uuid::Uuid,
|
id: uuid::Uuid,
|
||||||
contact_id: uuid::Uuid,
|
contact_id: uuid::Uuid,
|
||||||
@@ -10,7 +8,7 @@ pub struct ScheduledMessageEvent {
|
|||||||
created: Option<time::OffsetDateTime>,
|
created: Option<time::OffsetDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
|
||||||
pub struct ScheduledMessage {
|
pub struct ScheduledMessage {
|
||||||
id: uuid::Uuid,
|
id: uuid::Uuid,
|
||||||
#[serde(with = "time::serde::rfc3339::option")]
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
|
|||||||
Reference in New Issue
Block a user