@bondsports/types 2.1.74 → 2.1.76

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@
9
9
  * ************************
10
10
  * ************************
11
11
  */
12
- import { NotificationDeliveryChannel } from '../types/enums/notification.enums';
12
+ import { NotificationClassification, NotificationDeliveryChannel } from '../types/enums/notification.enums';
13
13
  export declare class SenderDto {
14
14
  static UNKNOWN_USER_ID: number;
15
15
  userId: number;
@@ -36,6 +36,7 @@ export declare class ContentDto {
36
36
  }
37
37
  export declare class NotificationCreateDto {
38
38
  channel: NotificationDeliveryChannel;
39
+ classification?: NotificationClassification;
39
40
  sender: SenderDto;
40
41
  recipients: RecipientsDto[];
41
42
  content: ContentDto;
@@ -56,11 +56,15 @@ class ContentDto {
56
56
  }
57
57
  exports.ContentDto = ContentDto;
58
58
  class NotificationCreateDto {
59
+ constructor() {
60
+ this.classification = notification_enums_1.NotificationClassification.UNKNOWN;
61
+ }
59
62
  // Added for convenience.
60
63
  // Not part of NotificationsService object definitions.
61
64
  static sendgridTemplate(toEmailAddress, dynamicTemplateData, sendingUserId, sendingOrganizationId, sendingFacilityId) {
62
65
  const note = new NotificationCreateDto();
63
66
  note.channel = notification_enums_1.NotificationDeliveryChannel.EMAIL;
67
+ note.classification = notification_enums_1.NotificationClassification.TRANSACTIONAL;
64
68
  note.sender = new SenderDto(sendingUserId, sendingOrganizationId, sendingFacilityId);
65
69
  note.recipients = [RecipientsDto.to(toEmailAddress)];
66
70
  // there is no Content object when using a sendgrid template, it's the template and dynamic data:
@@ -1 +1 @@
1
- {"version":3,"file":"notification.create.dto.js","sourceRoot":"","sources":["../../../../src/types/notifications/dto/notification.create.dto.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,0EAAgF;AAEhF,0EAA0E;AAE1E,2CAA2C;AAC3C,6CAA6C;AAE7C,MAAa,SAAS;IAcrB,yBAAyB;IACzB,uDAAuD;IACvD,YACC,MAAc,EACd,cAAuB,EACvB,UAAmB,EACnB,OAAgB,EAChB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E,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,gDAA2B,CAAC,KAAK,CAAC;QACjD,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;QACrF,IAAI,CAAC,UAAU,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACrD,iGAAiG;QACjG,IAAI,CAAC,eAAe,GAAG;YACtB,wGAAwG;YACxG,mBAAmB,EAAE,mBAAmB;SACxC,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AApCD,sDAoCC"}
1
+ {"version":3,"file":"notification.create.dto.js","sourceRoot":"","sources":["../../../../src/types/notifications/dto/notification.create.dto.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,0EAA4G;AAE5G,0EAA0E;AAE1E,2CAA2C;AAC3C,6CAA6C;AAE7C,MAAa,SAAS;IAcrB,yBAAyB;IACzB,uDAAuD;IACvD,YACC,MAAc,EACd,cAAuB,EACvB,UAAmB,EACnB,OAAgB,EAChB,eAAwB;QAExB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACxC,CAAC;;AA5BF,8BA6BC;AA5BA,0GAA0G;AACnG,yBAAe,GAAG,CAAC,EAAE,CAAC;AA6B9B,MAAa,aAAa;IAYzB,yBAAyB;IACzB,uDAAuD;IACvD,MAAM,CAAC,EAAE,CAAC,EAAW;QACpB,MAAM,CAAC,GAAG,IAAI,aAAa,EAAE,CAAC;QAC9B,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtB,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enum NotificationDeliveryChannel {
12
12
  EMAIL = "EMAIL",
13
13
  SMS = "SMS"
14
14
  }
15
+ /**
16
+ * Transactional communications do not need to provide opt-out (for email, at least).
17
+ * Commercial communications (aka marketing messages) must provide a one-click opt-out mechanism for email
18
+ *
19
+ * NB: We may not wish to trust TENENT emails when they self-classify as transactional.
20
+ */
21
+ export declare enum NotificationClassification {
22
+ TRANSACTIONAL = "TRANSACTIONAL",
23
+ COMMERCIAL = "COMMERCIAL",
24
+ UNKNOWN = "UNKNOWN"
25
+ }
15
26
  export declare enum SendErrorCode {
16
27
  BAD_DELIVERY_CHANNEL = 400,
17
28
  SENDGRID_ERROR = 401,
@@ -10,13 +10,25 @@
10
10
  * ************************
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.SendErrorCode = exports.NotificationDeliveryChannel = void 0;
13
+ exports.SendErrorCode = exports.NotificationClassification = exports.NotificationDeliveryChannel = void 0;
14
14
  var NotificationDeliveryChannel;
15
15
  (function (NotificationDeliveryChannel) {
16
16
  NotificationDeliveryChannel["EMAIL"] = "EMAIL";
17
17
  // SMS is not yet implemented. Error will be returned if attempted.
18
18
  NotificationDeliveryChannel["SMS"] = "SMS";
19
19
  })(NotificationDeliveryChannel = exports.NotificationDeliveryChannel || (exports.NotificationDeliveryChannel = {}));
20
+ /**
21
+ * Transactional communications do not need to provide opt-out (for email, at least).
22
+ * Commercial communications (aka marketing messages) must provide a one-click opt-out mechanism for email
23
+ *
24
+ * NB: We may not wish to trust TENENT emails when they self-classify as transactional.
25
+ */
26
+ var NotificationClassification;
27
+ (function (NotificationClassification) {
28
+ NotificationClassification["TRANSACTIONAL"] = "TRANSACTIONAL";
29
+ NotificationClassification["COMMERCIAL"] = "COMMERCIAL";
30
+ NotificationClassification["UNKNOWN"] = "UNKNOWN";
31
+ })(NotificationClassification = exports.NotificationClassification || (exports.NotificationClassification = {}));
20
32
  // Internal error codes.
21
33
  // NB: Specific errors (ie. from Sendgrid) will be logged and returned directly.
22
34
  // We are not translating each, as they are quite granular, and prone to frequent updates by service providers.
@@ -1 +1 @@
1
- {"version":3,"file":"notification.enums.js","sourceRoot":"","sources":["../../../../../src/types/notifications/types/enums/notification.enums.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,IAAY,2BAIX;AAJD,WAAY,2BAA2B;IACtC,8CAAe,CAAA;IACf,oEAAoE;IACpE,0CAAW,CAAA;AACZ,CAAC,EAJW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAItC;AAED,wBAAwB;AACxB,gFAAgF;AAChF,+GAA+G;AAC/G,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,mFAA0B,CAAA;IAC1B,uEAAoB,CAAA;IACpB,uEAAoB,CAAA;AACrB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
1
+ {"version":3,"file":"notification.enums.js","sourceRoot":"","sources":["../../../../../src/types/notifications/types/enums/notification.enums.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,IAAY,2BAIX;AAJD,WAAY,2BAA2B;IACtC,8CAAe,CAAA;IACf,oEAAoE;IACpE,0CAAW,CAAA;AACZ,CAAC,EAJW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAItC;AAED;;;;;GAKG;AACH,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACrC,6DAA+B,CAAA;IAC/B,uDAAyB,CAAA;IACzB,iDAAmB,CAAA;AACpB,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AAED,wBAAwB;AACxB,gFAAgF;AAChF,+GAA+G;AAC/G,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,mFAA0B,CAAA;IAC1B,uEAAoB,CAAA;IACpB,uEAAoB,CAAA;AACrB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
@@ -2,13 +2,14 @@ import { UserAnswersDto } from '../../dto/application.dto';
2
2
  import { Customer } from '../../entity/Customer';
3
3
  import { Invoice } from '../../entity/Invoice';
4
4
  import { ProductsUsers } from '../../entity/ProductsUsers';
5
+ import { ByOrganizationIdDto } from '../../organization/dto/organization.dto';
5
6
  import { ScheduledPaymentDto } from '../../payment/dto/payment-plan.dto';
6
7
  import { Payment } from '../../payment/entities/Payment';
7
8
  import { FuturePaymentStatusEnum, PaymentMethodTypeEnum, PaymentStatusEnum } from '../../payment/types/enums/payment.enums';
8
- import { PlatformsEnum, ResourceNameTypeEnum } from '../../services/enums.service';
9
9
  import { ResourceDto } from '../../resources/dto/resource.dto';
10
- import { ByOrganizationIdDto } from '../../organization/dto/organization.dto';
11
- export declare class PurchasePaymentDto {
10
+ import { PlatformsEnum, ResourceNameTypeEnum } from '../../services/enums.service';
11
+ import { IPurchasePayment } from '../types/interfaces/purchase.interfaces';
12
+ export declare class PurchasePaymentDto implements IPurchasePayment {
12
13
  type: PaymentMethodTypeEnum;
13
14
  token?: string;
14
15
  paymentMethodId?: number;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PurchaseCartDto = exports.PurchaseResultDto = exports.ValidateParticipantDto = exports.PartialPaymentAsUserDto = exports.AddItemsDto = exports.RedeemPunchCardRequestDto = exports.PartialPaymentRequestDto = exports.ScheduledPaymentRequestBodyDto = exports.ScheduledPaymentRequestDto = exports.ScheduledPaymentConsumerRequestDto = exports.PurchaseProductDto = exports.PurchaseResourceDto = exports.PurchaseRequestDto = exports.ChargeRentalsReuqestDto = exports.PurchasePaymentDto = void 0;
4
- const resource_dto_1 = require("../../resources/dto/resource.dto");
5
4
  const organization_dto_1 = require("../../organization/dto/organization.dto");
5
+ const resource_dto_1 = require("../../resources/dto/resource.dto");
6
6
  class PurchasePaymentDto {
7
7
  }
8
8
  exports.PurchasePaymentDto = PurchasePaymentDto;
@@ -1 +1 @@
1
- {"version":3,"file":"purchase.dto.js","sourceRoot":"","sources":["../../../../src/types/purchase/dto/purchase.dto.ts"],"names":[],"mappings":";;;AAYA,mEAA+D;AAE/D,8EAA8E;AAE9E,MAAa,kBAAkB;CAQ9B;AARD,gDAQC;AAED,MAAa,uBAAuB;CAkBnC;AAlBD,0DAkBC;AAED,MAAa,kBAAkB;CA8B9B;AA9BD,gDA8BC;AAED,MAAa,mBAAoB,SAAQ,0BAAW;CAInD;AAJD,kDAIC;AAED,MAAa,kBAAkB;CA6B9B;AA7BD,gDA6BC;AAED,MAAa,kCAAkC;CAM9C;AAND,gFAMC;AAED,MAAa,0BAA2B,SAAQ,sCAAmB;CAIlE;AAJD,gEAIC;AAED,MAAa,8BAA8B;CAU1C;AAVD,wEAUC;AAED,MAAa,wBAAwB;CAgBpC;AAhBD,4DAgBC;AAED,MAAa,yBAAyB;CAQrC;AARD,8DAQC;AAED,MAAa,WAAW;IAAxB;QAGC,qBAAgB,GAAG,KAAK,CAAC;QAEzB,aAAQ,GAAG,KAAK,CAAC;IAClB,CAAC;CAAA;AAND,kCAMC;AAED,MAAa,uBAAuB;CAUnC;AAVD,0DAUC;AAED,MAAa,sBAAsB;CAElC;AAFD,wDAEC;AAED,MAAa,iBAAiB;CAU7B;AAVD,8CAUC;AAED,MAAa,eAAe;CAgB3B;AAhBD,0CAgBC"}
1
+ {"version":3,"file":"purchase.dto.js","sourceRoot":"","sources":["../../../../src/types/purchase/dto/purchase.dto.ts"],"names":[],"mappings":";;;AAIA,8EAA8E;AAQ9E,mEAA+D;AAK/D,MAAa,kBAAkB;CAQ9B;AARD,gDAQC;AAED,MAAa,uBAAuB;CAkBnC;AAlBD,0DAkBC;AAED,MAAa,kBAAkB;CA8B9B;AA9BD,gDA8BC;AAED,MAAa,mBAAoB,SAAQ,0BAAW;CAInD;AAJD,kDAIC;AAED,MAAa,kBAAkB;CA6B9B;AA7BD,gDA6BC;AAED,MAAa,kCAAkC;CAM9C;AAND,gFAMC;AAED,MAAa,0BAA2B,SAAQ,sCAAmB;CAIlE;AAJD,gEAIC;AAED,MAAa,8BAA8B;CAU1C;AAVD,wEAUC;AAED,MAAa,wBAAwB;CAgBpC;AAhBD,4DAgBC;AAED,MAAa,yBAAyB;CAQrC;AARD,8DAQC;AAED,MAAa,WAAW;IAAxB;QAGC,qBAAgB,GAAG,KAAK,CAAC;QAEzB,aAAQ,GAAG,KAAK,CAAC;IAClB,CAAC;CAAA;AAND,kCAMC;AAED,MAAa,uBAAuB;CAUnC;AAVD,0DAUC;AAED,MAAa,sBAAsB;CAElC;AAFD,wDAEC;AAED,MAAa,iBAAiB;CAU7B;AAVD,8CAUC;AAED,MAAa,eAAe;CAgB3B;AAhBD,0CAgBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bondsports/types",
3
- "version": "2.1.74",
3
+ "version": "2.1.76",
4
4
  "description": "backend types module for Bond-Sports",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {