Refactor coupon repository to use CouponType for type field in FindCouponsOpts

This commit is contained in:
2025-12-06 12:59:31 +03:30
parent 816cb639e7
commit 7440d4db90
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { EntityManager, EntityRepository } from '@mikro-orm/postgresql';
import { FilterQuery } from '@mikro-orm/core';
import { Coupon } from '../entities/coupon.entity';
import { Coupon, CouponType } from '../entities/coupon.entity';
import { PaginatedResult } from 'src/common/interfaces/pagination.interface';
type FindCouponsOpts = {
@@ -10,7 +10,7 @@ type FindCouponsOpts = {
search?: string;
orderBy?: string;
order?: 'asc' | 'desc';
type?: string;
type?: CouponType;
isActive?: boolean;
};
@@ -63,4 +63,3 @@ export class CouponRepository extends EntityRepository<Coupon> {
};
}
}