# Seed Script Verification Checklist

## Overview
This document verifies that all required schema fields are properly seeded in `scripts/seed.mjs`.

---

## ✅ Settings Schema Verification

### General Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `storeName` | String | Yes | ✅ | "Storify" |
| `storeDescription` | String | Yes | ✅ | "Multi-vendor E-commerce Platform" |
| `storeEmail` | String | Yes | ✅ | "support@storify.com" |
| `storePhone` | String | Yes | ✅ | "+1 555-0100" |
| `storeAddress` | String | Yes | ✅ | "123 Main Street, New York, NY 10001" |
| `logoUrl` | String | No | ✅ | `LOCAL_ASSET_PATHS.logos.main` → "/logo.png" |
| `darkModeLogoUrl` | String | No | ✅ | `LOCAL_ASSET_PATHS.logos.dark` → "/logo-dark.png" |
| `faviconUrl` | String | No | ✅ | `""` (admin-uploaded; no bundled icon ships) |
| `defaultLanguage` | String | Yes | ✅ | "en" |
| `defaultCurrency` | String | Yes | ✅ | "USD" |
| `supportedLanguages` | String[] | Yes | ✅ | 9 languages |
| `supportedCurrencies` | String[] | Yes | ✅ | 5 currencies |
| `timezone` | String | Yes | ✅ | "America/New_York" |

**Status: ✅ COMPLETE**

---

### Appearance Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `primaryColor` | String | No | ✅ | "#2065D1" |
| `secondaryColor` | String | No | ✅ | "#8b5cf6" |
| `accentColor` | String | No | ✅ | "#f59e0b" |
| `theme` | Enum | No | ✅ | "system" |
| `contrast` | Boolean | No | ✅ | false |
| `rtl` | Boolean | No | ✅ | false |
| `compact` | Boolean | No | ✅ | false |
| `navLayout` | Enum | No | ✅ | "mini" |
| `navColor` | Enum | No | ✅ | "integrate" |
| `presetColor` | String | No | ✅ | "default" |

**Status: ✅ COMPLETE**

---

### Payment Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `stripe.enabled` | Boolean | No | ✅ | false |
| `stripe.publishableKey` | String | No | ✅ | "" |
| `stripe.secretKey` | String | No | ✅ | "" |
| `stripe.webhookSecret` | String | No | ✅ | "" |
| `paypal.enabled` | Boolean | No | ✅ | false |
| `paypal.clientId` | String | No | ✅ | "" |
| `paypal.clientSecret` | String | No | ✅ | "" |
| `paypal.mode` | Enum | No | ✅ | "sandbox" |
| `razorpay.enabled` | Boolean | No | ✅ | false |
| `paystack.enabled` | Boolean | No | ✅ | false |
| `cod.enabled` | Boolean | No | ✅ | true |
| `cod.instructions` | String | No | ✅ | "Pay with cash..." |
| `cod.minOrderAmount` | Number | No | ✅ | 0 |

**Status: ✅ COMPLETE**

---

### Email Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `provider` | Enum | No | ✅ | "smtp" |
| `enabled` | Boolean | No | ✅ | false |
| `smtp.host` | String | No | ✅ | undefined |
| `smtp.port` | Number | No | ✅ | 587 |
| `smtp.secure` | Boolean | No | ✅ | false |
| `smtp.auth.user` | String | No | ❌ | Missing |
| `smtp.auth.pass` | String | No | ❌ | Missing |
| `fromEmail` | String | No | ✅ | "no-reply@storify.com" |
| `fromName` | String | No | ✅ | "Storify" |

**Status: ⚠️ PARTIAL - SMTP auth credentials missing**

---

### Order Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `prefix` | String | No | ✅ | "ORD" |
| `taxRate` | Number | No | ✅ | 8 |
| `freeShippingThreshold` | Number | No | ✅ | 0 |
| `defaultShippingCost` | Number | No | ✅ | 5 |
| `commission.vendorRate` | Number | No | ✅ | 10 |
| `commission.minWithdrawalAmount` | Number | No | ✅ | 50 |

**Status: ✅ COMPLETE**

---

### Shipping Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `enabled` | Boolean | No | ✅ | true |
| `origin.country` | String | No | ✅ | "USA" |
| `origin.state` | String | No | ✅ | "NY" |
| `origin.city` | String | No | ✅ | "New York" |
| `origin.postalCode` | String | No | ✅ | "10001" |
| `origin.address1` | String | No | ✅ | "123 Main Street" |
| `origin.address2` | String | No | ❌ | Missing |
| `origin.phone` | String | No | ❌ | Missing |
| `delivery.processingDaysMin` | Number | No | ✅ | 1 |
| `delivery.processingDaysMax` | Number | No | ✅ | 2 |
| `delivery.showEstimatedDelivery` | Boolean | No | ✅ | true |
| `zones` | Array | No | ✅ | 1 US zone with 2 rates |
| `fallbackRate.enabled` | Boolean | No | ✅ | true |
| `fallbackRate.name` | String | No | ✅ | "Standard" |
| `fallbackRate.price` | Number | No | ✅ | 9.99 |
| `fallbackRate.minDays` | Number | No | ✅ | 5 |
| `fallbackRate.maxDays` | Number | No | ✅ | 10 |
| `localPickup.enabled` | Boolean | No | ✅ | false |

**Status: ⚠️ PARTIAL - Origin address2 and phone missing**

---

### SEO Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `metaTitle` | String | No | ✅ | "Storify - Multi-vendor E-commerce" |
| `metaDescription` | String | No | ✅ | "Shop premium products..." |
| `metaKeywords` | String | No | ✅ | "ecommerce, multi-vendor..." |
| `ogImage` | String | No | ✅ | `""` (admin-uploaded; no bundled image ships) |

**Status: ✅ COMPLETE**

---

### Social Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `facebook` | String | No | ✅ | {} (empty) |
| `twitter` | String | No | ✅ | {} (empty) |
| `instagram` | String | No | ✅ | {} (empty) |
| `youtube` | String | No | ✅ | {} (empty) |

**Status: ✅ COMPLETE**

---

### Analytics Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `googleAnalyticsId` | String | No | ✅ | {} (empty) |
| `googleTagManagerId` | String | No | ✅ | {} (empty) |
| `facebookPixelId` | String | No | ✅ | {} (empty) |

**Status: ✅ COMPLETE**

---

### Maintenance Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `enabled` | Boolean | No | ✅ | false |
| `allowedIPs` | String[] | No | ✅ | [] (empty) |
| `message` | String | No | ❌ | Missing |

**Status: ⚠️ PARTIAL - Maintenance message missing**

---

### Security Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `emailVerificationRequired` | Boolean | No | ✅ | false |
| `emailVerificationForVendors` | Boolean | No | ✅ | false |
| `twoFactorEnabled` | Boolean | No | ✅ | true |
| `twoFactorRequiredForAdmin` | Boolean | No | ✅ | false |
| `twoFactorRequiredForVendors` | Boolean | No | ✅ | false |
| `googleOAuthEnabled` | Boolean | No | ✅ | false |
| `facebookOAuthEnabled` | Boolean | No | ✅ | false |
| `sessionMaxAgeDays` | Number | No | ✅ | 7 |
| `maxLoginAttempts` | Number | No | ✅ | 5 |
| `lockoutDurationMinutes` | Number | No | ✅ | 15 |
| `minPasswordLength` | Number | No | ✅ | 8 |
| `requireUppercase` | Boolean | No | ✅ | false |
| `requireNumbers` | Boolean | No | ✅ | false |
| `requireSpecialChars` | Boolean | No | ✅ | false |
| `rateLimiting` | Object | No | ✅ | Complete rate limit config |

**Status: ✅ COMPLETE**

---

### POS Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `enabled` | Boolean | No | ✅ | true |
| `allowAdminSales` | Boolean | No | ✅ | true |
| `allowVendorSales` | Boolean | No | ✅ | true |
| `allowSellerSales` | Boolean | No | ✅ | true |
| `language` | String | No | ✅ | "en" |
| `customize.smartGridEnabled` | Boolean | No | ✅ | true |
| `customize.lockScreenTimeoutMinutes` | Number | No | ✅ | 5 |
| `customize.printedReceiptsEnabled` | Boolean | No | ✅ | false |
| `customize.customerDisplayEnabled` | Boolean | No | ✅ | false |
| `customize.soundEnabled` | Boolean | No | ✅ | true |
| `customize.soundVolume` | Number | No | ✅ | 50 |
| `customize.soundAddToCart` | Boolean | No | ✅ | true |
| `customize.soundOrderComplete` | Boolean | No | ✅ | true |
| `customize.soundPayment` | Boolean | No | ✅ | true |
| `customize.soundError` | Boolean | No | ✅ | true |
| `checkout.paymentMethods` | String[] | No | ✅ | ["cash", "card"] |
| `checkout.customerReceiptSelectionEnabled` | Boolean | No | ✅ | false |
| `checkout.offlinePaymentsEnabled` | Boolean | No | ✅ | false |
| `orders.orderNumberPrefix` | String | No | ✅ | "POS" |
| `orders.returnRules.enabled` | Boolean | No | ✅ | true |
| `orders.returnRules.windowDays` | Number | No | ✅ | 30 |
| `orders.returnRules.allowWithoutReceipt` | Boolean | No | ✅ | false |

**Status: ✅ COMPLETE**

---

### Multi-Vendor Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `enabled` | Boolean | No | ✅ | true |
| `canManageProducts` | Boolean | No | ✅ | true |
| `canViewOrders` | Boolean | No | ✅ | true |
| `canManageOrders` | Boolean | No | ✅ | true |
| `canManageStoreSettings` | Boolean | No | ✅ | true |
| `canViewAnalytics` | Boolean | No | ✅ | true |
| `canManagePayouts` | Boolean | No | ✅ | true |
| `canAccessPOS` | Boolean | No | ✅ | true |

**Status: ✅ COMPLETE**

---

### Storage Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `provider` | Enum | No | ✅ | "cloudflare_r2" |
| `region` | String | No | ✅ | "auto" |
| `maxFileSizeMB` | Number | No | ✅ | 20 |
| `maxImageSizeMB` | Number | No | ✅ | 20 |
| `maxVideoSizeMB` | Number | No | ✅ | 1024 |
| `maxModelSizeMB` | Number | No | ✅ | 500 |
| `pathPrefix` | String | No | ✅ | "uploads/" |

**Status: ✅ COMPLETE**

---

### AI Sales Agent Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `enabled` | Boolean | No | ✅ | false |
| `model` | String | No | ✅ | "gpt-5-mini" |
| `temperature` | Number | No | ✅ | 0.3 |
| `reasoningEffort` | Enum | No | ✅ | "minimal" |
| `maxRecommendations` | Number | No | ✅ | 4 |
| `agentName` | String | No | ✅ | "Sales AI" |
| `greeting` | String | No | ✅ | "Hi! I can help you..." |
| `tone` | Enum | No | ✅ | "friendly" |
| `escalationMessage` | String | No | ✅ | "I can connect you..." |
| `widget.position` | Enum | No | ✅ | "bottom-right" |
| `widget.primaryColor` | String | No | ✅ | "#7c3aed" |
| `widget.accentColor` | String | No | ✅ | "#a855f7" |
| `widget.footerText` | String | No | ✅ | "Powered by AI" |
| `capabilities.productQA` | Boolean | No | ✅ | true |
| `capabilities.recommendations` | Boolean | No | ✅ | true |
| `capabilities.cartActions` | Boolean | No | ✅ | true |
| `capabilities.checkoutHandoff` | Boolean | No | ✅ | true |
| `capabilities.orderStatus` | Boolean | No | ✅ | true |

**Status: ✅ COMPLETE**

---

### Home Page Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `sectionOrder` | String[] | No | ✅ | All 9 sections |
| `sections.hero.visible` | Boolean | No | ✅ | true |
| `sections.hero.slides` | Array | No | ✅ | 1 slide |
| `sections.featuredCategories.visible` | Boolean | No | ✅ | true |
| `sections.featuredCategories.title` | String | No | ✅ | "Featured Categories." |
| `sections.featuredCategories.limit` | Number | No | ✅ | 8 |
| `sections.newArrivals.visible` | Boolean | No | ✅ | true |
| `sections.newArrivals.title` | String | No | ✅ | "Products on Sale." |
| `sections.newArrivals.desktopColumns` | Number | No | ✅ | 4 |
| `sections.promotionsOffers.visible` | Boolean | No | ✅ | true |
| `sections.promotionsOffers.cards` | Array | No | ✅ | 5 cards |
| `sections.topVendors.visible` | Boolean | No | ✅ | true |
| `sections.topVendors.title` | String | No | ✅ | "Top Vendors" |
| `sections.topVendors.limit` | Number | No | ✅ | 8 |
| `sections.featuredProducts.visible` | Boolean | No | ✅ | true |
| `sections.topArticles.visible` | Boolean | No | ✅ | true |
| `sections.topArticles.title` | String | No | ✅ | "Top Articles" |
| `sections.topArticles.limit` | Number | No | ✅ | 9 |
| `sections.topArticles.desktopColumns` | Number | No | ✅ | 4 |
| `sections.becomeVendor.visible` | Boolean | No | ✅ | true |
| `sections.becomeVendor.title` | String | No | ✅ | "Start Selling With Us Today" |
| `sections.becomeVendor.subtitle` | String | No | ✅ | "Join our marketplace..." |
| `sections.becomeVendor.buttonLabel` | String | No | ✅ | "Become a Vendor" |
| `sections.becomeVendor.buttonHref` | String | No | ✅ | "/become-vendor" |
| `sections.fromInstagram.visible` | Boolean | No | ✅ | true |
| `sections.fromInstagram.title` | String | No | ✅ | "From Instagram" |
| `sections.fromInstagram.items` | Array | No | ✅ | 5 items |

**Status: ✅ COMPLETE**

---

### Content Pages Settings
| Field | Type | Required | Seeded | Value |
|-------|------|----------|--------|-------|
| `terms.title` | String | No | ✅ | "Terms of Service" |
| `terms.content` | String | No | ✅ | HTML content |
| `terms.visible` | Boolean | No | ✅ | true |
| `privacy.title` | String | No | ✅ | "Privacy Policy" |
| `privacy.content` | String | No | ✅ | HTML content |
| `privacy.visible` | Boolean | No | ✅ | true |
| `cookies.title` | String | No | ✅ | "Cookie Policy" |
| `cookies.content` | String | No | ✅ | HTML content |
| `cookies.visible` | Boolean | No | ✅ | true |
| `accessibility.title` | String | No | ✅ | "Accessibility" |
| `accessibility.content` | String | No | ✅ | HTML content |
| `accessibility.visible` | Boolean | No | ✅ | true |
| `faq.title` | String | No | ✅ | "Frequently Asked Questions" |
| `faq.subtitle` | String | No | ✅ | "Find quick answers..." |
| `faq.visible` | Boolean | No | ✅ | true |
| `faq.items` | Array | No | ✅ | 3 FAQ items |
| `customPages` | Array | No | ✅ | [] (empty) |

**Status: ✅ COMPLETE**

---

## 📋 Summary

### Total Fields: 120+
### ✅ Fully Seeded: 115+
### ⚠️ Partial/Missing: 5

### Missing Fields to Address:
1. **Email Settings**: `smtp.auth.user`, `smtp.auth.pass`
2. **Shipping Origin**: `origin.address2`, `origin.phone`
3. **Maintenance**: `message`

---

## 🔍 How to Verify in Database

After running `npm run seed`, check the settings collection:

```javascript
// MongoDB Shell
db.settings.findOne()

// Check specific fields
db.settings.findOne({}, {
  "general.storeName": 1,
  "general.logoUrl": 1,
  "general.darkModeLogoUrl": 1,
  "general.faviconUrl": 1,
  "seo.ogImage": 1
})
```

### Expected Output:
```json
{
  "_id": ObjectId("..."),
  "general": {
    "storeName": "Storify",
    "logoUrl": "/logo.png",
    "darkModeLogoUrl": "/logo-dark.png",
    "faviconUrl": ""
  },
  "seo": {
    "ogImage": ""
  }
}
```

---

## 🛠️ If Fields Are Missing

If the logo fields are not appearing after seeding:

1. **Clear the database**: `npm run seed:reset`
2. **Check MongoDB connection**: Ensure MongoDB is running
3. **Verify the seed script runs**: Check console logs
4. **Manually add via admin**: Update settings through UI

### Manual Fix (if needed):
```javascript
db.settings.updateOne(
  {},
  {
    $set: {
      "general.logoUrl": "/logo.png",
      "general.darkModeLogoUrl": "/logo-dark.png",
      "general.faviconUrl": "",
      "seo.ogImage": ""
    }
  }
)
```

---

## 📝 Files Created/Modified

| File | Purpose | Status |
|------|---------|--------|
| `scripts/seed.mjs` | Main seed script | ✅ Updated |
| `lib/media.ts` | Media utilities & asset paths | ✅ Created |
| `lib/remote-image-domains.ts` | Remote image domain config | ✅ Created |
| `components/ui/app-image.tsx` | Next.js Image wrapper | ✅ Updated |
| `next.config.ts` | Remote patterns configured | ✅ Verified |
| `docs/DUAL_ORIGIN_MEDIA_STRATEGY.md` | Documentation | ✅ Created |
| `docs/SEED_VERIFICATION.md` | This checklist | ✅ Created |

---

Last Updated: 2026-05-16
