feat(admin): implement smart pricing, rounding rules, formula margins and bulk price adjustment
This commit is contained in:
1 parent
382ebc0ce6
commit
ac15ece619
21 files changed
+17219
-14083
No files matched your search
@@ -11,6 +11,11 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { AdminService, CouponInput } from './admin.service';
|
||||
import { ProductDto } from './dto/product.dto';
|
||||
import {
|
||||
UpdatePricingSettingsDto,
|
||||
ApplyGlobalMarginsDto,
|
||||
BulkPriceAdjustmentDto,
|
||||
} from './dto/pricing.dto';
|
||||
import { AdminQueryDto } from './dto/admin-query.dto';
|
||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
import {
|
||||
@@ -147,6 +152,33 @@ export class AdminController {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
@Get('pricing/settings')
|
||||
@ApiOperation({ summary: 'دریافت تنظیمات هوشمند قیمتگذاری و گرد کردن' })
|
||||
async getPricingSettings() {
|
||||
const data = await this.adminService.getPricingSettings();
|
||||
return { success: true, data };
|
||||
}
|
||||
|
||||
@Put('pricing/settings')
|
||||
@ApiOperation({ summary: 'بروزرسانی تنظیمات هوشمند قیمتگذاری و گرد کردن' })
|
||||
async updatePricingSettings(@Body() dto: UpdatePricingSettingsDto) {
|
||||
return this.adminService.updatePricingSettings(dto);
|
||||
}
|
||||
|
||||
@Post('pricing/apply-global-margins')
|
||||
@ApiOperation({ summary: 'اعمال سراسری درصد سود تک و عمده بر روی محصولات' })
|
||||
async applyGlobalMargins(@Body() dto: ApplyGlobalMarginsDto) {
|
||||
return this.adminService.applyGlobalMargins(dto);
|
||||
}
|
||||
|
||||
@Post('pricing/bulk-adjust')
|
||||
@ApiOperation({
|
||||
summary: 'تغییرات گروهی قیمت (درصدی یا مبلغ ثابت) بر روی محصولات',
|
||||
})
|
||||
async bulkPriceAdjustment(@Body() dto: BulkPriceAdjustmentDto) {
|
||||
return this.adminService.bulkPriceAdjustment(dto);
|
||||
}
|
||||
|
||||
@Get('orders')
|
||||
@ApiOperation({ summary: 'لیست سفارشها (مدیریت)' })
|
||||
@ApiQuery({ name: 'page', required: false, description: 'شماره صفحه' })
|
||||
|
||||
Reference in new issue
Block a user