@daffodil/customer-store-credit 0.66.0 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/magento/testing/factories/customer-store-credit.factory.d.ts +1 -1
- package/{esm2020 → esm2022}/driver/in-memory/backend/store-credit.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/driver/driver.module.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/driver/store-credit.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/customer-store-credit.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/driver.module.mjs +5 -5
- package/esm2022/driver/magento/testing/factories/customer-store-credit.factory.mjs +28 -0
- package/{esm2020 → esm2022}/driver/testing/drivers/driver.module.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/store-credit.service.mjs +5 -5
- package/esm2022/routing/guards/clear-errors.guard.mjs +24 -0
- package/esm2022/routing/resolvers/customer-store-credit.resolver.mjs +26 -0
- package/{esm2020 → esm2022}/state/effects/store-credit.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/facades/store-credit/facade.mjs +5 -5
- package/{esm2020 → esm2022}/state/reducers/token/extra.token.mjs +4 -4
- package/esm2022/state/reducers/token/public_api.mjs +2 -0
- package/esm2022/state/state.module.mjs +32 -0
- package/{esm2020 → esm2022}/state/testing/mock-facade.mjs +4 -4
- package/{esm2020 → esm2022}/state/testing/state-testing.module.mjs +7 -7
- package/{esm2020 → esm2022}/testing/factories/customer-store-credit.factory.mjs +6 -6
- package/{fesm2015 → fesm2022}/daffodil-customer-store-credit-driver-in-memory.mjs +12 -12
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-driver-in-memory.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-driver-magento-testing.mjs +5 -5
- package/fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-driver-magento.mjs +8 -8
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-driver-magento.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-driver-testing.mjs +8 -8
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-driver-testing.mjs.map +1 -1
- package/{fesm2015 → fesm2022}/daffodil-customer-store-credit-routing.mjs +9 -9
- package/fesm2022/daffodil-customer-store-credit-routing.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-state-testing.mjs +9 -9
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-state-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-state.mjs +20 -20
- package/fesm2022/daffodil-customer-store-credit-state.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-testing.mjs +5 -5
- package/fesm2022/daffodil-customer-store-credit-testing.mjs.map +1 -0
- package/package.json +1 -1
- package/routing/guards/clear-errors.guard.d.ts +2 -2
- package/routing/resolvers/customer-store-credit.resolver.d.ts +1 -2
- package/state/actions/store-credit.actions.d.ts +1 -1
- package/state/reducers/token/extra.token.d.ts +3 -3
- package/state/reducers/token/public_api.d.ts +1 -1
- package/esm2020/driver/magento/testing/factories/customer-store-credit.factory.mjs +0 -28
- package/esm2020/routing/guards/clear-errors.guard.mjs +0 -24
- package/esm2020/routing/resolvers/customer-store-credit.resolver.mjs +0 -26
- package/esm2020/state/reducers/token/public_api.mjs +0 -2
- package/esm2020/state/state.module.mjs +0 -32
- package/fesm2015/daffodil-customer-store-credit-driver-in-memory.mjs.map +0 -1
- package/fesm2015/daffodil-customer-store-credit-driver-magento-testing.mjs +0 -34
- package/fesm2015/daffodil-customer-store-credit-driver-magento-testing.mjs.map +0 -1
- package/fesm2015/daffodil-customer-store-credit-driver-magento.mjs +0 -159
- package/fesm2015/daffodil-customer-store-credit-driver-magento.mjs.map +0 -1
- package/fesm2015/daffodil-customer-store-credit-driver-testing.mjs +0 -64
- package/fesm2015/daffodil-customer-store-credit-driver-testing.mjs.map +0 -1
- package/fesm2015/daffodil-customer-store-credit-driver.mjs.map +0 -1
- package/fesm2015/daffodil-customer-store-credit-routing.mjs.map +0 -1
- package/fesm2015/daffodil-customer-store-credit-state-testing.mjs +0 -51
- package/fesm2015/daffodil-customer-store-credit-state-testing.mjs.map +0 -1
- package/fesm2015/daffodil-customer-store-credit-state.mjs +0 -238
- package/fesm2015/daffodil-customer-store-credit-state.mjs.map +0 -1
- package/fesm2015/daffodil-customer-store-credit-testing.mjs +0 -37
- package/fesm2015/daffodil-customer-store-credit-testing.mjs.map +0 -1
- package/fesm2020/daffodil-customer-store-credit-driver-in-memory.mjs +0 -117
- package/fesm2020/daffodil-customer-store-credit-driver-magento-testing.mjs.map +0 -1
- package/fesm2020/daffodil-customer-store-credit-driver.mjs +0 -37
- package/fesm2020/daffodil-customer-store-credit-routing.mjs +0 -53
- package/fesm2020/daffodil-customer-store-credit-routing.mjs.map +0 -1
- package/fesm2020/daffodil-customer-store-credit-state.mjs.map +0 -1
- package/fesm2020/daffodil-customer-store-credit-testing.mjs.map +0 -1
- package/fesm2020/daffodil-customer-store-credit.mjs +0 -8
- package/fesm2020/daffodil-customer-store-credit.mjs.map +0 -1
- /package/{esm2020 → esm2022}/constants/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/constants/store-credit-order-total-type.mjs +0 -0
- /package/{esm2020 → esm2022}/daffodil-customer-store-credit.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/daffodil-customer-store-credit-driver.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/codes.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-api-response.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/map.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/daffodil-customer-store-credit-driver-in-memory.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/store-credit-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/daffodil-customer-store-credit-driver-magento.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/errors/map.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/errors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/errors/transform.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/customer-order-with-store-credit.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/get-customer-store-credit.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/store-credit.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/customer-order.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/store-credit.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-store-credit.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/testing/daffodil-customer-store-credit-driver-magento-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/testing/factories/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/responses/customer-order.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/responses/customer-store-credit.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/responses/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/validators/get-customer-store-credit.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/validators/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/daffodil-customer-store-credit-driver-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/drivers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/models/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/models/store-credit.type.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/daffodil-customer-store-credit-routing.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/resolvers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/store-credit.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/daffodil-customer-store-credit-state.mjs +0 -0
- /package/{esm2020 → esm2022}/state/facades/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/facades/store-credit/interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/index.mjs +0 -0
- /package/{esm2020 → esm2022}/state/injection-tokens/error-matcher.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/injection-tokens/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/reducers.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/store-credit/initial-state.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/store-credit/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/store-credit/reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/store-credit/type.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/store-feature-key.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/reducers.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/feature.selector.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/store-credit/selector.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/daffodil-customer-store-credit-state-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/daffodil-customer-store-credit-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/factories/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public_api.mjs +0 -0
- /package/{fesm2015 → fesm2022}/daffodil-customer-store-credit-driver.mjs +0 -0
- /package/{fesm2020 → fesm2022}/daffodil-customer-store-credit-driver.mjs.map +0 -0
- /package/{fesm2015 → fesm2022}/daffodil-customer-store-credit.mjs +0 -0
- /package/{fesm2015 → fesm2022}/daffodil-customer-store-credit.mjs.map +0 -0
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable, NgModule } from '@angular/core';
|
|
4
|
-
import { DaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
5
|
-
import { of } from 'rxjs';
|
|
6
|
-
import * as i1 from '@daffodil/customer-store-credit/testing';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A basic customer driver that creates mock customer results of different kinds.
|
|
10
|
-
* For testing purposes.
|
|
11
|
-
*
|
|
12
|
-
* @inheritdoc
|
|
13
|
-
*/
|
|
14
|
-
class DaffCustomerStoreCreditTestingDriver {
|
|
15
|
-
constructor(factory) {
|
|
16
|
-
this.factory = factory;
|
|
17
|
-
}
|
|
18
|
-
get() {
|
|
19
|
-
return of(this.factory.create());
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/** @nocollapse */ DaffCustomerStoreCreditTestingDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditTestingDriver, deps: [{ token: i1.DaffCustomerStoreCreditFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
23
|
-
/** @nocollapse */ DaffCustomerStoreCreditTestingDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditTestingDriver, providedIn: 'root' });
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditTestingDriver, decorators: [{
|
|
25
|
-
type: Injectable,
|
|
26
|
-
args: [{
|
|
27
|
-
providedIn: 'root',
|
|
28
|
-
}]
|
|
29
|
-
}], ctorParameters: function () { return [{ type: i1.DaffCustomerStoreCreditFactory }]; } });
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Provides the {@link DaffCustomerStoreCreditTestingDriver} as the {@link DaffCustomerStoreCreditDriver}.
|
|
33
|
-
*/
|
|
34
|
-
class DaffCustomerStoreCreditTestingDriverModule {
|
|
35
|
-
static forRoot() {
|
|
36
|
-
return {
|
|
37
|
-
ngModule: DaffCustomerStoreCreditTestingDriverModule,
|
|
38
|
-
providers: [
|
|
39
|
-
{
|
|
40
|
-
provide: DaffCustomerStoreCreditDriver,
|
|
41
|
-
useExisting: DaffCustomerStoreCreditTestingDriver,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/** @nocollapse */ DaffCustomerStoreCreditTestingDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
48
|
-
/** @nocollapse */ DaffCustomerStoreCreditTestingDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditTestingDriverModule, imports: [CommonModule] });
|
|
49
|
-
/** @nocollapse */ DaffCustomerStoreCreditTestingDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditTestingDriverModule, imports: [CommonModule] });
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditTestingDriverModule, decorators: [{
|
|
51
|
-
type: NgModule,
|
|
52
|
-
args: [{
|
|
53
|
-
imports: [
|
|
54
|
-
CommonModule,
|
|
55
|
-
],
|
|
56
|
-
}]
|
|
57
|
-
}] });
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Generated bundle index. Do not edit.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
export { DaffCustomerStoreCreditTestingDriver, DaffCustomerStoreCreditTestingDriverModule };
|
|
64
|
-
//# sourceMappingURL=daffodil-customer-store-credit-driver-testing.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-driver-testing.mjs","sources":["../../../libs/customer-store-credit/driver/testing/src/drivers/store-credit.service.ts","../../../libs/customer-store-credit/driver/testing/src/drivers/driver.module.ts","../../../libs/customer-store-credit/driver/testing/src/daffodil-customer-store-credit-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditDriverInterface } from '@daffodil/customer-store-credit/driver';\nimport { DaffCustomerStoreCreditFactory } from '@daffodil/customer-store-credit/testing';\n\n/**\n * A basic customer driver that creates mock customer results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditTestingDriver implements DaffCustomerStoreCreditDriverInterface {\n constructor(\n private factory: DaffCustomerStoreCreditFactory,\n ) {}\n\n get(): Observable<DaffCustomerStoreCredit> {\n return of(this.factory.create());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';\n\nimport { DaffCustomerStoreCreditTestingDriver } from './store-credit.service';\n\n/**\n * Provides the {@link DaffCustomerStoreCreditTestingDriver} as the {@link DaffCustomerStoreCreditDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCustomerStoreCreditTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffCustomerStoreCreditTestingDriverModule> {\n return {\n ngModule: DaffCustomerStoreCreditTestingDriverModule,\n providers: [\n {\n provide: DaffCustomerStoreCreditDriver,\n useExisting: DaffCustomerStoreCreditTestingDriver,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;;;;;AAKG;MAIU,oCAAoC,CAAA;AAC/C,IAAA,WAAA,CACU,OAAuC,EAAA;AAAvC,QAAA,IAAO,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AAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0CAA0C,YAHnD,YAAY,CAAA,EAAA,CAAA,CAAA;2FAGH,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBALtD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;iBACF,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-driver.mjs","sources":["../../../libs/customer-store-credit/driver/src/interfaces/store-credit-service.interface.ts","../../../libs/customer-store-credit/driver/src/errors/invalid-api-response.ts","../../../libs/customer-store-credit/driver/src/errors/map.ts","../../../libs/customer-store-credit/driver/src/errors/codes.ts","../../../libs/customer-store-credit/driver/src/daffodil-customer-store-credit-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\n/**\n * An injection token for the customer store credit driver.\n */\nexport const DaffCustomerStoreCreditDriver = new InjectionToken<DaffCustomerStoreCreditDriverInterface>('DaffCustomerStoreCreditDriver');\n\n/**\n * The customer store credit driver is responsible for loading customers.\n */\nexport interface DaffCustomerStoreCreditDriverInterface<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> {\n /**\n * Get the customer's store credit.\n */\n get(): Observable<TStoreCredit>;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE';\n\n/**\n * A general error indicating that the platform returned a response which cannot be processed.\n */\nexport class DaffCustomerStoreCreditInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffCustomerStoreCreditInvalidAPIResponseError,\n DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE,\n} from './invalid-api-response';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffCustomerStoreCreditDriverErrorMap = {\n [DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE]: DaffCustomerStoreCreditInvalidAPIResponseError,\n};\n","import { DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE } from './invalid-api-response';\n\nexport const DaffCustomerStoreCreditDriverErrorCodes = {\n INVALID_API_RESPONSE: DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAKA;;AAEG;MACU,6BAA6B,GAAG,IAAI,cAAc,CAAyC,+BAA+B;;ACHhI,MAAM,0DAA0D,GAAG,kDAAkD;AAE5H;;AAEG;AACG,MAAO,8CAA+C,SAAQ,oBAAoB,CAAA;AAGtF,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;AADE,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAI,CAAA,IAAA,GAAW,0DAA0D,CAAC;KAIzF;AACF;;ACXD;;AAEG;AACU,MAAA,qCAAqC,GAAG;IACnD,CAAC,0DAA0D,GAAG,8CAA8C;;;ACPjG,MAAA,uCAAuC,GAAG;AACrD,IAAA,oBAAoB,EAAE,0DAA0D;;;ACHlF;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-routing.mjs","sources":["../../../libs/customer-store-credit/routing/src/guards/clear-errors.guard.ts","../../../libs/customer-store-credit/routing/src/resolvers/customer-store-credit.resolver.ts","../../../libs/customer-store-credit/routing/src/daffodil-customer-store-credit-routing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n CanDeactivate,\n UrlTree,\n} from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomerStoreCreditClearErrors } from '@daffodil/customer-store-credit/state';\n\n/**\n * A guard that will clear customer state errors before allowing route deactivation.\n */\n@Injectable({ providedIn: 'root' })\nexport class DaffCustomerStoreCreditClearErrorsGuard implements CanDeactivate<unknown> {\n constructor(private store: Store<any>) {}\n\n canDeactivate(): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {\n this.store.dispatch(new DaffCustomerStoreCreditClearErrors());\n return true;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Resolve } from '@angular/router';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffCustomerStoreCreditLoad,\n DaffCustomerStoreCreditPageFacade,\n} from '@daffodil/customer-store-credit/state';\n\n/**\n * Dispatches customer load.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditResolver implements Resolve<Observable<boolean>> {\n constructor(\n private facade: DaffCustomerStoreCreditPageFacade,\n ) {}\n\n resolve(): Observable<boolean> {\n this.facade.dispatch(new DaffCustomerStoreCreditLoad());\n\n return of(true);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;AAUA;;AAEG;MAEU,uCAAuC,CAAA;AAClD,IAAA,WAAA,CAAoB,KAAiB,EAAA;AAAjB,QAAA,IAAK,CAAA,KAAA,GAAL,KAAK,CAAY;KAAI;IAEzC,aAAa,GAAA;QACX,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,kCAAkC,EAAE,CAAC,CAAC;AAC9D,QAAA,OAAO,IAAI,CAAC;KACb;;uJANU,uCAAuC,EAAA,IAAA,EA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|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule } from '@angular/core';
|
|
3
|
-
import { BehaviorSubject } from 'rxjs';
|
|
4
|
-
import { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';
|
|
5
|
-
import { DaffCustomerStoreCreditPageFacade } from '@daffodil/customer-store-credit/state';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Mocks out facade fields and methods for testing purposes.
|
|
9
|
-
*
|
|
10
|
-
* @inheritdoc
|
|
11
|
-
*/
|
|
12
|
-
class MockDaffCustomerStoreCreditPageFacade extends MockDaffOperationStateFacade {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.storeCredit$ = new BehaviorSubject(null);
|
|
16
|
-
}
|
|
17
|
-
dispatch(action) { }
|
|
18
|
-
;
|
|
19
|
-
}
|
|
20
|
-
/** @nocollapse */ MockDaffCustomerStoreCreditPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MockDaffCustomerStoreCreditPageFacade, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
21
|
-
/** @nocollapse */ MockDaffCustomerStoreCreditPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MockDaffCustomerStoreCreditPageFacade, providedIn: 'root' });
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MockDaffCustomerStoreCreditPageFacade, decorators: [{
|
|
23
|
-
type: Injectable,
|
|
24
|
-
args: [{ providedIn: 'root' }]
|
|
25
|
-
}] });
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Provides the {@link MockDaffCustomerStoreCreditPageFacade} for {@link DaffCustomerStoreCreditPageFacade}.
|
|
29
|
-
*/
|
|
30
|
-
class DaffCustomerStoreCreditStateTestingModule {
|
|
31
|
-
}
|
|
32
|
-
/** @nocollapse */ DaffCustomerStoreCreditStateTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
33
|
-
/** @nocollapse */ DaffCustomerStoreCreditStateTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditStateTestingModule });
|
|
34
|
-
/** @nocollapse */ DaffCustomerStoreCreditStateTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditStateTestingModule, providers: [
|
|
35
|
-
{ provide: DaffCustomerStoreCreditPageFacade, useExisting: MockDaffCustomerStoreCreditPageFacade },
|
|
36
|
-
] });
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditStateTestingModule, decorators: [{
|
|
38
|
-
type: NgModule,
|
|
39
|
-
args: [{
|
|
40
|
-
providers: [
|
|
41
|
-
{ provide: DaffCustomerStoreCreditPageFacade, useExisting: MockDaffCustomerStoreCreditPageFacade },
|
|
42
|
-
],
|
|
43
|
-
}]
|
|
44
|
-
}] });
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Generated bundle index. Do not edit.
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
export { DaffCustomerStoreCreditStateTestingModule, MockDaffCustomerStoreCreditPageFacade };
|
|
51
|
-
//# sourceMappingURL=daffodil-customer-store-credit-state-testing.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-state-testing.mjs","sources":["../../../libs/customer-store-credit/state/testing/src/mock-facade.ts","../../../libs/customer-store-credit/state/testing/src/state-testing.module.ts","../../../libs/customer-store-credit/state/testing/src/daffodil-customer-store-credit-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditPageFacadeInterface } from '@daffodil/customer-store-credit/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCustomerStoreCreditPageFacade extends MockDaffOperationStateFacade implements DaffCustomerStoreCreditPageFacadeInterface {\n storeCredit$ = new BehaviorSubject<DaffCustomerStoreCredit>(null);\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffCustomerStoreCreditPageFacade } from '@daffodil/customer-store-credit/state';\n\nimport { MockDaffCustomerStoreCreditPageFacade } from './mock-facade';\n\n/**\n * Provides the {@link MockDaffCustomerStoreCreditPageFacade} for {@link DaffCustomerStoreCreditPageFacade}.\n */\n@NgModule({\n providers: [\n { provide: DaffCustomerStoreCreditPageFacade, useExisting: MockDaffCustomerStoreCreditPageFacade },\n ],\n})\nexport class DaffCustomerStoreCreditStateTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;;;AAIG;AAEG,MAAO,qCAAsC,SAAQ,4BAA4B,CAAA;AADvF,IAAA,WAAA,GAAA;;QAEE,IAAA,CAAA,YAAY,GAAG,IAAI,eAAe,CAA0B,IAAI,CAAC,CAAC;KAGnE;IADC,QAAQ,CAAC,MAAc,EAAA,GAAI;;;qJAHhB,qCAAqC,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArC,mBAAA,qCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qCAAqC,cADxB,MAAM,EAAA,CAAA,CAAA;2FACnB,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBADjD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACPlC;;AAEG;MAMU,yCAAyC,CAAA;;yJAAzC,yCAAyC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;0JAAzC,yCAAyC,EAAA,CAAA,CAAA;AAAzC,mBAAA,yCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yCAAyC,EAJzC,SAAA,EAAA;AACT,QAAA,EAAE,OAAO,EAAE,iCAAiC,EAAE,WAAW,EAAE,qCAAqC,EAAE;AACnG,KAAA,EAAA,CAAA,CAAA;2FAEU,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBALrD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,iCAAiC,EAAE,WAAW,EAAE,qCAAqC,EAAE;AACnG,qBAAA;iBACF,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Inject, inject, NgModule } from '@angular/core';
|
|
3
|
-
import { daffOperationInitialState, daffOperationFailed, daffCompleteOperation, daffStartResolution, daffOperationStateSelectorFactory, daffTransformErrorToStateError, daffComposeReducers } from '@daffodil/core/state';
|
|
4
|
-
import * as i1 from '@ngrx/store';
|
|
5
|
-
import { createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
|
|
6
|
-
import * as i1$1 from '@ngrx/effects';
|
|
7
|
-
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
8
|
-
import { of } from 'rxjs';
|
|
9
|
-
import { switchMap, map, catchError } from 'rxjs/operators';
|
|
10
|
-
import { DaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The customer store credit action types enum.
|
|
14
|
-
*/
|
|
15
|
-
var DaffCustomerStoreCreditActionTypes;
|
|
16
|
-
(function (DaffCustomerStoreCreditActionTypes) {
|
|
17
|
-
DaffCustomerStoreCreditActionTypes["StoreCreditLoadAction"] = "[@daffodil/customer-store-credit] Store Credit Load Action";
|
|
18
|
-
DaffCustomerStoreCreditActionTypes["StoreCreditLoadSuccessAction"] = "[@daffodil/customer-store-credit] Store Credit Load Success Action";
|
|
19
|
-
DaffCustomerStoreCreditActionTypes["StoreCreditLoadFailureAction"] = "[@daffodil/customer-store-credit] Store Credit Load Failure Action";
|
|
20
|
-
DaffCustomerStoreCreditActionTypes["StoreCreditClearErrorsAction"] = "[@daffodil/customer-store-credit] Store Credit Clear Errors Action";
|
|
21
|
-
})(DaffCustomerStoreCreditActionTypes || (DaffCustomerStoreCreditActionTypes = {}));
|
|
22
|
-
/**
|
|
23
|
-
* Loads the store credit of the current customer.
|
|
24
|
-
*/
|
|
25
|
-
class DaffCustomerStoreCreditLoad {
|
|
26
|
-
constructor() {
|
|
27
|
-
this.type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Indicates a successful load of the customer's store credit.
|
|
32
|
-
*/
|
|
33
|
-
class DaffCustomerStoreCreditLoadSuccess {
|
|
34
|
-
constructor(payload) {
|
|
35
|
-
this.payload = payload;
|
|
36
|
-
this.type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* A failed customer store credit load with the error message.
|
|
41
|
-
*/
|
|
42
|
-
class DaffCustomerStoreCreditLoadFailure {
|
|
43
|
-
constructor(payload) {
|
|
44
|
-
this.payload = payload;
|
|
45
|
-
this.type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* An action to clear all errors in state.
|
|
50
|
-
*/
|
|
51
|
-
class DaffCustomerStoreCreditClearErrors {
|
|
52
|
-
constructor() {
|
|
53
|
-
this.type = DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* The key under which the customer store credit feature state will be stored.
|
|
59
|
-
*/
|
|
60
|
-
const DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY = 'daffCustomerStoreCredit';
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* A token to hold the injectable extra reducers.
|
|
64
|
-
*
|
|
65
|
-
* Prefer using {@link daffCustomerProvideExtraReducers}.
|
|
66
|
-
*/
|
|
67
|
-
const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS', {
|
|
68
|
-
factory: () => [],
|
|
69
|
-
providedIn: 'any',
|
|
70
|
-
});
|
|
71
|
-
/**
|
|
72
|
-
* Provides additional reducers that run after the standard Daffodil customer reducers.
|
|
73
|
-
*
|
|
74
|
-
* ```ts
|
|
75
|
-
* providers: [
|
|
76
|
-
* ...daffCustomerProvideExtraReducers(
|
|
77
|
-
* myReducer1,
|
|
78
|
-
* myReducer2
|
|
79
|
-
* )
|
|
80
|
-
* ]
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
function daffCustomerProvideExtraReducers(...reducers) {
|
|
84
|
-
return reducers.map(reducer => ({
|
|
85
|
-
provide: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,
|
|
86
|
-
useValue: reducer,
|
|
87
|
-
multi: true,
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* The initial state for the main customer store credit state, see {@link DaffCustomerStoreCreditReducerState}.
|
|
93
|
-
*/
|
|
94
|
-
const daffCustomerStoreCreditInitialState = Object.assign(Object.assign({}, daffOperationInitialState), { storeCredit: {
|
|
95
|
-
balance: 0,
|
|
96
|
-
} });
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* The reducer for the customer store credit page state, see {@link DaffCustomerStoreCreditReducerState}.
|
|
100
|
-
*/
|
|
101
|
-
const daffCustomerStoreCreditReducer = (state = daffCustomerStoreCreditInitialState, action) => {
|
|
102
|
-
switch (action.type) {
|
|
103
|
-
case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:
|
|
104
|
-
case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:
|
|
105
|
-
return daffStartResolution(state);
|
|
106
|
-
case DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction:
|
|
107
|
-
return Object.assign(Object.assign({}, daffCompleteOperation(state)), { storeCredit: action.payload });
|
|
108
|
-
case DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction:
|
|
109
|
-
return daffCompleteOperation(state);
|
|
110
|
-
case DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction:
|
|
111
|
-
return daffOperationFailed([action.payload], state);
|
|
112
|
-
default:
|
|
113
|
-
return state;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const getDaffCustomerStoreCreditReducersStateSelector = (() => {
|
|
118
|
-
let cache;
|
|
119
|
-
return () => cache = cache || {
|
|
120
|
-
selectCustomerStoreCreditFeatureState: createFeatureSelector(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY),
|
|
121
|
-
};
|
|
122
|
-
})();
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Creates a group of selectors for {@link DaffCustomerStoreCreditReducerState} that use the passed state selector as the basis.
|
|
126
|
-
*/
|
|
127
|
-
const daffCustomerStoreCreditCreateSelectors = () => {
|
|
128
|
-
const { selectCustomerStoreCreditFeatureState } = getDaffCustomerStoreCreditReducersStateSelector();
|
|
129
|
-
const selectCustomerStoreCreditState = createSelector(selectCustomerStoreCreditFeatureState, state => state.storeCredit);
|
|
130
|
-
const selectStoreCredit = createSelector(selectCustomerStoreCreditState, state => state.storeCredit);
|
|
131
|
-
return Object.assign(Object.assign({}, daffOperationStateSelectorFactory(selectCustomerStoreCreditState)), { selectStoreCredit });
|
|
132
|
-
};
|
|
133
|
-
const daffCustomerStoreCreditGetSelectors = (() => {
|
|
134
|
-
let cache;
|
|
135
|
-
return () => cache = cache || daffCustomerStoreCreditCreateSelectors();
|
|
136
|
-
})();
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* @inheritdoc
|
|
140
|
-
*/
|
|
141
|
-
class DaffCustomerStoreCreditPageFacade {
|
|
142
|
-
constructor(store) {
|
|
143
|
-
this.store = store;
|
|
144
|
-
const { selectStoreCredit, selectErrors, selectHasErrors, selectLoading, selectLoadingState, selectMutating, selectResolving, } = daffCustomerStoreCreditGetSelectors();
|
|
145
|
-
this.storeCredit$ = this.store.pipe(select(selectStoreCredit));
|
|
146
|
-
this.loadingState$ = this.store.pipe(select(selectLoadingState));
|
|
147
|
-
this.loading$ = this.store.pipe(select(selectLoading));
|
|
148
|
-
this.resolving$ = this.store.pipe(select(selectResolving));
|
|
149
|
-
this.mutating$ = this.store.pipe(select(selectMutating));
|
|
150
|
-
this.errors$ = this.store.pipe(select(selectErrors));
|
|
151
|
-
this.hasErrors$ = this.store.pipe(select(selectHasErrors));
|
|
152
|
-
}
|
|
153
|
-
dispatch(action) {
|
|
154
|
-
this.store.dispatch(action);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/** @nocollapse */ DaffCustomerStoreCreditPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
158
|
-
/** @nocollapse */ DaffCustomerStoreCreditPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, providedIn: 'root' });
|
|
159
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, decorators: [{
|
|
160
|
-
type: Injectable,
|
|
161
|
-
args: [{
|
|
162
|
-
providedIn: 'root',
|
|
163
|
-
}]
|
|
164
|
-
}], ctorParameters: function () { return [{ type: i1.Store }]; } });
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
168
|
-
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
169
|
-
*/
|
|
170
|
-
const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
171
|
-
|
|
172
|
-
class DaffCustomerStoreCreditEffects {
|
|
173
|
-
constructor(actions$, driver, errorMatcher) {
|
|
174
|
-
this.actions$ = actions$;
|
|
175
|
-
this.driver = driver;
|
|
176
|
-
this.errorMatcher = errorMatcher;
|
|
177
|
-
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction), switchMap((action) => this.driver.get().pipe(map(resp => new DaffCustomerStoreCreditLoadSuccess(resp)), catchError((error) => of(new DaffCustomerStoreCreditLoadFailure(this.errorMatcher(error))))))));
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/** @nocollapse */ DaffCustomerStoreCreditEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditEffects, deps: [{ token: i1$1.Actions }, { token: DaffCustomerStoreCreditDriver }, { token: DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
181
|
-
/** @nocollapse */ DaffCustomerStoreCreditEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditEffects });
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditEffects, decorators: [{
|
|
183
|
-
type: Injectable
|
|
184
|
-
}], ctorParameters: function () {
|
|
185
|
-
return [{ type: i1$1.Actions }, { type: undefined, decorators: [{
|
|
186
|
-
type: Inject,
|
|
187
|
-
args: [DaffCustomerStoreCreditDriver]
|
|
188
|
-
}] }, { type: undefined, decorators: [{
|
|
189
|
-
type: Inject,
|
|
190
|
-
args: [DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER]
|
|
191
|
-
}] }];
|
|
192
|
-
} });
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* An internal token to hold the Daffodil customer reducers.
|
|
196
|
-
* Includes the extra and standard reducers.
|
|
197
|
-
*
|
|
198
|
-
* @docs-private
|
|
199
|
-
*/
|
|
200
|
-
const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_REDUCERS', {
|
|
201
|
-
providedIn: 'any',
|
|
202
|
-
factory: () => daffComposeReducers([
|
|
203
|
-
combineReducers({
|
|
204
|
-
storeCredit: daffCustomerStoreCreditReducer,
|
|
205
|
-
}),
|
|
206
|
-
...inject(DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS),
|
|
207
|
-
]),
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Creates the customer store credit feature store.
|
|
212
|
-
*/
|
|
213
|
-
class DaffCustomerStoreCreditStateModule {
|
|
214
|
-
}
|
|
215
|
-
/** @nocollapse */ DaffCustomerStoreCreditStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
216
|
-
/** @nocollapse */ DaffCustomerStoreCreditStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] });
|
|
217
|
-
/** @nocollapse */ DaffCustomerStoreCreditStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditStateModule, imports: [StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),
|
|
218
|
-
EffectsModule.forFeature([
|
|
219
|
-
DaffCustomerStoreCreditEffects,
|
|
220
|
-
])] });
|
|
221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditStateModule, decorators: [{
|
|
222
|
-
type: NgModule,
|
|
223
|
-
args: [{
|
|
224
|
-
imports: [
|
|
225
|
-
StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),
|
|
226
|
-
EffectsModule.forFeature([
|
|
227
|
-
DaffCustomerStoreCreditEffects,
|
|
228
|
-
]),
|
|
229
|
-
],
|
|
230
|
-
}]
|
|
231
|
-
}] });
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Generated bundle index. Do not edit.
|
|
235
|
-
*/
|
|
236
|
-
|
|
237
|
-
export { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER, DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS, DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DaffCustomerStoreCreditActionTypes, DaffCustomerStoreCreditClearErrors, DaffCustomerStoreCreditLoad, DaffCustomerStoreCreditLoadFailure, DaffCustomerStoreCreditLoadSuccess, DaffCustomerStoreCreditPageFacade, DaffCustomerStoreCreditStateModule, daffCustomerProvideExtraReducers, daffCustomerStoreCreditGetSelectors, daffCustomerStoreCreditInitialState, daffCustomerStoreCreditReducer, getDaffCustomerStoreCreditReducersStateSelector };
|
|
238
|
-
//# sourceMappingURL=daffodil-customer-store-credit-state.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-state.mjs","sources":["../../../libs/customer-store-credit/state/src/actions/store-credit.actions.ts","../../../libs/customer-store-credit/state/src/reducers/store-feature-key.ts","../../../libs/customer-store-credit/state/src/reducers/token/extra.token.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/initial-state.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/reducer.ts","../../../libs/customer-store-credit/state/src/selectors/feature.selector.ts","../../../libs/customer-store-credit/state/src/selectors/store-credit/selector.ts","../../../libs/customer-store-credit/state/src/facades/store-credit/facade.ts","../../../libs/customer-store-credit/state/src/injection-tokens/error-matcher.token.ts","../../../libs/customer-store-credit/state/src/effects/store-credit.effects.ts","../../../libs/customer-store-credit/state/src/reducers/token/reducers.token.ts","../../../libs/customer-store-credit/state/src/state.module.ts","../../../libs/customer-store-credit/state/src/daffodil-customer-store-credit-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\n/**\n * The customer store credit action types enum.\n */\nexport enum DaffCustomerStoreCreditActionTypes {\n StoreCreditLoadAction = '[@daffodil/customer-store-credit] Store Credit Load Action',\n StoreCreditLoadSuccessAction = '[@daffodil/customer-store-credit] Store Credit Load Success Action',\n StoreCreditLoadFailureAction = '[@daffodil/customer-store-credit] Store Credit Load Failure Action',\n StoreCreditClearErrorsAction = '[@daffodil/customer-store-credit] Store Credit Clear Errors Action',\n}\n\n/**\n * Loads the store credit of the current customer.\n */\nexport class DaffCustomerStoreCreditLoad implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction;\n}\n\n/**\n * Indicates a successful load of the customer's store credit.\n */\nexport class DaffCustomerStoreCreditLoadSuccess<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction;\n\n constructor(public payload: T) {}\n}\n\n/**\n * A failed customer store credit load with the error message.\n */\nexport class DaffCustomerStoreCreditLoadFailure implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\n/**\n * An action to clear all errors in state.\n */\nexport class DaffCustomerStoreCreditClearErrors implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction;\n}\n\n/**\n * A union of the customer action types.\n */\nexport type DaffCustomerStoreCreditActions<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> =\n | DaffCustomerStoreCreditLoad\n | DaffCustomerStoreCreditLoadSuccess<TStoreCredit>\n | DaffCustomerStoreCreditLoadFailure\n | DaffCustomerStoreCreditClearErrors;\n","/**\n * The key under which the customer store credit feature state will be stored.\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY = 'daffCustomerStoreCredit';\n","import {\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport { ActionReducer } from '@ngrx/store';\n\nimport { DaffCustomerStoreCreditReducersState } from '../reducers.interface';\n\n/**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffCustomerProvideExtraReducers}.\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState>[]>(\n 'DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides additional reducers that run after the standard Daffodil customer reducers.\n *\n * ```ts\n * providers: [\n * ...daffCustomerProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffCustomerProvideExtraReducers(\n ...reducers: ActionReducer<DaffCustomerStoreCreditReducersState>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\n}\n","import { daffOperationInitialState } from '@daffodil/core/state';\n\nimport { DaffCustomerStoreCreditReducerState } from './type';\n\n/**\n * The initial state for the main customer store credit state, see {@link DaffCustomerStoreCreditReducerState}.\n */\nexport const daffCustomerStoreCreditInitialState: DaffCustomerStoreCreditReducerState = {\n ...daffOperationInitialState,\n storeCredit: {\n balance: 0,\n },\n};\n","import {\n daffCompleteOperation,\n daffOperationFailed,\n daffStartMutation,\n daffStartResolution,\n} from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { daffCustomerStoreCreditInitialState } from './initial-state';\nimport { DaffCustomerStoreCreditReducerState } from './type';\nimport {\n DaffCustomerStoreCreditActions,\n DaffCustomerStoreCreditActionTypes,\n DaffCustomerStoreCreditLoadFailure,\n} from '../../actions/store-credit.actions';\n\n/**\n * The reducer for the customer store credit page state, see {@link DaffCustomerStoreCreditReducerState}.\n */\nexport const daffCustomerStoreCreditReducer = <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(\n state = daffCustomerStoreCreditInitialState,\n action: DaffCustomerStoreCreditActions<T>,\n): DaffCustomerStoreCreditReducerState => {\n switch (action.type) {\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:\n return daffStartResolution(state);\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction:\n return {\n ...daffCompleteOperation(state),\n storeCredit: action.payload,\n };\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction:\n return daffCompleteOperation(state);\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction:\n return daffOperationFailed([(<DaffCustomerStoreCreditLoadFailure>action).payload], state);\n\n default:\n return state;\n }\n};\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport {\n DaffCustomerStoreCreditStateRootSlice,\n DaffCustomerStoreCreditReducersState,\n DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n/**\n * Selector for the customer store credit feature state.\n */\nexport interface DaffCustomerStoreCreditFeatureSelector<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit\n> {\n selectCustomerStoreCreditFeatureState: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<TStoreCredit>, DaffCustomerStoreCreditReducersState<TStoreCredit>>;\n}\n\nexport const getDaffCustomerStoreCreditReducersStateSelector = (() => {\n let cache;\n return <TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditFeatureSelector<TStoreCredit> =>\n cache = cache || {\n selectCustomerStoreCreditFeatureState: createFeatureSelector<DaffCustomerStoreCreditReducersState<TStoreCredit>>(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY),\n };\n})();\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n daffOperationStateSelectorFactory,\n DaffOperationStateSelectors,\n} from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport {\n DaffCustomerStoreCreditReducerState,\n DaffCustomerStoreCreditStateRootSlice,\n} from '../../reducers/public_api';\nimport { getDaffCustomerStoreCreditReducersStateSelector } from '../feature.selector';\n\n/**\n * Selectors for the main part of customer store credit state.\n */\nexport interface DaffCustomerStoreCreditSelectors<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> extends DaffOperationStateSelectors<DaffCustomerStoreCreditStateRootSlice<T>, DaffCustomerStoreCreditReducerState<T>> {\n /**\n * Selects the customer's current store credit balance.\n */\n selectStoreCredit: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<T>, T>;\n}\n\n/**\n * Creates a group of selectors for {@link DaffCustomerStoreCreditReducerState} that use the passed state selector as the basis.\n */\nconst daffCustomerStoreCreditCreateSelectors = <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditSelectors<T> => {\n const { selectCustomerStoreCreditFeatureState } = getDaffCustomerStoreCreditReducersStateSelector<T>();\n const selectCustomerStoreCreditState = createSelector(\n selectCustomerStoreCreditFeatureState,\n state => state.storeCredit,\n );\n const selectStoreCredit = createSelector(\n selectCustomerStoreCreditState,\n state => state.storeCredit,\n );\n\n return {\n ...daffOperationStateSelectorFactory(selectCustomerStoreCreditState),\n selectStoreCredit,\n };\n};\n\nexport const daffCustomerStoreCreditGetSelectors = (() => {\n let cache;\n return <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditSelectors<T> =>\n cache = cache || daffCustomerStoreCreditCreateSelectors<T>();\n})();\n\n","import { Injectable } from '@angular/core';\nimport {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DaffCustomerStoreCreditPageFacadeInterface } from './interface';\nimport {\n DaffCustomerStoreCreditReducerState,\n DaffCustomerStoreCreditStateRootSlice,\n} from '../../reducers/public_api';\nimport { daffCustomerStoreCreditGetSelectors } from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditPageFacade<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements DaffCustomerStoreCreditPageFacadeInterface<T> {\n storeCredit$: Observable<T>;\n loadingState$: Observable<DaffCustomerStoreCreditReducerState['daffState']>;\n loading$: Observable<boolean>;\n resolving$: Observable<boolean>;\n mutating$: Observable<boolean>;\n errors$: Observable<DaffCustomerStoreCreditReducerState['daffErrors']>;\n hasErrors$: Observable<boolean>;\n\n constructor(\n private store: Store<DaffCustomerStoreCreditStateRootSlice>,\n ) {\n const {\n selectStoreCredit,\n selectErrors,\n selectHasErrors,\n selectLoading,\n selectLoadingState,\n selectMutating,\n selectResolving,\n } = daffCustomerStoreCreditGetSelectors<T>();\n\n this.storeCredit$ = this.store.pipe(select(selectStoreCredit));\n this.loadingState$ = this.store.pipe(select(selectLoadingState));\n this.loading$ = this.store.pipe(select(selectLoading));\n this.resolving$ = this.store.pipe(select(selectResolving));\n this.mutating$ = this.store.pipe(select(selectMutating));\n this.errors$ = this.store.pipe(select(selectErrors));\n this.hasErrors$ = this.store.pipe(select(selectHasErrors));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport {\n switchMap,\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport {\n DaffCustomerStoreCreditDriver,\n DaffCustomerStoreCreditDriverInterface,\n} from '@daffodil/customer-store-credit/driver';\n\nimport {\n DaffCustomerStoreCreditActionTypes,\n DaffCustomerStoreCreditLoadFailure,\n DaffCustomerStoreCreditLoadSuccess,\n DaffCustomerStoreCreditActions,\n} from '../actions/store-credit.actions';\nimport { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER } from '../injection-tokens/public_api';\n\n@Injectable()\nexport class DaffCustomerStoreCreditEffects<\n T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> {\n constructor(\n private actions$: Actions<DaffCustomerStoreCreditActions<T>>,\n @Inject(DaffCustomerStoreCreditDriver) private driver: DaffCustomerStoreCreditDriverInterface<T>,\n @Inject(DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n ) {}\n\n list$ = createEffect(() => this.actions$.pipe(\n ofType(DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction),\n switchMap((action) =>\n this.driver.get().pipe(\n map(resp => new DaffCustomerStoreCreditLoadSuccess<T>(resp)),\n catchError((error: DaffError) => of(new DaffCustomerStoreCreditLoadFailure(this.errorMatcher(error)))),\n ),\n ),\n ));\n}\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { daffComposeReducers } from '@daffodil/core/state';\n// these unused imports are a workaround\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS } from './extra.token';\nimport { DaffCustomerStoreCreditReducersState } from '../reducers.interface';\nimport { daffCustomerStoreCreditReducer } from '../store-credit/public_api';\n\n/**\n * An internal token to hold the Daffodil customer reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS = new InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState>>(\n 'DAFF_CUSTOMER_STORE_CREDIT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n storeCredit: daffCustomerStoreCreditReducer,\n }),\n ...inject(DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffCustomerStoreCreditEffects } from './effects/store-credit.effects';\nimport { DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_CUSTOMER_STORE_CREDIT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the customer store credit feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),\n EffectsModule.forFeature([\n DaffCustomerStoreCreditEffects,\n ]),\n ],\n})\nexport class DaffCustomerStoreCreditStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;AAMA;;AAEG;AACS,IAAA,mCAKX;AALD,CAAA,UAAY,kCAAkC,EAAA;AAC5C,IAAA,kCAAA,CAAA,uBAAA,CAAA,GAAA,4DAAoF,CAAA;AACpF,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACrG,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,GAK7C,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IA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AC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;QACzG,aAAa,CAAC,UAAU,CAAC;YACvB,8BAA8B;SAC/B,CAAC,CAAA,EAAA,CAAA,CAAA;2FAGO,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAR9C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;wBACzG,aAAa,CAAC,UAAU,CAAC;4BACvB,8BAA8B;yBAC/B,CAAC;AACH,qBAAA;iBACF,CAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
import { faker } from '@faker-js/faker';
|
|
4
|
-
import { DaffModelFactory } from '@daffodil/core/testing';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Mock class for {@link DaffCustomerStoreCredit}.
|
|
8
|
-
*/
|
|
9
|
-
class MockDaffCustomerStoreCredit {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.balance = faker.datatype.number({ min: 0, max: 1000 });
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
;
|
|
15
|
-
/**
|
|
16
|
-
* Model factory for {@link DaffCustomerStoreCredit}.
|
|
17
|
-
*/
|
|
18
|
-
class DaffCustomerStoreCreditFactory extends DaffModelFactory {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(MockDaffCustomerStoreCredit);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/** @nocollapse */ DaffCustomerStoreCreditFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
24
|
-
/** @nocollapse */ DaffCustomerStoreCreditFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditFactory, providedIn: 'root' });
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditFactory, decorators: [{
|
|
26
|
-
type: Injectable,
|
|
27
|
-
args: [{
|
|
28
|
-
providedIn: 'root',
|
|
29
|
-
}]
|
|
30
|
-
}], ctorParameters: function () { return []; } });
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Generated bundle index. Do not edit.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
export { DaffCustomerStoreCreditFactory, MockDaffCustomerStoreCredit };
|
|
37
|
-
//# sourceMappingURL=daffodil-customer-store-credit-testing.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-testing.mjs","sources":["../../../libs/customer-store-credit/testing/src/factories/customer-store-credit.factory.ts","../../../libs/customer-store-credit/testing/src/daffodil-customer-store-credit-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\n/**\n * Mock class for {@link DaffCustomerStoreCredit}.\n */\nexport class MockDaffCustomerStoreCredit implements DaffCustomerStoreCredit {\n balance = faker.datatype.number({ min: 0, max: 1000 });\n};\n\n/**\n * Model factory for {@link DaffCustomerStoreCredit}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditFactory extends DaffModelFactory<DaffCustomerStoreCredit>{\n constructor() {\n super(MockDaffCustomerStoreCredit);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAMA;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;KACxD;AAAA,CAAA;AAAA,CAAC;AAEF;;AAEG;AAIG,MAAO,8BAA+B,SAAQ,gBAAyC,CAAA;AAC3F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,2BAA2B,CAAC,CAAC;KACpC;;8IAHU,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,mBAAA,8BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cAF7B,MAAM,EAAA,CAAA,CAAA;2FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule } from '@angular/core';
|
|
3
|
-
import { STATUS } from 'angular-in-memory-web-api';
|
|
4
|
-
import * as i1 from '@daffodil/customer-store-credit/testing';
|
|
5
|
-
import * as i1$1 from '@angular/common/http';
|
|
6
|
-
import { CommonModule } from '@angular/common';
|
|
7
|
-
import { DaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* An in-memory service that handles customer store credit HTTP requests.
|
|
11
|
-
*/
|
|
12
|
-
class DaffCustomerStoreCreditInMemoryBackendService {
|
|
13
|
-
constructor(factory) {
|
|
14
|
-
this.factory = factory;
|
|
15
|
-
this.storeCredit = this.factory.create();
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
|
|
19
|
-
*
|
|
20
|
-
* @param url initial url
|
|
21
|
-
* @param utils utility to parse url
|
|
22
|
-
* @returns ParsedRequestUrl
|
|
23
|
-
* @docs-private
|
|
24
|
-
*/
|
|
25
|
-
parseRequestUrl(url, utils) {
|
|
26
|
-
return utils.parseRequestUrl(url);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @docs-private
|
|
30
|
-
*/
|
|
31
|
-
createDb() {
|
|
32
|
-
return {
|
|
33
|
-
storeCredit: this.storeCredit,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Gets the customer's store credit.
|
|
38
|
-
*
|
|
39
|
-
* @param reqInfo request object
|
|
40
|
-
* @returns An http response object
|
|
41
|
-
*/
|
|
42
|
-
get(reqInfo) {
|
|
43
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
44
|
-
status: STATUS.OK,
|
|
45
|
-
body: this.storeCredit,
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/** @nocollapse */ DaffCustomerStoreCreditInMemoryBackendService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryBackendService, deps: [{ token: i1.DaffCustomerStoreCreditFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
50
|
-
/** @nocollapse */ DaffCustomerStoreCreditInMemoryBackendService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryBackendService, providedIn: 'root' });
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryBackendService, decorators: [{
|
|
52
|
-
type: Injectable,
|
|
53
|
-
args: [{
|
|
54
|
-
providedIn: 'root',
|
|
55
|
-
}]
|
|
56
|
-
}], ctorParameters: function () { return [{ type: i1.DaffCustomerStoreCreditFactory }]; } });
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The customer store credit in-memory driver to mock the customer store credit backend service.
|
|
60
|
-
*
|
|
61
|
-
* @inheritdoc
|
|
62
|
-
*/
|
|
63
|
-
class DaffCustomerStoreCreditInMemoryDriver {
|
|
64
|
-
constructor(http) {
|
|
65
|
-
this.http = http;
|
|
66
|
-
/**
|
|
67
|
-
* @docs-private
|
|
68
|
-
*/
|
|
69
|
-
this.url = '/api/customer-store-credit';
|
|
70
|
-
}
|
|
71
|
-
get() {
|
|
72
|
-
return this.http.get(this.url);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/** @nocollapse */ DaffCustomerStoreCreditInMemoryDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryDriver, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
76
|
-
/** @nocollapse */ DaffCustomerStoreCreditInMemoryDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryDriver, providedIn: 'root' });
|
|
77
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryDriver, decorators: [{
|
|
78
|
-
type: Injectable,
|
|
79
|
-
args: [{
|
|
80
|
-
providedIn: 'root',
|
|
81
|
-
}]
|
|
82
|
-
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Provides the {@link DaffCustomerStoreCreditInMemoryDriver} as the {@link DaffCustomerStoreCreditDriver}.
|
|
86
|
-
*/
|
|
87
|
-
class DaffCustomerStoreCreditInMemoryDriverModule {
|
|
88
|
-
static forRoot() {
|
|
89
|
-
return {
|
|
90
|
-
ngModule: DaffCustomerStoreCreditInMemoryDriverModule,
|
|
91
|
-
providers: [
|
|
92
|
-
{
|
|
93
|
-
provide: DaffCustomerStoreCreditDriver,
|
|
94
|
-
useExisting: DaffCustomerStoreCreditInMemoryDriver,
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/** @nocollapse */ DaffCustomerStoreCreditInMemoryDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
101
|
-
/** @nocollapse */ DaffCustomerStoreCreditInMemoryDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryDriverModule, imports: [CommonModule] });
|
|
102
|
-
/** @nocollapse */ DaffCustomerStoreCreditInMemoryDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryDriverModule, imports: [CommonModule] });
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCustomerStoreCreditInMemoryDriverModule, decorators: [{
|
|
104
|
-
type: NgModule,
|
|
105
|
-
args: [{
|
|
106
|
-
imports: [
|
|
107
|
-
CommonModule,
|
|
108
|
-
],
|
|
109
|
-
}]
|
|
110
|
-
}] });
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Generated bundle index. Do not edit.
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
export { DaffCustomerStoreCreditInMemoryBackendService, DaffCustomerStoreCreditInMemoryDriver, DaffCustomerStoreCreditInMemoryDriverModule };
|
|
117
|
-
//# sourceMappingURL=daffodil-customer-store-credit-driver-in-memory.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-driver-magento-testing.mjs","sources":["../../../libs/customer-store-credit/driver/magento/testing/src/factories/customer-store-credit.factory.ts","../../../libs/customer-store-credit/driver/magento/testing/src/daffodil-customer-store-credit-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoCustomerStoreCredit } from '@daffodil/customer-store-credit/driver/magento';\nimport { MagentoMoneyFactory } from '@daffodil/driver/magento/testing';\n\nexport class MockMagentoCustomerStoreCredit implements MagentoCustomerStoreCredit {\n __typename: 'CustomerStoreCredit' = 'CustomerStoreCredit';\n current_balance = this.moneyFactory.create();\n enabled = faker.datatype.boolean();\n\n constructor(\n protected moneyFactory: MagentoMoneyFactory,\n ) {}\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoCustomerStoreCreditFactory extends DaffModelFactory<MagentoCustomerStoreCredit> {\n constructor(\n moneyFactory: MagentoMoneyFactory,\n ) {\n super(MockMagentoCustomerStoreCredit, moneyFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAOa,8BAA8B,CAAA;AAKzC,IAAA,WAAA,CACY,YAAiC,EAAA;QAAjC,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAqB;QAL7C,IAAU,CAAA,UAAA,GAA0B,qBAAqB,CAAC;AAC1D,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;AAC7C,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;KAI/B;AACL,CAAA;AAKK,MAAO,iCAAkC,SAAQ,gBAA4C,CAAA;AACjG,IAAA,WAAA,CACE,YAAiC,EAAA;AAEjC,QAAA,KAAK,CAAC,8BAA8B,EAAE,YAAY,CAAC,CAAC;KACrD;;iJALU,iCAAiC,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,mBAAA,iCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iCAAiC,cAFhC,MAAM,EAAA,CAAA,CAAA;2FAEP,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAH7C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|