Add lessons domain Phase 1: instructor and lesson type entities

Foundation tables for the lessons module with full CRUD, pagination,
search, and sorting. Includes migration, Drizzle schema, Zod validation,
services, routes, and 23 integration tests.
This commit is contained in:
Ryan Moon
2026-03-30 09:17:32 -05:00
parent 145eb0efce
commit 5dbe837c08
10 changed files with 603 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
-- Phase 1: Lessons foundation — instructor + lesson_type tables
CREATE TYPE "lesson_format" AS ENUM ('private', 'group');
CREATE TABLE "instructor" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
"user_id" uuid REFERENCES "user"("id"),
"display_name" varchar(255) NOT NULL,
"bio" text,
"instruments" text[],
"is_active" boolean NOT NULL DEFAULT true,
"created_at" timestamptz NOT NULL DEFAULT now(),
"updated_at" timestamptz NOT NULL DEFAULT now()
);
CREATE TABLE "lesson_type" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
"name" varchar(255) NOT NULL,
"instrument" varchar(100),
"duration_minutes" integer NOT NULL,
"lesson_format" lesson_format NOT NULL DEFAULT 'private',
"base_rate_monthly" varchar(20),
"is_active" boolean NOT NULL DEFAULT true,
"created_at" timestamptz NOT NULL DEFAULT now(),
"updated_at" timestamptz NOT NULL DEFAULT now()
);

View File

@@ -197,6 +197,13 @@
"when": 1774870000000,
"tag": "0027_generalize_terminology",
"breakpoints": true
},
{
"idx": 28,
"version": "7",
"when": 1774880000000,
"tag": "0028_lessons_foundation",
"breakpoints": true
}
]
}