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:
@@ -392,13 +392,12 @@ export const ModelName = {
|
||||
UserRole: 'UserRole',
|
||||
Verification: 'Verification',
|
||||
Proclamation: 'Proclamation',
|
||||
ProclamationGroup: 'ProclamationGroup',
|
||||
UserProclamations: 'UserProclamations',
|
||||
SolfeggioFrequency: 'SolfeggioFrequency',
|
||||
ProclamationCategory: 'ProclamationCategory',
|
||||
ProclamationCategorySubscriptionLevel: 'ProclamationCategorySubscriptionLevel',
|
||||
LicenseKey: 'LicenseKey',
|
||||
ApiKey: 'ApiKey',
|
||||
SubscriptionLevel: 'SubscriptionLevel',
|
||||
ColorPalette: 'ColorPalette'
|
||||
} as const
|
||||
|
||||
@@ -415,7 +414,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
omit: GlobalOmitOptions
|
||||
}
|
||||
meta: {
|
||||
modelProps: "user" | "profile" | "address" | "session" | "account" | "userRole" | "verification" | "proclamation" | "userProclamations" | "solfeggioFrequency" | "proclamationCategory" | "proclamationCategorySubscriptionLevel" | "licenseKey" | "apiKey" | "subscriptionLevel" | "colorPalette"
|
||||
modelProps: "user" | "profile" | "address" | "session" | "account" | "userRole" | "verification" | "proclamation" | "proclamationGroup" | "userProclamations" | "solfeggioFrequency" | "proclamationCategory" | "licenseKey" | "apiKey" | "colorPalette"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -1011,6 +1010,80 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
ProclamationGroup: {
|
||||
payload: Prisma.$ProclamationGroupPayload<ExtArgs>
|
||||
fields: Prisma.ProclamationGroupFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.ProclamationGroupFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.ProclamationGroupFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.ProclamationGroupFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.ProclamationGroupFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.ProclamationGroupFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.ProclamationGroupCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.ProclamationGroupCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.ProclamationGroupCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.ProclamationGroupDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.ProclamationGroupUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.ProclamationGroupDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.ProclamationGroupUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.ProclamationGroupUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.ProclamationGroupUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationGroupPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.ProclamationGroupAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateProclamationGroup>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.ProclamationGroupGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ProclamationGroupGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.ProclamationGroupCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ProclamationGroupCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
UserProclamations: {
|
||||
payload: Prisma.$UserProclamationsPayload<ExtArgs>
|
||||
fields: Prisma.UserProclamationsFieldRefs
|
||||
@@ -1233,80 +1306,6 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
ProclamationCategorySubscriptionLevel: {
|
||||
payload: Prisma.$ProclamationCategorySubscriptionLevelPayload<ExtArgs>
|
||||
fields: Prisma.ProclamationCategorySubscriptionLevelFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ProclamationCategorySubscriptionLevelPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateProclamationCategorySubscriptionLevel>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ProclamationCategorySubscriptionLevelGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.ProclamationCategorySubscriptionLevelCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ProclamationCategorySubscriptionLevelCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
LicenseKey: {
|
||||
payload: Prisma.$LicenseKeyPayload<ExtArgs>
|
||||
fields: Prisma.LicenseKeyFieldRefs
|
||||
@@ -1455,80 +1454,6 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
SubscriptionLevel: {
|
||||
payload: Prisma.$SubscriptionLevelPayload<ExtArgs>
|
||||
fields: Prisma.SubscriptionLevelFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.SubscriptionLevelFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.SubscriptionLevelFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.SubscriptionLevelFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.SubscriptionLevelFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.SubscriptionLevelFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.SubscriptionLevelCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.SubscriptionLevelCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.SubscriptionLevelCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.SubscriptionLevelDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.SubscriptionLevelUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.SubscriptionLevelDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.SubscriptionLevelUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.SubscriptionLevelUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.SubscriptionLevelUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SubscriptionLevelPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.SubscriptionLevelAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateSubscriptionLevel>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.SubscriptionLevelGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.SubscriptionLevelGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.SubscriptionLevelCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.SubscriptionLevelCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
ColorPalette: {
|
||||
payload: Prisma.$ColorPalettePayload<ExtArgs>
|
||||
fields: Prisma.ColorPaletteFieldRefs
|
||||
@@ -1659,6 +1584,7 @@ export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof User
|
||||
export const ProfileScalarFieldEnum = {
|
||||
id: 'id',
|
||||
userId: 'userId',
|
||||
email: 'email',
|
||||
firstName: 'firstName',
|
||||
lastName: 'lastName',
|
||||
phoneNumber: 'phoneNumber',
|
||||
@@ -1744,12 +1670,21 @@ export const ProclamationScalarFieldEnum = {
|
||||
content: 'content',
|
||||
solfeggioFrequencyId: 'solfeggioFrequencyId',
|
||||
categoryId: 'categoryId',
|
||||
subscriptionLevelId: 'subscriptionLevelId'
|
||||
groupId: 'groupId'
|
||||
} as const
|
||||
|
||||
export type ProclamationScalarFieldEnum = (typeof ProclamationScalarFieldEnum)[keyof typeof ProclamationScalarFieldEnum]
|
||||
|
||||
|
||||
export const ProclamationGroupScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
sortOrder: 'sortOrder'
|
||||
} as const
|
||||
|
||||
export type ProclamationGroupScalarFieldEnum = (typeof ProclamationGroupScalarFieldEnum)[keyof typeof ProclamationGroupScalarFieldEnum]
|
||||
|
||||
|
||||
export const UserProclamationsScalarFieldEnum = {
|
||||
userId: 'userId',
|
||||
proclamationId: 'proclamationId',
|
||||
@@ -1772,27 +1707,18 @@ export type SolfeggioFrequencyScalarFieldEnum = (typeof SolfeggioFrequencyScalar
|
||||
export const ProclamationCategoryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
sortOrder: 'sortOrder',
|
||||
parentId: 'parentId'
|
||||
sortOrder: 'sortOrder'
|
||||
} as const
|
||||
|
||||
export type ProclamationCategoryScalarFieldEnum = (typeof ProclamationCategoryScalarFieldEnum)[keyof typeof ProclamationCategoryScalarFieldEnum]
|
||||
|
||||
|
||||
export const ProclamationCategorySubscriptionLevelScalarFieldEnum = {
|
||||
categoryId: 'categoryId',
|
||||
subscriptionLevelId: 'subscriptionLevelId'
|
||||
} as const
|
||||
|
||||
export type ProclamationCategorySubscriptionLevelScalarFieldEnum = (typeof ProclamationCategorySubscriptionLevelScalarFieldEnum)[keyof typeof ProclamationCategorySubscriptionLevelScalarFieldEnum]
|
||||
|
||||
|
||||
export const LicenseKeyScalarFieldEnum = {
|
||||
id: 'id',
|
||||
key: 'key',
|
||||
active: 'active',
|
||||
level: 'level',
|
||||
userId: 'userId'
|
||||
userId: 'userId',
|
||||
email: 'email'
|
||||
} as const
|
||||
|
||||
export type LicenseKeyScalarFieldEnum = (typeof LicenseKeyScalarFieldEnum)[keyof typeof LicenseKeyScalarFieldEnum]
|
||||
@@ -1810,15 +1736,6 @@ export const ApiKeyScalarFieldEnum = {
|
||||
export type ApiKeyScalarFieldEnum = (typeof ApiKeyScalarFieldEnum)[keyof typeof ApiKeyScalarFieldEnum]
|
||||
|
||||
|
||||
export const SubscriptionLevelScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description'
|
||||
} as const
|
||||
|
||||
export type SubscriptionLevelScalarFieldEnum = (typeof SubscriptionLevelScalarFieldEnum)[keyof typeof SubscriptionLevelScalarFieldEnum]
|
||||
|
||||
|
||||
export const ColorPaletteScalarFieldEnum = {
|
||||
solfeggioFrequencyId: 'solfeggioFrequencyId',
|
||||
colors: 'colors'
|
||||
@@ -2067,13 +1984,12 @@ export type GlobalOmitConfig = {
|
||||
userRole?: Prisma.UserRoleOmit
|
||||
verification?: Prisma.VerificationOmit
|
||||
proclamation?: Prisma.ProclamationOmit
|
||||
proclamationGroup?: Prisma.ProclamationGroupOmit
|
||||
userProclamations?: Prisma.UserProclamationsOmit
|
||||
solfeggioFrequency?: Prisma.SolfeggioFrequencyOmit
|
||||
proclamationCategory?: Prisma.ProclamationCategoryOmit
|
||||
proclamationCategorySubscriptionLevel?: Prisma.ProclamationCategorySubscriptionLevelOmit
|
||||
licenseKey?: Prisma.LicenseKeyOmit
|
||||
apiKey?: Prisma.ApiKeyOmit
|
||||
subscriptionLevel?: Prisma.SubscriptionLevelOmit
|
||||
colorPalette?: Prisma.ColorPaletteOmit
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user