fix(all): resolve wallet callback validation, card-to-card conditional rendering, pet management tab, withdrawal settings, smart advisor loop, reports chart and announcement config
Deploy Canina / deploy (push) Successful in 1m47s
Deploy Canina / deploy (push) Successful in 1m47s
This commit is contained in:
1 parent
b807d25632
commit
d9254e9b01
14 files changed
+533
-77
No files matched your search
@@ -31,4 +31,19 @@ export class ZibalCallbackQueryDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
hashedCardNumber?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'نوع پرداخت (ORDER یا WALLET_TOPUP)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
type?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'مبلغ تراکنش' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
amount?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'پیام تراکنش' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
message?: string;
|
||||
}
|
||||
@@ -10,7 +10,14 @@ import {
|
||||
Req,
|
||||
HttpStatus,
|
||||
Query,
|
||||
UseInterceptors,
|
||||
UploadedFile,
|
||||
BadRequestException,
|
||||
} from '@nestjs/common';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { diskStorage } from 'multer';
|
||||
import { extname, join } from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { PetsService } from './pets.service';
|
||||
import { CreatePetDto } from './dto/create-pet.dto';
|
||||
import { UpdatePetDto } from './dto/update-pet.dto';
|
||||
@@ -78,6 +85,37 @@ export class PetsController {
|
||||
},
|
||||
},
|
||||
})
|
||||
@Post('upload-image')
|
||||
@UseInterceptors(
|
||||
FileInterceptor('file', {
|
||||
storage: diskStorage({
|
||||
destination: (req, file, cb) => {
|
||||
const dir = join(process.cwd(), 'uploads', 'pets');
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
}
|
||||
cb(null, dir);
|
||||
},
|
||||
filename: (req, file, cb) => {
|
||||
const randomName = Array(32)
|
||||
.fill(null)
|
||||
.map(() => Math.round(Math.random() * 16).toString(16))
|
||||
.join('');
|
||||
cb(null, `${randomName}${extname(file.originalname)}`);
|
||||
},
|
||||
}),
|
||||
limits: { fileSize: 10 * 1024 * 1024 }, // 10MB
|
||||
}),
|
||||
)
|
||||
@ApiOperation({ summary: 'آپلود تصویر حیوان خانگی' })
|
||||
uploadPetImage(@UploadedFile() file: Express.Multer.File) {
|
||||
if (!file) {
|
||||
throw new BadRequestException('فایلی ارسال نشده است');
|
||||
}
|
||||
const url = `/uploads/pets/${file.filename}`;
|
||||
return { url, filename: file.filename };
|
||||
}
|
||||
|
||||
create(
|
||||
@Req() req: { user: { id: string } },
|
||||
@Body() createPetDto: CreatePetDto,
|
||||
|
||||
Reference in new issue
Block a user