feat(05-02): add SearchProvider backend with model, CRUD, and defaults

- Prisma model SearchProvider with userId/tenantId scoping
- Three default providers (Google/Bing/DuckDuckGo) as constants, always returned without DB seed
- GET/POST/DELETE search-providers endpoints on DashboardController
- Ownership verification on delete (T-05-07), default providers cannot be deleted
- CreateSearchProviderDto with class-validator: urlTemplate must contain {query} (T-05-08)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 11:34:45 +02:00
parent dd0209898b
commit 38dcfdfa6d
4 changed files with 151 additions and 0 deletions
@@ -0,0 +1,18 @@
import { IsNotEmpty, IsString, Matches } from 'class-validator';
/**
* DTO for creating a custom search provider (D-15).
* urlTemplate must contain {query} placeholder for the search term.
*/
export class CreateSearchProviderDto {
@IsString()
@IsNotEmpty()
name!: string;
@IsString()
@IsNotEmpty()
@Matches(/\{query\}/, {
message: 'urlTemplate must contain {query}',
})
urlTemplate!: string;
}