@carbonbox/domain 0.29.0 → 0.29.2
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/build/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidContractStatusError.js +24 -7
- package/build/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidPaymentTermsError.js +24 -7
- package/build/carbonbox/shared/domain/exceptions/AccountLockedError.js +58 -0
- package/build/carbonbox/shared/domain/exceptions/CodedRootError.js +6 -6
- package/build/carbonbox/shared/domain/exceptions/ConfigurationNotFoundError.js +62 -0
- package/build/carbonbox/shared/domain/exceptions/ContractNotFoundError.js +58 -0
- package/build/carbonbox/shared/domain/exceptions/EmailNotVerifiedError.js +61 -0
- package/build/carbonbox/shared/domain/exceptions/InvalidBusinessStatusError.js +56 -0
- package/build/carbonbox/shared/domain/exceptions/InvalidCredentialsError.js +35 -0
- package/build/carbonbox/shared/domain/exceptions/InvalidCurrencyError.js +51 -6
- package/build/carbonbox/shared/domain/exceptions/InvalidDateFormatError.js +1 -1
- package/build/carbonbox/shared/domain/exceptions/MissingCredentialsError.js +53 -0
- package/build/carbonbox/shared/domain/exceptions/OrderExceedsBudgetError.js +98 -0
- package/build/carbonbox/shared/domain/exceptions/ServiceCatalogNotFoundError.js +64 -0
- package/build/carbonbox/shared/domain/exceptions/StakeholderNotFoundError.js +49 -0
- package/build/carbonbox/shared/domain/exceptions/TokenExpiredError.js +48 -0
- package/build/carbonbox/stakeholders/carbon-clients/domain/entity/CarbonClient.js +10 -8
- package/build/carbonbox/stakeholders/carbon-coordinators/domain/entity/CarbonCoordinator.js +10 -8
- package/build/carbonbox/stakeholders/carbon-host/domain/entity/CarbonHost.js +5 -4
- package/build/carbonbox/stakeholders/carbon-managers/domain/entity/CarbonManager.js +10 -8
- package/build/main/index.js +31 -5
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidContractStatusError.d.ts +9 -3
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidContractStatusError.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidPaymentTermsError.d.ts +9 -3
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidPaymentTermsError.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/exceptions/AccountLockedError.d.ts +25 -0
- package/build/types/carbonbox/shared/domain/exceptions/AccountLockedError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/CodedRootError.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/exceptions/ConfigurationNotFoundError.d.ts +29 -0
- package/build/types/carbonbox/shared/domain/exceptions/ConfigurationNotFoundError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/ContractNotFoundError.d.ts +25 -0
- package/build/types/carbonbox/shared/domain/exceptions/ContractNotFoundError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/EmailNotVerifiedError.d.ts +27 -0
- package/build/types/carbonbox/shared/domain/exceptions/EmailNotVerifiedError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/InvalidBusinessStatusError.d.ts +25 -0
- package/build/types/carbonbox/shared/domain/exceptions/InvalidBusinessStatusError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/InvalidCredentialsError.d.ts +13 -0
- package/build/types/carbonbox/shared/domain/exceptions/InvalidCredentialsError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/InvalidCurrencyError.d.ts +23 -3
- package/build/types/carbonbox/shared/domain/exceptions/InvalidCurrencyError.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/exceptions/MissingCredentialsError.d.ts +25 -0
- package/build/types/carbonbox/shared/domain/exceptions/MissingCredentialsError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/OrderExceedsBudgetError.d.ts +42 -0
- package/build/types/carbonbox/shared/domain/exceptions/OrderExceedsBudgetError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/ServiceCatalogNotFoundError.d.ts +29 -0
- package/build/types/carbonbox/shared/domain/exceptions/ServiceCatalogNotFoundError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/StakeholderNotFoundError.d.ts +21 -0
- package/build/types/carbonbox/shared/domain/exceptions/StakeholderNotFoundError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/exceptions/TokenExpiredError.d.ts +21 -0
- package/build/types/carbonbox/shared/domain/exceptions/TokenExpiredError.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/entity/CarbonClient.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/entity/CarbonCoordinator.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-host/domain/entity/CarbonHost.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/entity/CarbonManager.d.ts.map +1 -1
- package/build/types/main/index.d.ts +11 -0
- package/build/types/main/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderExceedsBudgetError = void 0;
|
|
4
|
+
const CodedRootError_1 = require("./CodedRootError");
|
|
5
|
+
const ErrorCode_1 = require("../enums/ErrorCode");
|
|
6
|
+
/**
|
|
7
|
+
* Error thrown when a purchase order exceeds the allocated budget limit.
|
|
8
|
+
* This error helps prevent overspending and maintains financial controls.
|
|
9
|
+
*
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
*/
|
|
12
|
+
class OrderExceedsBudgetError extends CodedRootError_1.CodedRootError {
|
|
13
|
+
constructor(orderAmount, budgetLimit, currency, orderId, projectName) {
|
|
14
|
+
const exceedAmount = orderAmount - budgetLimit;
|
|
15
|
+
const exceedPercentage = ((exceedAmount / budgetLimit) * 100).toFixed(2);
|
|
16
|
+
const technicalMessage = `Order ${orderId ? `#${orderId} ` : ''}exceeds budget limit by ${currency} ${exceedAmount.toFixed(2)} (${exceedPercentage}% over limit). Order amount: ${currency} ${orderAmount.toFixed(2)}, Budget limit: ${currency} ${budgetLimit.toFixed(2)}${projectName ? ` for project '${projectName}'` : ''}`;
|
|
17
|
+
const context = {
|
|
18
|
+
orderAmount,
|
|
19
|
+
budgetLimit,
|
|
20
|
+
exceedAmount,
|
|
21
|
+
exceedPercentage: parseFloat(exceedPercentage),
|
|
22
|
+
currency,
|
|
23
|
+
timestamp: new Date().toISOString(),
|
|
24
|
+
};
|
|
25
|
+
if (orderId) {
|
|
26
|
+
context.orderId = orderId;
|
|
27
|
+
}
|
|
28
|
+
if (projectName) {
|
|
29
|
+
context.projectName = projectName;
|
|
30
|
+
}
|
|
31
|
+
const suggestions = [
|
|
32
|
+
'Review the order items and quantities to reduce the total amount',
|
|
33
|
+
'Request a budget increase approval from the appropriate authority',
|
|
34
|
+
'Split the order into multiple smaller orders if possible',
|
|
35
|
+
'Consider alternative products or services that fit within budget',
|
|
36
|
+
'Check if there are any available discounts or promotions',
|
|
37
|
+
];
|
|
38
|
+
super(ErrorCode_1.ErrorCode.ORDER_EXCEEDS_BUDGET, technicalMessage, context, suggestions);
|
|
39
|
+
this.name = 'OrderExceedsBudgetError';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Factory method to create a new OrderExceedsBudgetError instance
|
|
43
|
+
*
|
|
44
|
+
* @param orderAmount - The total amount of the order
|
|
45
|
+
* @param budgetLimit - The maximum budget allowed
|
|
46
|
+
* @param currency - The currency code (e.g., USD, EUR)
|
|
47
|
+
* @param orderId - Optional order identifier
|
|
48
|
+
* @param projectName - Optional project or department name
|
|
49
|
+
* @returns A new OrderExceedsBudgetError instance
|
|
50
|
+
*/
|
|
51
|
+
static create(orderAmount, budgetLimit, currency = 'USD', orderId, projectName) {
|
|
52
|
+
return new OrderExceedsBudgetError(orderAmount, budgetLimit, currency, orderId, projectName);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Returns the amount by which the order exceeds the budget
|
|
56
|
+
*/
|
|
57
|
+
getExceedAmount() {
|
|
58
|
+
return this.context?.exceedAmount || 0;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Returns the percentage by which the order exceeds the budget
|
|
62
|
+
*/
|
|
63
|
+
getExceedPercentage() {
|
|
64
|
+
return this.context?.exceedPercentage || 0;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Checks if the order is slightly over budget (less than 10%)
|
|
68
|
+
*/
|
|
69
|
+
isSlightlyOverBudget() {
|
|
70
|
+
return this.getExceedPercentage() < 10;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Returns a user-friendly message based on the locale
|
|
74
|
+
*/
|
|
75
|
+
getUserMessage(locale = 'en') {
|
|
76
|
+
const messages = {
|
|
77
|
+
en: 'The order amount exceeds the available budget',
|
|
78
|
+
es: 'El monto de la orden excede el presupuesto disponible',
|
|
79
|
+
pt: 'O valor do pedido excede o orçamento disponível',
|
|
80
|
+
};
|
|
81
|
+
return messages[locale] || messages.en;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns a detailed user message with amounts
|
|
85
|
+
*/
|
|
86
|
+
getDetailedUserMessage(locale = 'en') {
|
|
87
|
+
const currency = this.context?.currency || 'USD';
|
|
88
|
+
const exceedAmount = this.context?.exceedAmount || 0;
|
|
89
|
+
const exceedPercentage = this.context?.exceedPercentage || 0;
|
|
90
|
+
const messages = {
|
|
91
|
+
en: `Order exceeds budget by ${currency} ${exceedAmount.toFixed(2)} (${exceedPercentage}% over limit)`,
|
|
92
|
+
es: `La orden excede el presupuesto por ${currency} ${exceedAmount.toFixed(2)} (${exceedPercentage}% sobre el límite)`,
|
|
93
|
+
pt: `O pedido excede o orçamento em ${currency} ${exceedAmount.toFixed(2)} (${exceedPercentage}% acima do limite)`,
|
|
94
|
+
};
|
|
95
|
+
return messages[locale] || messages.en;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.OrderExceedsBudgetError = OrderExceedsBudgetError;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServiceCatalogNotFoundError = void 0;
|
|
4
|
+
const CodedRootError_1 = require("./CodedRootError");
|
|
5
|
+
const ErrorCode_1 = require("../enums/ErrorCode");
|
|
6
|
+
/**
|
|
7
|
+
* Exception thrown when a service catalog item is not found in the system
|
|
8
|
+
* This error occurs when searching for services by ID, code, or category
|
|
9
|
+
*
|
|
10
|
+
* Error code: CBX-PMS-007
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
class ServiceCatalogNotFoundError extends CodedRootError_1.CodedRootError {
|
|
14
|
+
constructor(searchCriteria, searchValue, category, status) {
|
|
15
|
+
const errorCode = ErrorCode_1.ErrorCode.SERVICE_CATALOG_NOT_FOUND;
|
|
16
|
+
const categoryInfo = category ? ` in category '${category}'` : '';
|
|
17
|
+
const statusInfo = status ? ` with status '${status}'` : '';
|
|
18
|
+
const technicalMessage = `Service catalog item not found: ${searchCriteria}='${searchValue}'${categoryInfo}${statusInfo}`;
|
|
19
|
+
const context = {
|
|
20
|
+
searchCriteria,
|
|
21
|
+
searchValue,
|
|
22
|
+
...(category && { category }),
|
|
23
|
+
...(status && { status }),
|
|
24
|
+
timestamp: new Date().toISOString(),
|
|
25
|
+
};
|
|
26
|
+
const suggestions = [
|
|
27
|
+
'Verify the service catalog ID or code is correct',
|
|
28
|
+
'Check if the service is active and available',
|
|
29
|
+
'Ensure the service category is correct',
|
|
30
|
+
'Browse the available services in the catalog',
|
|
31
|
+
'Contact support to request the service be added',
|
|
32
|
+
];
|
|
33
|
+
super(errorCode, technicalMessage, context, suggestions);
|
|
34
|
+
this.name = 'ServiceCatalogNotFoundError';
|
|
35
|
+
}
|
|
36
|
+
static create(searchCriteria, searchValue, category, status) {
|
|
37
|
+
return new ServiceCatalogNotFoundError(searchCriteria, searchValue, category, status);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates a ServiceCatalogNotFoundError specifically for ID searches
|
|
41
|
+
*/
|
|
42
|
+
static byId(id) {
|
|
43
|
+
return new ServiceCatalogNotFoundError('id', id);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Creates a ServiceCatalogNotFoundError specifically for service code searches
|
|
47
|
+
*/
|
|
48
|
+
static byCode(code) {
|
|
49
|
+
return new ServiceCatalogNotFoundError('code', code);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Creates a ServiceCatalogNotFoundError for category searches
|
|
53
|
+
*/
|
|
54
|
+
static byCategory(category) {
|
|
55
|
+
return new ServiceCatalogNotFoundError('category', category, category);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Creates a ServiceCatalogNotFoundError for active services
|
|
59
|
+
*/
|
|
60
|
+
static noActiveService(serviceCode) {
|
|
61
|
+
return new ServiceCatalogNotFoundError('code', serviceCode, undefined, 'ACTIVE');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.ServiceCatalogNotFoundError = ServiceCatalogNotFoundError;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StakeholderNotFoundError = void 0;
|
|
4
|
+
const CodedRootError_1 = require("./CodedRootError");
|
|
5
|
+
const ErrorCode_1 = require("../enums/ErrorCode");
|
|
6
|
+
/**
|
|
7
|
+
* Exception thrown when a stakeholder is not found in the system
|
|
8
|
+
* This error occurs when searching for a stakeholder by ID, email, or other criteria
|
|
9
|
+
*
|
|
10
|
+
* Error code: CBX-STK-003
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
class StakeholderNotFoundError extends CodedRootError_1.CodedRootError {
|
|
14
|
+
constructor(searchCriteria, searchValue, stakeholderType) {
|
|
15
|
+
const errorCode = ErrorCode_1.ErrorCode.STAKEHOLDER_NOT_FOUND;
|
|
16
|
+
const stakeholderInfo = stakeholderType ? ` (type: ${stakeholderType})` : '';
|
|
17
|
+
const technicalMessage = `Stakeholder not found: ${searchCriteria}='${searchValue}'${stakeholderInfo}`;
|
|
18
|
+
const context = {
|
|
19
|
+
searchCriteria,
|
|
20
|
+
searchValue,
|
|
21
|
+
...(stakeholderType && { stakeholderType }),
|
|
22
|
+
timestamp: new Date().toISOString(),
|
|
23
|
+
};
|
|
24
|
+
const suggestions = [
|
|
25
|
+
'Verify the stakeholder ID or email is correct',
|
|
26
|
+
'Check if the stakeholder has been registered in the system',
|
|
27
|
+
'Ensure the stakeholder has not been deactivated',
|
|
28
|
+
'Contact an administrator to verify stakeholder status',
|
|
29
|
+
];
|
|
30
|
+
super(errorCode, technicalMessage, context, suggestions);
|
|
31
|
+
this.name = 'StakeholderNotFoundError';
|
|
32
|
+
}
|
|
33
|
+
static create(searchCriteria, searchValue, stakeholderType) {
|
|
34
|
+
return new StakeholderNotFoundError(searchCriteria, searchValue, stakeholderType);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a StakeholderNotFoundError specifically for ID searches
|
|
38
|
+
*/
|
|
39
|
+
static byId(id, stakeholderType) {
|
|
40
|
+
return new StakeholderNotFoundError('id', id, stakeholderType);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a StakeholderNotFoundError specifically for email searches
|
|
44
|
+
*/
|
|
45
|
+
static byEmail(email, stakeholderType) {
|
|
46
|
+
return new StakeholderNotFoundError('email', email, stakeholderType);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.StakeholderNotFoundError = StakeholderNotFoundError;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenExpiredError = void 0;
|
|
4
|
+
const CodedRootError_1 = require("./CodedRootError");
|
|
5
|
+
const ErrorCode_1 = require("../enums/ErrorCode");
|
|
6
|
+
/**
|
|
7
|
+
* Exception thrown when a JWT token has expired
|
|
8
|
+
* This error indicates the user needs to authenticate again
|
|
9
|
+
*
|
|
10
|
+
* Error code: CBX-AUTH-002
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
class TokenExpiredError extends CodedRootError_1.CodedRootError {
|
|
14
|
+
constructor(tokenType = 'access', expiredAt, userId) {
|
|
15
|
+
const errorCode = ErrorCode_1.ErrorCode.TOKEN_EXPIRED;
|
|
16
|
+
const technicalMessage = `${tokenType.charAt(0).toUpperCase() + tokenType.slice(1)} token has expired${expiredAt ? ` at ${expiredAt}` : ''}${userId ? ` for user ${userId}` : ''}`;
|
|
17
|
+
const context = {
|
|
18
|
+
tokenType,
|
|
19
|
+
...(expiredAt && { expiredAt }),
|
|
20
|
+
...(userId && { userId }),
|
|
21
|
+
timestamp: new Date().toISOString(),
|
|
22
|
+
};
|
|
23
|
+
const suggestions = [
|
|
24
|
+
'Your session has expired. Please log in again',
|
|
25
|
+
'Use the refresh token to obtain a new access token',
|
|
26
|
+
'If you continue having issues, clear your browser cache and cookies',
|
|
27
|
+
'Contact support if the problem persists',
|
|
28
|
+
];
|
|
29
|
+
super(errorCode, technicalMessage, context, suggestions);
|
|
30
|
+
this.name = 'TokenExpiredError';
|
|
31
|
+
}
|
|
32
|
+
static create(tokenType = 'access', expiredAt, userId) {
|
|
33
|
+
return new TokenExpiredError(tokenType, expiredAt, userId);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Creates a TokenExpiredError specifically for access tokens
|
|
37
|
+
*/
|
|
38
|
+
static accessToken(expiredAt, userId) {
|
|
39
|
+
return new TokenExpiredError('access', expiredAt, userId);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a TokenExpiredError specifically for refresh tokens
|
|
43
|
+
*/
|
|
44
|
+
static refreshToken(expiredAt, userId) {
|
|
45
|
+
return new TokenExpiredError('refresh', expiredAt, userId);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.TokenExpiredError = TokenExpiredError;
|
|
@@ -57,16 +57,18 @@ class CarbonClient extends Stakeholder_1.Stakeholder {
|
|
|
57
57
|
const lastAccessAt = skipDomainValidation
|
|
58
58
|
? CarbonClientLastAccessAt_1.CarbonClientLastAccessAt.fromPrimitives(props.lastAccessAt).toPrimitives()
|
|
59
59
|
: CarbonClientLastAccessAt_1.CarbonClientLastAccessAt.create(props.lastAccessAt).toPrimitives();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
let taxIdentification = null;
|
|
61
|
+
if (props.taxIdentification !== null) {
|
|
62
|
+
taxIdentification = skipDomainValidation
|
|
63
63
|
? CarbonClientTaxIdentification_1.CarbonClientTaxIdentification.fromPrimitives(props.taxIdentification).toPrimitives()
|
|
64
|
-
: CarbonClientTaxIdentification_1.CarbonClientTaxIdentification.create(props.taxIdentification).toPrimitives()
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
: CarbonClientTaxIdentification_1.CarbonClientTaxIdentification.create(props.taxIdentification).toPrimitives();
|
|
65
|
+
}
|
|
66
|
+
let identityDocument = null;
|
|
67
|
+
if (props.identityDocument !== null) {
|
|
68
|
+
identityDocument = skipDomainValidation
|
|
68
69
|
? CarbonClientIdentityDocument_1.CarbonClientIdentityDocument.fromPrimitives(props.identityDocument).toPrimitives()
|
|
69
|
-
: CarbonClientIdentityDocument_1.CarbonClientIdentityDocument.create(props.identityDocument).toPrimitives()
|
|
70
|
+
: CarbonClientIdentityDocument_1.CarbonClientIdentityDocument.create(props.identityDocument).toPrimitives();
|
|
71
|
+
}
|
|
70
72
|
const roleType = skipDomainValidation
|
|
71
73
|
? CarbonClientRoleType_1.CarbonClientRoleType.fromPrimitives(props.roleType).toEnum()
|
|
72
74
|
: CarbonClientRoleType_1.CarbonClientRoleType.create(props.roleType).toEnum();
|
|
@@ -53,16 +53,18 @@ class CarbonCoordinator extends Stakeholder_1.Stakeholder {
|
|
|
53
53
|
const lastAccessAt = skipDomainValidation
|
|
54
54
|
? CarbonCoordinatorLastAccessAt_1.CarbonCoordinatorLastAccessAt.fromPrimitives(props.lastAccessAt).toPrimitives()
|
|
55
55
|
: CarbonCoordinatorLastAccessAt_1.CarbonCoordinatorLastAccessAt.create(props.lastAccessAt).toPrimitives();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
let taxIdentification = null;
|
|
57
|
+
if (props.taxIdentification !== null) {
|
|
58
|
+
taxIdentification = skipDomainValidation
|
|
59
59
|
? CarbonCoordinatorTaxIdentification_1.CarbonCoordinatorTaxIdentification.fromPrimitives(props.taxIdentification).toPrimitives()
|
|
60
|
-
: CarbonCoordinatorTaxIdentification_1.CarbonCoordinatorTaxIdentification.create(props.taxIdentification).toPrimitives()
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
: CarbonCoordinatorTaxIdentification_1.CarbonCoordinatorTaxIdentification.create(props.taxIdentification).toPrimitives();
|
|
61
|
+
}
|
|
62
|
+
let identityDocument = null;
|
|
63
|
+
if (props.identityDocument !== null) {
|
|
64
|
+
identityDocument = skipDomainValidation
|
|
64
65
|
? CarbonCoordinatorIdentityDocument_1.CarbonCoordinatorIdentityDocument.fromPrimitives(props.identityDocument).toPrimitives()
|
|
65
|
-
: CarbonCoordinatorIdentityDocument_1.CarbonCoordinatorIdentityDocument.create(props.identityDocument).toPrimitives()
|
|
66
|
+
: CarbonCoordinatorIdentityDocument_1.CarbonCoordinatorIdentityDocument.create(props.identityDocument).toPrimitives();
|
|
67
|
+
}
|
|
66
68
|
const roleType = skipDomainValidation
|
|
67
69
|
? CarbonCoordinatorRoleType_1.CarbonCoordinatorRoleType.fromPrimitives(props.roleType).toEnum()
|
|
68
70
|
: CarbonCoordinatorRoleType_1.CarbonCoordinatorRoleType.create(props.roleType).toEnum();
|
|
@@ -36,11 +36,12 @@ class CarbonHost extends Stakeholder_1.Stakeholder {
|
|
|
36
36
|
: CarbonHostLastAccessAt_1.CarbonHostLastAccessAt.create(props.lastAccessAt).toPrimitives();
|
|
37
37
|
// USR-020: Host conserva taxIdentification (a nivel app sigue requerido); identityDocument
|
|
38
38
|
// no aplica al Host (siempre null). El tipo base es nullable, de ahí el manejo defensivo.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
let taxIdentification = null;
|
|
40
|
+
if (props.taxIdentification !== null) {
|
|
41
|
+
taxIdentification = skipDomainValidation
|
|
42
42
|
? CarbonHostTaxIdentification_1.CarbonHostTaxIdentification.fromPrimitives(props.taxIdentification).toPrimitives()
|
|
43
|
-
: CarbonHostTaxIdentification_1.CarbonHostTaxIdentification.create(props.taxIdentification).toPrimitives()
|
|
43
|
+
: CarbonHostTaxIdentification_1.CarbonHostTaxIdentification.create(props.taxIdentification).toPrimitives();
|
|
44
|
+
}
|
|
44
45
|
const roleType = skipDomainValidation
|
|
45
46
|
? CarbonHostRoleType_1.CarbonHostRoleType.fromPrimitives(props.roleType).toEnum()
|
|
46
47
|
: CarbonHostRoleType_1.CarbonHostRoleType.create(props.roleType).toEnum();
|
|
@@ -48,16 +48,18 @@ class CarbonManager extends Stakeholder_1.Stakeholder {
|
|
|
48
48
|
const lastAccessAt = skipDomainValidation
|
|
49
49
|
? CarbonManagerLastAccessAt_1.CarbonManagerLastAccessAt.fromPrimitives(props.lastAccessAt).toPrimitives()
|
|
50
50
|
: CarbonManagerLastAccessAt_1.CarbonManagerLastAccessAt.create(props.lastAccessAt).toPrimitives();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
let taxIdentification = null;
|
|
52
|
+
if (props.taxIdentification !== null) {
|
|
53
|
+
taxIdentification = skipDomainValidation
|
|
54
54
|
? CarbonManagerTaxIdentification_1.CarbonManagerTaxIdentification.fromPrimitives(props.taxIdentification).toPrimitives()
|
|
55
|
-
: CarbonManagerTaxIdentification_1.CarbonManagerTaxIdentification.create(props.taxIdentification).toPrimitives()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
: CarbonManagerTaxIdentification_1.CarbonManagerTaxIdentification.create(props.taxIdentification).toPrimitives();
|
|
56
|
+
}
|
|
57
|
+
let identityDocument = null;
|
|
58
|
+
if (props.identityDocument !== null) {
|
|
59
|
+
identityDocument = skipDomainValidation
|
|
59
60
|
? CarbonManagerIdentityDocument_1.CarbonManagerIdentityDocument.fromPrimitives(props.identityDocument).toPrimitives()
|
|
60
|
-
: CarbonManagerIdentityDocument_1.CarbonManagerIdentityDocument.create(props.identityDocument).toPrimitives()
|
|
61
|
+
: CarbonManagerIdentityDocument_1.CarbonManagerIdentityDocument.create(props.identityDocument).toPrimitives();
|
|
62
|
+
}
|
|
61
63
|
const roleType = skipDomainValidation
|
|
62
64
|
? CarbonManagerRoleType_1.CarbonManagerRoleType.fromPrimitives(props.roleType).toEnum()
|
|
63
65
|
: CarbonManagerRoleType_1.CarbonManagerRoleType.create(props.roleType).toEnum();
|
package/build/main/index.js
CHANGED
|
@@ -16,11 +16,11 @@ exports.ServicePricingAllowsDiscounts = exports.ServicePricingMaximumUnits = exp
|
|
|
16
16
|
exports.InvalidMarkupPercentageError = exports.InvalidDiscountPercentageError = exports.InvalidUserRoleError = exports.InvalidServiceCatalogTypeError = exports.InvalidServiceCatalogStatusError = exports.InvalidServiceCatalogCategoryError = exports.InvalidReportTypeError = exports.InvalidExpertDedicationLevelError = exports.InvalidTotalAmountFactorError = exports.InvalidTaxAmountFactorError = exports.InvalidSubtotalAmountFactorError = exports.InvalidSubtotalAmountError = exports.InvalidPurchaseOrderStatusError = exports.InvalidPercentageRangeError = exports.InvalidPaymentStatusError = exports.InvalidPaymentMethodError = exports.InvalidMaximumSubtotalError = exports.InvalidFixedDiscountAmountError = exports.InvalidDiscountAmountFactorError = exports.InvalidTaxRateError = exports.InvalidPaymentTermsError = exports.InvalidPaymentScheduleError = exports.InvalidContractValueFactorError = exports.InvalidContractTypeError = exports.InvalidContractStatusError = exports.PricingStatusEnum = exports.PricingModelEnum = exports.UserRoleEnum = exports.ReportTypeEnum = exports.ExpertDedicationLevelEnum = exports.ServiceCatalogStatusEnum = exports.ServiceCatalogTypeEnum = exports.ServiceCatalogCategoryEnum = exports.PaymentStatusEnum = exports.PaymentMethodEnum = exports.OrderStatusEnum = exports.PaymentTermsEnum = exports.PaymentScheduleEnum = exports.ContractDurationUnitEnum = exports.ContractTypeEnum = exports.ContractStatusEnum = exports.ServicePricingInternalNotes = exports.ServicePricingPricingNotes = exports.ServicePricingValidToDate = exports.ServicePricingValidFromDate = exports.ServicePricingPromotionalDiscountPercentage = exports.ServicePricingPromotionalEndDate = exports.ServicePricingPromotionalStartDate = exports.ServicePricingPromotionalPricing = exports.ServicePricingMaxDiscountPercentage = void 0;
|
|
17
17
|
exports.ColombiaNIT = exports.TaxIdentificationNumber = exports.ExecutionPeriod = exports.AggregateId = exports.Code = exports.Url = exports.Image = exports.Address = exports.Phone = exports.Email = exports.DateTimeString = exports.DateString = exports.Boolean = exports.Numeric = exports.PositiveInteger = exports.Integer = exports.String = exports.SemanticUuidPrefixEnum = exports.TaxIdentificationEnum = exports.SystemBoundaryEnum = exports.StakeholderRoleEnum = exports.ReportingStandardEnum = exports.ISOCategoryEnum = exports.GreenhouseGasCategoryEnum = exports.GenderEnum = exports.GHGSubScopeEnum = exports.GHGScopeEnum = exports.EmissionSourceEnum = exports.EmissionCategoryEnum = exports.DayOfWeekEnum = exports.CurrencyEnum = exports.CountryCodeEnum = exports.BusinessScaleEnum = exports.LocaleEnum = exports.UserBusinessStatusEnum = exports.UserTypeEnum = exports.ErrorCode = exports.CodedRootError = exports.RootError = exports.ObjectValueObject = exports.PrimitiveValueObject = exports.ValueObject = exports.User = exports.DomainError = exports.AggregateRoot = exports.InvalidUnitsError = exports.InvalidTaxPercentageError = exports.InvalidPricingStatusError = exports.InvalidPricingModelError = exports.InvalidPricePerUnitError = void 0;
|
|
18
18
|
exports.CarbonFootprintConfigurationReference = exports.GlobalWarmingPotentialReference = exports.EmissionFactorReference = exports.EmissionCalculationFormulaReference = exports.EmissionCalculationReference = exports.CalculationVariableReferences = exports.CalculationProcessReference = exports.ActivityDataSubmissionRejectionReason = exports.ActivityDataSubmissionRejectedAt = exports.ActivityDataSubmissionApprovedAt = exports.ActivityDataSubmissionSubmittedAt = exports.ActivityDataSubmissionDataQualityNotes = exports.ActivityDataSubmissionUncertaintySource = exports.ActivityDataSubmissionOverallUncertaintyPercentage = exports.ActivityDataSubmissionReference = exports.EmissionSource = exports.EmissionSources = exports.CarbonClientReferences = exports.CarbonClientReference = exports.StakeholderReferences = exports.StakeholderReference = exports.UserPreferredLocale = exports.UserType = exports.UserLastAccessAt = exports.UserAvatar = exports.UserBusinessStatus = exports.UserPassword = exports.UserDisplayName = exports.UserId = exports.UserEmail = exports.NullableProductConfigurationCarbonFootprintSubsegmentReference = exports.NullableEventEditionConfigurationCarbonFootprintSubsegmentReference = exports.NullableCorporateConfigurationCarbonFootprintSubsegmentReference = exports.NullableStakeholderReference = exports.NullableColombianNIT = exports.NullableTaxIdentificationNumber = exports.NullablePositiveInteger = exports.NullableNumeric = exports.NullableDateTimeString = exports.NullableDate = exports.NullableCode = exports.NullableString = exports.TaxIdentificationNumberList = exports.UrlList = exports.StringList = exports.CodeList = exports.AggregateIdList = exports.TaxIdentification = exports.Gender = exports.Currency = void 0;
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.InvalidIdentityDocumentTypeError = exports.CarbonClientIdentityDocument = exports.CarbonCoordinatorIdentityDocument = exports.CarbonManagerIdentityDocument = exports.StakeholderIdentityDocument = exports.IdentityDocument = exports.IdentityDocumentTypeEnum = exports.CompanyServiceEntitlementValidTo = exports.CompanyServiceEntitlementValidFrom = exports.CompanyServiceEntitlementAdditionalUserRoles = exports.CompanyServiceEntitlementMaxUsers = exports.CompanyServiceEntitlementIsAvailableForEvent = exports.CompanyServiceEntitlementIsAvailableForProduct = exports.CompanyServiceEntitlementIsAvailableForCorporate = exports.CompanyServiceEntitlementIncludesEsgIndicators = exports.CompanyServiceEntitlementIncludesCarbonBoxAcademy = exports.CompanyServiceEntitlementAllowsSectoralComparison = exports.CompanyServiceEntitlementAllowsDocumentReading = exports.CompanyServiceEntitlementSourceContractIds = exports.CompanyServiceEntitlementActiveServiceCodes = exports.CompanyServiceEntitlementCarbonClientId = exports.CompanyServiceEntitlementId = void 0;
|
|
19
|
+
exports.ConfigurationNotFoundError = exports.InvalidBusinessStatusError = exports.StakeholderNotFoundError = exports.EmailNotVerifiedError = exports.AccountLockedError = exports.MissingCredentialsError = exports.TokenExpiredError = exports.InvalidCredentialsError = exports.InvalidColombianNITNumberError = exports.InvalidColombianNITCheckDigitError = exports.InvalidColombianNITFormatError = exports.InvalidTaxIdentificationTypeError = exports.InvalidStakeholderRoleTypeError = exports.InvalidGenderError = exports.InvalidCurrencyError = exports.InvalidCountryCodeError = exports.InvalidBusinessScaleError = exports.UnknownBoundedContextCodeError = exports.InvalidUuidFormatError = exports.InvalidUserPrefixError = exports.InvalidUserIdFormatError = exports.InvalidSemanticUuidFormatError = exports.InvalidAggregateIdFormatError = exports.InvalidPropertyValueError = exports.InvalidPropertyTypeError = exports.InvalidValueObjectConfigurationError = exports.UndefinedValueError = exports.NullValueError = exports.MethodNotImplementedError = exports.CreateMethodNotImplementedError = exports.ServiceCatalogReference = exports.ProductReference = exports.ProductConfigurationSystemBoundaryReference = exports.ProductConfigurationCarbonFootprintSubsegmentReference = exports.ProductConfigurationCarbonFootprintSegmentReference = exports.ProductCarbonFootprintSegmentConfigurationReferences = exports.FacilityReference = exports.EventReference = exports.EventEditionReferences = exports.EventEditionReference = exports.EventEditionLifecycleStageReference = exports.EventEditionLifecycleStageConfigurationReferences = exports.EventEditionConfigurationCarbonFootprintSubsegmentReferences = exports.EventEditionConfigurationCarbonFootprintSubsegmentReference = exports.CorporateConfigurationCarbonFootprintSubsegmentReference = exports.CorporateConfigurationCarbonFootprintSegmentReference = exports.CorporateCarbonFootprintSegmentConfigurationReferences = exports.CollectionFieldReference = exports.CarbonFootprintSegmentReferences = exports.CarbonFootprintIntensityIndicatorReference = void 0;
|
|
20
|
+
exports.ResultExtensions = exports.EitherUtils = exports.ResultFactory = exports.EitherFactory = exports.RightEither = exports.LeftEither = exports.Either = exports.EventEditionLifecycleStageConfigurationEmissionSourceConfigurations = exports.ProductCarbonFootprintSegmentConfigurationEmissionSourceConfigurations = exports.EmissionSourceConfiguration = exports.CarbonFootprintSegmentConfigurationReference = exports.TaxIdentificationNumberWithControlCharactersError = exports.InvalidTaxIdentificationNumberLengthError = exports.InvalidTaxIdentificationNumberFormatError = exports.InvalidSupervisorRoleError = exports.InvalidMinutesDurationError = exports.InvalidMeasurementUnitOperationError = exports.InvalidManagedStakeholderRoleError = exports.InvalidDomainCodeError = exports.InvalidCountrySpecificTaxIdentificationNumberError = exports.InvalidCodeError = exports.InvalidAssignerRoleError = exports.InvalidAggregateIdError = exports.EmptyTaxIdentificationNumberError = exports.EmptySegmentNameError = exports.EmptySegmentCodeError = exports.EmptyDisplayNameError = exports.DateGreaterThanError = exports.InvalidUserBusinessStatusError = exports.InvalidUserTypeError = exports.DivisionByZeroError = exports.MoneyOverflowError = exports.NotIntegerError = exports.NegativeAmountError = exports.MinimumValueViolationError = exports.InvalidUrlListError = exports.InvalidCodeListError = exports.InvalidStringListError = exports.EmptyArrayNotAllowedError = exports.PasswordPolicyViolationError = exports.InvalidNationalNumberError = exports.InvalidFullInternationalNumberError = exports.InvalidEmailPolicyError = exports.InvalidCoordinatesError = exports.InvalidTimeFormatError = exports.InvalidDateRangeError = exports.InvalidDateFormatError = exports.OrderExceedsBudgetError = exports.ServiceCatalogNotFoundError = exports.ContractNotFoundError = void 0;
|
|
21
|
+
exports.CarbonCoordinatorAssignedByStakeholder = exports.CarbonCoordinatorLastAccessAt = exports.CarbonCoordinatorTaxIdentification = exports.CarbonCoordinatorBusinessStatus = exports.CarbonCoordinatorRoleType = exports.CarbonCoordinatorManagedCarbonClients = exports.CarbonCoordinatorWeeklyWorkingSchedule = exports.CarbonCoordinatorGender = exports.CarbonCoordinatorUserType = exports.CarbonCoordinatorAvailabilityStatus = exports.CarbonCoordinatorDisplayName = exports.CarbonCoordinatorEmail = exports.CarbonCoordinatorId = exports.CarbonClientPermissions = exports.CarbonClientPassword = exports.CarbonClientBusinessStatus = exports.CarbonClientLastAccessAt = exports.CarbonClientSupervisedByStakeholder = exports.CarbonClientRoleType = exports.CarbonClientTaxIdentification = exports.CarbonClientPrimaryContactPhone = exports.CarbonClientPrimaryContactEmail = exports.CarbonClientLogo = exports.CarbonClientWebsiteUrl = exports.CarbonClientPhysicalAddress = exports.CarbonClientOrganizationSize = exports.CarbonClientIndustryType = exports.CarbonClientUserType = exports.CarbonClientLegalBusinessName = exports.CarbonClientAccountType = exports.CarbonClientDisplayName = exports.CarbonClientEmail = exports.CarbonClientId = exports.StakeholderUserType = exports.StakeholderLastAccessAt = exports.StakeholderAvatar = exports.StakeholderTaxIdentification = exports.StakeholderRoleType = exports.StakeholderBusinessStatus = exports.StakeholderPassword = exports.StakeholderDisplayName = exports.StakeholderEmail = exports.StakeholderId = exports.CarbonManager = exports.CarbonHost = exports.CarbonCoordinator = exports.CarbonClient = exports.Stakeholder = exports.CannotAccessRightOnLeftValueError = exports.CannotAccessLeftOnRightValueError = void 0;
|
|
22
|
+
exports.CalculationJobFailedDomainEvent = exports.CalculationJobCompletedDomainEvent = exports.CalculationJobStartedDomainEvent = exports.WorkflowPausedDomainEvent = exports.WorkflowActivatedDomainEvent = exports.CalculationWorkflowReferenceVO = exports.InvalidDomainEventNameError = exports.DomainEventName = exports.DomainEvent = exports.StakeholderPermissions = exports.UserPermissions = exports.UnsupportedUserTypeError = exports.UnsupportedStakeholderRoleError = exports.SecurityContextReconstructionError = exports.SecurityContext = exports.PermissionSet = exports.PermissionEnum = exports.AuthorizationDecisionEnum = exports.UserCreationDomainService = exports.AggregateIdDomainService = exports.DateTimeFormattingDomainService = exports.InvalidCarbonCoordinatorAvailabilityStatusError = exports.InvalidCarbonClientAccountTypeError = exports.CarbonCoordinatorAvailabilityStatusEnum = exports.CarbonClientAccountEnum = exports.CarbonManagerPermissions = exports.CarbonManagerPassword = exports.CarbonManagerLastAccessAt = exports.CarbonManagerTaxIdentification = exports.CarbonManagerBusinessStatus = exports.CarbonManagerRoleType = exports.CarbonManagerUserType = exports.CarbonManagerManagedStakeholders = exports.CarbonManagerDisplayName = exports.CarbonManagerEmail = exports.CarbonManagerId = exports.CarbonHostPermissions = exports.CarbonHostAvatar = exports.CarbonHostLastAccessAt = exports.CarbonHostUserType = exports.CarbonHostBusinessStatus = exports.CarbonHostDisplayName = exports.CarbonHostTaxIdentification = exports.CarbonHostRoleType = exports.CarbonHostPassword = exports.CarbonHostEmail = exports.CarbonHostId = exports.CarbonCoordinatorPermissions = exports.CarbonCoordinatorPassword = exports.CarbonCoordinatorReportsToStakeholder = void 0;
|
|
23
|
+
exports.InvalidIdentityDocumentTypeError = exports.CarbonClientIdentityDocument = exports.CarbonCoordinatorIdentityDocument = exports.CarbonManagerIdentityDocument = exports.StakeholderIdentityDocument = exports.IdentityDocument = exports.IdentityDocumentTypeEnum = exports.CompanyServiceEntitlementValidTo = exports.CompanyServiceEntitlementValidFrom = exports.CompanyServiceEntitlementAdditionalUserRoles = exports.CompanyServiceEntitlementMaxUsers = exports.CompanyServiceEntitlementIsAvailableForEvent = exports.CompanyServiceEntitlementIsAvailableForProduct = exports.CompanyServiceEntitlementIsAvailableForCorporate = exports.CompanyServiceEntitlementIncludesEsgIndicators = exports.CompanyServiceEntitlementIncludesCarbonBoxAcademy = exports.CompanyServiceEntitlementAllowsSectoralComparison = exports.CompanyServiceEntitlementAllowsDocumentReading = exports.CompanyServiceEntitlementSourceContractIds = exports.CompanyServiceEntitlementActiveServiceCodes = exports.CompanyServiceEntitlementCarbonClientId = exports.CompanyServiceEntitlementId = exports.ServiceCapabilityPolicy = exports.CompanyServiceEntitlement = exports.PurchaseContractServiceRemovedDomainEvent = exports.PurchaseContractServiceAddedDomainEvent = exports.PurchaseContractRenewedDomainEvent = exports.PurchaseContractExpiredDomainEvent = exports.PurchaseContractCancelledDomainEvent = exports.PurchaseContractSuspendedDomainEvent = exports.PurchaseContractActivatedDomainEvent = exports.CalculationProcessFailedDomainEvent = exports.CalculationProcessCompletedDomainEvent = void 0;
|
|
24
24
|
// ─── Entity Classes (For Application Layer) ─────────────────────────────────
|
|
25
25
|
var ActivityDataSubmission_1 = require("../carbonbox/activity-data-collection/activity-data-submissions/domain/entity/ActivityDataSubmission");
|
|
26
26
|
Object.defineProperty(exports, "ActivityDataSubmission", { enumerable: true, get: function () { return ActivityDataSubmission_1.ActivityDataSubmission; } });
|
|
@@ -1523,6 +1523,32 @@ var InvalidColombianNITCheckDigitError_1 = require("../carbonbox/shared/domain/e
|
|
|
1523
1523
|
Object.defineProperty(exports, "InvalidColombianNITCheckDigitError", { enumerable: true, get: function () { return InvalidColombianNITCheckDigitError_1.InvalidColombianNITCheckDigitError; } });
|
|
1524
1524
|
var InvalidColombianNITNumberError_1 = require("../carbonbox/shared/domain/exceptions/InvalidColombianNITNumberError");
|
|
1525
1525
|
Object.defineProperty(exports, "InvalidColombianNITNumberError", { enumerable: true, get: function () { return InvalidColombianNITNumberError_1.InvalidColombianNITNumberError; } });
|
|
1526
|
+
// Authentication Exceptions
|
|
1527
|
+
var InvalidCredentialsError_1 = require("../carbonbox/shared/domain/exceptions/InvalidCredentialsError");
|
|
1528
|
+
Object.defineProperty(exports, "InvalidCredentialsError", { enumerable: true, get: function () { return InvalidCredentialsError_1.InvalidCredentialsError; } });
|
|
1529
|
+
var TokenExpiredError_1 = require("../carbonbox/shared/domain/exceptions/TokenExpiredError");
|
|
1530
|
+
Object.defineProperty(exports, "TokenExpiredError", { enumerable: true, get: function () { return TokenExpiredError_1.TokenExpiredError; } });
|
|
1531
|
+
var MissingCredentialsError_1 = require("../carbonbox/shared/domain/exceptions/MissingCredentialsError");
|
|
1532
|
+
Object.defineProperty(exports, "MissingCredentialsError", { enumerable: true, get: function () { return MissingCredentialsError_1.MissingCredentialsError; } });
|
|
1533
|
+
var AccountLockedError_1 = require("../carbonbox/shared/domain/exceptions/AccountLockedError");
|
|
1534
|
+
Object.defineProperty(exports, "AccountLockedError", { enumerable: true, get: function () { return AccountLockedError_1.AccountLockedError; } });
|
|
1535
|
+
var EmailNotVerifiedError_1 = require("../carbonbox/shared/domain/exceptions/EmailNotVerifiedError");
|
|
1536
|
+
Object.defineProperty(exports, "EmailNotVerifiedError", { enumerable: true, get: function () { return EmailNotVerifiedError_1.EmailNotVerifiedError; } });
|
|
1537
|
+
// Stakeholder Exceptions
|
|
1538
|
+
var StakeholderNotFoundError_1 = require("../carbonbox/shared/domain/exceptions/StakeholderNotFoundError");
|
|
1539
|
+
Object.defineProperty(exports, "StakeholderNotFoundError", { enumerable: true, get: function () { return StakeholderNotFoundError_1.StakeholderNotFoundError; } });
|
|
1540
|
+
var InvalidBusinessStatusError_1 = require("../carbonbox/shared/domain/exceptions/InvalidBusinessStatusError");
|
|
1541
|
+
Object.defineProperty(exports, "InvalidBusinessStatusError", { enumerable: true, get: function () { return InvalidBusinessStatusError_1.InvalidBusinessStatusError; } });
|
|
1542
|
+
// Configuration Exceptions
|
|
1543
|
+
var ConfigurationNotFoundError_1 = require("../carbonbox/shared/domain/exceptions/ConfigurationNotFoundError");
|
|
1544
|
+
Object.defineProperty(exports, "ConfigurationNotFoundError", { enumerable: true, get: function () { return ConfigurationNotFoundError_1.ConfigurationNotFoundError; } });
|
|
1545
|
+
// Purchase Management System Exceptions
|
|
1546
|
+
var ContractNotFoundError_1 = require("../carbonbox/shared/domain/exceptions/ContractNotFoundError");
|
|
1547
|
+
Object.defineProperty(exports, "ContractNotFoundError", { enumerable: true, get: function () { return ContractNotFoundError_1.ContractNotFoundError; } });
|
|
1548
|
+
var ServiceCatalogNotFoundError_1 = require("../carbonbox/shared/domain/exceptions/ServiceCatalogNotFoundError");
|
|
1549
|
+
Object.defineProperty(exports, "ServiceCatalogNotFoundError", { enumerable: true, get: function () { return ServiceCatalogNotFoundError_1.ServiceCatalogNotFoundError; } });
|
|
1550
|
+
var OrderExceedsBudgetError_1 = require("../carbonbox/shared/domain/exceptions/OrderExceedsBudgetError");
|
|
1551
|
+
Object.defineProperty(exports, "OrderExceedsBudgetError", { enumerable: true, get: function () { return OrderExceedsBudgetError_1.OrderExceedsBudgetError; } });
|
|
1526
1552
|
// Data Validation Exceptions
|
|
1527
1553
|
var InvalidDateFormatError_1 = require("../carbonbox/shared/domain/exceptions/InvalidDateFormatError");
|
|
1528
1554
|
Object.defineProperty(exports, "InvalidDateFormatError", { enumerable: true, get: function () { return InvalidDateFormatError_1.InvalidDateFormatError; } });
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* Exception thrown when an invalid contract status is provided
|
|
4
|
+
* This error occurs when the contract status doesn't match allowed values
|
|
5
|
+
*
|
|
6
|
+
* Error code: CBX-PMS-002
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
export declare class InvalidContractStatusError extends CodedRootError {
|
|
3
10
|
private constructor();
|
|
4
11
|
static create(contractStatus: string, validStatuses: string[]): InvalidContractStatusError;
|
|
5
|
-
logError(): string;
|
|
6
12
|
}
|
|
7
13
|
//# sourceMappingURL=InvalidContractStatusError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidContractStatusError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidContractStatusError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InvalidContractStatusError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidContractStatusError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,cAAc;IAC5D,OAAO;WAsBgB,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,0BAA0B;CAG3G"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* Exception thrown when invalid payment terms are provided for a contract
|
|
4
|
+
* This error occurs when the payment terms don't match allowed values
|
|
5
|
+
*
|
|
6
|
+
* Error code: CBX-PMS-003
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
export declare class InvalidPaymentTermsError extends CodedRootError {
|
|
3
10
|
private constructor();
|
|
4
11
|
static create(paymentTerms: string, validTerms: string[]): InvalidPaymentTermsError;
|
|
5
|
-
logError(): string;
|
|
6
12
|
}
|
|
7
13
|
//# sourceMappingURL=InvalidPaymentTermsError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidPaymentTermsError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidPaymentTermsError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InvalidPaymentTermsError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/exceptions/InvalidPaymentTermsError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,cAAc;IAC1D,OAAO;WAsBgB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,wBAAwB;CAGpG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CodedRootError } from './CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* Exception thrown when a user account is locked
|
|
4
|
+
* This error occurs when too many failed login attempts or security violations
|
|
5
|
+
*
|
|
6
|
+
* Error code: CBX-AUTH-005
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
export declare class AccountLockedError extends CodedRootError {
|
|
10
|
+
private constructor();
|
|
11
|
+
static create(email: string, reason: string, lockedUntil?: Date, attemptCount?: number): AccountLockedError;
|
|
12
|
+
/**
|
|
13
|
+
* Creates an AccountLockedError for too many failed attempts
|
|
14
|
+
*/
|
|
15
|
+
static tooManyAttempts(email: string, attemptCount: number, lockedUntil: Date): AccountLockedError;
|
|
16
|
+
/**
|
|
17
|
+
* Creates an AccountLockedError for security violation
|
|
18
|
+
*/
|
|
19
|
+
static securityViolation(email: string, lockedUntil?: Date): AccountLockedError;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an AccountLockedError for administrative lock
|
|
22
|
+
*/
|
|
23
|
+
static administrativeLock(email: string, reason: string): AccountLockedError;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=AccountLockedError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountLockedError.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/exceptions/AccountLockedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO;WA+BgB,MAAM,CAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,IAAI,EAClB,YAAY,CAAC,EAAE,MAAM,GACpB,kBAAkB;IAIrB;;OAEG;WACW,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,GAAG,kBAAkB;IAIzG;;OAEG;WACW,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,GAAG,kBAAkB;IAItF;;OAEG;WACW,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,kBAAkB;CAGpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodedRootError.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/exceptions/CodedRootError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD;;;;;;GAMG;AACH,8BAAsB,cAAe,SAAQ,SAAU,YAAW,WAAW;IAC3E,SAAgB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CodedRootError.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/exceptions/CodedRootError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD;;;;;;GAMG;AACH,8BAAsB,cAAe,SAAQ,SAAU,YAAW,WAAW;IAC3E,SAAgB,SAAS,EAAE,MAAM,CAAC;IAElC,SAAgB,gBAAgB,EAAE,MAAM,CAAC;IAEzC,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE9C,SAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvC;;;;;;;OAOG;IACH,SAAS,aACP,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,WAAW,CAAC,EAAE,MAAM,EAAE;IAcxB;;;OAGG;IACa,QAAQ,IAAI,MAAM;IAKlC;;;OAGG;IACI,aAAa,IAAI;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB;IASD;;OAEG;WACW,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW;CAUjE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CodedRootError } from './CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* Exception thrown when a carbon footprint configuration is not found
|
|
4
|
+
* This error occurs when searching for configurations by ID, type, or other criteria
|
|
5
|
+
*
|
|
6
|
+
* Error code: CBX-CFC-001
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
export declare class ConfigurationNotFoundError extends CodedRootError {
|
|
10
|
+
private constructor();
|
|
11
|
+
static create(configurationType: string, searchCriteria: string, searchValue: string, clientId?: string): ConfigurationNotFoundError;
|
|
12
|
+
/**
|
|
13
|
+
* Creates an error for missing corporate configuration
|
|
14
|
+
*/
|
|
15
|
+
static corporate(id: string, clientId?: string): ConfigurationNotFoundError;
|
|
16
|
+
/**
|
|
17
|
+
* Creates an error for missing product configuration
|
|
18
|
+
*/
|
|
19
|
+
static product(id: string, clientId?: string): ConfigurationNotFoundError;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an error for missing event configuration
|
|
22
|
+
*/
|
|
23
|
+
static event(id: string, clientId?: string): ConfigurationNotFoundError;
|
|
24
|
+
/**
|
|
25
|
+
* Creates an error for missing configuration by period
|
|
26
|
+
*/
|
|
27
|
+
static byPeriod(configurationType: string, period: string, clientId?: string): ConfigurationNotFoundError;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=ConfigurationNotFoundError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationNotFoundError.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/exceptions/ConfigurationNotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,cAAc;IAC5D,OAAO;WA6BgB,MAAM,CAC3B,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,0BAA0B;IAI7B;;OAEG;WACW,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,0BAA0B;IAIlF;;OAEG;WACW,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,0BAA0B;IAIhF;;OAEG;WACW,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,0BAA0B;IAI9E;;OAEG;WACW,QAAQ,CAAC,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,0BAA0B;CAGjH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CodedRootError } from './CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* Exception thrown when a purchase contract is not found in the system
|
|
4
|
+
* This error occurs when searching for contracts by ID, client, or other criteria
|
|
5
|
+
*
|
|
6
|
+
* Error code: CBX-PMS-001
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
export declare class ContractNotFoundError extends CodedRootError {
|
|
10
|
+
private constructor();
|
|
11
|
+
static create(searchCriteria: string, searchValue: string, clientId?: string, contractType?: string): ContractNotFoundError;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a ContractNotFoundError specifically for ID searches
|
|
14
|
+
*/
|
|
15
|
+
static byId(id: string, clientId?: string): ContractNotFoundError;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a ContractNotFoundError specifically for contract number searches
|
|
18
|
+
*/
|
|
19
|
+
static byContractNumber(contractNumber: string, clientId?: string): ContractNotFoundError;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a ContractNotFoundError for active contracts
|
|
22
|
+
*/
|
|
23
|
+
static noActiveContract(clientId: string): ContractNotFoundError;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ContractNotFoundError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractNotFoundError.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/exceptions/ContractNotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,cAAc;IACvD,OAAO;WA+BgB,MAAM,CAC3B,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,GACpB,qBAAqB;IAIxB;;OAEG;WACW,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,qBAAqB;IAIxE;;OAEG;WACW,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,qBAAqB;IAIhG;;OAEG;WACW,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB;CAGxE"}
|