Fas 1a: product analytics schema + GDPR controls

This commit is contained in:
Sven (AAMOS AI)
2026-08-05 19:21:32 +07:00
parent ac5340195a
commit d627014425
26 changed files with 9039 additions and 14 deletions
+10
View File
@@ -54,6 +54,16 @@ export async function authRoutes(app: FastifyInstance) {
.values({ userId: user.id })
.onConflictDoNothing();
// Product analytics: legitimate interest with opt-out (spec §8, §33).
const consentNow = new Date();
await app.db.insert(schema.userConsents).values({
userId: user.id,
kind: "product_analytics",
status: "granted",
grantedAt: consentNow,
updatedAt: consentNow,
});
// 7 dagars trial utan kort startar direkt (spec §46)
const now = new Date();
await app.db