- Create Economist SubmissionTracking package correctly: * mainArticle = full blog post content * coverLetter = 216-word SIR— letter * Links to blog post via blogPostId - Archive 'Letter to The Economist' from blog posts (it's the cover letter) - Fix date display on article cards (use published_at) - Target publication already displaying via blue badge Database changes: - Make blogPostId optional in SubmissionTracking model - Economist package ID: 68fa85ae49d4900e7f2ecd83 - Le Monde package ID: 68fa2abd2e6acd5691932150 Next: Enhanced modal with tabs, validation, export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
78 lines
2.6 KiB
JavaScript
78 lines
2.6 KiB
JavaScript
#!/usr/bin/env node
|
|
require('dotenv').config();
|
|
|
|
const { connect, close } = require('../src/utils/db.util');
|
|
const Document = require('../src/models/Document.model');
|
|
|
|
async function main() {
|
|
await connect();
|
|
|
|
// Query all documents with valid categories (including archived)
|
|
const { MongoClient } = require('mongodb');
|
|
const client = new MongoClient(process.env.MONGO_URI || 'mongodb://localhost:27017');
|
|
|
|
try {
|
|
await client.connect();
|
|
const db = client.db(process.env.MONGO_DB || 'tractatus_dev');
|
|
const collection = db.collection('documents');
|
|
|
|
const docs = await collection.find({
|
|
category: {
|
|
$in: ['getting-started', 'technical-reference', 'research-theory',
|
|
'advanced-topics', 'case-studies', 'business-leadership', 'archives']
|
|
}
|
|
}).sort({ category: 1, order: 1 }).toArray();
|
|
|
|
console.log(`\n${'='.repeat(70)}`);
|
|
console.log(`COMPLETE VERIFICATION - All 34 Public Documents`);
|
|
console.log(`${'='.repeat(70)}\n`);
|
|
console.log(`Total documents: ${docs.length}\n`);
|
|
|
|
const byCategory = {};
|
|
docs.forEach(doc => {
|
|
const cat = doc.category;
|
|
if (!byCategory[cat]) byCategory[cat] = [];
|
|
byCategory[cat].push(doc);
|
|
});
|
|
|
|
const categoryOrder = ['getting-started', 'technical-reference', 'research-theory',
|
|
'advanced-topics', 'case-studies', 'business-leadership', 'archives'];
|
|
|
|
categoryOrder.forEach(cat => {
|
|
if (byCategory[cat]) {
|
|
const docsInCat = byCategory[cat].sort((a, b) => (a.order || 999) - (b.order || 999));
|
|
console.log(`\n${'━'.repeat(70)}`);
|
|
console.log(`${cat.toUpperCase().replace(/-/g, ' ')} (${docsInCat.length} docs)`);
|
|
console.log(`${'━'.repeat(70)}`);
|
|
|
|
docsInCat.forEach(doc => {
|
|
const sections = doc.sections ? doc.sections.length : 0;
|
|
const sectionStatus = sections > 0 ? `✅ ${sections} sections` : `❌ No sections`;
|
|
const visibility = doc.visibility || 'public';
|
|
const visLabel = visibility === 'archived' ? ' [ARCHIVED]' : '';
|
|
console.log(`${doc.order}. ${doc.title}${visLabel}`);
|
|
console.log(` ${doc.slug} | ${sectionStatus}`);
|
|
});
|
|
}
|
|
});
|
|
|
|
console.log(`\n${'='.repeat(70)}`);
|
|
console.log(`Total: ${docs.length} documents`);
|
|
|
|
if (docs.length === 34) {
|
|
console.log('✅ SUCCESS - All 34 expected documents present');
|
|
} else {
|
|
console.log(`⚠️ MISMATCH - Expected 34, found ${docs.length}`);
|
|
}
|
|
|
|
console.log(`${'='.repeat(70)}\n`);
|
|
|
|
await client.close();
|
|
await close();
|
|
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
}
|
|
}
|
|
|
|
main();
|