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

@@ -108,15 +108,13 @@ impl Category {
ORDER BY c.ordering, c.category
"
)
.fetch_many(exec)
.try_filter_map(|e| async {
Ok(e.right().map(|c| Category {
id: CategoryId(c.id),
category: c.category,
project_type: c.project_type,
icon: c.icon,
header: c.category_header
}))
.fetch(exec)
.map_ok(|c| Category {
id: CategoryId(c.id),
category: c.category,
project_type: c.project_type,
icon: c.icon,
header: c.category_header
})
.try_collect::<Vec<Category>>()
.await?;
@@ -166,13 +164,11 @@ impl LinkPlatform {
SELECT id, name, donation FROM link_platforms
"
)
.fetch_many(exec)
.try_filter_map(|e| async {
Ok(e.right().map(|c| LinkPlatform {
id: LinkPlatformId(c.id),
name: c.name,
donation: c.donation,
}))
.fetch(exec)
.map_ok(|c| LinkPlatform {
id: LinkPlatformId(c.id),
name: c.name,
donation: c.donation,
})
.try_collect::<Vec<LinkPlatform>>()
.await?;
@@ -222,8 +218,8 @@ impl ReportType {
SELECT name FROM report_types
"
)
.fetch_many(exec)
.try_filter_map(|e| async { Ok(e.right().map(|c| c.name)) })
.fetch(exec)
.map_ok(|c| c.name)
.try_collect::<Vec<String>>()
.await?;
@@ -272,8 +268,8 @@ impl ProjectType {
SELECT name FROM project_types
"
)
.fetch_many(exec)
.try_filter_map(|e| async { Ok(e.right().map(|c| c.name)) })
.fetch(exec)
.map_ok(|c| c.name)
.try_collect::<Vec<String>>()
.await?;