aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2026-02-11 08:46:55 +0200
committerrtkay123 <dev@kanjala.com>2026-02-11 08:46:55 +0200
commit8e75d3af03fdd0e92f00de10eef0af2b093d1c7c (patch)
treedc5f04c3cc495f695a7be8ce79293d49aefdc48e /lib
parent9fd685039613d0e9aa71eabe51d3a6272a3ace21 (diff)
downloadsellershut-8e75d3af03fdd0e92f00de10eef0af2b093d1c7c.tar.bz2
sellershut-8e75d3af03fdd0e92f00de10eef0af2b093d1c7c.zip
feat: jsonb column
Diffstat (limited to 'lib')
-rw-r--r--lib/auth-service/src/service/mod.rs30
-rw-r--r--lib/users-service/Cargo.toml18
-rw-r--r--lib/users-service/src/lib.rs14
3 files changed, 33 insertions, 29 deletions
diff --git a/lib/auth-service/src/service/mod.rs b/lib/auth-service/src/service/mod.rs
index 6d04b67..31c9019 100644
--- a/lib/auth-service/src/service/mod.rs
+++ b/lib/auth-service/src/service/mod.rs
@@ -44,7 +44,7 @@ impl AccountMgr for AuthService {
) -> Result {
let query = sqlx::query!(
"insert into account
- (provider_id, provider_user_id, email, ap_id)
+ (provider_id, provider_user_id, email, user_id)
values
($1, $2, $3, $4)
on conflict (provider_id, provider_user_id)
@@ -131,31 +131,3 @@ impl SessionStore for AuthService {
Ok(())
}
}
-
-async fn create_account_step<'c, E>(
- provider: Provider,
- provider_user_id: &str,
- ap_id: &str,
- email: &str,
- transaction: E,
-) -> Result
-where
- E: Executor<'c, Database = Postgres>,
-{
- sqlx::query!(
- "insert into account
- (provider_id, provider_user_id, email, ap_id)
- values
- ($1, $2, $3, $4)
- on conflict (provider_id, provider_user_id)
- do nothing
- ",
- provider.to_string(),
- provider_user_id,
- email,
- ap_id
- )
- .execute(transaction)
- .await?;
- todo!()
-}
diff --git a/lib/users-service/Cargo.toml b/lib/users-service/Cargo.toml
new file mode 100644
index 0000000..639f4ff
--- /dev/null
+++ b/lib/users-service/Cargo.toml
@@ -0,0 +1,18 @@
+[package]
+name = "users-service"
+version = "0.1.0"
+edition = "2024"
+license.workspace = true
+readme.workspace = true
+documentation.workspace = true
+
+[dependencies]
+async-trait.workspace = true
+secrecy = "0.10.3"
+serde_json = "1.0.149"
+shared-svc = { workspace = true, features = ["cache"] }
+sqlx.workspace = true
+thiserror.workspace = true
+time.workspace = true
+tracing.workspace = true
+url = { workspace = true, features = ["serde"] }
diff --git a/lib/users-service/src/lib.rs b/lib/users-service/src/lib.rs
new file mode 100644
index 0000000..b93cf3f
--- /dev/null
+++ b/lib/users-service/src/lib.rs
@@ -0,0 +1,14 @@
+pub fn add(left: u64, right: u64) -> u64 {
+ left + right
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn it_works() {
+ let result = add(2, 2);
+ assert_eq!(result, 4);
+ }
+}