@pvh-afl/graphql 1.1.2 → 1.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.module.d.ts","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":"AAqBA,qBA0Ba,aAAa;CAAG"}
1
+ {"version":3,"file":"graphql.module.d.ts","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":"AAsBA,qBA2Ba,aAAa;CAAG"}
@@ -16,6 +16,7 @@ const header_module_1 = require("./header/header.module");
16
16
  const serviceability_module_1 = require("./serviceability/serviceability.module");
17
17
  const store_locator_module_1 = require("./store-locator/store-locator.module");
18
18
  const order_tracking_module_1 = require("./order-tracking/order-tracking.module");
19
+ const loyalty_module_1 = require("./loyalty/loyalty.module");
19
20
  let GraphqlModule = class GraphqlModule {
20
21
  };
21
22
  exports.GraphqlModule = GraphqlModule;
@@ -44,6 +45,7 @@ exports.GraphqlModule = GraphqlModule = tslib_1.__decorate([
44
45
  serviceability_module_1.ServiceabilityModule,
45
46
  store_locator_module_1.StoreLocatorModule,
46
47
  order_tracking_module_1.OrderTrackingModule,
48
+ loyalty_module_1.LoyaltyModule,
47
49
  ],
48
50
  })
49
51
  ], GraphqlModule);
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.module.js","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2CAAkE;AAClE,+BAA4B;AAE5B,6DAAyD;AACzD,sEAAkE;AAClE,oDAAgD;AAChD,iDAA6C;AAC7C,4EAAuE;AACvE,qFAAgF;AAChF,0DAAsD;AACtD,kFAA8E;AAC9E,+EAA0E;AAC1E,kFAA6E;AAiCtE,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IA1BzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,OAAO,CAAqB;gBACxC,MAAM,EAAE,qBAAY;gBACpB,cAAc,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC;gBACrD,UAAU,EAAE,IAAI;gBAChB,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,CAAC,EAAE,GAAG,EAA6B,EAAE,EAAE,CAAC,CAAC;oBAChD,GAAG;oBACH,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,WAAW,EAAE,GAAG,CAAC,WAAW;iBAC7B,CAAC;aACH,CAAC;YACF,8BAAa;YACb,oCAAgB;YAChB,wBAAU;YACV,sBAAS;YACT,uCAAiB;YACjB,6CAAoB;YACpB,4BAAY;YACZ,4CAAoB;YACpB,yCAAkB;YAClB,2CAAmB;SACpB;KACF,CAAC;GACW,aAAa,CAAG"}
1
+ {"version":3,"file":"graphql.module.js","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2CAAkE;AAClE,+BAA4B;AAE5B,6DAAyD;AACzD,sEAAkE;AAClE,oDAAgD;AAChD,iDAA6C;AAC7C,4EAAuE;AACvE,qFAAgF;AAChF,0DAAsD;AACtD,kFAA8E;AAC9E,+EAA0E;AAC1E,kFAA6E;AAC7E,6DAAyD;AAkClD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IA3BzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,OAAO,CAAqB;gBACxC,MAAM,EAAE,qBAAY;gBACpB,cAAc,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC;gBACrD,UAAU,EAAE,IAAI;gBAChB,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,CAAC,EAAE,GAAG,EAA6B,EAAE,EAAE,CAAC,CAAC;oBAChD,GAAG;oBACH,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,WAAW,EAAE,GAAG,CAAC,WAAW;iBAC7B,CAAC;aACH,CAAC;YACF,8BAAa;YACb,oCAAgB;YAChB,wBAAU;YACV,sBAAS;YACT,uCAAiB;YACjB,6CAAoB;YACpB,4BAAY;YACZ,4CAAoB;YACpB,yCAAkB;YAClB,2CAAmB;YACnB,8BAAa;SACd;KACF,CAAC;GACW,aAAa,CAAG"}
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './collection';
10
10
  export * from './serviceability';
11
11
  export * from './store-locator';
12
12
  export * from './order-tracking';
13
+ export * from './loyalty';
13
14
  export * from './page-content';
14
15
  export * from './product-content';
15
16
  export * from './header';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,WAAW,CAAC;AAG1B,cAAc,QAAQ,CAAC;AAGvB,cAAc,cAAc,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,UAAU,CAAC;AAGzB,cAAc,OAAO,CAAC;AAGtB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,WAAW,CAAC;AAG1B,cAAc,QAAQ,CAAC;AAGvB,cAAc,cAAc,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,WAAW,CAAC;AAG1B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,UAAU,CAAC;AAGzB,cAAc,OAAO,CAAC;AAGtB,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -20,6 +20,8 @@ tslib_1.__exportStar(require("./serviceability"), exports);
20
20
  tslib_1.__exportStar(require("./store-locator"), exports);
21
21
  // Order Tracking
22
22
  tslib_1.__exportStar(require("./order-tracking"), exports);
23
+ // Loyalty
24
+ tslib_1.__exportStar(require("./loyalty"), exports);
23
25
  // Page Content
24
26
  tslib_1.__exportStar(require("./page-content"), exports);
25
27
  // Product Content
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mDAAmD;AACnD,2DAAiC;AAEjC,UAAU;AACV,oDAA0B;AAE1B,OAAO;AACP,iDAAuB;AAEvB,aAAa;AACb,uDAA6B;AAE7B,iBAAiB;AACjB,2DAAiC;AAEjC,gBAAgB;AAChB,0DAAgC;AAEhC,iBAAiB;AACjB,2DAAiC;AAEjC,eAAe;AACf,yDAA+B;AAE/B,kBAAkB;AAClB,4DAAkC;AAElC,SAAS;AACT,mDAAyB;AAEzB,MAAM;AACN,gDAAsB;AAEtB,2BAA2B;AAC3B,mDAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mDAAmD;AACnD,2DAAiC;AAEjC,UAAU;AACV,oDAA0B;AAE1B,OAAO;AACP,iDAAuB;AAEvB,aAAa;AACb,uDAA6B;AAE7B,iBAAiB;AACjB,2DAAiC;AAEjC,gBAAgB;AAChB,0DAAgC;AAEhC,iBAAiB;AACjB,2DAAiC;AAEjC,UAAU;AACV,oDAA0B;AAE1B,eAAe;AACf,yDAA+B;AAE/B,kBAAkB;AAClB,4DAAkC;AAElC,SAAS;AACT,mDAAyB;AAEzB,MAAM;AACN,gDAAsB;AAEtB,2BAA2B;AAC3B,mDAAyB"}
@@ -0,0 +1,5 @@
1
+ export * from './loyalty.module';
2
+ export * from './loyalty.resolver';
3
+ export * from './loyalty.service';
4
+ export * from './loyalty.types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loyalty/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./loyalty.module"), exports);
5
+ tslib_1.__exportStar(require("./loyalty.resolver"), exports);
6
+ tslib_1.__exportStar(require("./loyalty.service"), exports);
7
+ tslib_1.__exportStar(require("./loyalty.types"), exports);
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/loyalty/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,6DAAmC;AACnC,4DAAkC;AAClC,0DAAgC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Loyalty Module
3
+ *
4
+ * GraphQL module for customer loyalty functionality.
5
+ */
6
+ export declare class LoyaltyModule {
7
+ }
8
+ //# sourceMappingURL=loyalty.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.module.d.ts","sourceRoot":"","sources":["../../src/loyalty/loyalty.module.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,qBAIa,aAAa;CAAG"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoyaltyModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@pvh-afl/core");
7
+ const loyalty_resolver_1 = require("./loyalty.resolver");
8
+ const loyalty_service_1 = require("./loyalty.service");
9
+ /**
10
+ * Loyalty Module
11
+ *
12
+ * GraphQL module for customer loyalty functionality.
13
+ */
14
+ let LoyaltyModule = class LoyaltyModule {
15
+ };
16
+ exports.LoyaltyModule = LoyaltyModule;
17
+ exports.LoyaltyModule = LoyaltyModule = tslib_1.__decorate([
18
+ (0, common_1.Module)({
19
+ imports: [core_1.IntegrationsModule],
20
+ providers: [loyalty_resolver_1.LoyaltyResolver, loyalty_service_1.LoyaltyService],
21
+ })
22
+ ], LoyaltyModule);
23
+ //# sourceMappingURL=loyalty.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.module.js","sourceRoot":"","sources":["../../src/loyalty/loyalty.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,wCAAmD;AACnD,yDAAqD;AACrD,uDAAmD;AAEnD;;;;GAIG;AAKI,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAJzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAkB,CAAC;QAC7B,SAAS,EAAE,CAAC,kCAAe,EAAE,gCAAc,CAAC;KAC7C,CAAC;GACW,aAAa,CAAG"}
@@ -0,0 +1,15 @@
1
+ import { LoyaltyService } from './loyalty.service';
2
+ import { CustomerCouponsInput, CustomerCouponsResult } from './loyalty.types';
3
+ /**
4
+ * Loyalty Resolver
5
+ *
6
+ * GraphQL resolver for listing a customer's coupons.
7
+ */
8
+ export declare class LoyaltyResolver {
9
+ private readonly loyaltyService;
10
+ constructor(loyaltyService: LoyaltyService);
11
+ getCustomerCoupons(input: CustomerCouponsInput, context: {
12
+ brand: string;
13
+ }): Promise<CustomerCouponsResult>;
14
+ }
15
+ //# sourceMappingURL=loyalty.resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.resolver.d.ts","sourceRoot":"","sources":["../../src/loyalty/loyalty.resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE9E;;;;GAIG;AACH,qBACa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IAMrD,kBAAkB,CACP,KAAK,EAAE,oBAAoB,EAC/B,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GACpC,OAAO,CAAC,qBAAqB,CAAC;CAGlC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoyaltyResolver = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_1 = require("@nestjs/graphql");
6
+ const common_1 = require("@nestjs/common");
7
+ const core_1 = require("@pvh-afl/core");
8
+ const loyalty_service_1 = require("./loyalty.service");
9
+ const loyalty_types_1 = require("./loyalty.types");
10
+ /**
11
+ * Loyalty Resolver
12
+ *
13
+ * GraphQL resolver for listing a customer's coupons.
14
+ */
15
+ let LoyaltyResolver = class LoyaltyResolver {
16
+ loyaltyService;
17
+ constructor(loyaltyService) {
18
+ this.loyaltyService = loyaltyService;
19
+ }
20
+ async getCustomerCoupons(input, context) {
21
+ return this.loyaltyService.getCustomerCoupons(context.brand, input);
22
+ }
23
+ };
24
+ exports.LoyaltyResolver = LoyaltyResolver;
25
+ tslib_1.__decorate([
26
+ (0, graphql_1.Query)(() => loyalty_types_1.CustomerCouponsResult, {
27
+ description: 'Get a customer coupons by mobile number and coupon state',
28
+ }),
29
+ (0, common_1.UseGuards)(core_1.TenantGuard),
30
+ tslib_1.__param(0, (0, graphql_1.Args)('input')),
31
+ tslib_1.__param(1, (0, graphql_1.Context)()),
32
+ tslib_1.__metadata("design:type", Function),
33
+ tslib_1.__metadata("design:paramtypes", [loyalty_types_1.CustomerCouponsInput, Object]),
34
+ tslib_1.__metadata("design:returntype", Promise)
35
+ ], LoyaltyResolver.prototype, "getCustomerCoupons", null);
36
+ exports.LoyaltyResolver = LoyaltyResolver = tslib_1.__decorate([
37
+ (0, graphql_1.Resolver)(),
38
+ tslib_1.__metadata("design:paramtypes", [loyalty_service_1.LoyaltyService])
39
+ ], LoyaltyResolver);
40
+ //# sourceMappingURL=loyalty.resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.resolver.js","sourceRoot":"","sources":["../../src/loyalty/loyalty.resolver.ts"],"names":[],"mappings":";;;;AAAA,6CAAiE;AACjE,2CAA2C;AAC3C,wCAA4C;AAC5C,uDAAmD;AACnD,mDAA8E;AAE9E;;;;GAIG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAMzD,AAAN,KAAK,CAAC,kBAAkB,CACP,KAA2B,EAC/B,OAA0B;QAErC,OAAO,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AAbY,0CAAe;AAOpB;IAJL,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,qCAAqB,EAAE;QAClC,WAAW,EAAE,0DAA0D;KACxE,CAAC;IACD,IAAA,kBAAS,EAAC,kBAAW,CAAC;IAEpB,mBAAA,IAAA,cAAI,EAAC,OAAO,CAAC,CAAA;IACb,mBAAA,IAAA,iBAAO,GAAE,CAAA;;6CADY,oCAAoB;;yDAI3C;0BAZU,eAAe;IAD3B,IAAA,kBAAQ,GAAE;6CAEoC,gCAAc;GADhD,eAAe,CAa3B"}
@@ -0,0 +1,13 @@
1
+ import { CapillaryCouponService } from '@pvh-afl/core';
2
+ import { CustomerCouponsInput, CustomerCouponsResult } from './loyalty.types';
3
+ /**
4
+ * Loyalty Service
5
+ *
6
+ * Fetches customer coupons from Capillary.
7
+ */
8
+ export declare class LoyaltyService {
9
+ private readonly couponService;
10
+ constructor(couponService: CapillaryCouponService);
11
+ getCustomerCoupons(brand: string, input: CustomerCouponsInput): Promise<CustomerCouponsResult>;
12
+ }
13
+ //# sourceMappingURL=loyalty.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.service.d.ts","sourceRoot":"","sources":["../../src/loyalty/loyalty.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAU,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE9E;;;;GAIG;AACH,qBACa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,sBAAsB;IAE5D,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;CAalC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoyaltyService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@pvh-afl/core");
7
+ /**
8
+ * Loyalty Service
9
+ *
10
+ * Fetches customer coupons from Capillary.
11
+ */
12
+ let LoyaltyService = class LoyaltyService {
13
+ couponService;
14
+ constructor(couponService) {
15
+ this.couponService = couponService;
16
+ }
17
+ async getCustomerCoupons(brand, input) {
18
+ core_1.logger.info('Fetching customer coupons', {
19
+ brand,
20
+ mobile: input.mobile,
21
+ state: input.state,
22
+ });
23
+ return this.couponService.getCustomerCoupons(brand, input.mobile, input.state);
24
+ }
25
+ };
26
+ exports.LoyaltyService = LoyaltyService;
27
+ exports.LoyaltyService = LoyaltyService = tslib_1.__decorate([
28
+ (0, common_1.Injectable)(),
29
+ tslib_1.__metadata("design:paramtypes", [core_1.CapillaryCouponService])
30
+ ], LoyaltyService);
31
+ //# sourceMappingURL=loyalty.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.service.js","sourceRoot":"","sources":["../../src/loyalty/loyalty.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,wCAA+D;AAG/D;;;;GAIG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAc;IACI;IAA7B,YAA6B,aAAqC;QAArC,kBAAa,GAAb,aAAa,CAAwB;IAAG,CAAC;IAEtE,KAAK,CAAC,kBAAkB,CACtB,KAAa,EACb,KAA2B;QAE3B,aAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;YACvC,KAAK;YACL,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAC1C,KAAK,EACL,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,KAAK,CACZ,CAAC;IACJ,CAAC;CACF,CAAA;AAnBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;6CAEiC,6BAAsB;GADvD,cAAc,CAmB1B"}
@@ -0,0 +1,28 @@
1
+ import { CouponState } from '@pvh-afl/core';
2
+ export declare class CustomerCouponsInput {
3
+ mobile: string;
4
+ state: CouponState;
5
+ }
6
+ /**
7
+ * A single coupon issued to the customer
8
+ */
9
+ export declare class CustomerCoupon {
10
+ code: string;
11
+ seriesId: number;
12
+ description?: string;
13
+ validTill: string;
14
+ validTillDateTime?: string;
15
+ discountType: string;
16
+ discountValue: number;
17
+ discountUpto?: number;
18
+ redemptionsLeft: number;
19
+ issuedOn?: string;
20
+ }
21
+ /**
22
+ * Customer coupon listing result
23
+ */
24
+ export declare class CustomerCouponsResult {
25
+ coupons: CustomerCoupon[];
26
+ message: string;
27
+ }
28
+ //# sourceMappingURL=loyalty.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.types.d.ts","sourceRoot":"","sources":["../../src/loyalty/loyalty.types.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA2B5C,qBACa,oBAAoB;IAE/B,MAAM,EAAG,MAAM,CAAC;IAKhB,KAAK,EAAG,WAAW,CAAC;CACrB;AAMD;;GAEG;AACH,qBACa,cAAc;IAEzB,IAAI,EAAG,MAAM,CAAC;IAGd,QAAQ,EAAG,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAG,MAAM,CAAC;IAGnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,YAAY,EAAG,MAAM,CAAC;IAGtB,aAAa,EAAG,MAAM,CAAC;IAMvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,eAAe,EAAG,MAAM,CAAC;IAGzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBACa,qBAAqB;IAIhC,OAAO,EAAG,cAAc,EAAE,CAAC;IAM3B,OAAO,EAAG,MAAM,CAAC;CAClB"}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerCouponsResult = exports.CustomerCoupon = exports.CustomerCouponsInput = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_1 = require("@nestjs/graphql");
6
+ const core_1 = require("@pvh-afl/core");
7
+ /**
8
+ * GraphQL Types for Loyalty
9
+ *
10
+ * Customer coupon listing backed by the Capillary loyalty APIs.
11
+ */
12
+ (0, graphql_1.registerEnumType)(core_1.CouponState, {
13
+ name: 'CouponState',
14
+ description: 'Which slice of the customer coupons to return',
15
+ valuesMap: {
16
+ ACTIVE: { description: 'Coupons Capillary reports as active' },
17
+ REDEEMABLE: {
18
+ description: 'Coupons that can be redeemed right now (not implemented yet)',
19
+ },
20
+ BOTH: {
21
+ description: 'Active coupons flagged with their redeemability (not implemented yet)',
22
+ },
23
+ },
24
+ });
25
+ // ============================================================================
26
+ // Input Types
27
+ // ============================================================================
28
+ let CustomerCouponsInput = class CustomerCouponsInput {
29
+ mobile;
30
+ state;
31
+ };
32
+ exports.CustomerCouponsInput = CustomerCouponsInput;
33
+ tslib_1.__decorate([
34
+ (0, graphql_1.Field)({ description: 'Customer mobile number registered with Capillary' }),
35
+ tslib_1.__metadata("design:type", String)
36
+ ], CustomerCouponsInput.prototype, "mobile", void 0);
37
+ tslib_1.__decorate([
38
+ (0, graphql_1.Field)(() => core_1.CouponState, {
39
+ description: 'Coupon state to filter by. Only ACTIVE is implemented today',
40
+ }),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], CustomerCouponsInput.prototype, "state", void 0);
43
+ exports.CustomerCouponsInput = CustomerCouponsInput = tslib_1.__decorate([
44
+ (0, graphql_1.InputType)()
45
+ ], CustomerCouponsInput);
46
+ // ============================================================================
47
+ // Output Types
48
+ // ============================================================================
49
+ /**
50
+ * A single coupon issued to the customer
51
+ */
52
+ let CustomerCoupon = class CustomerCoupon {
53
+ code;
54
+ seriesId;
55
+ description;
56
+ validTill;
57
+ validTillDateTime;
58
+ discountType;
59
+ discountValue;
60
+ discountUpto;
61
+ redemptionsLeft;
62
+ issuedOn;
63
+ };
64
+ exports.CustomerCoupon = CustomerCoupon;
65
+ tslib_1.__decorate([
66
+ (0, graphql_1.Field)({ description: 'Coupon code' }),
67
+ tslib_1.__metadata("design:type", String)
68
+ ], CustomerCoupon.prototype, "code", void 0);
69
+ tslib_1.__decorate([
70
+ (0, graphql_1.Field)(() => graphql_1.Int, { description: 'Capillary coupon series ID' }),
71
+ tslib_1.__metadata("design:type", Number)
72
+ ], CustomerCoupon.prototype, "seriesId", void 0);
73
+ tslib_1.__decorate([
74
+ (0, graphql_1.Field)({ nullable: true, description: 'Coupon description' }),
75
+ tslib_1.__metadata("design:type", String)
76
+ ], CustomerCoupon.prototype, "description", void 0);
77
+ tslib_1.__decorate([
78
+ (0, graphql_1.Field)({ description: 'Date the coupon stops being valid' }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], CustomerCoupon.prototype, "validTill", void 0);
81
+ tslib_1.__decorate([
82
+ (0, graphql_1.Field)({ nullable: true, description: 'Expiry with end-of-day time' }),
83
+ tslib_1.__metadata("design:type", String)
84
+ ], CustomerCoupon.prototype, "validTillDateTime", void 0);
85
+ tslib_1.__decorate([
86
+ (0, graphql_1.Field)({ description: 'Discount type (ABS for flat, PERC for percentage)' }),
87
+ tslib_1.__metadata("design:type", String)
88
+ ], CustomerCoupon.prototype, "discountType", void 0);
89
+ tslib_1.__decorate([
90
+ (0, graphql_1.Field)(() => graphql_1.Float, { description: 'Discount amount or percentage' }),
91
+ tslib_1.__metadata("design:type", Number)
92
+ ], CustomerCoupon.prototype, "discountValue", void 0);
93
+ tslib_1.__decorate([
94
+ (0, graphql_1.Field)(() => graphql_1.Float, {
95
+ nullable: true,
96
+ description: 'Maximum discount for percentage coupons',
97
+ }),
98
+ tslib_1.__metadata("design:type", Number)
99
+ ], CustomerCoupon.prototype, "discountUpto", void 0);
100
+ tslib_1.__decorate([
101
+ (0, graphql_1.Field)(() => graphql_1.Int, { description: 'Redemptions remaining on this coupon' }),
102
+ tslib_1.__metadata("design:type", Number)
103
+ ], CustomerCoupon.prototype, "redemptionsLeft", void 0);
104
+ tslib_1.__decorate([
105
+ (0, graphql_1.Field)({ nullable: true, description: 'Date the coupon was issued' }),
106
+ tslib_1.__metadata("design:type", String)
107
+ ], CustomerCoupon.prototype, "issuedOn", void 0);
108
+ exports.CustomerCoupon = CustomerCoupon = tslib_1.__decorate([
109
+ (0, graphql_1.ObjectType)()
110
+ ], CustomerCoupon);
111
+ /**
112
+ * Customer coupon listing result
113
+ */
114
+ let CustomerCouponsResult = class CustomerCouponsResult {
115
+ coupons;
116
+ message;
117
+ };
118
+ exports.CustomerCouponsResult = CustomerCouponsResult;
119
+ tslib_1.__decorate([
120
+ (0, graphql_1.Field)(() => [CustomerCoupon], {
121
+ description: 'Coupons matching the requested state',
122
+ }),
123
+ tslib_1.__metadata("design:type", Array)
124
+ ], CustomerCouponsResult.prototype, "coupons", void 0);
125
+ tslib_1.__decorate([
126
+ (0, graphql_1.Field)({
127
+ description: 'Human-readable outcome, so an empty list is never returned bare',
128
+ }),
129
+ tslib_1.__metadata("design:type", String)
130
+ ], CustomerCouponsResult.prototype, "message", void 0);
131
+ exports.CustomerCouponsResult = CustomerCouponsResult = tslib_1.__decorate([
132
+ (0, graphql_1.ObjectType)()
133
+ ], CustomerCouponsResult);
134
+ //# sourceMappingURL=loyalty.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.types.js","sourceRoot":"","sources":["../../src/loyalty/loyalty.types.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pvh-afl/graphql",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "AFL GraphQL - Shared GraphQL modules for multi-brand commerce platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",