Rebuild admin pages around DataTable/AdminModal; restructure categories/groups and v2 groups API
Remove the generic $lib/svelte-admin CRUD layer and AdminTable.svelte; each admin route now owns its own form/modal logic. Add DataTable.svelte, superform-errors.ts, and profile-specific modal/field components. Flatten proclamation categories/groups and drop subscription levels; add the v2 groups API; update v1/v2 endpoints, serializers, auth, and regenerated Prisma client with the new migrations. Document the overhaul plan in docs/ADMIN_OVERHAUL.md.
This commit is contained in:
+26
-43
@@ -72,43 +72,26 @@ const colorPalettes: { solfeggioFrequencyId: number; colors: string[] }[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const subscriptionLevels = [
|
||||
{ id: 1, name: 'Basic', description: 'General only' },
|
||||
{ id: 2, name: 'Advanced', description: 'General + Specific' },
|
||||
{ id: 3, name: 'Elite', description: 'General + Specific + Precise' }
|
||||
const proclamationGroups = [
|
||||
{ name: 'General', sortOrder: 0 },
|
||||
{ name: 'Specific', sortOrder: 1 },
|
||||
{ name: 'Precise', sortOrder: 2 },
|
||||
{ name: 'Prayers', sortOrder: 3 },
|
||||
{ name: 'Scripture', sortOrder: 4 }
|
||||
];
|
||||
|
||||
// Flat category list (formerly hierarchical parents).
|
||||
const proclamationCategories = [
|
||||
{ id: 4, name: 'Spiritual', parentId: null },
|
||||
{ id: 5, name: 'General', parentId: 4 },
|
||||
{ id: 9, name: 'Specific', parentId: 4 },
|
||||
{ id: 40, name: 'Precise', parentId: 4 },
|
||||
{ id: 2, name: 'Physical', parentId: null },
|
||||
{ id: 3, name: 'General', parentId: 2 },
|
||||
{ id: 10, name: 'Specific', parentId: 2 },
|
||||
{ id: 32, name: 'Precise', parentId: 2 },
|
||||
{ id: 16, name: 'Mental', parentId: null },
|
||||
{ id: 30, name: 'General', parentId: 16 },
|
||||
{ id: 31, name: 'Specific', parentId: 16 },
|
||||
{ id: 38, name: 'Precise', parentId: 16 },
|
||||
{ id: 17, name: 'Custom (Client Specific)', parentId: null },
|
||||
{ id: 19, name: 'Financial', parentId: null },
|
||||
{ id: 28, name: 'General', parentId: 19 },
|
||||
{ id: 29, name: 'Specific', parentId: 19 },
|
||||
{ id: 37, name: 'Precise', parentId: 19 },
|
||||
{ id: 20, name: 'Emotional', parentId: null },
|
||||
{ id: 24, name: 'General', parentId: 20 },
|
||||
{ id: 26, name: 'Specific', parentId: 20 },
|
||||
{ id: 45, name: 'Precise', parentId: 20 },
|
||||
{ id: 21, name: 'Social', parentId: null },
|
||||
{ id: 22, name: 'General', parentId: 21 },
|
||||
{ id: 23, name: 'Specific', parentId: 21 },
|
||||
{ id: 39, name: 'Precise', parentId: 21 },
|
||||
{ id: 41, name: 'Biblical', parentId: null },
|
||||
{ id: 42, name: 'Personal Growth & Development', parentId: null },
|
||||
{ id: 43, name: 'Prayers', parentId: 41 },
|
||||
{ id: 44, name: 'Scripture', parentId: 41 },
|
||||
{ id: 46, name: 'Sports', parentId: null }
|
||||
{ id: 4, name: 'Spiritual' },
|
||||
{ id: 2, name: 'Physical' },
|
||||
{ id: 16, name: 'Mental' },
|
||||
{ id: 17, name: 'Custom (Client Specific)' },
|
||||
{ id: 19, name: 'Financial' },
|
||||
{ id: 20, name: 'Emotional' },
|
||||
{ id: 21, name: 'Social' },
|
||||
{ id: 41, name: 'Biblical' },
|
||||
{ id: 42, name: 'Personal Growth & Development' },
|
||||
{ id: 46, name: 'Sports' }
|
||||
];
|
||||
|
||||
async function main() {
|
||||
@@ -130,6 +113,15 @@ async function main() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log('Seeding ProclamationGroup...');
|
||||
for (const group of proclamationGroups) {
|
||||
await prisma.proclamationGroup.upsert({
|
||||
where: { name: group.name },
|
||||
create: group,
|
||||
update: group
|
||||
});
|
||||
}
|
||||
|
||||
console.log('Seeding ProclamationCategory...');
|
||||
for (const cat of proclamationCategories) {
|
||||
await prisma.proclamationCategory.upsert({
|
||||
@@ -139,15 +131,6 @@ async function main() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log('Seeding SubscriptionLevel...');
|
||||
for (const level of subscriptionLevels) {
|
||||
await prisma.subscriptionLevel.upsert({
|
||||
where: { id: level.id },
|
||||
create: level,
|
||||
update: level
|
||||
});
|
||||
}
|
||||
|
||||
console.log('Seeding ColorPalette...');
|
||||
for (const palette of colorPalettes) {
|
||||
await prisma.colorPalette.upsert({
|
||||
|
||||
Reference in New Issue
Block a user