Drop the unlimited package, new prices, AI quality note
CI / test (push) Successful in 53s
CI / build (push) Successful in 6m41s
CI / deploy (push) Skipped

- The unlimited package is gone (easy to resell, e.g. by an astrologer):
  catalog, fair-use cap, UNLIMITED_DAILY_LIMIT, /v1/me unlimited_until,
  admin badge. Migration 0014 removes the 'unlimited' entitlements; old
  orders of it are skipped in the header.
- New prices: single 2 000 Ft, couple 4 500, family 8 000, +1 synastry
  2 500, +5 persons 1 500 (list prices 2 000 / 2 500 / 300).
- Login page, packages page and the analysis offer say the analyses are
  written by top AI models, close to a professional astrologer's written
  reading, for a fraction of the price (the packages page names the model).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-18 06:20:31 +00:00
co-authored by Claude Opus 5.5
parent 742b88183b
commit 6d2ad4aa0c
27 changed files with 147 additions and 280 deletions
+4 -20
View File
@@ -33,26 +33,12 @@ pub async fn list_users(
let limit = query.limit.unwrap_or(50).clamp(1, 200);
let offset = query.offset.unwrap_or(0).max(0);
let pattern = query.q.as_deref().map(|q| format!("%{}%", q.trim().replace(['%', '_'], "")));
type Row = (
Uuid,
String,
Option<String>,
Vec<String>,
bool,
OffsetDateTime,
Option<OffsetDateTime>,
i64,
i64,
i64,
Option<OffsetDateTime>,
);
type Row = (Uuid, String, Option<String>, Vec<String>, bool, OffsetDateTime, Option<OffsetDateTime>, i64, i64, i64);
let rows: Vec<Row> = sqlx::query_as(
"SELECT u.id, u.email, u.display_name, u.roles, u.email_verified_at IS NOT NULL, u.created_at, u.last_login_at, \
(SELECT count(*) FROM charts c WHERE c.owner_id = u.id), \
(SELECT COALESCE(SUM(delta), 0)::bigint FROM credit_ledger l WHERE l.user_id = u.id AND l.unit = 'natal'), \
(SELECT COALESCE(SUM(delta), 0)::bigint FROM credit_ledger l WHERE l.user_id = u.id AND l.unit = 'synastry'), \
(SELECT e.expires_at FROM entitlements e \
WHERE e.user_id = u.id AND e.entitlement = 'unlimited' AND e.expires_at > now()) \
(SELECT COALESCE(SUM(delta), 0)::bigint FROM credit_ledger l WHERE l.user_id = u.id AND l.unit = 'synastry') \
FROM users u \
WHERE $1::text IS NULL OR u.email ILIKE $1 OR u.display_name ILIKE $1 \
ORDER BY u.created_at DESC LIMIT $2 OFFSET $3",
@@ -64,12 +50,11 @@ pub async fn list_users(
.await?;
let users: Vec<Value> = rows
.into_iter()
.map(|(id, email, name, roles, verified, created, last_login, charts, natal, synastry, unlimited)| {
.map(|(id, email, name, roles, verified, created, last_login, charts, natal, synastry)| {
json!({
"id": id, "email": email, "display_name": name, "roles": roles, "email_verified": verified,
"created_at": rfc3339(created), "last_login_at": rfc3339_opt(last_login),
"charts": charts, "analyses_left": {"natal": natal, "synastry": synastry},
"unlimited_until": rfc3339_opt(unlimited),
})
})
.collect();
@@ -167,14 +152,13 @@ pub async fn grant_package(
let mut tx = state.db.begin().await?;
let order = packages::grant(&mut tx, id, package, Source::Admin, Some(admin.id()), note.as_deref()).await?;
let balance = credits::balance(&mut tx, id).await?;
let unlimited = packages::unlimited_until(&mut tx, id).await?;
tx.commit().await?;
tracing::info!(admin = %admin.id(), user = %id, package = package.id, "package granted");
Ok((
StatusCode::CREATED,
Json(json!({
"order_id": order, "user_id": id, "package": package.id,
"analyses_left": balance.view(), "unlimited_until": rfc3339_opt(unlimited),
"analyses_left": balance.view(),
})),
))
}