Update botserver submodule
This commit is contained in:
parent
5126c648ff
commit
4f63065da2
8 changed files with 272 additions and 276 deletions
63
Cargo.toml
63
Cargo.toml
|
|
@ -2,44 +2,42 @@
|
|||
name = "botserver"
|
||||
version = "6.1.0"
|
||||
edition = "2021"
|
||||
resolver = "2" # Better feature resolution
|
||||
resolver = "2"
|
||||
|
||||
[dependencies.botlib]
|
||||
path = "../botlib"
|
||||
# Remove features here - control them in botlib's Cargo.toml
|
||||
# features = ["database", "i18n"] # BAD - causes full recompile
|
||||
features = ["database", "i18n"]
|
||||
|
||||
[features]
|
||||
# ===== SINGLE DEFAULT FEATURE SET =====
|
||||
default = ["chat", "drive", "tasks", "automation", "cache"]
|
||||
default = ["chat", "drive", "tasks", "automation", "cache", "communications", "productivity"]
|
||||
|
||||
# ===== COMMUNICATION APPS =====
|
||||
chat = ["botlib/chat"] # Delegate to botlib
|
||||
chat = []
|
||||
people = []
|
||||
mail = ["botlib/mail"] # Delegate optional deps to botlib
|
||||
mail = ["dep:lettre","dep:mailparse", "dep:imap", "dep:native-tls"]
|
||||
meet = ["dep:livekit"]
|
||||
social = []
|
||||
whatsapp = []
|
||||
telegram = []
|
||||
instagram = []
|
||||
msteams = []
|
||||
# CONSIDER: Do you REALLY need this mega-feature?
|
||||
communications = ["chat", "people", "mail", "meet", "social", "whatsapp", "telegram", "instagram", "msteams", "cache"]
|
||||
|
||||
# ===== PRODUCTIVITY APPS =====
|
||||
calendar = []
|
||||
tasks = ["dep:cron"]
|
||||
project = []
|
||||
project=["quick-xml"]
|
||||
goals = []
|
||||
workspace = []
|
||||
productivity = ["calendar", "tasks", "project", "goals", "workspace", "cache"]
|
||||
|
||||
# ===== DOCUMENT APPS =====
|
||||
paper = ["docs", "dep:pdf-extract"] # Reuse docs
|
||||
paper = ["docs", "dep:pdf-extract"]
|
||||
docs = ["docx-rs", "ooxmlsdk"]
|
||||
sheet = ["calamine", "spreadsheet-ods"] # Reduced - pick one Excel lib
|
||||
sheet = ["calamine", "spreadsheet-ods"]
|
||||
slides = ["ooxmlsdk"]
|
||||
drive = ["dep:aws-config", "dep:aws-sdk-s3", "dep:pdf-extract", "dep:flate2"]
|
||||
drive = ["dep:aws-config", "dep:aws-sdk-s3", "dep:pdf-extract"]
|
||||
documents = ["paper", "docs", "sheet", "slides", "drive"]
|
||||
|
||||
# ===== MEDIA APPS =====
|
||||
|
|
@ -76,27 +74,21 @@ admin = ["attendant", "security", "settings"]
|
|||
llm = []
|
||||
vectordb = ["dep:qdrant-client"]
|
||||
nvidia = []
|
||||
email = []
|
||||
cache = ["dep:redis"]
|
||||
compliance = ["dep:csv"]
|
||||
timeseries = []
|
||||
weba = []
|
||||
directory = []
|
||||
progress-bars = ["dep:indicatif"]
|
||||
grpc = ["dep:tonic"]
|
||||
grpc = []
|
||||
jemalloc = ["dep:tikv-jemallocator", "dep:tikv-jemalloc-ctl"]
|
||||
console = ["dep:crossterm", "dep:ratatui", "monitoring"]
|
||||
|
||||
# ===== BUNDLE FEATURES =====
|
||||
# REDUCED VERSION - Enable only what you actually use
|
||||
full = [
|
||||
# Communication
|
||||
"chat", "people", "mail",
|
||||
# Productivity
|
||||
"tasks", "calendar",
|
||||
# Documents
|
||||
"drive", "docs",
|
||||
# Core tech
|
||||
"llm", "cache", "compliance"
|
||||
]
|
||||
|
||||
|
|
@ -104,19 +96,20 @@ minimal = ["chat"]
|
|||
lightweight = ["chat", "drive", "tasks", "people"]
|
||||
|
||||
[dependencies]
|
||||
# === CORE RUNTIME (Minimal) ===
|
||||
# === CORE RUNTIME ===
|
||||
aes-gcm = "0.10"
|
||||
anyhow = "1.0"
|
||||
argon2 = "0.5"
|
||||
async-lock = "2.8.0"
|
||||
async-stream = "0.3"
|
||||
async-trait = "0.1"
|
||||
axum = { version = "0.7.5", default-features = false, features = [] } # NO defaults!
|
||||
axum = { version = "0.7.5", features = ["ws", "multipart", "macros"] }
|
||||
axum-server = { version = "0.7", features = ["tls-rustls"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1.8"
|
||||
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
|
||||
color-eyre = "0.6.5"
|
||||
diesel = { version = "2.1", default-features = false, features = ["postgres", "r2d2"] } # MINIMAL!
|
||||
diesel = { version = "2.1", features = ["postgres", "uuid", "chrono", "serde_json", "r2d2", "numeric", "32-column-tables"] }
|
||||
bigdecimal = { version = "0.4", default-features = false }
|
||||
diesel_migrations = "2.1.0"
|
||||
dirs = "5.0"
|
||||
|
|
@ -134,16 +127,16 @@ num-format = "0.4"
|
|||
once_cell = "1.18.0"
|
||||
rand = "0.9.2"
|
||||
regex = "1.11"
|
||||
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] } # Reduced
|
||||
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "multipart"] }
|
||||
serde = { version = "1.0", default-features = false, features = ["derive", "std"] }
|
||||
serde_json = "1.0"
|
||||
toml = "0.8"
|
||||
sha2 = "0.10.9"
|
||||
sha1 = "0.10.6"
|
||||
tokio = { version = "1.41", default-features = false, features = ["rt", "sync", "time", "macros", "net"] }
|
||||
tokio = { version = "1.41", default-features = false, features = ["rt", "sync", "time", "macros", "net", "rt-multi-thread"] }
|
||||
tokio-stream = "0.1"
|
||||
tower = "0.4"
|
||||
tower-http = { version = "0.5", default-features = false, features = ["cors", "fs"] }
|
||||
tower-http = { version = "0.5", default-features = false, features = ["cors", "fs", "trace"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", default-features = false }
|
||||
urlencoding = "2.1"
|
||||
|
|
@ -152,7 +145,7 @@ uuid = { version = "1.11", default-features = false, features = ["v4"] }
|
|||
# === TLS/SECURITY DEPENDENCIES ===
|
||||
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
|
||||
tokio-rustls = "0.26"
|
||||
rcgen = { version = "0.14", default-features = false }
|
||||
rcgen = { version = "0.14", default-features = false, features = ["crypto", "ring"] } # Added ring feature
|
||||
x509-parser = "0.15"
|
||||
rustls-native-certs = "0.8"
|
||||
webpki-roots = "0.25"
|
||||
|
|
@ -164,7 +157,7 @@ tower-cookies = "0.10"
|
|||
|
||||
# === APP-SPECIFIC DEPENDENCIES ===
|
||||
|
||||
# Email Integration (mail feature)
|
||||
# mail Integration (mail feature)
|
||||
imap = { version = "3.0.0-alpha.15", optional = true }
|
||||
lettre = { version = "0.11", default-features = false, optional = true }
|
||||
mailparse = { version = "0.15", optional = true }
|
||||
|
|
@ -176,29 +169,25 @@ livekit = { version = "0.7", optional = true }
|
|||
# Vector Database (vectordb feature)
|
||||
qdrant-client = { version = "1.12", optional = true }
|
||||
|
||||
# Document Processing - PICK ONE PER FORMAT!
|
||||
# Document Processing
|
||||
docx-rs = { version = "0.4", optional = true }
|
||||
ooxmlsdk = { version = "0.3", default-features = false, optional = true }
|
||||
# umya-spreadsheet = { version = "2.3", optional = true } # REMOVE - pick one
|
||||
calamine = { version = "0.26", optional = true }
|
||||
# rust_xlsxwriter = { version = "0.79", optional = true } # REMOVE - pick one
|
||||
spreadsheet-ods = { version = "1.0", optional = true }
|
||||
|
||||
# File Storage & Drive (drive feature)
|
||||
aws-config = { version = "1.8.8", default-features = false, optional = true }
|
||||
aws-sdk-s3 = { version = "1.109.0", default-features = false, optional = true }
|
||||
pdf-extract = { version = "0.10.0", optional = true }
|
||||
quick-xml = { version = "0.37", default-features = false }
|
||||
# zip = { version = "2.2", optional = true } # Only if needed
|
||||
# downloader = { version = "0.2", optional = true } # Use reqwest instead
|
||||
flate2 = { version = "1.0", optional = true }
|
||||
# tar = { version = "0.4", optional = true } # Only if needed
|
||||
quick-xml = { version = "0.37", optional=true, default-features = false }
|
||||
flate2 = { version = "1.0", optional = false }
|
||||
zip = { version = "2.2", optional = false }
|
||||
tar = { version = "0.4", optional = false }
|
||||
|
||||
# Task Management (tasks feature)
|
||||
cron = { version = "0.15.0", optional = true }
|
||||
|
||||
# Automation & Scripting (automation feature)
|
||||
# REPLACE git with version
|
||||
rhai = { version = "1.23", features = ["sync"], optional = true }
|
||||
|
||||
# Compliance & Reporting (compliance feature)
|
||||
|
|
@ -222,7 +211,7 @@ redis = { version = "0.27", default-features = false, features = ["tokio-comp"],
|
|||
sysinfo = { version = "0.37.2", optional = true }
|
||||
|
||||
# Networking/gRPC (grpc feature)
|
||||
tonic = { version = "0.14.2", default-features = false, features = ["transport", "tls"], optional = true }
|
||||
tonic = { version = "0.14.2", default-features = false, features = ["transport"], optional = true }
|
||||
|
||||
# UI Enhancement (progress-bars feature)
|
||||
indicatif = { version = "0.18.0", optional = true }
|
||||
|
|
@ -263,7 +252,7 @@ mockito = "1.7.0"
|
|||
tempfile = "3"
|
||||
|
||||
[profile.dev]
|
||||
opt-level = 1 # Slightly optimized debug builds
|
||||
opt-level = 1
|
||||
split-debuginfo = "unpacked"
|
||||
incremental = true
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ async fn execute_create_draft(
|
|||
subject: &str,
|
||||
reply_text: &str,
|
||||
) -> Result<String, String> {
|
||||
#[cfg(feature = "email")]
|
||||
#[cfg(feature = "mail")]
|
||||
{
|
||||
use crate::email::{fetch_latest_sent_to, save_email_draft, SaveDraftRequest};
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ async fn execute_create_draft(
|
|||
.map(|()| "Draft saved successfully".to_string())
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "email"))]
|
||||
#[cfg(not(feature = "mail"))]
|
||||
{
|
||||
use chrono::Utc;
|
||||
use diesel::prelude::*;
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ async fn execute_send_mail(
|
|||
return send_via_connected_account(state, &creds, to, subject, body, attachments).await;
|
||||
}
|
||||
|
||||
#[cfg(feature = "email")]
|
||||
#[cfg(feature = "mail")]
|
||||
{
|
||||
use crate::email::EmailService;
|
||||
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ fn send_email(
|
|||
email: &str,
|
||||
message: &str,
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
#[cfg(feature = "email")]
|
||||
#[cfg(feature = "mail")]
|
||||
{
|
||||
use crate::email::EmailService;
|
||||
|
||||
|
|
@ -625,7 +625,7 @@ fn send_email(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "email"))]
|
||||
#[cfg(not(feature = "mail"))]
|
||||
{
|
||||
let _ = (state, email, message);
|
||||
error!("Email feature not enabled");
|
||||
|
|
@ -639,7 +639,7 @@ fn send_email_attachment(
|
|||
file_data: Vec<u8>,
|
||||
caption: &str,
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
#[cfg(feature = "email")]
|
||||
#[cfg(feature = "mail")]
|
||||
{
|
||||
use crate::email::EmailService;
|
||||
|
||||
|
|
@ -654,7 +654,7 @@ fn send_email_attachment(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "email"))]
|
||||
#[cfg(not(feature = "mail"))]
|
||||
{
|
||||
let _ = (state, email, file_data, caption);
|
||||
error!("Email feature not enabled for attachments");
|
||||
|
|
|
|||
|
|
@ -181,55 +181,101 @@ diesel::table! {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
diesel::table! {
|
||||
user_email_accounts (id) {
|
||||
rbac_roles (id) {
|
||||
id -> Uuid,
|
||||
user_id -> Uuid,
|
||||
email -> Varchar,
|
||||
display_name -> Nullable<Varchar>,
|
||||
imap_server -> Varchar,
|
||||
imap_port -> Int4,
|
||||
smtp_server -> Varchar,
|
||||
smtp_port -> Int4,
|
||||
username -> Varchar,
|
||||
password_encrypted -> Text,
|
||||
is_primary -> Bool,
|
||||
name -> Varchar,
|
||||
display_name -> Varchar,
|
||||
description -> Nullable<Text>,
|
||||
is_system -> Bool,
|
||||
is_active -> Bool,
|
||||
created_by -> Nullable<Uuid>,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
email_drafts (id) {
|
||||
rbac_groups (id) {
|
||||
id -> Uuid,
|
||||
name -> Varchar,
|
||||
display_name -> Varchar,
|
||||
description -> Nullable<Text>,
|
||||
parent_group_id -> Nullable<Uuid>,
|
||||
is_active -> Bool,
|
||||
created_by -> Nullable<Uuid>,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_permissions (id) {
|
||||
id -> Uuid,
|
||||
name -> Varchar,
|
||||
display_name -> Varchar,
|
||||
description -> Nullable<Text>,
|
||||
resource_type -> Varchar,
|
||||
action -> Varchar,
|
||||
category -> Varchar,
|
||||
is_system -> Bool,
|
||||
created_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_role_permissions (id) {
|
||||
id -> Uuid,
|
||||
role_id -> Uuid,
|
||||
permission_id -> Uuid,
|
||||
granted_by -> Nullable<Uuid>,
|
||||
granted_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_user_roles (id) {
|
||||
id -> Uuid,
|
||||
user_id -> Uuid,
|
||||
account_id -> Uuid,
|
||||
to_address -> Text,
|
||||
cc_address -> Nullable<Text>,
|
||||
bcc_address -> Nullable<Text>,
|
||||
subject -> Nullable<Varchar>,
|
||||
body -> Nullable<Text>,
|
||||
attachments -> Jsonb,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
role_id -> Uuid,
|
||||
granted_by -> Nullable<Uuid>,
|
||||
granted_at -> Timestamptz,
|
||||
expires_at -> Nullable<Timestamptz>,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
email_folders (id) {
|
||||
rbac_user_groups (id) {
|
||||
id -> Uuid,
|
||||
account_id -> Uuid,
|
||||
folder_name -> Varchar,
|
||||
folder_path -> Varchar,
|
||||
unread_count -> Int4,
|
||||
total_count -> Int4,
|
||||
last_synced -> Nullable<Timestamptz>,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
user_id -> Uuid,
|
||||
group_id -> Uuid,
|
||||
added_by -> Nullable<Uuid>,
|
||||
added_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_group_roles (id) {
|
||||
id -> Uuid,
|
||||
group_id -> Uuid,
|
||||
role_id -> Uuid,
|
||||
granted_by -> Nullable<Uuid>,
|
||||
granted_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::joinable!(rbac_role_permissions -> rbac_roles (role_id));
|
||||
diesel::joinable!(rbac_role_permissions -> rbac_permissions (permission_id));
|
||||
diesel::joinable!(rbac_user_roles -> users (user_id));
|
||||
diesel::joinable!(rbac_user_roles -> rbac_roles (role_id));
|
||||
diesel::joinable!(rbac_user_groups -> users (user_id));
|
||||
diesel::joinable!(rbac_user_groups -> rbac_groups (group_id));
|
||||
diesel::joinable!(rbac_group_roles -> rbac_groups (group_id));
|
||||
diesel::joinable!(rbac_group_roles -> rbac_roles (role_id));
|
||||
|
||||
|
||||
|
||||
diesel::table! {
|
||||
user_preferences (id) {
|
||||
id -> Uuid,
|
||||
|
|
@ -293,6 +339,57 @@ diesel::table! {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
diesel::table! {
|
||||
user_email_accounts (id) {
|
||||
id -> Uuid,
|
||||
user_id -> Uuid,
|
||||
email -> Varchar,
|
||||
display_name -> Nullable<Varchar>,
|
||||
imap_server -> Varchar,
|
||||
imap_port -> Int4,
|
||||
smtp_server -> Varchar,
|
||||
smtp_port -> Int4,
|
||||
username -> Varchar,
|
||||
password_encrypted -> Text,
|
||||
is_primary -> Bool,
|
||||
is_active -> Bool,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
email_drafts (id) {
|
||||
id -> Uuid,
|
||||
user_id -> Uuid,
|
||||
account_id -> Uuid,
|
||||
to_address -> Text,
|
||||
cc_address -> Nullable<Text>,
|
||||
bcc_address -> Nullable<Text>,
|
||||
subject -> Nullable<Varchar>,
|
||||
body -> Nullable<Text>,
|
||||
attachments -> Jsonb,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
email_folders (id) {
|
||||
id -> Uuid,
|
||||
account_id -> Uuid,
|
||||
folder_name -> Varchar,
|
||||
folder_path -> Varchar,
|
||||
unread_count -> Int4,
|
||||
total_count -> Int4,
|
||||
last_synced -> Nullable<Timestamptz>,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
diesel::table! {
|
||||
email_signatures (id) {
|
||||
id -> Uuid,
|
||||
|
|
@ -447,98 +544,6 @@ diesel::table! {
|
|||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_roles (id) {
|
||||
id -> Uuid,
|
||||
name -> Varchar,
|
||||
display_name -> Varchar,
|
||||
description -> Nullable<Text>,
|
||||
is_system -> Bool,
|
||||
is_active -> Bool,
|
||||
created_by -> Nullable<Uuid>,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_groups (id) {
|
||||
id -> Uuid,
|
||||
name -> Varchar,
|
||||
display_name -> Varchar,
|
||||
description -> Nullable<Text>,
|
||||
parent_group_id -> Nullable<Uuid>,
|
||||
is_active -> Bool,
|
||||
created_by -> Nullable<Uuid>,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_permissions (id) {
|
||||
id -> Uuid,
|
||||
name -> Varchar,
|
||||
display_name -> Varchar,
|
||||
description -> Nullable<Text>,
|
||||
resource_type -> Varchar,
|
||||
action -> Varchar,
|
||||
category -> Varchar,
|
||||
is_system -> Bool,
|
||||
created_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_role_permissions (id) {
|
||||
id -> Uuid,
|
||||
role_id -> Uuid,
|
||||
permission_id -> Uuid,
|
||||
granted_by -> Nullable<Uuid>,
|
||||
granted_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_user_roles (id) {
|
||||
id -> Uuid,
|
||||
user_id -> Uuid,
|
||||
role_id -> Uuid,
|
||||
granted_by -> Nullable<Uuid>,
|
||||
granted_at -> Timestamptz,
|
||||
expires_at -> Nullable<Timestamptz>,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_user_groups (id) {
|
||||
id -> Uuid,
|
||||
user_id -> Uuid,
|
||||
group_id -> Uuid,
|
||||
added_by -> Nullable<Uuid>,
|
||||
added_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rbac_group_roles (id) {
|
||||
id -> Uuid,
|
||||
group_id -> Uuid,
|
||||
role_id -> Uuid,
|
||||
granted_by -> Nullable<Uuid>,
|
||||
granted_at -> Timestamptz,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::joinable!(rbac_role_permissions -> rbac_roles (role_id));
|
||||
diesel::joinable!(rbac_role_permissions -> rbac_permissions (permission_id));
|
||||
diesel::joinable!(rbac_user_roles -> users (user_id));
|
||||
diesel::joinable!(rbac_user_roles -> rbac_roles (role_id));
|
||||
diesel::joinable!(rbac_user_groups -> users (user_id));
|
||||
diesel::joinable!(rbac_user_groups -> rbac_groups (group_id));
|
||||
diesel::joinable!(rbac_group_roles -> rbac_groups (group_id));
|
||||
diesel::joinable!(rbac_group_roles -> rbac_roles (role_id));
|
||||
|
||||
diesel::table! {
|
||||
crm_contacts (id) {
|
||||
id -> Uuid,
|
||||
|
|
@ -983,59 +988,61 @@ diesel::table! {
|
|||
barcode -> Nullable<Varchar>,
|
||||
created_at -> Timestamptz,
|
||||
updated_at -> Timestamptz,
|
||||
// Tax and fiscal identification
|
||||
tax_code -> Nullable<Varchar>,
|
||||
tax_class -> Nullable<Varchar>,
|
||||
fiscal_code -> Nullable<Varchar>,
|
||||
origin_code -> Nullable<Int4>,
|
||||
global_trade_number -> Nullable<Varchar>,
|
||||
tax_unit_code -> Nullable<Varchar>,
|
||||
// Detailed dimensions (shipping)
|
||||
net_weight -> Nullable<Numeric>,
|
||||
gross_weight -> Nullable<Numeric>,
|
||||
width -> Nullable<Numeric>,
|
||||
height -> Nullable<Numeric>,
|
||||
length -> Nullable<Numeric>,
|
||||
package_count -> Nullable<Int4>,
|
||||
// Tax rates by type
|
||||
sales_tax_code -> Nullable<Varchar>,
|
||||
sales_tax_rate -> Nullable<Numeric>,
|
||||
excise_tax_code -> Nullable<Varchar>,
|
||||
excise_tax_rate -> Nullable<Numeric>,
|
||||
vat_code -> Nullable<Varchar>,
|
||||
vat_rate -> Nullable<Numeric>,
|
||||
service_tax_code -> Nullable<Varchar>,
|
||||
service_tax_rate -> Nullable<Numeric>,
|
||||
// Marketplace and e-commerce
|
||||
brand -> Nullable<Varchar>,
|
||||
model -> Nullable<Varchar>,
|
||||
color -> Nullable<Varchar>,
|
||||
size -> Nullable<Varchar>,
|
||||
material -> Nullable<Varchar>,
|
||||
gender -> Nullable<Varchar>,
|
||||
// Advanced inventory control
|
||||
warehouse_location -> Nullable<Varchar>,
|
||||
batch_number -> Nullable<Varchar>,
|
||||
expiration_date -> Nullable<Date>,
|
||||
manufacture_date -> Nullable<Date>,
|
||||
min_stock -> Nullable<Int4>,
|
||||
max_stock -> Nullable<Int4>,
|
||||
reorder_point -> Nullable<Int4>,
|
||||
// Detailed pricing
|
||||
sale_price -> Nullable<Numeric>,
|
||||
sale_start -> Nullable<Timestamptz>,
|
||||
sale_end -> Nullable<Timestamptz>,
|
||||
shipping_cost -> Nullable<Numeric>,
|
||||
profit_margin -> Nullable<Numeric>,
|
||||
// // Tax and fiscal identification
|
||||
// tax_code -> Nullable<Varchar>,
|
||||
// tax_class -> Nullable<Varchar>,
|
||||
// fiscal_code -> Nullable<Varchar>,
|
||||
// origin_code -> Nullable<Int4>,
|
||||
// global_trade_number -> Nullable<Varchar>,
|
||||
// tax_unit_code -> Nullable<Varchar>,
|
||||
|
||||
|
||||
// // Detailed dimensions (shipping)
|
||||
// net_weight -> Nullable<Numeric>,
|
||||
// gross_weight -> Nullable<Numeric>,
|
||||
// width -> Nullable<Numeric>,
|
||||
// height -> Nullable<Numeric>,
|
||||
// length -> Nullable<Numeric>,
|
||||
// package_count -> Nullable<Int4>,
|
||||
// // Tax rates by type
|
||||
// sales_tax_code -> Nullable<Varchar>,
|
||||
// sales_tax_rate -> Nullable<Numeric>,
|
||||
// excise_tax_code -> Nullable<Varchar>,
|
||||
// excise_tax_rate -> Nullable<Numeric>,
|
||||
// vat_code -> Nullable<Varchar>,
|
||||
// vat_rate -> Nullable<Numeric>,
|
||||
// service_tax_code -> Nullable<Varchar>,
|
||||
// service_tax_rate -> Nullable<Numeric>,
|
||||
// // Marketplace and e-commerce
|
||||
// brand -> Nullable<Varchar>,
|
||||
// model -> Nullable<Varchar>,
|
||||
// color -> Nullable<Varchar>,
|
||||
// size -> Nullable<Varchar>,
|
||||
// material -> Nullable<Varchar>,
|
||||
// gender -> Nullable<Varchar>,
|
||||
// // Advanced inventory control
|
||||
// warehouse_location -> Nullable<Varchar>,
|
||||
// batch_number -> Nullable<Varchar>,
|
||||
// expiration_date -> Nullable<Date>,
|
||||
// manufacture_date -> Nullable<Date>,
|
||||
// min_stock -> Nullable<Int4>,
|
||||
// max_stock -> Nullable<Int4>,
|
||||
// reorder_point -> Nullable<Int4>,
|
||||
// // Detailed pricing
|
||||
// sale_price -> Nullable<Numeric>,
|
||||
// sale_start -> Nullable<Timestamptz>,
|
||||
// sale_end -> Nullable<Timestamptz>,
|
||||
// shipping_cost -> Nullable<Numeric>,
|
||||
// profit_margin -> Nullable<Numeric>,
|
||||
// Payment gateway integration
|
||||
external_id -> Nullable<Varchar>,
|
||||
external_category_id -> Nullable<Varchar>,
|
||||
external_metadata -> Nullable<Jsonb>,
|
||||
// SEO and search
|
||||
slug -> Nullable<Varchar>,
|
||||
meta_title -> Nullable<Varchar>,
|
||||
meta_description -> Nullable<Text>,
|
||||
tags -> Nullable<Array<Nullable<Text>>>,
|
||||
// external_id -> Nullable<Varchar>,
|
||||
// external_category_id -> Nullable<Varchar>,
|
||||
// external_metadata -> Nullable<Jsonb>,
|
||||
// // SEO and search
|
||||
// slug -> Nullable<Varchar>,
|
||||
// meta_title -> Nullable<Varchar>,
|
||||
// meta_description -> Nullable<Text>,
|
||||
// tags -> Nullable<Array<Nullable<Text>>>,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ pub mod directory;
|
|||
#[cfg(feature = "drive")]
|
||||
pub mod drive;
|
||||
|
||||
#[cfg(feature = "email")]
|
||||
#[cfg(feature = "mail")]
|
||||
pub mod email;
|
||||
|
||||
#[cfg(feature = "instagram")]
|
||||
|
|
@ -427,7 +427,7 @@ async fn run_axum_server(
|
|||
api_router = api_router.merge(crate::meet::configure());
|
||||
}
|
||||
|
||||
#[cfg(feature = "email")]
|
||||
#[cfg(feature = "mail")]
|
||||
{
|
||||
api_router = api_router.merge(crate::email::configure());
|
||||
}
|
||||
|
|
@ -503,7 +503,7 @@ api_router = api_router.merge(crate::video::configure_video_routes());
|
|||
api_router = api_router.merge(crate::social::configure_social_routes());
|
||||
api_router = api_router.merge(crate::social::ui::configure_social_ui_routes());
|
||||
api_router = api_router.merge(crate::learn::ui::configure_learn_ui_routes());
|
||||
#[cfg(feature = "email")]
|
||||
#[cfg(feature = "mail")]
|
||||
{
|
||||
api_router = api_router.merge(crate::email::ui::configure_email_ui_routes());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,59 +48,59 @@ pub struct Product {
|
|||
pub barcode: Option<String>,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
// Tax and fiscal identification
|
||||
pub tax_code: Option<String>,
|
||||
pub tax_class: Option<String>,
|
||||
pub fiscal_code: Option<String>,
|
||||
pub origin_code: Option<i32>,
|
||||
pub global_trade_number: Option<String>,
|
||||
pub tax_unit_code: Option<String>,
|
||||
// Detailed dimensions (shipping)
|
||||
pub net_weight: Option<BigDecimal>,
|
||||
pub gross_weight: Option<BigDecimal>,
|
||||
pub width: Option<BigDecimal>,
|
||||
pub height: Option<BigDecimal>,
|
||||
pub length: Option<BigDecimal>,
|
||||
pub package_count: Option<i32>,
|
||||
// Tax rates by type
|
||||
pub sales_tax_code: Option<String>,
|
||||
pub sales_tax_rate: Option<BigDecimal>,
|
||||
pub excise_tax_code: Option<String>,
|
||||
pub excise_tax_rate: Option<BigDecimal>,
|
||||
pub vat_code: Option<String>,
|
||||
pub vat_rate: Option<BigDecimal>,
|
||||
pub service_tax_code: Option<String>,
|
||||
pub service_tax_rate: Option<BigDecimal>,
|
||||
// Marketplace and e-commerce
|
||||
pub brand: Option<String>,
|
||||
pub model: Option<String>,
|
||||
pub color: Option<String>,
|
||||
pub size: Option<String>,
|
||||
pub material: Option<String>,
|
||||
pub gender: Option<String>,
|
||||
// Advanced inventory control
|
||||
pub warehouse_location: Option<String>,
|
||||
pub batch_number: Option<String>,
|
||||
pub expiration_date: Option<chrono::NaiveDate>,
|
||||
pub manufacture_date: Option<chrono::NaiveDate>,
|
||||
pub min_stock: Option<i32>,
|
||||
pub max_stock: Option<i32>,
|
||||
pub reorder_point: Option<i32>,
|
||||
// Detailed pricing
|
||||
pub sale_price: Option<BigDecimal>,
|
||||
pub sale_start: Option<DateTime<Utc>>,
|
||||
pub sale_end: Option<DateTime<Utc>>,
|
||||
pub shipping_cost: Option<BigDecimal>,
|
||||
pub profit_margin: Option<BigDecimal>,
|
||||
// // Tax and fiscal identification
|
||||
// pub tax_code: Option<String>,
|
||||
// pub tax_class: Option<String>,
|
||||
// pub fiscal_code: Option<String>,
|
||||
// pub origin_code: Option<i32>,
|
||||
// pub global_trade_number: Option<String>,
|
||||
// pub tax_unit_code: Option<String>,
|
||||
// // Detailed dimensions (shipping)
|
||||
// pub net_weight: Option<BigDecimal>,
|
||||
// pub gross_weight: Option<BigDecimal>,
|
||||
// pub width: Option<BigDecimal>,
|
||||
// pub height: Option<BigDecimal>,
|
||||
// pub length: Option<BigDecimal>,
|
||||
// pub package_count: Option<i32>,
|
||||
// // Tax rates by type
|
||||
// pub sales_tax_code: Option<String>,
|
||||
// pub sales_tax_rate: Option<BigDecimal>,
|
||||
// pub excise_tax_code: Option<String>,
|
||||
// pub excise_tax_rate: Option<BigDecimal>,
|
||||
// pub vat_code: Option<String>,
|
||||
// pub vat_rate: Option<BigDecimal>,
|
||||
// pub service_tax_code: Option<String>,
|
||||
// pub service_tax_rate: Option<BigDecimal>,
|
||||
// // Marketplace and e-commerce
|
||||
// pub brand: Option<String>,
|
||||
// pub model: Option<String>,
|
||||
// pub color: Option<String>,
|
||||
// pub size: Option<String>,
|
||||
// pub material: Option<String>,
|
||||
// pub gender: Option<String>,
|
||||
// // Advanced inventory control
|
||||
// pub warehouse_location: Option<String>,
|
||||
// pub batch_number: Option<String>,
|
||||
// pub expiration_date: Option<chrono::NaiveDate>,
|
||||
// pub manufacture_date: Option<chrono::NaiveDate>,
|
||||
// pub min_stock: Option<i32>,
|
||||
// pub max_stock: Option<i32>,
|
||||
// pub reorder_point: Option<i32>,
|
||||
// // Detailed pricing
|
||||
// pub sale_price: Option<BigDecimal>,
|
||||
// pub sale_start: Option<DateTime<Utc>>,
|
||||
// pub sale_end: Option<DateTime<Utc>>,
|
||||
// pub shipping_cost: Option<BigDecimal>,
|
||||
// pub profit_margin: Option<BigDecimal>,
|
||||
// Payment gateway integration
|
||||
pub external_id: Option<String>,
|
||||
pub external_category_id: Option<String>,
|
||||
pub external_metadata: Option<serde_json::Value>,
|
||||
// SEO and search
|
||||
pub slug: Option<String>,
|
||||
pub meta_title: Option<String>,
|
||||
pub meta_description: Option<String>,
|
||||
pub tags: Option<Vec<Option<String>>>,
|
||||
// pub external_id: Option<String>,
|
||||
// pub external_category_id: Option<String>,
|
||||
// pub external_metadata: Option<serde_json::Value>,
|
||||
// // SEO and search
|
||||
// pub slug: Option<String>,
|
||||
// pub meta_title: Option<String>,
|
||||
// pub meta_description: Option<String>,
|
||||
// pub tags: Option<Vec<Option<String>>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Queryable, Insertable, AsChangeset)]
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ use uuid::Uuid;
|
|||
use crate::drive::vectordb::UserDriveVectorDB;
|
||||
#[cfg(feature = "vectordb")]
|
||||
use crate::drive::vectordb::{FileContentExtractor, FileDocument};
|
||||
#[cfg(all(feature = "vectordb", feature = "email"))]
|
||||
#[cfg(all(feature = "vectordb", feature = "mail"))]
|
||||
use crate::email::vectordb::UserEmailVectorDB;
|
||||
#[cfg(all(feature = "vectordb", feature = "email"))]
|
||||
#[cfg(all(feature = "vectordb", feature = "mail"))]
|
||||
use crate::email::vectordb::{EmailDocument, EmailEmbeddingGenerator};
|
||||
use crate::shared::utils::DbPool;
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ struct UserIndexingJob {
|
|||
user_id: Uuid,
|
||||
bot_id: Uuid,
|
||||
workspace: UserWorkspace,
|
||||
#[cfg(all(feature = "vectordb", feature = "email"))]
|
||||
#[cfg(all(feature = "vectordb", feature = "mail"))]
|
||||
email_db: Option<UserEmailVectorDB>,
|
||||
#[cfg(feature = "vectordb")]
|
||||
drive_db: Option<UserDriveVectorDB>,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue