feat(sprint-4/etapa-2): migración persistencia proceso/grupos/settings a Supabase
- Scripts SQL 002-004: process_groups, processes, app_settings con RLS - supabaseProcessRepo: save/getById/getAll/delete con mapeo camelCase↔snake_case y limpieza Dexie en delete (actividades/gateways/resources/simulations) - supabaseGroupRepo: save/getAll/getById/delete; FK ON DELETE SET NULL en processes - supabaseSettingsRepo: get/update sobre fila singleton - Stores actualizados: library-store y process-store usan repos Supabase para procesos (actividades/gateways/recursos siguen en Dexie hasta Etapa 3-4) - ImportPage y useReportData actualizados a supabaseProcessRepo - userId inyectado internamente en repos via supabase.auth.getSession() — no se threadea por la call stack; stores mantienen interfaces sin cambios - 561/561 tests verdes, build limpio Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,8 @@ import { UploadCloud, FileText, Loader2, FlaskConical } from 'lucide-react'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { Card, CardContent } from '@/components/ui/card'
|
||||
import { parseBpmnXml, extractActivityElements, extractGatewayElements, BpmnParseError } from '@/domain/bpmn-parser'
|
||||
import { processRepo, activityRepo, gatewayRepo } from '@/persistence/repositories'
|
||||
import { activityRepo, gatewayRepo } from '@/persistence/repositories'
|
||||
import { supabaseProcessRepo } from '@/persistence/supabase/process-repo'
|
||||
import type { Process, Activity, GatewayConfig } from '@/domain/types'
|
||||
import { bpmnTypeToGatewayType } from '@/domain/types'
|
||||
import { useToast } from '@/components/ui/use-toast'
|
||||
@@ -112,7 +113,7 @@ export function ImportPage() {
|
||||
})
|
||||
|
||||
await Promise.all([
|
||||
processRepo.save(process),
|
||||
supabaseProcessRepo.save(process),
|
||||
activityRepo.saveMany(activities),
|
||||
gatewayRepo.saveMany(gateways),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user