Fix ride model submission constraint

This commit is contained in:
gpt-engineer-app[bot]
2025-10-10 18:11:05 +00:00
parent 93e908aef7
commit 0aee7673ec

View File

@@ -682,18 +682,20 @@ Deno.serve(async (req) => {
// Get manufacturer dependency for depends_on
const mfgItemId = createdSubmissionItems.manufacturer.length > 0 ? randomItem(createdSubmissionItems.manufacturer) : undefined;
const category = randomItem(['roller_coaster', 'flat_ride', 'water_ride']);
const modelData: any = {
name: `Test Model ${i + 1}`,
slug: `test-model-${i + 1}`,
category: category,
manufacturer_id: mfgData?.id || null
};
const category = randomItem(['roller_coaster', 'flat_ride', 'water_ride']);
const rideType = randomItem(['spinning', 'launch', 'suspended', 'family', 'standard']);
const modelData: any = {
name: `Test Model ${i + 1}`,
slug: `test-model-${i + 1}`,
category: category,
ride_type: rideType,
manufacturer_id: mfgData?.id || null
};
if (level >= 1) {
modelData.description = `Popular ${category.replace('_', ' ')} model.`;
modelData.ride_type = randomItem(['spinning', 'launch', 'suspended', 'family']);
}
if (level >= 1) {
modelData.description = `Popular ${category.replace('_', ' ')} model.`;
}
if (level >= 2) {
modelData.card_image_id = `test-model-card-${i + 1}`;