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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user