DashboardNotifications
Purpose
The DashboardNotifications collection stores notifications sent to users through the dashboard. Each document contains details about the notification type, subject, action, related product or variant, recipient, status, and timestamps. This collection enables tracking, displaying, and managing user notifications within the dashboard interface.
Document schema
{
"accountRef": "string",
"action": "string",
"productRef": "string",
"readTime": "string",
"sendTime": "string",
"status": "string",
"subject": "string",
"type": "string",
"variantRef": "string"
}
Indexes
- accountRef is a
stringthat refers to the ID ofProfilescollection; - productRef is a
stringthat refers to the ID ofProductscollection; - variantRef is a
stringthat refers to the ID ofVariantscollection;
Query examples
// Fetch the Reference Doc from Firebase
const dashNotificationRefDoc = doc(db, "DashboardNotifications", dashNotificationId);
// Get the Document Snapshot from the Reference Doc
const dashNotificationRefSnap = await getDoc(dashNotificationRefDoc);
// Query for dashboard notifications by type
const dashNotificationByType = query(
collection(db, "DashboardNotifications"),
where("type", "==", "Require review")
);