adamo-types 1.1.11 → 1.1.14

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.
@@ -83,3 +83,14 @@ export declare enum StorageConfiguration {
83
83
  BLACKLISTED_APARTMENTS_OPERATORS = "BLACKLISTED_APARTMENTS_OPERATORS",
84
84
  FORBIDDEN_SALE_PROCESS_STATUSES = "FORBIDDEN_SALE_PROCESS_STATUSES"
85
85
  }
86
+ export declare enum MicroserviceType {
87
+ AMS = "AMS",
88
+ ARS_EDGE = "ARS EDGE",
89
+ BSS_BRIDGE = "BSS BRIDGE",
90
+ DB_BRIDGE = "DB BRIDGE",
91
+ FTP = "FTP",
92
+ BEARINGPOINT = "BEARINGPOINT",
93
+ OTRS = "OTRS",
94
+ SMS_CERT = "SMS CERT",
95
+ ZOHO_ADAPTOR = "ZOHO ADAPTOR"
96
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StorageConfiguration = exports.Province = exports.ShoppingCartConfigurationProductType = exports.SalesArea = exports.ClientType = void 0;
3
+ exports.MicroserviceType = exports.StorageConfiguration = exports.Province = exports.ShoppingCartConfigurationProductType = exports.SalesArea = exports.ClientType = void 0;
4
4
  var ClientType;
5
5
  (function (ClientType) {
6
6
  ClientType["RESIDENTIAL"] = "Residential";
@@ -91,3 +91,15 @@ var StorageConfiguration;
91
91
  StorageConfiguration["BLACKLISTED_APARTMENTS_OPERATORS"] = "BLACKLISTED_APARTMENTS_OPERATORS";
92
92
  StorageConfiguration["FORBIDDEN_SALE_PROCESS_STATUSES"] = "FORBIDDEN_SALE_PROCESS_STATUSES";
93
93
  })(StorageConfiguration = exports.StorageConfiguration || (exports.StorageConfiguration = {}));
94
+ var MicroserviceType;
95
+ (function (MicroserviceType) {
96
+ MicroserviceType["AMS"] = "AMS";
97
+ MicroserviceType["ARS_EDGE"] = "ARS EDGE";
98
+ MicroserviceType["BSS_BRIDGE"] = "BSS BRIDGE";
99
+ MicroserviceType["DB_BRIDGE"] = "DB BRIDGE";
100
+ MicroserviceType["FTP"] = "FTP";
101
+ MicroserviceType["BEARINGPOINT"] = "BEARINGPOINT";
102
+ MicroserviceType["OTRS"] = "OTRS";
103
+ MicroserviceType["SMS_CERT"] = "SMS CERT";
104
+ MicroserviceType["ZOHO_ADAPTOR"] = "ZOHO ADAPTOR";
105
+ })(MicroserviceType = exports.MicroserviceType || (exports.MicroserviceType = {}));
@@ -18,6 +18,7 @@ export declare const E_SHOPPING_CART_NOT_FOUND = "E_SHOPPING_CART_NOT_FOUND";
18
18
  export declare const E_EMPTY_SHOPPING_CART = "E_EMPTY_SHOPPING_CART";
19
19
  export declare const E_UPDATE_SHOPPING_CART_EXTRAS = "E_UPDATE_SHOPPING_CART_EXTRAS";
20
20
  export declare const E_BP_INTERNAL_SERVER_ERROR = "E_BP_INTERNAL_SERVER_ERROR";
21
+ export declare const E_BP = "E_BP";
21
22
  export declare const E_CHANGE_CHANNEL = "E_CHANGE_CHANNEL";
22
23
  export declare const E_NO_SELECTED_CHANNEL = "E_NO_SELECTED_CHANNEL";
23
24
  export declare const E_BODY_NOT_PROVIDED = "E_BODY_NOT_PROVIDED";
@@ -82,3 +83,5 @@ export declare const E_UPDATE_CACHE_RECORD = "E_UPDATE_CACHE_RECORD";
82
83
  export declare const E_USER_SALE_PROCESS_PERMISSION = "E_USER_SALE_PROCESS_PERMISSION";
83
84
  export declare const E_WHOLESALE_APARTMENT_BLACKLISTED = "E_WHOLESALE_APARTMENT_BLACKLISTED";
84
85
  export declare const E_RESERVE_NUMBER_FROM_POOL = "E_RESERVE_NUMBER_FROM_POOL";
86
+ export declare const E_USER_WITHOUT_ROLE = "E_USER_WITHOUT_ROLE";
87
+ export declare const E_USER_ROLE_UNKNOWN = "E_USER_ROLE_UNKNOWN";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.E_FTP_UPLOAD = exports.E_SUBMIT_SHOPPING_CART = exports.E_FETCH_SHOPPING_CART = exports.E_UPDATE_PAYMENT_METHOD = exports.E_CREATE_PAYMENT_METHOD = exports.E_UPDATE_MANDATE = exports.E_CREATE_MANDATE = exports.E_UPDATE_BILLING_ACCOUNT = exports.E_CREATE_BILLING_ACCOUNT = exports.E_UPLOAD_CUSTOMER_ACCOUNT_DOCUMENT = exports.E_CREATE_CUSTOMER_ACCOUNT_NOTE = exports.E_UPDATE_CUSTOMER_ACCOUNT = exports.E_CREATE_CUSTOMER_ACCOUNT = exports.E_FETCH_ADDRESS = exports.E_CREATE_ADDRESS = exports.E_FIBER_NOT_AVAILABLE_FOR_THIS_NETWORK = exports.E_UPDATE_SHOPPING_CART_CONFIGURATION = exports.E_CIF_VALIDATION = exports.E_NIE_VALIDATION = exports.E_DNI_VALIDATION = exports.E_SET_SHOPPING_CART_PROMOTIONS = exports.E_SET_SHOPPING_CART_CONTRACT = exports.E_FETCH_AVAILABLE_NUMBERS_FROM_POOL = exports.E_PROVINCE_WITHOUT_PREFIXES = exports.E_SERVER = exports.E_CONNECTION_REFUSED = exports.E_VALIDATION = exports.E_BODY_NOT_PROVIDED = exports.E_NO_SELECTED_CHANNEL = exports.E_CHANGE_CHANNEL = exports.E_BP_INTERNAL_SERVER_ERROR = exports.E_UPDATE_SHOPPING_CART_EXTRAS = exports.E_EMPTY_SHOPPING_CART = exports.E_SHOPPING_CART_NOT_FOUND = exports.E_BUNDLE_CONFIGURATION_ATTRIBUTE_MISMATCHING = exports.E_SAVE_SHOPPING_CART = exports.E_CREATE_SHOPPING_CART = exports.E_FETCH_PRODUCT_DEFAULT_SUMMARY = exports.E_FETCH_SHOPPING_CART_CONFIGURATION = exports.E_FETCH_SHOPPING_CART_SUMMARY = exports.E_FETCH_SHOPPING_CART_AVAILABLE_EXTRAS = exports.E_FETCH_SHOPPING_CART_AVAILABLE_PRODUCT = exports.E_FETCH_SHOPPING_CART_AVAILABLE_PRODUCTS = exports.E_FETCH_PRODUCT_OFFERINGS = exports.E_ASSIGN_SALESPERSON = exports.E_ASSIGN_ROLE_TENENT = exports.E_CREATE_USER = exports.E_UPDATE_PASSWORD = exports.E_ASSIGN_CHANNELS = exports.E_LOGIN = void 0;
4
- exports.E_RESERVE_NUMBER_FROM_POOL = exports.E_WHOLESALE_APARTMENT_BLACKLISTED = exports.E_USER_SALE_PROCESS_PERMISSION = exports.E_UPDATE_CACHE_RECORD = exports.E_DELETE_CACHE_RECORD = exports.E_UPDATE_PRODUCT_CATALOG = exports.E_DELETE_PRODUCT_CATALOG = exports.E_CREATE_CUSTOMER_ACCOUNT_HISTORY = exports.E_FETCH_ORGANIZATION_PARTY = exports.E_FETCH_INDIVIDUAL_PARTY = exports.E_FETCH_PAYMENT_METHOD = exports.E_FETCH_MANDATE = exports.E_FETCH_BILLING_ACCOUNT = exports.E_FETCH_PRODUCT_INVENTORY = exports.E_FETCH_CUSTOMERS = exports.E_FETCH_ORGANIZATION_PARTIES = exports.E_FETCH_INDIVIDUAL_PARTIES = exports.E_DOWNLOAD_INVOICE = exports.E_FETCH_BILLING_ACCOUNT_DETAILS = exports.E_INVALID_IBAN_MOD = exports.E_INVALID_IBAN_FORMAT = exports.E_INVALID_IBAN_LENGTH = exports.E_INVALID_IBAN_ISO_CODE = exports.E_IBAN_IS_REQUIRED = exports.E_IBAN_COUNTRY_NOT_SUPPORTED = exports.E_SPAIN_NOT_ALLOWED = exports.E_EMAIL_INVALID_FORMAT = exports.E_PHONE_INVALID_FORMAT = exports.E_PHONE_INVALID_LENGTH = exports.E_VALIDATE_SHOPPING_CART = exports.E_FETCH_CHANNEL_USERS = exports.E_FTP_RENAME = exports.E_FTP_REMOVE = exports.E_FTP_DOWNLOAD = void 0;
3
+ exports.E_SUBMIT_SHOPPING_CART = exports.E_FETCH_SHOPPING_CART = exports.E_UPDATE_PAYMENT_METHOD = exports.E_CREATE_PAYMENT_METHOD = exports.E_UPDATE_MANDATE = exports.E_CREATE_MANDATE = exports.E_UPDATE_BILLING_ACCOUNT = exports.E_CREATE_BILLING_ACCOUNT = exports.E_UPLOAD_CUSTOMER_ACCOUNT_DOCUMENT = exports.E_CREATE_CUSTOMER_ACCOUNT_NOTE = exports.E_UPDATE_CUSTOMER_ACCOUNT = exports.E_CREATE_CUSTOMER_ACCOUNT = exports.E_FETCH_ADDRESS = exports.E_CREATE_ADDRESS = exports.E_FIBER_NOT_AVAILABLE_FOR_THIS_NETWORK = exports.E_UPDATE_SHOPPING_CART_CONFIGURATION = exports.E_CIF_VALIDATION = exports.E_NIE_VALIDATION = exports.E_DNI_VALIDATION = exports.E_SET_SHOPPING_CART_PROMOTIONS = exports.E_SET_SHOPPING_CART_CONTRACT = exports.E_FETCH_AVAILABLE_NUMBERS_FROM_POOL = exports.E_PROVINCE_WITHOUT_PREFIXES = exports.E_SERVER = exports.E_CONNECTION_REFUSED = exports.E_VALIDATION = exports.E_BODY_NOT_PROVIDED = exports.E_NO_SELECTED_CHANNEL = exports.E_CHANGE_CHANNEL = exports.E_BP = exports.E_BP_INTERNAL_SERVER_ERROR = exports.E_UPDATE_SHOPPING_CART_EXTRAS = exports.E_EMPTY_SHOPPING_CART = exports.E_SHOPPING_CART_NOT_FOUND = exports.E_BUNDLE_CONFIGURATION_ATTRIBUTE_MISMATCHING = exports.E_SAVE_SHOPPING_CART = exports.E_CREATE_SHOPPING_CART = exports.E_FETCH_PRODUCT_DEFAULT_SUMMARY = exports.E_FETCH_SHOPPING_CART_CONFIGURATION = exports.E_FETCH_SHOPPING_CART_SUMMARY = exports.E_FETCH_SHOPPING_CART_AVAILABLE_EXTRAS = exports.E_FETCH_SHOPPING_CART_AVAILABLE_PRODUCT = exports.E_FETCH_SHOPPING_CART_AVAILABLE_PRODUCTS = exports.E_FETCH_PRODUCT_OFFERINGS = exports.E_ASSIGN_SALESPERSON = exports.E_ASSIGN_ROLE_TENENT = exports.E_CREATE_USER = exports.E_UPDATE_PASSWORD = exports.E_ASSIGN_CHANNELS = exports.E_LOGIN = void 0;
4
+ exports.E_USER_ROLE_UNKNOWN = exports.E_USER_WITHOUT_ROLE = exports.E_RESERVE_NUMBER_FROM_POOL = exports.E_WHOLESALE_APARTMENT_BLACKLISTED = exports.E_USER_SALE_PROCESS_PERMISSION = exports.E_UPDATE_CACHE_RECORD = exports.E_DELETE_CACHE_RECORD = exports.E_UPDATE_PRODUCT_CATALOG = exports.E_DELETE_PRODUCT_CATALOG = exports.E_CREATE_CUSTOMER_ACCOUNT_HISTORY = exports.E_FETCH_ORGANIZATION_PARTY = exports.E_FETCH_INDIVIDUAL_PARTY = exports.E_FETCH_PAYMENT_METHOD = exports.E_FETCH_MANDATE = exports.E_FETCH_BILLING_ACCOUNT = exports.E_FETCH_PRODUCT_INVENTORY = exports.E_FETCH_CUSTOMERS = exports.E_FETCH_ORGANIZATION_PARTIES = exports.E_FETCH_INDIVIDUAL_PARTIES = exports.E_DOWNLOAD_INVOICE = exports.E_FETCH_BILLING_ACCOUNT_DETAILS = exports.E_INVALID_IBAN_MOD = exports.E_INVALID_IBAN_FORMAT = exports.E_INVALID_IBAN_LENGTH = exports.E_INVALID_IBAN_ISO_CODE = exports.E_IBAN_IS_REQUIRED = exports.E_IBAN_COUNTRY_NOT_SUPPORTED = exports.E_SPAIN_NOT_ALLOWED = exports.E_EMAIL_INVALID_FORMAT = exports.E_PHONE_INVALID_FORMAT = exports.E_PHONE_INVALID_LENGTH = exports.E_VALIDATE_SHOPPING_CART = exports.E_FETCH_CHANNEL_USERS = exports.E_FTP_RENAME = exports.E_FTP_REMOVE = exports.E_FTP_DOWNLOAD = exports.E_FTP_UPLOAD = void 0;
5
5
  exports.E_LOGIN = 'E_LOGIN';
6
6
  exports.E_ASSIGN_CHANNELS = 'E_ASSIGN_CHANNELS';
7
7
  exports.E_UPDATE_PASSWORD = 'E_UPDATE_PASSWORD';
@@ -22,6 +22,7 @@ exports.E_SHOPPING_CART_NOT_FOUND = 'E_SHOPPING_CART_NOT_FOUND';
22
22
  exports.E_EMPTY_SHOPPING_CART = 'E_EMPTY_SHOPPING_CART';
23
23
  exports.E_UPDATE_SHOPPING_CART_EXTRAS = 'E_UPDATE_SHOPPING_CART_EXTRAS';
24
24
  exports.E_BP_INTERNAL_SERVER_ERROR = 'E_BP_INTERNAL_SERVER_ERROR';
25
+ exports.E_BP = 'E_BP';
25
26
  exports.E_CHANGE_CHANNEL = 'E_CHANGE_CHANNEL';
26
27
  exports.E_NO_SELECTED_CHANNEL = 'E_NO_SELECTED_CHANNEL';
27
28
  exports.E_BODY_NOT_PROVIDED = 'E_BODY_NOT_PROVIDED';
@@ -86,3 +87,5 @@ exports.E_UPDATE_CACHE_RECORD = 'E_UPDATE_CACHE_RECORD';
86
87
  exports.E_USER_SALE_PROCESS_PERMISSION = 'E_USER_SALE_PROCESS_PERMISSION';
87
88
  exports.E_WHOLESALE_APARTMENT_BLACKLISTED = 'E_WHOLESALE_APARTMENT_BLACKLISTED';
88
89
  exports.E_RESERVE_NUMBER_FROM_POOL = 'E_RESERVE_NUMBER_FROM_POOL';
90
+ exports.E_USER_WITHOUT_ROLE = 'E_USER_WITHOUT_ROLE';
91
+ exports.E_USER_ROLE_UNKNOWN = 'E_USER_ROLE_UNKNOWN';
@@ -13,7 +13,6 @@ export declare class PartialSaleProcessBusinessDto {
13
13
  }
14
14
  export declare class PatchSaleProcessCustomerTypeSelectedDto {
15
15
  status: SaleProcessStatusType;
16
- shoppingCartId: string;
17
16
  customer: PartialSaleProcessCustomerDto;
18
17
  businessInfo?: PartialSaleProcessBusinessDto;
19
18
  }
@@ -51,18 +51,13 @@ __decorate([
51
51
  exports.PartialSaleProcessBusinessDto = PartialSaleProcessBusinessDto;
52
52
  class PatchSaleProcessCustomerTypeSelectedDto {
53
53
  static _OPENAPI_METADATA_FACTORY() {
54
- return { status: { required: true, enum: require("../../../../zoho/constants/zoho.constants").SaleProcessStatusType }, shoppingCartId: { required: true, type: () => String }, customer: { required: true, type: () => require("./patch.entity").PartialSaleProcessCustomerDto }, businessInfo: { required: false, type: () => require("./patch.entity").PartialSaleProcessBusinessDto } };
54
+ return { status: { required: true, enum: require("../../../../zoho/constants/zoho.constants").SaleProcessStatusType }, customer: { required: true, type: () => require("./patch.entity").PartialSaleProcessCustomerDto }, businessInfo: { required: false, type: () => require("./patch.entity").PartialSaleProcessBusinessDto } };
55
55
  }
56
56
  }
57
57
  __decorate([
58
58
  (0, class_validator_1.IsEnum)(constants_2.SaleProcessStatusType),
59
59
  __metadata("design:type", String)
60
60
  ], PatchSaleProcessCustomerTypeSelectedDto.prototype, "status", void 0);
61
- __decorate([
62
- (0, class_validator_1.IsString)(),
63
- (0, class_validator_1.IsNotEmpty)(),
64
- __metadata("design:type", String)
65
- ], PatchSaleProcessCustomerTypeSelectedDto.prototype, "shoppingCartId", void 0);
66
61
  __decorate([
67
62
  (0, class_validator_1.ValidateNested)(),
68
63
  (0, class_transformer_1.Type)(() => PartialSaleProcessCustomerDto),
@@ -337,7 +332,7 @@ class PartialAddressSelectedDto {
337
332
  }
338
333
  }
339
334
  __decorate([
340
- (0, class_validator_1.IsString)(),
335
+ (0, class_validator_1.IsInt)(),
341
336
  (0, class_validator_1.IsNotEmpty)(),
342
337
  __metadata("design:type", Number)
343
338
  ], PartialAddressSelectedDto.prototype, "coberturaId", void 0);
@@ -359,13 +354,13 @@ __decorate([
359
354
  __metadata("design:type", String)
360
355
  ], PartialApartmentSelectedDto.prototype, "search", void 0);
361
356
  __decorate([
362
- (0, class_validator_1.IsString)(),
357
+ (0, class_validator_1.IsInt)(),
363
358
  (0, class_validator_1.IsNotEmpty)(),
364
359
  (0, class_validator_1.IsOptional)(),
365
360
  __metadata("design:type", Number)
366
361
  ], PartialApartmentSelectedDto.prototype, "coberturaId", void 0);
367
362
  __decorate([
368
- (0, class_validator_1.IsString)(),
363
+ (0, class_validator_1.IsInt)(),
369
364
  (0, class_validator_1.IsNotEmpty)(),
370
365
  __metadata("design:type", Number)
371
366
  ], PartialApartmentSelectedDto.prototype, "coberturaPisoPortaId", void 0);
@@ -1,3 +1,4 @@
1
+ import { MicroserviceType } from '@common/constants/common.constants';
1
2
  export declare class BulkExceptionPayloadDto {
2
3
  child: string | number;
3
4
  message: HttpExceptionPayloadDto;
@@ -14,39 +15,55 @@ export declare class ConstraintsDto {
14
15
  isNotNull?: string;
15
16
  }
16
17
  export declare class HttpExceptionPayloadDto {
18
+ source?: MicroserviceType;
17
19
  status: number;
18
20
  i18n?: string;
19
21
  message: string;
20
22
  messages?: MessagePayloadDto[];
21
23
  }
24
+ interface ErrorParams {
25
+ code?: string;
26
+ args?: any;
27
+ }
22
28
  export declare class CustomError extends Error {
23
29
  code: string;
24
- constructor(code: string, ...args: any[]);
25
- }
26
- export declare class BundleConfigurationAttributeMismatchingError extends CustomError {
27
- constructor(...args: any[]);
28
- }
29
- export declare class FiberNotAvailableForThisNetworkError extends CustomError {
30
- constructor(...args: any[]);
31
- }
32
- export declare class EmptyShoppingCartError extends CustomError {
33
- constructor(...args: any[]);
34
- }
35
- export declare class ProvinceWithoutPrefixesError extends CustomError {
36
- constructor(...args: any[]);
30
+ source: MicroserviceType;
31
+ constructor(source: MicroserviceType, code: string, ...args: any[]);
37
32
  }
38
33
  export declare class DniValidationError extends CustomError {
39
- constructor(...args: any[]);
34
+ constructor(source: MicroserviceType, ...args: any[]);
40
35
  }
41
36
  export declare class CifValidationError extends CustomError {
42
- constructor(...args: any[]);
37
+ constructor(source: MicroserviceType, ...args: any[]);
43
38
  }
44
39
  export declare class NieValidationError extends CustomError {
45
- constructor(...args: any[]);
40
+ constructor(source: MicroserviceType, ...args: any[]);
46
41
  }
47
42
  export declare class FtpError extends CustomError {
48
- constructor(code: string, ...args: any[]);
43
+ constructor({ code, args }: ErrorParams);
44
+ }
45
+ export declare class ArsEdgeError extends CustomError {
46
+ constructor({ code, args }: ErrorParams);
49
47
  }
50
48
  export declare class ZohoError extends CustomError {
51
- constructor(code: string, ...args: any[]);
49
+ constructor({ code, args }: ErrorParams);
50
+ }
51
+ export declare class SmsCertError extends CustomError {
52
+ constructor({ code, args }: ErrorParams);
53
+ }
54
+ export declare class OtrsError extends CustomError {
55
+ constructor({ code, args }: ErrorParams);
56
+ }
57
+ export declare class DbBridgeError extends CustomError {
58
+ constructor({ code, args }: ErrorParams);
59
+ }
60
+ export declare class AmsError extends CustomError {
61
+ constructor({ args, code }: ErrorParams);
62
+ }
63
+ export declare class BearingPointError extends CustomError {
64
+ constructor({ code, args }: ErrorParams);
65
+ }
66
+ export declare class BssBridgeError extends CustomError {
67
+ constructor({ code, args }: ErrorParams);
52
68
  }
69
+ export {};
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZohoError = exports.FtpError = exports.NieValidationError = exports.CifValidationError = exports.DniValidationError = exports.ProvinceWithoutPrefixesError = exports.EmptyShoppingCartError = exports.FiberNotAvailableForThisNetworkError = exports.BundleConfigurationAttributeMismatchingError = exports.CustomError = exports.HttpExceptionPayloadDto = exports.ConstraintsDto = exports.MessagePayloadDto = exports.BulkExceptionPayloadDto = void 0;
3
+ exports.BssBridgeError = exports.BearingPointError = exports.AmsError = exports.DbBridgeError = exports.OtrsError = exports.SmsCertError = exports.ZohoError = exports.ArsEdgeError = exports.FtpError = exports.NieValidationError = exports.CifValidationError = exports.DniValidationError = exports.CustomError = exports.HttpExceptionPayloadDto = exports.ConstraintsDto = exports.MessagePayloadDto = exports.BulkExceptionPayloadDto = void 0;
4
4
  const openapi = require("@nestjs/swagger");
5
- const constants_1 = require("../constants");
5
+ const error_constants_1 = require("../constants/error.constants");
6
+ const common_constants_1 = require("../constants/common.constants");
6
7
  class BulkExceptionPayloadDto {
7
8
  static _OPENAPI_METADATA_FACTORY() {
8
9
  return { child: { required: true, type: () => Object }, message: { required: true, type: () => require("./exception.entity").HttpExceptionPayloadDto } };
@@ -23,98 +24,158 @@ class ConstraintsDto {
23
24
  exports.ConstraintsDto = ConstraintsDto;
24
25
  class HttpExceptionPayloadDto {
25
26
  static _OPENAPI_METADATA_FACTORY() {
26
- return { status: { required: true, type: () => Number }, i18n: { required: false, type: () => String }, message: { required: true, type: () => String }, messages: { required: false, type: () => [require("./exception.entity").MessagePayloadDto] } };
27
+ return { source: { required: false, enum: require("../constants/common.constants").MicroserviceType }, status: { required: true, type: () => Number }, i18n: { required: false, type: () => String }, message: { required: true, type: () => String }, messages: { required: false, type: () => [require("./exception.entity").MessagePayloadDto] } };
27
28
  }
28
29
  }
29
30
  exports.HttpExceptionPayloadDto = HttpExceptionPayloadDto;
31
+ function mapErrorCode(code) {
32
+ if (code && code.toString().startsWith('E_'))
33
+ return code;
34
+ switch (code) {
35
+ case 'ECONNREFUSED':
36
+ return error_constants_1.E_CONNECTION_REFUSED;
37
+ }
38
+ }
30
39
  class CustomError extends Error {
31
- constructor(code, ...args) {
40
+ constructor(source, code, ...args) {
32
41
  super(...args);
42
+ this.source = source;
33
43
  this.code = code;
34
44
  }
35
45
  static _OPENAPI_METADATA_FACTORY() {
36
- return { code: { required: true, type: () => String } };
46
+ return { code: { required: true, type: () => String }, source: { required: true, enum: require("../constants/common.constants").MicroserviceType } };
37
47
  }
38
48
  }
39
49
  exports.CustomError = CustomError;
40
- class BundleConfigurationAttributeMismatchingError extends CustomError {
41
- constructor(...args) {
42
- super(constants_1.E_BUNDLE_CONFIGURATION_ATTRIBUTE_MISMATCHING, ...args);
50
+ class DniValidationError extends CustomError {
51
+ constructor(source, ...args) {
52
+ super(source, error_constants_1.E_DNI_VALIDATION, ...args);
43
53
  }
44
54
  static _OPENAPI_METADATA_FACTORY() {
45
55
  return {};
46
56
  }
47
57
  }
48
- exports.BundleConfigurationAttributeMismatchingError = BundleConfigurationAttributeMismatchingError;
49
- class FiberNotAvailableForThisNetworkError extends CustomError {
50
- constructor(...args) {
51
- super(constants_1.E_FIBER_NOT_AVAILABLE_FOR_THIS_NETWORK, ...args);
58
+ exports.DniValidationError = DniValidationError;
59
+ class CifValidationError extends CustomError {
60
+ constructor(source, ...args) {
61
+ super(source, error_constants_1.E_CIF_VALIDATION, ...args);
52
62
  }
53
63
  static _OPENAPI_METADATA_FACTORY() {
54
64
  return {};
55
65
  }
56
66
  }
57
- exports.FiberNotAvailableForThisNetworkError = FiberNotAvailableForThisNetworkError;
58
- class EmptyShoppingCartError extends CustomError {
59
- constructor(...args) {
60
- super(constants_1.E_EMPTY_SHOPPING_CART, ...args);
67
+ exports.CifValidationError = CifValidationError;
68
+ class NieValidationError extends CustomError {
69
+ constructor(source, ...args) {
70
+ super(source, error_constants_1.E_NIE_VALIDATION, ...args);
61
71
  }
62
72
  static _OPENAPI_METADATA_FACTORY() {
63
73
  return {};
64
74
  }
65
75
  }
66
- exports.EmptyShoppingCartError = EmptyShoppingCartError;
67
- class ProvinceWithoutPrefixesError extends CustomError {
68
- constructor(...args) {
69
- super(constants_1.E_PROVINCE_WITHOUT_PREFIXES, ...args);
76
+ exports.NieValidationError = NieValidationError;
77
+ class FtpError extends CustomError {
78
+ constructor({ code, args }) {
79
+ const { code: argsCode } = args, mappedCode = code !== null && code !== void 0 ? code : mapErrorCode(argsCode);
80
+ super(common_constants_1.MicroserviceType.FTP, mappedCode, args);
81
+ this.name = 'FtpError';
70
82
  }
71
83
  static _OPENAPI_METADATA_FACTORY() {
72
84
  return {};
73
85
  }
74
86
  }
75
- exports.ProvinceWithoutPrefixesError = ProvinceWithoutPrefixesError;
76
- class DniValidationError extends CustomError {
77
- constructor(...args) {
78
- super(constants_1.E_DNI_VALIDATION, ...args);
87
+ exports.FtpError = FtpError;
88
+ class ArsEdgeError extends CustomError {
89
+ constructor({ code, args = {} }) {
90
+ const { code: argsCode, message } = args, mappedCode = code !== null && code !== void 0 ? code : mapErrorCode(argsCode);
91
+ super(common_constants_1.MicroserviceType.ARS_EDGE, mappedCode, message, args);
92
+ this.name = 'ArsEdgeError';
79
93
  }
80
94
  static _OPENAPI_METADATA_FACTORY() {
81
95
  return {};
82
96
  }
83
97
  }
84
- exports.DniValidationError = DniValidationError;
85
- class CifValidationError extends CustomError {
86
- constructor(...args) {
87
- super(constants_1.E_CIF_VALIDATION, ...args);
98
+ exports.ArsEdgeError = ArsEdgeError;
99
+ class ZohoError extends CustomError {
100
+ constructor({ code, args = {} }) {
101
+ const { response: { data: { code: responseCode, message: responseMessage } } = { data: ({} = {}) }, message, stack, code: argsCode } = args, mappedCode = code !== null && code !== void 0 ? code : (responseCode !== null && responseCode !== void 0 ? responseCode : mapErrorCode(argsCode));
102
+ super(common_constants_1.MicroserviceType.ZOHO_ADAPTOR, responseCode, responseMessage || message, stack);
103
+ this.name = 'ZohoError';
88
104
  }
89
105
  static _OPENAPI_METADATA_FACTORY() {
90
106
  return {};
91
107
  }
92
108
  }
93
- exports.CifValidationError = CifValidationError;
94
- class NieValidationError extends CustomError {
95
- constructor(...args) {
96
- super(constants_1.E_NIE_VALIDATION, ...args);
109
+ exports.ZohoError = ZohoError;
110
+ class SmsCertError extends CustomError {
111
+ constructor({ code, args = {} }) {
112
+ const { response: { data: { code: responseCode, message: responseMessage } } = { data: ({} = {}) }, message, stack, code: argsCode } = args, mappedCode = code !== null && code !== void 0 ? code : (responseCode !== null && responseCode !== void 0 ? responseCode : mapErrorCode(argsCode));
113
+ super(common_constants_1.MicroserviceType.SMS_CERT, mappedCode, responseMessage || message, stack);
114
+ this.name = 'SmsCertError';
97
115
  }
98
116
  static _OPENAPI_METADATA_FACTORY() {
99
117
  return {};
100
118
  }
101
119
  }
102
- exports.NieValidationError = NieValidationError;
103
- class FtpError extends CustomError {
104
- constructor(code, ...args) {
105
- super(code, ...args);
120
+ exports.SmsCertError = SmsCertError;
121
+ class OtrsError extends CustomError {
122
+ constructor({ code, args = {} }) {
123
+ const { message, stack, code: argsCode } = args, mappedCode = code !== null && code !== void 0 ? code : mapErrorCode(argsCode);
124
+ super(common_constants_1.MicroserviceType.OTRS, mappedCode, message, stack);
125
+ this.name = 'OtrsError';
106
126
  }
107
127
  static _OPENAPI_METADATA_FACTORY() {
108
128
  return {};
109
129
  }
110
130
  }
111
- exports.FtpError = FtpError;
112
- class ZohoError extends CustomError {
113
- constructor(code, ...args) {
114
- super(code, ...args);
131
+ exports.OtrsError = OtrsError;
132
+ class DbBridgeError extends CustomError {
133
+ constructor({ code, args = {} }) {
134
+ const { message, stack, code: argsCode } = args, mappedCode = code !== null && code !== void 0 ? code : mapErrorCode(argsCode);
135
+ super(common_constants_1.MicroserviceType.DB_BRIDGE, mappedCode, message, stack);
136
+ this.name = 'DbBridgeError';
115
137
  }
116
138
  static _OPENAPI_METADATA_FACTORY() {
117
139
  return {};
118
140
  }
119
141
  }
120
- exports.ZohoError = ZohoError;
142
+ exports.DbBridgeError = DbBridgeError;
143
+ class AmsError extends CustomError {
144
+ constructor({ args, code }) {
145
+ const { message, stack, code: argsCode } = args, mappedCode = code !== null && code !== void 0 ? code : mapErrorCode(argsCode);
146
+ super(common_constants_1.MicroserviceType.AMS, mappedCode, message, stack);
147
+ this.name = 'AmsError';
148
+ }
149
+ static _OPENAPI_METADATA_FACTORY() {
150
+ return {};
151
+ }
152
+ }
153
+ exports.AmsError = AmsError;
154
+ class BearingPointError extends CustomError {
155
+ constructor({ code, args = {} }) {
156
+ const { message, stack, code: argsCode } = args, mappedCode = code !== null && code !== void 0 ? code : mapErrorCode(argsCode);
157
+ super(common_constants_1.MicroserviceType.BEARINGPOINT, mappedCode, message, stack);
158
+ this.name = 'BearingPointError';
159
+ }
160
+ static _OPENAPI_METADATA_FACTORY() {
161
+ return {};
162
+ }
163
+ }
164
+ exports.BearingPointError = BearingPointError;
165
+ class BssBridgeError extends CustomError {
166
+ constructor({ code, args = {} }) {
167
+ const { message, stack, code: argsCode, response } = args, mappedCode = code !== null && code !== void 0 ? code : mapErrorCode(argsCode);
168
+ if (response && response.data) {
169
+ const { source, i18n, message: dataMessage } = response.data;
170
+ super(source, i18n !== null && i18n !== void 0 ? i18n : mappedCode, dataMessage !== null && dataMessage !== void 0 ? dataMessage : message, stack);
171
+ this.name = 'BssBridgeError';
172
+ return;
173
+ }
174
+ super(common_constants_1.MicroserviceType.BSS_BRIDGE, mappedCode, message, stack);
175
+ this.name = 'BssBridgeError';
176
+ }
177
+ static _OPENAPI_METADATA_FACTORY() {
178
+ return {};
179
+ }
180
+ }
181
+ exports.BssBridgeError = BssBridgeError;
@@ -1,5 +1,4 @@
1
1
  export declare class AclUser {
2
- id?: number;
3
2
  user_id: string;
4
3
  role: string;
5
4
  }
@@ -14,19 +14,17 @@ const openapi = require("@nestjs/swagger");
14
14
  const typeorm_1 = require("typeorm");
15
15
  let AclUser = class AclUser {
16
16
  static _OPENAPI_METADATA_FACTORY() {
17
- return { id: { required: false, type: () => Number }, user_id: { required: true, type: () => String }, role: { required: true, type: () => String } };
17
+ return { user_id: { required: true, type: () => String }, role: { required: true, type: () => String } };
18
18
  }
19
19
  };
20
- __decorate([
21
- (0, typeorm_1.PrimaryGeneratedColumn)(),
22
- __metadata("design:type", Number)
23
- ], AclUser.prototype, "id", void 0);
24
20
  __decorate([
25
21
  (0, typeorm_1.Column)({ nullable: false }),
22
+ (0, typeorm_1.PrimaryColumn)(),
26
23
  __metadata("design:type", String)
27
24
  ], AclUser.prototype, "user_id", void 0);
28
25
  __decorate([
29
26
  (0, typeorm_1.Column)({ nullable: false }),
27
+ (0, typeorm_1.PrimaryColumn)(),
30
28
  __metadata("design:type", String)
31
29
  ], AclUser.prototype, "role", void 0);
32
30
  AclUser = __decorate([