This commit is contained in:
2026-08-28 17:31:02 +02:00
commit 2b30e8bd39
694 changed files with 49243 additions and 0 deletions
@@ -0,0 +1,62 @@
import {
Body,
Controller,
Get,
Patch,
Post,
UploadedFile,
UseGuards,
UseInterceptors
} from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import { JwtGuard } from '../../../guards/JwtGuard';
import { shopFaviconFilePipe, shopFaviconUploadOptions } from '../config/shopFaviconUpload';
import { shopLogoFilePipe, shopLogoUploadOptions } from '../config/shopLogoUpload';
import { ConnectSimplexNotificationsDto } from '../dto/ConnectSimplexNotificationsDto';
import { UpdateNotificationsDto } from '../dto/UpdateNotificationsDto';
import { UpdateShippingNoteDto } from '../dto/UpdateShippingNoteDto';
import { UpdateSimplexLinkDto } from '../dto/UpdateSimplexLinkDto';
import { ShopSettingsService } from '../services/ShopSettingsService';
@Controller('shop-settings')
@UseGuards(JwtGuard)
export class ShopSettingsController {
constructor(private readonly shopSettingsService: ShopSettingsService) {}
@Get('/')
get() {
return this.shopSettingsService.getView();
}
@Patch('/simplex-link')
updateSimplexLink(@Body() dto: UpdateSimplexLinkDto) {
return this.shopSettingsService.updateSimplexLink(dto);
}
@Patch('/shipping-note')
updateShippingNote(@Body() dto: UpdateShippingNoteDto) {
return this.shopSettingsService.updateShippingNote(dto);
}
@Patch('/notifications')
updateNotifications(@Body() dto: UpdateNotificationsDto) {
return this.shopSettingsService.updateNotifications(dto);
}
@Post('/simplex-connect')
connectSimplexNotifications(@Body() dto: ConnectSimplexNotificationsDto) {
return this.shopSettingsService.connectSimplexNotifications(dto.simplexNotificationLink);
}
@Post('/logo')
@UseInterceptors(FileInterceptor('file', shopLogoUploadOptions))
uploadLogo(@UploadedFile(shopLogoFilePipe) file: Express.Multer.File) {
return this.shopSettingsService.uploadLogo(file.filename);
}
@Post('/favicon')
@UseInterceptors(FileInterceptor('file', shopFaviconUploadOptions))
uploadFavicon(@UploadedFile(shopFaviconFilePipe) file: Express.Multer.File) {
return this.shopSettingsService.uploadFavicon(file.filename);
}
}