36 lines
1.0 KiB
Markdown
36 lines
1.0 KiB
Markdown
|
|
# Task ID: 38
|
||
|
|
|
||
|
|
**Title:** Add priority field to PromptRequest schema
|
||
|
|
|
||
|
|
**Status:** done
|
||
|
|
|
||
|
|
**Dependencies:** 37 ✓
|
||
|
|
|
||
|
|
**Priority:** high
|
||
|
|
|
||
|
|
**Description:** Extend the Prisma schema for the PromptRequest model to include the priority field (integer 1-10, default 5) to match the Prompt model.
|
||
|
|
|
||
|
|
**Details:**
|
||
|
|
|
||
|
|
1. Update `/src/db/prisma/schema.prisma` to add to PromptRequest:
|
||
|
|
- `priority Int @default(5)`
|
||
|
|
|
||
|
|
2. Create Prisma migration:
|
||
|
|
```bash
|
||
|
|
pnpm --filter db exec prisma migrate dev --name add-promptrequest-priority
|
||
|
|
```
|
||
|
|
|
||
|
|
3. Update the `CreatePromptRequestSchema` in `/src/mcpd/src/validation/prompt.schema.ts` to include priority validation:
|
||
|
|
```typescript
|
||
|
|
priority: z.number().int().min(1).max(10).default(5).optional(),
|
||
|
|
```
|
||
|
|
|
||
|
|
4. Update TypeScript types in shared package
|
||
|
|
|
||
|
|
**Test Strategy:**
|
||
|
|
|
||
|
|
- Unit test: Migration creates priority column with default 5
|
||
|
|
- Unit test: PromptRequest creation with explicit priority
|
||
|
|
- Unit test: PromptRequest creation uses default priority when not specified
|
||
|
|
- Unit test: Validation rejects priority outside 1-10 range
|