Add business registration requests with approval flow, SMS notifications, and owner businesses endpoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-23 18:13:09 +03:30
co-authored by Cursor
parent 97a9ee022f
commit aa990c3204
14 changed files with 611 additions and 3 deletions
@@ -48,6 +48,13 @@ export class BusinessesController {
});
}
@Get('mine')
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(UserRole.ADMIN, UserRole.BUSINESS_OWNER)
findMine(@CurrentUser() user: AuthUser): Promise<BusinessEntity[]> {
return this.service.findMine(user.id);
}
@Get(':id')
findOne(@Param('id') id: string): Promise<BusinessEntity> {
return this.service.findOne(id);
@@ -70,6 +70,14 @@ export class BusinessesService {
return business;
}
async findMine(ownerId: string): Promise<BusinessEntity[]> {
return this.repo.find({
where: { ownerId },
relations: { category: true, images: true },
order: { createdAt: 'DESC' },
});
}
async create(payload: CreateBusinessDto): Promise<BusinessEntity> {
const slugTaken = await this.repo.findOne({ where: { slug: payload.slug } });
if (slugTaken) {