Build API v2

This commit is contained in:
NeilClack
2026-08-07 14:06:20 -05:00
parent b2091deae0
commit 64f7070ad7
50 changed files with 25534 additions and 26502 deletions
@@ -0,0 +1,7 @@
-- CreateTable
CREATE TABLE "ColorPalette" (
"solfeggioFrequencyId" INTEGER NOT NULL,
"colors" JSONB NOT NULL,
CONSTRAINT "ColorPalette_pkey" PRIMARY KEY ("solfeggioFrequencyId")
);
+10
View File
@@ -193,4 +193,14 @@ model SubscriptionLevel {
description String?
proclamations Proclamation[]
categoryLevels ProclamationCategorySubscriptionLevel[]
}
// Portal-editable 7-color palette per canonical solfeggio frequency id (1-9).
// `solfeggioFrequencyId` is the canonical id the kiosk uses (see
// v2-serializers.ts), not the DB autoincrement id of `SolfeggioFrequency`.
model ColorPalette {
solfeggioFrequencyId Int @id
colors Json // ["#RRGGBB", ... x7]
@@map("ColorPalette")
}
+58 -1
View File
@@ -21,7 +21,55 @@ const solfeggioFrequencies = [
{ id: 4, name: 'Heart', value: 639 },
{ id: 5, name: 'Solar Plexus', value: 528 },
{ id: 6, name: 'Sacral', value: 417 },
{ id: 7, name: 'Root', value: 396 }
{ id: 7, name: 'Root', value: 396 },
// Canonical frequencies missing from the original 7-row set. Kept as
// separate rows (with distinct unique names) so the canonical id mapping
// in v2-serializers.ts can resolve 1-9 without renumbering v1 rows.
{ id: 8, name: 'Grounding / Relief', value: 174 },
{ id: 9, name: 'Relief', value: 285 },
{ id: 10, name: 'Clarity / Wellbeing', value: 432 },
{ id: 11, name: 'Crown 963', value: 963 }
];
// Canonical id -> 7-color palette, matching the kiosk's
// DatabaseManager::seedColorPalettes() (radiantwave-rebuild).
const colorPalettes: { solfeggioFrequencyId: number; colors: string[] }[] = [
{
solfeggioFrequencyId: 1,
colors: ['#8B6914', '#B8860B', '#DAA520', '#E8B64C', '#FFD700', '#FFE9A8', '#FFF4CC']
},
{
solfeggioFrequencyId: 2,
colors: ['#8B0000', '#B22222', '#DC143C', '#FF6347', '#FF8C69', '#FFA500', '#FFDAB9']
},
{
solfeggioFrequencyId: 3,
colors: ['#FF4500', '#FF7F50', '#FF8C00', '#FFA500', '#FFC87F', '#FFDFBA', '#FFEBCD']
},
{
solfeggioFrequencyId: 4,
colors: ['#8B2252', '#CD3278', '#DB7093', '#FF69B4', '#FFB6C1', '#FFC0CB', '#FFE4E1']
},
{
solfeggioFrequencyId: 5,
colors: ['#32CD32', '#3CB371', '#90EE90', '#98FB98', '#ADFFA9', '#C8FFD2', '#F0FFF0']
},
{
solfeggioFrequencyId: 6,
colors: ['#00FF7F', '#00CED1', '#40E0D0', '#5F9EA0', '#7FFFD4', '#AFEEEE', '#E0FFFF']
},
{
solfeggioFrequencyId: 7,
colors: ['#00BFFF', '#1E90FF', '#4169E1', '#6495ED', '#87CEEB', '#ADD8E6', '#F0F8FF']
},
{
solfeggioFrequencyId: 8,
colors: ['#4B0082', '#9370DB', '#8A2BE2', '#7B68EE', '#DA70D6', '#D8BFD8', '#E6E6FA']
},
{
solfeggioFrequencyId: 9,
colors: ['#9400D3', '#BA55D3', '#C71585', '#DDA0DD', '#EE82EE', '#FFF0F5', '#FAF0FA']
}
];
const subscriptionLevels = [
@@ -100,6 +148,15 @@ async function main() {
});
}
console.log('Seeding ColorPalette...');
for (const palette of colorPalettes) {
await prisma.colorPalette.upsert({
where: { solfeggioFrequencyId: palette.solfeggioFrequencyId },
create: palette,
update: palette
});
}
console.log('Seed complete.');
}