Class: CouponRepository
backend.CouponRepository
Hierarchy#
↳
CouponRepository
Table of contents#
Constructors#
Properties#
Methods#
- applyBaseFilter
- applyCouponFilter
- applyDeleteMany
- applyGetEntityViews
- createCoupon
- createEntity
- deleteCoupon
- deleteEntity
- deleteMany
- deleteManyFilteredCoupons
- getAll
- getById
- getBySlug
- getCouponById
- getCoupons
- getCouponsByCodes
- getCouponsByIds
- getEntityViews
- getFilteredCoupons
- getFilteredEntities
- getPaged
- getSqlBoolStr
- getSqlLike
- quote
- updateCoupon
- updateEntity
Constructors#
constructor#
• new CouponRepository()
Overrides#
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:16
Properties#
dbType#
• dbType: "mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-data-api" | "aurora-data-api-pg" | "expo" | "better-sqlite3" | "capacitor"
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:24
Methods#
applyBaseFilter#
â–¸ applyBaseFilter<EntityType>(qb, filter?): SelectQueryBuilder<EntityType>
Type parameters#
| Name | Type |
|---|---|
EntityType | TBasePageEntity |
Parameters#
| Name | Type |
|---|---|
qb | SelectQueryBuilder<EntityType> |
filter? | BaseFilterInput |
Returns#
SelectQueryBuilder<EntityType>
Inherited from#
BaseRepository.applyBaseFilter
Defined in#
system/core/backend/src/repositories/base.repository.ts:155
applyCouponFilter#
â–¸ applyCouponFilter(qb, filterParams?): SelectQueryBuilder<Coupon>
Parameters#
| Name | Type |
|---|---|
qb | SelectQueryBuilder<Coupon> |
filterParams? | BaseFilterInput |
Returns#
SelectQueryBuilder<Coupon>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:101
applyDeleteMany#
â–¸ applyDeleteMany(qb, input): Promise<void>
Parameters#
| Name | Type |
|---|---|
qb | SelectQueryBuilder<Coupon> | DeleteQueryBuilder<Coupon> |
input | TDeleteManyInput |
Returns#
Promise<void>
Inherited from#
BaseRepository.applyDeleteMany
Defined in#
system/core/backend/src/repositories/base.repository.ts:108
applyGetEntityViews#
â–¸ applyGetEntityViews(qb, entityType): SelectQueryBuilder<TBasePageEntity>
Parameters#
| Name | Type |
|---|---|
qb | SelectQueryBuilder<TBasePageEntity> |
entityType | EDBEntity |
Returns#
SelectQueryBuilder<TBasePageEntity>
Inherited from#
BaseRepository.applyGetEntityViews
Defined in#
system/core/backend/src/repositories/base.repository.ts:133
createCoupon#
â–¸ createCoupon(inputData, id?): Promise<Coupon>
Parameters#
| Name | Type |
|---|---|
inputData | TCouponInput |
id? | null | number |
Returns#
Promise<Coupon>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:70
createEntity#
â–¸ createEntity(input, id?): Promise<Coupon>
Parameters#
| Name | Type |
|---|---|
input | Coupon |
id? | null | number |
Returns#
Promise<Coupon>
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:70
deleteCoupon#
â–¸ deleteCoupon(id): Promise<boolean>
Parameters#
| Name | Type |
|---|---|
id | number |
Returns#
Promise<boolean>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:89
deleteEntity#
â–¸ deleteEntity(id): Promise<boolean>
Parameters#
| Name | Type |
|---|---|
id | number |
Returns#
Promise<boolean>
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:97
deleteMany#
â–¸ deleteMany(input): Promise<boolean>
Parameters#
| Name | Type |
|---|---|
input | TDeleteManyInput |
Returns#
Promise<boolean>
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:125
deleteManyFilteredCoupons#
â–¸ deleteManyFilteredCoupons(input, filterParams?): Promise<undefined | boolean>
Parameters#
| Name | Type |
|---|---|
input | TDeleteManyInput |
filterParams? | BaseFilterInput |
Returns#
Promise<undefined | boolean>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:113
getAll#
â–¸ getAll(): Promise<Coupon[]>
Returns#
Promise<Coupon[]>
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:44
getById#
â–¸ getById(id, relations?): Promise<Coupon>
Parameters#
| Name | Type |
|---|---|
id | number |
relations? | string[] |
Returns#
Promise<Coupon>
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:49
getBySlug#
â–¸ getBySlug(slug, relations?): Promise<Coupon>
Parameters#
| Name | Type |
|---|---|
slug | string |
relations? | string[] |
Returns#
Promise<Coupon>
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:60
getCouponById#
â–¸ getCouponById(id): Promise<undefined | Coupon>
Parameters#
| Name | Type |
|---|---|
id | number |
Returns#
Promise<undefined | Coupon>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:25
getCoupons#
â–¸ getCoupons(params?): Promise<TPagedList<Coupon>>
Parameters#
| Name | Type |
|---|---|
params? | TPagedParams<TCoupon> |
Returns#
Promise<TPagedList<Coupon>>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:20
getCouponsByCodes#
â–¸ getCouponsByCodes(codes): Promise<undefined | Coupon[]>
Parameters#
| Name | Type |
|---|---|
codes | string[] |
Returns#
Promise<undefined | Coupon[]>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:35
getCouponsByIds#
â–¸ getCouponsByIds(ids): Promise<Coupon[]>
Parameters#
| Name | Type |
|---|---|
ids | number[] |
Returns#
Promise<Coupon[]>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:30
getEntityViews#
â–¸ getEntityViews(entityId, entityType): Promise<any>
Parameters#
| Name | Type |
|---|---|
entityId | number |
entityType | EDBEntity |
Returns#
Promise<any>
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:144
getFilteredCoupons#
â–¸ getFilteredCoupons(pagedParams?, filterParams?): Promise<TPagedList<Coupon>>
Parameters#
| Name | Type |
|---|---|
pagedParams? | PagedParamsInput<Coupon> |
filterParams? | BaseFilterInput |
Returns#
Promise<TPagedList<Coupon>>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:106
getFilteredEntities#
â–¸ getFilteredEntities(pagedParams?, filterParams?): Promise<TPagedList<Coupon>>
Parameters#
| Name | Type |
|---|---|
pagedParams? | PagedParamsInput<Coupon> |
filterParams? | BaseFilterInput |
Returns#
Promise<TPagedList<Coupon>>
Inherited from#
BaseRepository.getFilteredEntities
Defined in#
system/core/backend/src/repositories/base.repository.ts:164
getPaged#
â–¸ getPaged(params?): Promise<TPagedList<Coupon>>
Parameters#
| Name | Type |
|---|---|
params? | TPagedParams<Coupon> |
Returns#
Promise<TPagedList<Coupon>>
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:38
getSqlBoolStr#
â–¸ getSqlBoolStr(b): "true" | "false" | "1" | "0"
Parameters#
| Name | Type |
|---|---|
b | boolean |
Returns#
"true" | "false" | "1" | "0"
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:34
getSqlLike#
â–¸ getSqlLike(): "ILIKE" | "LIKE"
Returns#
"ILIKE" | "LIKE"
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:35
quote#
â–¸ quote(str): string
Parameters#
| Name | Type |
|---|---|
str | string |
Returns#
string
Inherited from#
Defined in#
system/core/backend/src/repositories/base.repository.ts:36
updateCoupon#
â–¸ updateCoupon(id, inputData): Promise<Coupon>
Parameters#
| Name | Type |
|---|---|
id | number |
inputData | TCouponInput |
Returns#
Promise<Coupon>
Defined in#
system/core/backend/src/repositories/coupon.repository.ts:80
updateEntity#
â–¸ updateEntity(id, input): Promise<Coupon>
Parameters#
| Name | Type |
|---|---|
id | number |
input | Coupon |
Returns#
Promise<Coupon>