Add authentication guards and API documentation to admin and restaurant controllers; update restaurant service for soft delete; enhance database seeder with new permissions and roles

This commit is contained in:
2025-11-18 00:37:43 +03:30
parent e2b2a746f7
commit 746769a735
5 changed files with 94 additions and 18 deletions
@@ -51,7 +51,17 @@ export class RestaurantsService {
return restaurant;
}
remove(id: number) {
return `This action removes a #${id} restaurant`;
async remove(id: string) {
// Soft delete the restaurant by setting isActive to false
const restaurant = await this.restRepository.findOne({ id });
if (!restaurant) {
throw new NotFoundException(RestMessage.NOT_FOUND);
}
restaurant.isActive = false;
await this.em.persistAndFlush(restaurant);
return restaurant;
}
}