feat(admin,sms): implement full pattern management CRUD and live binding directly from admin panel

This commit is contained in:
parsa aghaei committed 2026-08-16 11:52:13 +03:30
1 parent 09fd339e89
commit 0934b4f3af
4 files changed
+868 -35

No files matched your search

@@ -158,5 +158,39 @@ export class SettingsController {
) {
return this.settingsService.testSms(phone, patternId, args);
}
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('Admin')
@ApiBearerAuth()
@Get('sms/patterns')
@ApiOperation({ summary: 'دریافت لیست تمامی پترن‌های تعریف شده در ملی پیامک' })
getPatterns() {
return this.settingsService.getPatterns();
}
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('Admin')
@ApiBearerAuth()
@Post('sms/patterns')
@ApiOperation({ summary: 'درج الگوی جدید در سامانه ملی پیامک' })
addPattern(
@Body('title') title: string,
@Body('body') body: string,
@Body('blackListId') blackListId?: number,
) {
return this.settingsService.addPattern(title, body, blackListId);
}
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('Admin')
@ApiBearerAuth()
@Put('sms/patterns/:bodyId')
@ApiOperation({ summary: 'ویرایش الگوی رد شده یا در حال ویرایش در ملی پیامک' })
editPattern(
@Param('bodyId') bodyId: string,
@Body('body') body: string,
) {
return this.settingsService.editPattern(Number(bodyId), body);
}
}