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 _ = require("lodash");
const { refList, db, ALERT_TYPE } = require("../index");
@@ -123,7 +124,7 @@ exports.distributeMonthlyPayouts = onSchedule(
totalStreams: userData.totalStreams,
projects: userData.projects,
computedAt: now,
updatedAt: admin.firestore.FieldValue.serverTimestamp(),
updatedAt: FieldValue.serverTimestamp(),
},
};
});
@@ -195,7 +196,7 @@ exports.distributeMonthlyPayouts = onSchedule(
totalAllocated: _.round(_.sumBy(payouts, "amount"), 2),
payouts,
status: payouts.length ? "computed" : "no-data",
updatedAt: admin.firestore.FieldValue.serverTimestamp(),
updatedAt: FieldValue.serverTimestamp(),
computedAt: now,
};