"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateCombinedSeedDataJson = generateCombinedSeedDataJson;
exports.generateTestDataJson = generateTestDataJson;
function collectSeedData(context) {
    const data = {};
    for (const model of context.models.values()) {
        if (model.seedData.data.length === 0) {
            continue;
        }
        data[model._conjugated.camelCasePlural] = model.seedData.data;
    }
    return data;
}
/**
 * Generates a combined JSON file containing all seed data across all models.
 * This file can be used by `SeedMigration_JsonSeed` to seed the database from JSON
 * instead of Excel.
 */
function generateCombinedSeedDataJson(context) {
    return JSON.stringify(collectSeedData(context), null, 2);
}
/**
 * Generates a scenario-based test data JSON file for E2E testing.
 * Each scenario contains a complete dataset that can be used to seed the database
 * for a specific test context.
 *
 * Format:
 * ```json
 * {
 *   "scenarios": {
 *     "default": {
 *       "description": "Default seed data",
 *       "data": { "modelName": [...] }
 *     },
 *     "empty": {
 *       "description": "Empty database",
 *       "data": {}
 *     }
 *   }
 * }
 * ```
 */
function generateTestDataJson(context) {
    const testData = {
        scenarios: {
            default: {
                description: 'Default seed data — contains all generated seed data for all models.',
                data: collectSeedData(context),
            },
            empty: {
                description: 'Empty database — clean slate for testing empty states.',
                data: {},
            },
        },
    };
    return JSON.stringify(testData, null, 2);
}
//# sourceMappingURL=json-seed-data.generator.js.map