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 -1
View File
@@ -1,9 +1,11 @@
const admin = require("firebase-admin");
const { FieldValue } = require("firebase-admin/firestore");
const ORDER_TYPES = {
GIFT: "GIFT",
SONG: "SONG",
COINS: "COINS",
SUBSCRIPTION: "SUBSCRIPTION",
};
const ORDER_STATUS = {
@@ -60,7 +62,7 @@ const createOrderDocument = async ({
type,
amount: normalizedAmount,
songId: type === ORDER_TYPES.SONG ? songId || null : null,
createdAt: admin.firestore.FieldValue.serverTimestamp(),
createdAt: FieldValue.serverTimestamp(),
createdBy: createdBy || "system",
status: ORDER_STATUS.PENDING,
metadata: metadata || {},