mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 11:11:13 -05:00
Implement all phases sequentially
This commit is contained in:
@@ -40,7 +40,7 @@ export async function submitCompanyCreation(
|
||||
content: {
|
||||
action: 'create'
|
||||
},
|
||||
status: 'pending'
|
||||
status: 'pending' as const
|
||||
})
|
||||
.select()
|
||||
.single();
|
||||
@@ -64,7 +64,7 @@ export async function submitCompanyCreation(
|
||||
company_type: companyType,
|
||||
images: processedImages as unknown as Json
|
||||
},
|
||||
status: 'pending',
|
||||
status: 'pending' as const,
|
||||
order_index: 0
|
||||
});
|
||||
|
||||
@@ -118,7 +118,7 @@ export async function submitCompanyUpdate(
|
||||
action: 'edit',
|
||||
company_id: companyId
|
||||
},
|
||||
status: 'pending'
|
||||
status: 'pending' as const
|
||||
})
|
||||
.select()
|
||||
.single();
|
||||
@@ -143,7 +143,7 @@ export async function submitCompanyUpdate(
|
||||
images: processedImages as unknown as Json
|
||||
},
|
||||
original_data: JSON.parse(JSON.stringify(existingCompany)),
|
||||
status: 'pending',
|
||||
status: 'pending' as const,
|
||||
order_index: 0
|
||||
});
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ export async function resolveConflicts(
|
||||
async function linkToExistingEntity(itemId: string, entityId: string): Promise<void> {
|
||||
await updateSubmissionItem(itemId, {
|
||||
approved_entity_id: entityId,
|
||||
status: 'approved',
|
||||
status: 'approved' as const,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ async function cascadeRejectDependents(
|
||||
// Reject all collected dependents
|
||||
for (const depId of toReject) {
|
||||
await updateSubmissionItem(depId, {
|
||||
status: 'rejected',
|
||||
status: 'rejected' as const,
|
||||
rejection_reason: 'Parent dependency was rejected',
|
||||
});
|
||||
}
|
||||
@@ -152,7 +152,7 @@ async function escalateForAdminReview(
|
||||
const { error } = await supabase
|
||||
.from('content_submissions')
|
||||
.update({
|
||||
status: 'pending',
|
||||
status: 'pending' as const,
|
||||
escalation_reason: reason,
|
||||
escalated_by: userId,
|
||||
updated_at: new Date().toISOString(),
|
||||
|
||||
@@ -27,7 +27,7 @@ export const parkValidationSchema = z.object({
|
||||
slug: z.string().trim().min(1, 'Slug is required').regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens'),
|
||||
description: z.string().trim().max(2000, 'Description must be less than 2000 characters').optional().or(z.literal('')),
|
||||
park_type: z.string().min(1, 'Park type is required'),
|
||||
status: z.string().min(1, 'Status is required'),
|
||||
status: z.enum(['operating', 'closed_permanently', 'closed_temporarily', 'under_construction', 'planned', 'abandoned']),
|
||||
opening_date: z.string().optional().or(z.literal('')).refine((val) => {
|
||||
if (!val) return true;
|
||||
const date = new Date(val);
|
||||
@@ -73,7 +73,7 @@ export const rideValidationSchema = z.object({
|
||||
description: z.string().trim().max(2000, 'Description must be less than 2000 characters').optional().or(z.literal('')),
|
||||
category: z.string().min(1, 'Category is required'),
|
||||
ride_sub_type: z.string().trim().max(100, 'Sub type must be less than 100 characters').optional().or(z.literal('')),
|
||||
status: z.string().min(1, 'Status is required'),
|
||||
status: z.enum(['operating', 'closed_permanently', 'closed_temporarily', 'under_construction', 'relocated', 'stored', 'demolished']),
|
||||
park_id: z.string().uuid().optional().nullable(),
|
||||
designer_id: z.string().uuid().optional().nullable(),
|
||||
opening_date: z.string().optional().or(z.literal('')),
|
||||
|
||||
@@ -136,7 +136,7 @@ export async function approvePhotoSubmission(
|
||||
const { error: updateError } = await supabase
|
||||
.from('content_submissions')
|
||||
.update({
|
||||
status: 'approved',
|
||||
status: 'approved' as const,
|
||||
reviewer_id: config.moderatorId,
|
||||
reviewed_at: new Date().toISOString(),
|
||||
reviewer_notes: config.moderatorNotes,
|
||||
@@ -239,7 +239,7 @@ export async function rejectSubmissionItems(
|
||||
const { error: rejectError } = await supabase
|
||||
.from('submission_items')
|
||||
.update({
|
||||
status: 'rejected',
|
||||
status: 'rejected' as const,
|
||||
rejection_reason: rejectionReason || 'Parent submission rejected',
|
||||
updated_at: new Date().toISOString(),
|
||||
})
|
||||
|
||||
@@ -18,7 +18,7 @@ export const parkRuntimeSchema = z.object({
|
||||
slug: z.string(),
|
||||
description: z.string().nullable().optional(),
|
||||
park_type: z.string(),
|
||||
status: z.string(),
|
||||
status: z.enum(['operating', 'closed_permanently', 'closed_temporarily', 'under_construction', 'planned', 'abandoned']),
|
||||
opening_date: z.string().nullable().optional(),
|
||||
opening_date_precision: z.string().nullable().optional(),
|
||||
closing_date: z.string().nullable().optional(),
|
||||
@@ -51,7 +51,7 @@ export const rideRuntimeSchema = z.object({
|
||||
description: z.string().nullable().optional(),
|
||||
category: z.string(),
|
||||
ride_sub_type: z.string().nullable().optional(),
|
||||
status: z.string(),
|
||||
status: z.enum(['operating', 'closed_permanently', 'closed_temporarily', 'under_construction', 'relocated', 'stored', 'demolished']),
|
||||
park_id: z.string().uuid().nullable().optional(),
|
||||
manufacturer_id: z.string().uuid().nullable().optional(),
|
||||
designer_id: z.string().uuid().nullable().optional(),
|
||||
|
||||
Reference in New Issue
Block a user