projects/congarevenuecloud/ecommerce/src/lib/modules/incentive/services/incentive.service.ts
This service provides methods to interact with incentives, including retrieving incentives for carts and cart items, fetching incentives by ID or code, and more.
import { IncentiveService } from '@congarevenuecloud/ecommerce';
constructor(private incentiveService: IncentiveService) {}
// or
export class MyService extends AObjectService {
private incentiveService: IncentiveService = this.injector.get(IncentiveService);
}
AObjectService
Properties |
Methods |
getIncentiveByCode | ||||||||
getIncentiveByCode(incentiveCodes: Array
|
||||||||
Retrieves a list of incentives that match the provided incentive codes.
Parameters :
Returns :
Observable<Array<Incentive>>
An Observable of type Array |
getIncentiveById | |||||||||||||||
getIncentiveById(incentiveIds: Array
|
|||||||||||||||
Method retrieves all the applicable Incentives for the incentive Ids passed. Example:Example :
Parameters :
Returns :
Observable<Array<Incentive>>
An Observable of type Array |
getIncentivesForCart | ||||||||||
getIncentivesForCart(cartId: string)
|
||||||||||
Method retrieves all the applicable incentives for the cart with cartitems. Example:Example :
Parameters :
Returns :
Observable<Array<Incentive>>
An Observable of type Array |
getIncentivesForCartItem | |||||||||||||||
getIncentivesForCartItem(lineItemId: string, cartId: string)
|
|||||||||||||||
Method retrieves all applicable incentives for a given cart item. Example:Example :
Parameters :
Returns :
Observable<Array<Incentive>>
An Observable of type Array |
apiService |
Type : ApiService
|
Default value : this.injector.get(ApiService)
|
cartService |
Type : CartService
|
Default value : this.injector.get(CartService)
|
type |
Default value : Incentive
|