This commit is contained in:
2026-03-09 16:30:45 +03:30
parent 8f833b5677
commit 1175a052f7
3 changed files with 1 additions and 140 deletions
@@ -5,7 +5,7 @@ import { FindCataloguesDto } from "../dto/find-catalogues.dto";
export class CatalogueRepository extends EntityRepository<Catalogue> {
async findAllPaginated( opts: FindCataloguesDto = {}): Promise<PaginatedResult<Catalogue>> {
const { page = 1, limit = 10, orderBy = 'order', order = 'asc', isActive } = opts;
const { page = 1, limit = 10, orderBy = 'createdAt', order = 'desc', isActive } = opts;
const offset = (page - 1) * limit;
-94
View File
@@ -1,94 +0,0 @@
import { CouponType } from '../../modules/coupons/interface/coupon';
export interface CouponData {
restaurantSlug: string;
code: string;
name: string;
description?: string;
type: CouponType;
value: number;
maxDiscount?: number;
minOrderAmount?: number;
maxUses?: number;
maxUsesPerUser?: number;
startDate?: string;
endDate?: string;
isActive: boolean;
}
export const couponsData: CouponData[] = [
{
restaurantSlug: 'zhivan',
code: 'WELCOME10',
name: 'خوش آمدگویی ۱۰٪',
description: 'تخفیف ۱۰ درصدی برای اولین خرید',
type: CouponType.PERCENTAGE,
value: 10,
maxDiscount: 50000,
minOrderAmount: 100000,
maxUses: 100,
maxUsesPerUser: 1,
isActive: true,
},
{
restaurantSlug: 'zhivan',
code: 'FIXED50K',
name: 'تخفیف ۵۰ هزار تومانی',
description: 'تخفیف ثابت ۵۰ هزار تومانی',
type: CouponType.FIXED,
value: 50000,
minOrderAmount: 200000,
maxUses: 50,
maxUsesPerUser: 2,
isActive: true,
},
{
restaurantSlug: 'zhivan',
code: 'WEEKEND20',
name: 'تعطیلات ۲۰٪',
description: 'تخفیف ۲۰ درصدی برای آخر هفته',
type: CouponType.PERCENTAGE,
value: 20,
maxDiscount: 100000,
minOrderAmount: 150000,
maxUses: 200,
isActive: true,
},
{
restaurantSlug: 'boote',
code: 'FIRST15',
name: 'اولین خرید ۱۵٪',
description: 'تخفیف ۱۵ درصدی برای اولین خرید',
type: CouponType.PERCENTAGE,
value: 15,
maxDiscount: 75000,
minOrderAmount: 100000,
maxUses: 100,
maxUsesPerUser: 1,
isActive: true,
},
{
restaurantSlug: 'boote',
code: 'SAVE30K',
name: 'صرفه جویی ۳۰ هزار',
description: 'تخفیف ثابت ۳۰ هزار تومانی',
type: CouponType.FIXED,
value: 30000,
minOrderAmount: 100000,
maxUses: 100,
isActive: true,
},
{
restaurantSlug: 'boote',
code: 'VIP25',
name: 'ویژه ۲۵٪',
description: 'تخفیف ویژه ۲۵ درصدی',
type: CouponType.PERCENTAGE,
value: 25,
maxDiscount: 150000,
minOrderAmount: 200000,
maxUses: 50,
maxUsesPerUser: 1,
isActive: true,
},
];
-45
View File
@@ -1,45 +0,0 @@
import { DeliveryMethodEnum } from '../../modules/delivery/interface/delivery';
export interface DeliveryMethodData {
method: DeliveryMethodEnum;
description: string;
deliveryFee: number;
minOrderPrice: number;
enabled: boolean;
order: number;
}
export const deliveryMethodsData: DeliveryMethodData[] = [
{
method: DeliveryMethodEnum.DineIn,
description: 'سرو غذا در رستوران',
deliveryFee: 0,
minOrderPrice: 0,
enabled: true,
order: 1,
},
{
method: DeliveryMethodEnum.CustomerPickup,
description: 'برداشت غذا از رستوران',
deliveryFee: 0,
minOrderPrice: 0,
enabled: true,
order: 2,
},
{
method: DeliveryMethodEnum.DeliveryCar,
description: 'تحویل غذا در خودرو',
deliveryFee: 5000,
minOrderPrice: 50000,
enabled: true,
order: 3,
},
{
method: DeliveryMethodEnum.DeliveryCourier,
description: 'تحویل غذا با پیک',
deliveryFee: 10000,
minOrderPrice: 100000,
enabled: true,
order: 4,
},
];