Skip to main content
Version: 1.0.0

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 string that refers to the ID of Profiles collection;
  • productRef is a string that refers to the ID of Products collection;
  • variantRef is a string that refers to the ID of Variants collection;

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")
);