Refactor coupon repository to use CouponType for type field in FindCouponsOpts
This commit is contained in:
@@ -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> {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user