functions

This commit is contained in:
Thomas Demirdjian
2025-11-03 13:47:07 +01:00
parent 460c91f1e6
commit 7b3a47090d
16 changed files with 23868 additions and 2399 deletions
+20 -5
View File
@@ -4,18 +4,33 @@ const admin = require("firebase-admin");
// Avoid bundling a service account key and hardcoding project/bucket.
admin.initializeApp();
const db = admin.firestore();
exports.db = db;
exports.refList = {
projects: admin.firestore().collection("projects"),
playlists: admin.firestore().collection("playlists"),
tasks: admin.firestore().collection("tasks"),
notifications: admin.firestore().collection("notifications"),
users: admin.firestore().collection("users"),
projects: db.collection("projects"),
playlists: db.collection("playlists"),
tasks: db.collection("tasks"),
notifications: db.collection("notifications"),
users: db.collection("users"),
projectStreamStats: db.collection("projectStreamStats"),
projectStreamStatsMonthlyTotals: db.collection(
"projectStreamStatsMonthlyTotals",
),
monthlyPayoutEntries: db.collection("monthlyPayoutEntries"),
monthlyPayouts: db.collection("monthlyPayouts"),
};
exports.ALERT_TYPE = {
NEW_LIKE: "NEW_LIKE",
NEW_COMMENT: "NEW_COMMENT",
NEW_FOLLOWER: "NEW_FOLLOWER",
MUSIC_GENERATION_SUCCESS: "MUSIC_GENERATION_SUCCESS",
MUSIC_GENERATION_FAILED: "MUSIC_GENERATION_FAILED",
COVER_GENERATION_SUCCESS: "COVER_GENERATION_SUCCESS",
COVER_GENERATION_FAILED: "COVER_GENERATION_FAILED",
PAYOUT_AVAILABLE: "PAYOUT_AVAILABLE",
};
// Exporter toutes les fonctions