Skip to main content

Frontend Data Field Inventory

This document lists all data fields used across the ChainAlign frontend components, categorized by component and their implied database/API source.

1. Organization Management

frontend/src/components/pages/OrganizationAdminPage.jsx

  • organizations (Array of Objects): Fetched from GET /api/organizations
    • id (maps to tenants.tenant_id)
    • name (maps to tenants.tenant_name)
    • full_name (maps to tenants.full_name)
    • address (maps to tenants.address)
    • admin_name (maps to tenants.admin_name)
    • admin_email (maps to tenants.admin_email)
    • duns_number (maps to tenants.duns_number)
    • industry (maps to tenants.industry)
    • status (maps to tenants.status)
    • license_level (maps to tenants.license_level)
    • max_users (maps to tenants.max_users)
    • allowed_domains (maps to tenants.allowed_domains)
    • created_at (maps to tenants.created_at)
  • selectedOrg (Object): Selected item from organizations array. All fields are same as organizations item.

frontend/src/components/ui/CreateOrganizationForm.jsx

  • orgName (String): Input field, maps to tenants.tenant_name
  • fullName (String): Input field, maps to tenants.full_name
  • address (String): Input field, maps to tenants.address
  • adminName (String): Input field, maps to tenants.admin_name
  • adminEmail (String): Input field, maps to tenants.admin_email
  • dunsNumber (String): Input field, maps to tenants.duns_number
  • industry (String): Input field, maps to tenants.industry
  • user (Object): Prop, from AuthContext (used for creatorUserId, creatorEmail, creatorDisplayName in POST request to /api/organizations)
    • uid (maps to tenants.creator_user_id)
    • email (maps to tenants.creator_email)
    • displayName (maps to tenants.creator_display_name)

frontend/src/components/ui/UserManagementTable.jsx

  • orgId (String): Prop, from OrganizationAdminPage.jsx (selectedOrg.id), maps to tenants.tenant_id
  • orgName (String): Prop, from OrganizationAdminPage.jsx (selectedOrg.name), maps to tenants.tenant_name
  • users (Array of Objects): Mock data currently, will be fetched from backend (e.g., GET /api/users?orgId=...)
    • id (maps to users.user_id)
    • name (maps to users.display_name)
    • email (maps to users.email)
    • role (maps to users.role)

frontend/src/components/ui/DataLinksManager.jsx

  • orgId (String): Prop, from OrganizationAdminPage.jsx (selectedOrg.id), maps to tenants.tenant_id
  • orgName (String): Prop, from OrganizationAdminPage.jsx (selectedOrg.name), maps to tenants.tenant_name
  • linkedCustomers (Array of Objects): Fetched from GET /api/datalinks/${orgId}/linked-customers
    • customer_id (maps to customers.customer_id)
    • customer_name (maps to customers.customer_name)
    • region (maps to customers.region)
  • unlinkedCustomers (Array of Objects): Fetched from GET /api/datalinks/unlinked-customers
    • customer_id (maps to customers.customer_id)
    • customer_name (maps to customers.customer_name)
    • region (maps to customers.region)

2. Dashboard Views

frontend/src/components/pages/PlannerDashboard.jsx

  • dashboardContent (Object): Fetched from GET /api/planner-dashboard
    • contextualNav (Array of Objects)
      • text
      • href
    • urgentTask (Object)
      • label
      • title
      • subtitle
      • buttonText
    • insights (Object)
      • title
      • items (Array of Objects)
        • header
        • description
    • dataReview (Object)
      • title
      • status
      • sections (Array of Objects)
        • name
        • health
        • healthStatus
      • buttonText
    • myNotes (Object)
      • title
      • buttonText
      • notes (Array)
    • teamUpdates (Object)
      • title
      • updates (Array)

frontend/src/components/pages/FinancePartnerDashboard.jsx

  • dashboardContent (Object): Fetched from GET /api/finance-dashboard
    • criticalInsight (Object)
      • label
      • title
      • subtitle
      • primaryAction
      • secondaryAction
    • meetingControl (Object)
      • title
      • dueDate
      • teams (Array of Objects)
        • name
        • status
      • buttonText
      • buttonDisabled
    • intelligenceFeed (Object)
      • title
      • items (Array of Objects)
        • time
        • content
    • performanceSummary (Object)
      • title
      • metrics (Array of Objects)
        • name
        • value
        • status

frontend/src/components/pages/HRPartnerDashboard.jsx

  • dashboardContent (Object): Fetched from GET /api/hr-dashboard
    • criticalInsight (Object)
      • label
      • title
      • subtitle
      • primaryAction
      • secondaryAction
    • meetingControl (Object)
      • title
      • dueDate
      • teams (Array of Objects)
        • name
        • status
      • buttonText
      • buttonDisabled
    • intelligenceFeed (Object)
      • title
      • items (Array of Objects)
        • time
        • content
    • performanceSummary (Object)
      • title
      • metrics (Array of Objects)
        • name
        • value
        • status

frontend/src/components/pages/OrchestratorDashboard.jsx

  • dashboardContent (Object): Fetched from GET /api/orchestrator-dashboard
    • criticalInsight (Object)
      • label
      • title
      • subtitle
      • primaryAction
      • secondaryAction
    • meetingControl (Object)
      • title
      • dueDate
      • teams (Array of Objects)
        • name
        • status
      • buttonText
      • buttonDisabled
    • intelligenceFeed (Object)
      • title
      • items (Array of Objects)
        • time
        • content
  • plan (Object): From PlanContext (live simulation data)
    • grossMargin
    • serviceLevel
    • inventoryValue
    • workingCapital

frontend/src/components/pages/SupplyPlannerDashboard.jsx

  • dashboardContent (Object): Fetched from GET /api/supply-dashboard
    • contextualNav (Array of Objects)
      • text
      • href
    • urgentTask (Object)
      • label
      • title
      • subtitle
      • buttonText
    • insights (Object)
      • title
      • items (Array of Objects)
        • header
        • description
    • dataReview (Object)
      • title
      • status
      • sections (Array of Objects)
        • name
        • health
        • healthStatus
      • buttonText
    • myNotes (Object)
      • title
      • buttonText
    • teamUpdates (Object)
      • title

3. Curation Queue

frontend/src/components/pages/CurationQueuePage.jsx

  • queueItems (Array of Objects): Fetched from GET /curation/queue
    • item_id (maps to curation_queue.item_id)
    • content (maps to curation_queue.content)
    • ai_summary (maps to curation_queue.ai_summary)
    • ai_tags (maps to curation_queue.ai_tags)
    • source_url (maps to curation_queue.source_url)

4. Global User Data

frontend/src/components/layout/Header.js (and AuthContext)

  • user (Object): From AuthContext
    • isChainAlignAdmin (derived from user profile roles)
    • profile (Object, from backend GET /user/user-profile)
      • photo_url
      • display_name
      • email
      • role (maps to users.role or similar)
    • firebase (Object, from Firebase Auth)
      • displayName
      • email
      • uid (maps to users.uid or similar)

5. Database Schema Details

tenants table

CREATE TABLE tenants (
tenant_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_name VARCHAR(255) NOT NULL,
full_name VARCHAR(255),
address VARCHAR(255),
admin_name VARCHAR(255),
admin_email VARCHAR(255),
duns_number VARCHAR(255),
industry VARCHAR(255),
status VARCHAR(50) NOT NULL DEFAULT 'active',
license_level VARCHAR(50) NOT NULL DEFAULT 'standard',
max_users INT DEFAULT 10,
allowed_domains TEXT[],
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
creator_user_id VARCHAR(255),
creator_email VARCHAR(255),
creator_display_name VARCHAR(255)
);

curation_queue table

CREATE TABLE curation_queue (
item_id SERIAL PRIMARY KEY,
content TEXT NOT NULL,
ai_summary TEXT,
ai_tags JSONB DEFAULT '{}',
status VARCHAR(50) NOT NULL DEFAULT 'pending',
source_url VARCHAR(2048),
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

users table

CREATE TABLE users (
user_id VARCHAR(255) PRIMARY KEY,
tenant_id UUID REFERENCES tenants(tenant_id),
email VARCHAR(100) UNIQUE NOT NULL,
display_name VARCHAR(100),
photo_url TEXT,
role VARCHAR(50) NOT NULL DEFAULT 'user',
preferences JSONB DEFAULT '{}',
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
last_login_at TIMESTAMP WITH TIME ZONE
);

customers table

CREATE TABLE customers (
customer_id VARCHAR(50) PRIMARY KEY,
customer_name VARCHAR(100),
region VARCHAR(50)
);