Payments/subscriptions support (#943)

* [wip] Payments/subscriptions support

* finish

* working payment flow

* finish subscriptions, lint, clippy, etc

* docker compose
This commit is contained in:
Geometrically
2024-08-14 17:14:52 -07:00
committed by GitHub
parent 60edbcd5f0
commit 1d0d8d7fbe
71 changed files with 4009 additions and 1101 deletions

View File

@@ -358,8 +358,8 @@ impl Project {
",
id as ProjectId,
)
.fetch_many(&mut **transaction)
.try_filter_map(|e| async { Ok(e.right().map(|x| ThreadId(x.id))) })
.fetch(&mut **transaction)
.map_ok(|x| ThreadId(x.id))
.try_collect::<Vec<_>>()
.await?;
@@ -443,8 +443,8 @@ impl Project {
",
project.inner.team_id as TeamId,
)
.fetch_many(&mut **transaction)
.try_filter_map(|e| async { Ok(e.right().map(|x| UserId(x.user_id))) })
.fetch(&mut **transaction)
.map_ok(|x| UserId(x.user_id))
.try_collect::<Vec<_>>()
.await?;
@@ -874,19 +874,17 @@ impl Project {
",
id as ProjectId
)
.fetch_many(exec)
.try_filter_map(|e| async {
Ok(e.right().map(|x| {
(
x.dependency_id.map(VersionId),
if x.mod_id == Some(0) {
None
} else {
x.mod_id.map(ProjectId)
},
x.mod_dependency_id.map(ProjectId),
)
}))
.fetch(exec)
.map_ok(|x| {
(
x.dependency_id.map(VersionId),
if x.mod_id == Some(0) {
None
} else {
x.mod_id.map(ProjectId)
},
x.mod_dependency_id.map(ProjectId),
)
})
.try_collect::<Dependencies>()
.await?;