Generate complete CRUD (Create, Read, Update, Delete) operations for a database entity.
Generate complete CRUD operations including model, service, controller, DTOs, and tests for any database entity. Use this when you need to scaffold a full API endpoint with best practices.
/plugin marketplace add anton-abyzov/specweave/plugin install sw-backend@specweaveGenerate complete CRUD (Create, Read, Update, Delete) operations for a database entity.
You are an expert backend developer. Generate a complete CRUD implementation for a specified entity/model with:
// Example for TypeORM
@Entity()
export class Product {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column()
name: string;
@Column('decimal', { precision: 10, scale: 2 })
price: number;
@Column({ type: 'text', nullable: true })
description: string;
@CreateDateColumn()
createdAt: Date;
@UpdateDateColumn()
updatedAt: Date;
}
export class ProductService {
async create(dto: CreateProductDto): Promise<Product> { }
async findAll(query: QueryDto): Promise<PaginatedResponse<Product>> { }
async findById(id: string): Promise<Product> { }
async update(id: string, dto: UpdateProductDto): Promise<Product> { }
async delete(id: string): Promise<void> { }
}
// REST endpoints
POST /api/products - Create
GET /api/products - List (with pagination/filtering)
GET /api/products/:id - Get by ID
PUT /api/products/:id - Update
PATCH /api/products/:id - Partial update
DELETE /api/products/:id - Delete
User: "Generate CRUD for Product entity with name, price, description"
Result: Complete model, service, controller, DTOs, tests for Product