Added user apps and token resources.
This commit is contained in:
@@ -2,7 +2,10 @@ pub mod accounts;
|
||||
pub mod dtos;
|
||||
mod error_codes;
|
||||
pub mod recurring_transactions;
|
||||
pub mod tokens;
|
||||
pub mod transactions;
|
||||
pub mod user_app_secrets;
|
||||
pub mod user_apps;
|
||||
pub mod users;
|
||||
|
||||
use error_codes::PG_FOREIGN_KEY_VIOLATION;
|
||||
@@ -43,6 +46,12 @@ impl From<sqlx::Error> for DatabaseError {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
|
||||
pub enum Constraint {
|
||||
#[error("user app user constraint")]
|
||||
UserAppUser,
|
||||
|
||||
#[error("user app secret app constraint")]
|
||||
UserAppSecretApp,
|
||||
|
||||
#[error("transaction account constraint")]
|
||||
TransactionAccount,
|
||||
|
||||
@@ -59,6 +68,8 @@ pub enum Constraint {
|
||||
impl From<&str> for Constraint {
|
||||
fn from(constraint: &str) -> Self {
|
||||
match constraint {
|
||||
"fk_user_apps_user" => Constraint::UserAppUser,
|
||||
"fk_user_app_secrets_app" => Constraint::UserAppSecretApp,
|
||||
"fk_transactions_account" => Constraint::TransactionAccount,
|
||||
"fk_recurring_transactions_account" => Constraint::RecurringTransactionAccount,
|
||||
_ => Constraint::Unknown(constraint.to_string()),
|
||||
|
||||
Reference in New Issue
Block a user