[package]
name = "data-persistence-service"
version = "0.1.2"
edition = "2024"
authors = ["Lv, Qi <lvsoft@gmail.com>"]
default-run = "data-persistence-service-server"

[lib]
name = "data_persistence_service"
path = "src/lib.rs"

[[bin]]
name = "data-persistence-service-server"
path = "src/main.rs"

[[bin]]
name = "api-cli"
path = "src/bin/api-cli.rs"
# The cli feature is not yet compatible with the new architecture.
# required-features = ["service_kit/api-cli"] 

[dependencies]
service_kit = { version = "0.1.2", default-features = true }
anyhow = "1.0"
rmcp = { version = "0.8.5", features = [
    "transport-streamable-http-server",
    "transport-worker"
] }
common-contracts = { path = "../common-contracts" }

# Web framework
axum = "0.8"
tokio = { version = "1.0", features = ["full"] }
tower-http = { version = "0.6.6", features = ["cors", "trace"] }
tower = { version = "0.5", features = ["util"] }

# Observability
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# OpenAPI & Schema
utoipa = { version = "5.4", features = ["axum_extras", "chrono", "uuid"] }
utoipa-swagger-ui = { version = "9.0", features = ["axum"] }

# Environment variables
dotenvy = "0.15"

# Error Handling
thiserror = "2.0.17"

# Database
sqlx = { version = "0.8.6", features = [ "runtime-tokio-rustls", "postgres", "chrono", "uuid", "json", "rust_decimal" ] }
rust_decimal = { version = "1.36", features = ["serde"] }
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["serde", "v4"] }

# WASM CLI UI
rust-embed = "8.7"
axum-embed = "0.1.0"

[dev-dependencies]
http-body-util = "0.1"
tower = { version = "0.5", features = ["util"] }

# Feature 管理：默认全部启用，可选择性关闭
[features]
default = ["swagger-ui"]
swagger-ui = []
wasm-cli = []
# 让模板的 `mcp` 特性联动 service_kit 的 mcp 功能
mcp = ["service_kit/mcp"]
# 可选：透传 api-cli 给 service_kit
# api-cli = ["service_kit/api-cli"]
# full-data = []

# --- For Local Development ---
# If you are developing `service_kit` locally, uncomment the following lines
# in your project's `.cargo/config.toml` file (create it if it doesn't exist)
# to make Cargo use your local version instead of the one from git.
#
# [patch.'https://github.com/lvsoft/service_kit']
# service_kit = { path = "../service_kit" } # Note: Adjust the path if your directory structure is different.
