Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f804438db
|
||
|
|
7a8790c896
|
||
|
|
8964501eca
|
||
|
|
6c2bb761fb
|
||
|
|
24ae7bf8d9
|
||
|
|
e7834093a6
|
||
|
|
bea9489c8e
|
||
|
|
bb3f2f3af5
|
||
|
|
8622b8c720
|
@@ -5,10 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: Check
|
name: Check
|
||||||
|
|||||||
@@ -5,10 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: Check
|
name: Check
|
||||||
|
|||||||
Generated
+1
-1
@@ -521,7 +521,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textsender_models"
|
name = "textsender_models"
|
||||||
version = "0.4.1"
|
version = "0.3.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const_format",
|
"const_format",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "textsender_models"
|
name = "textsender_models"
|
||||||
version = "0.4.1"
|
version = "0.3.4"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.96"
|
rust-version = "1.96"
|
||||||
description = "Models used for the textsender project"
|
description = "Models used for the textsender project"
|
||||||
@@ -13,7 +13,7 @@ uuid = { version = "1.23.3", features = ["v4", "serde"] }
|
|||||||
dotenvy = { version = "0.15.7" }
|
dotenvy = { version = "0.15.7" }
|
||||||
const_format = { version = "0.2.36" }
|
const_format = { version = "0.2.36" }
|
||||||
josekit = { version = "0.10.3" }
|
josekit = { version = "0.10.3" }
|
||||||
utoipa = { version = "5.5.0", features = ["uuid", "time"] }
|
utoipa = { version = "5.4.0", features = ["uuid", "time"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["full"]
|
default = ["full"]
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
pub struct TwilioConfig {
|
pub struct TwilioConfig {
|
||||||
#[serde(alias = "auth_id")]
|
#[serde(alias = "auth_id")]
|
||||||
pub account_sid: String,
|
pub account_sid: String,
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
#[derive(
|
use serde::{Deserialize, Serialize};
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
pub struct Contact {
|
pub struct Contact {
|
||||||
#[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,13 +1,13 @@
|
|||||||
|
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(
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, 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,
|
||||||
/// Stores a json response of the sent message
|
// Json field
|
||||||
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,
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
pub mod event;
|
pub mod event;
|
||||||
pub mod scheduling;
|
pub mod scheduling;
|
||||||
|
|
||||||
#[derive(
|
use serde::{Deserialize, Serialize};
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, 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,26 +1,24 @@
|
|||||||
#[derive(
|
use serde::{Deserialize, Serialize};
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
pub struct ScheduledMessageEvent {
|
pub struct ScheduledMessageEvent {
|
||||||
pub id: uuid::Uuid,
|
id: uuid::Uuid,
|
||||||
pub contact_id: uuid::Uuid,
|
contact_id: uuid::Uuid,
|
||||||
pub message_id: uuid::Uuid,
|
message_id: uuid::Uuid,
|
||||||
pub scheduled_message_id: uuid::Uuid,
|
scheduled_message_id: uuid::Uuid,
|
||||||
#[serde(with = "time::serde::rfc3339::option")]
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
pub created: Option<time::OffsetDateTime>,
|
created: Option<time::OffsetDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
|
||||||
pub struct ScheduledMessage {
|
pub struct ScheduledMessage {
|
||||||
pub id: uuid::Uuid,
|
id: uuid::Uuid,
|
||||||
#[serde(with = "time::serde::rfc3339::option")]
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
pub scheduled: Option<time::OffsetDateTime>,
|
scheduled: Option<time::OffsetDateTime>,
|
||||||
#[serde(with = "time::serde::rfc3339::option")]
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
pub created: Option<time::OffsetDateTime>,
|
created: Option<time::OffsetDateTime>,
|
||||||
pub status: String,
|
status: String,
|
||||||
pub user_id: uuid::Uuid,
|
user_id: uuid::Uuid,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const READY: &str = "READY";
|
pub const READY: &str = "READY";
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
use serde::Deserialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
pub struct Claims {
|
pub struct Claims {
|
||||||
pub user_id: uuid::Uuid,
|
pub user_id: uuid::Uuid,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
@@ -34,7 +34,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
pub struct LoginResult {
|
pub struct LoginResult {
|
||||||
pub user_id: uuid::Uuid,
|
pub user_id: uuid::Uuid,
|
||||||
pub access_token: String,
|
pub access_token: String,
|
||||||
|
|||||||
+9
-19
@@ -1,6 +1,6 @@
|
|||||||
#[derive(
|
use serde::{Deserialize, Serialize};
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
pub phone_number: String,
|
pub phone_number: String,
|
||||||
@@ -18,9 +18,7 @@ pub struct User {
|
|||||||
pub salt_id: uuid::Uuid,
|
pub salt_id: uuid::Uuid,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
|
||||||
pub struct ServiceUser {
|
pub struct ServiceUser {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
pub username: String,
|
pub username: String,
|
||||||
@@ -34,9 +32,7 @@ pub struct ServiceUser {
|
|||||||
pub salt_id: uuid::Uuid,
|
pub salt_id: uuid::Uuid,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
|
||||||
pub struct Organization {
|
pub struct Organization {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
@@ -44,9 +40,7 @@ pub struct Organization {
|
|||||||
pub created: Option<time::OffsetDateTime>,
|
pub created: Option<time::OffsetDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
|
||||||
pub struct UserLoginHistory {
|
pub struct UserLoginHistory {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
#[serde(with = "time::serde::rfc3339::option")]
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
@@ -54,9 +48,7 @@ pub struct UserLoginHistory {
|
|||||||
pub user_id: uuid::Uuid,
|
pub user_id: uuid::Uuid,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
|
||||||
pub struct ServiceUserLoginHistory {
|
pub struct ServiceUserLoginHistory {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
#[serde(with = "time::serde::rfc3339::option")]
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
@@ -64,9 +56,7 @@ pub struct ServiceUserLoginHistory {
|
|||||||
pub service_user_id: uuid::Uuid,
|
pub service_user_id: uuid::Uuid,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema,
|
|
||||||
)]
|
|
||||||
pub struct UserProfile {
|
pub struct UserProfile {
|
||||||
pub user_id: uuid::Uuid,
|
pub user_id: uuid::Uuid,
|
||||||
pub phone_number: String,
|
pub phone_number: String,
|
||||||
@@ -79,7 +69,7 @@ pub struct UserProfile {
|
|||||||
pub last_login: Option<time::OffsetDateTime>,
|
pub last_login: Option<time::OffsetDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
pub struct Salt {
|
pub struct Salt {
|
||||||
// #[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
|
// #[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
|
|||||||
Reference in New Issue
Block a user