continue subscriptions and coins

This commit is contained in:
Thomas Demirdjian
2025-11-05 15:39:15 +01:00
parent a58eeac079
commit 5f777f3b6d
25 changed files with 1994 additions and 222 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
const admin = require("firebase-admin");
const { FieldValue } = require("firebase-admin/firestore");
const { onSchedule } = require("firebase-functions/v2/scheduler");
const { refList } = require("../index");
const firestore = refList.projects.firestore;
@@ -71,11 +72,11 @@ exports.snapshotMonthlyTopSongs = onSchedule(
},
topProjects,
totalProjects: topProjects.length,
updatedAt: admin.firestore.FieldValue.serverTimestamp(),
updatedAt: FieldValue.serverTimestamp(),
};
if (!existingSnapshot.exists) {
payload.createdAt = admin.firestore.FieldValue.serverTimestamp();
payload.createdAt = FieldValue.serverTimestamp();
}
await docRef.set(payload, { merge: true });