first commit

This commit is contained in:
Leonardo
2026-02-18 22:36:45 -03:00
parent ec6b6ef53a
commit 676042268b
122 changed files with 26354 additions and 1615 deletions
+31
View File
@@ -0,0 +1,31 @@
// src/stores/saasHealthStore.js
import { defineStore } from 'pinia'
import { supabase } from '@/lib/supabase/client'
export const useSaasHealthStore = defineStore('saasHealth', {
state: () => ({
mismatchCount: 0,
loading: false,
lastLoadedAt: null
}),
actions: {
async loadMismatchCount ({ force = false } = {}) {
if (this.loading) return
if (!force && this.lastLoadedAt && (Date.now() - this.lastLoadedAt) < 30_000) return // cache 30s
this.loading = true
try {
const { count, error } = await supabase
.from('v_subscription_feature_mismatch')
.select('*', { count: 'exact', head: true })
if (error) throw error
this.mismatchCount = Number(count || 0)
this.lastLoadedAt = Date.now()
} finally {
this.loading = false
}
}
}
})