@carbonbox/domain 0.48.1 → 0.49.1
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/carbon-footprint-configurations/shared/domain/enums/CarbonFootprintConfigurationActivationRequirement.js +61 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/enums/CarbonFootprintConfigurationCompletionRequirement.js +28 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/policies/CarbonFootprintConfigurationActivationPolicy.js +349 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/policies/CarbonFootprintConfigurationCompletionPolicy.js +151 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationActivationFacts.js +2 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationCompletionFacts.js +2 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationRequirementContext.js +2 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/types/CorporateCarbonFootprintConfigurationActivationFacts.js +2 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/types/UnmetCarbonFootprintConfigurationActivationRequirement.js +2 -0
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/types/UnmetCarbonFootprintConfigurationCompletionRequirement.js +2 -0
- package/build/carbonbox/shared/domain/enums/ErrorCode.js +5 -1
- package/build/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyBlockingReason.js +104 -0
- package/build/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStep.js +52 -0
- package/build/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStepStatus.js +30 -0
- package/build/carbonbox/shared/domain/journeys/enums/PendingActionType.js +59 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/entity/IUserPreference.js +2 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/entity/UserPreference.js +122 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/exceptions/DuplicateUserPreferenceCodeError.js +31 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/exceptions/InvalidUserPreferenceCodeError.js +33 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/exceptions/UserPreferenceCodeLimitExceededError.js +31 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/repository/IUserPreferenceRepository.js +2 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/types/UserPreferencePrimitives.js +2 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/types/UserPreferenceProps.js +2 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceCodes.js +93 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceDismissedChecklistCodes.js +29 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceSeenOnboardingTourCodes.js +29 -0
- package/build/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceUserId.js +47 -0
- package/build/main/index.js +53 -16
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/enums/CarbonFootprintConfigurationActivationRequirement.d.ts +48 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/enums/CarbonFootprintConfigurationActivationRequirement.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/enums/CarbonFootprintConfigurationCompletionRequirement.d.ts +22 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/enums/CarbonFootprintConfigurationCompletionRequirement.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/policies/CarbonFootprintConfigurationActivationPolicy.d.ts +121 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/policies/CarbonFootprintConfigurationActivationPolicy.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/policies/CarbonFootprintConfigurationCompletionPolicy.d.ts +71 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/policies/CarbonFootprintConfigurationCompletionPolicy.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationActivationFacts.d.ts +16 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationActivationFacts.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationCompletionFacts.d.ts +29 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationCompletionFacts.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationRequirementContext.d.ts +34 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationRequirementContext.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/CorporateCarbonFootprintConfigurationActivationFacts.d.ts +22 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/CorporateCarbonFootprintConfigurationActivationFacts.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/UnmetCarbonFootprintConfigurationActivationRequirement.d.ts +11 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/UnmetCarbonFootprintConfigurationActivationRequirement.d.ts.map +1 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/UnmetCarbonFootprintConfigurationCompletionRequirement.d.ts +11 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/types/UnmetCarbonFootprintConfigurationCompletionRequirement.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/enums/ErrorCode.d.ts +4 -1
- package/build/types/carbonbox/shared/domain/enums/ErrorCode.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyBlockingReason.d.ts +93 -0
- package/build/types/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyBlockingReason.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStep.d.ts +49 -0
- package/build/types/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStep.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStepStatus.d.ts +27 -0
- package/build/types/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStepStatus.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/journeys/enums/PendingActionType.d.ts +56 -0
- package/build/types/carbonbox/shared/domain/journeys/enums/PendingActionType.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/entity/IUserPreference.d.ts +10 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/entity/IUserPreference.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/entity/UserPreference.d.ts +45 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/entity/UserPreference.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/exceptions/DuplicateUserPreferenceCodeError.d.ts +7 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/exceptions/DuplicateUserPreferenceCodeError.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/exceptions/InvalidUserPreferenceCodeError.d.ts +7 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/exceptions/InvalidUserPreferenceCodeError.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/exceptions/UserPreferenceCodeLimitExceededError.d.ts +7 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/exceptions/UserPreferenceCodeLimitExceededError.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/repository/IUserPreferenceRepository.d.ts +21 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/repository/IUserPreferenceRepository.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/types/UserPreferencePrimitives.d.ts +22 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/types/UserPreferencePrimitives.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/types/UserPreferenceProps.d.ts +18 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/types/UserPreferenceProps.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceCodes.d.ts +53 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceCodes.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceDismissedChecklistCodes.d.ts +16 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceDismissedChecklistCodes.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceSeenOnboardingTourCodes.d.ts +16 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceSeenOnboardingTourCodes.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceUserId.d.ts +18 -0
- package/build/types/carbonbox/stakeholders/user-preferences/domain/value-objects/UserPreferenceUserId.d.ts.map +1 -0
- package/build/types/main/index.d.ts +26 -0
- package/build/types/main/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarbonFootprintConfigurationCompletionPolicy.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/carbon-footprint-configurations/shared/domain/policies/CarbonFootprintConfigurationCompletionPolicy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,+CAA+C,EAAE,MAAM,gGAAgG,CAAC;AACjK,OAAO,EAAE,2CAA2C,EAAE,MAAM,wFAAwF,CAAC;AACrJ,OAAO,EAAE,6CAA6C,EAAE,MAAM,4FAA4F,CAAC;AAG3J,OAAO,EAAE,2CAA2C,EAAE,MAAM,sDAAsD,CAAC;AAGnH,OAAO,EAAE,sDAAsD,EAAE,MAAM,iEAAiE,CAAC;AAEzI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAAa,4CAA4C;IACvD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,+CAA+C,CAGrE;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAGhD;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAA8E;IAE1H,OAAO;WAIO,8BAA8B,CAC1C,UAAU,EAAE,+CAA+C,EAC3D,KAAK,EAAE,2CAA2C,GACjD,aAAa,CAAC,sDAAsD,CAAC;WAc1D,0BAA0B,CACtC,UAAU,EAAE,2CAA2C,EACvD,KAAK,EAAE,2CAA2C,GACjD,aAAa,CAAC,sDAAsD,CAAC;WAI1D,4BAA4B,CACxC,UAAU,EAAE,6CAA6C,EACzD,KAAK,EAAE,2CAA2C,GACjD,aAAa,CAAC,sDAAsD,CAAC;IAIxE,OAAO,CAAC,MAAM,CAAC,2CAA2C;IAgB1D,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB,OAAO,CAAC,MAAM,CAAC,aAAa;IAuB5B,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAuB3C,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAerC,OAAO,CAAC,MAAM,CAAC,8BAA8B;IAU7C,OAAO,CAAC,MAAM,CAAC,kCAAkC;IAajD;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAuBpC,OAAO,CAAC,MAAM,CAAC,KAAK;CAMrB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Facts outside the configuration aggregate that
|
|
3
|
+
* `CarbonFootprintConfigurationActivationPolicy` needs to evaluate an event
|
|
4
|
+
* or product configuration. The caller (application layer) gathers them; the
|
|
5
|
+
* policy never loads data.
|
|
6
|
+
*
|
|
7
|
+
* - `evaluatedAt`: the instant the evaluation refers to ("now").
|
|
8
|
+
* - `isCarbonClientEntitledToFootprintType`: whether the carbon client that
|
|
9
|
+
* owns the configuration has bought a service available for this footprint
|
|
10
|
+
* type. A command that already passed the entitlement gate passes `true`.
|
|
11
|
+
*/
|
|
12
|
+
export type CarbonFootprintConfigurationActivationFacts = Readonly<{
|
|
13
|
+
evaluatedAt: Date;
|
|
14
|
+
isCarbonClientEntitledToFootprintType: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=CarbonFootprintConfigurationActivationFacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarbonFootprintConfigurationActivationFacts.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationActivationFacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,2CAA2C,GAAG,QAAQ,CAAC;IACjE,WAAW,EAAE,IAAI,CAAC;IAClB,qCAAqC,EAAE,OAAO,CAAC;CAChD,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GHGScope } from '../../../../shared/domain/enums/GHGScope';
|
|
2
|
+
import { ISOCategory } from '../../../../shared/domain/enums/ISOCategory';
|
|
3
|
+
/**
|
|
4
|
+
* Facts outside the configuration aggregate that
|
|
5
|
+
* `CarbonFootprintConfigurationCompletionPolicy` needs. The caller
|
|
6
|
+
* (application layer) gathers them; the policy never loads data.
|
|
7
|
+
*
|
|
8
|
+
* - `evaluatedAt`: the instant the evaluation refers to ("now"); a corporate
|
|
9
|
+
* execution period must have ended by then.
|
|
10
|
+
* - `isCarbonClientEntitledToFootprintType`: whether the carbon client that
|
|
11
|
+
* owns the configuration has bought a service available for this footprint
|
|
12
|
+
* type. A command that already passed the entitlement gate passes `true`.
|
|
13
|
+
* - `activeCalculationProcessCount`: calculation processes of the
|
|
14
|
+
* configuration still `SCHEDULED`, `QUEUED` or `RUNNING`.
|
|
15
|
+
* - `emissionScopesOfSubmissions`: the emission scope of every activity data
|
|
16
|
+
* submission of the configuration (one entry per submission, any status,
|
|
17
|
+
* duplicates allowed).
|
|
18
|
+
*
|
|
19
|
+
* When the configuration is not `ACTIVE` the policy only reports
|
|
20
|
+
* `CONFIGURATION_MUST_BE_ACTIVE` (plus the entitlement gate), so callers may
|
|
21
|
+
* pass `0` and `[]` without loading them.
|
|
22
|
+
*/
|
|
23
|
+
export type CarbonFootprintConfigurationCompletionFacts = Readonly<{
|
|
24
|
+
evaluatedAt: Date;
|
|
25
|
+
isCarbonClientEntitledToFootprintType: boolean;
|
|
26
|
+
activeCalculationProcessCount: number;
|
|
27
|
+
emissionScopesOfSubmissions: ReadonlyArray<GHGScope | ISOCategory>;
|
|
28
|
+
}>;
|
|
29
|
+
//# sourceMappingURL=CarbonFootprintConfigurationCompletionFacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarbonFootprintConfigurationCompletionFacts.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationCompletionFacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,2CAA2C,GAAG,QAAQ,CAAC;IACjE,WAAW,EAAE,IAAI,CAAC;IAClB,qCAAqC,EAAE,OAAO,CAAC;IAC/C,6BAA6B,EAAE,MAAM,CAAC;IACtC,2BAA2B,EAAE,aAAa,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;CACpE,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GHGScope } from '../../../../shared/domain/enums/GHGScope';
|
|
2
|
+
import { ISOCategory } from '../../../../shared/domain/enums/ISOCategory';
|
|
3
|
+
import { ReportingStandard } from '../../../../shared/domain/enums/ReportingStandard';
|
|
4
|
+
import { ConfigurationStatus } from '../enums/ConfigurationStatus';
|
|
5
|
+
/**
|
|
6
|
+
* Flat, serializable detail attached to an unmet activation or completion
|
|
7
|
+
* requirement. Every field is optional: each requirement code fills only the
|
|
8
|
+
* fields that describe it (see the JSDoc of
|
|
9
|
+
* `CarbonFootprintConfigurationActivationPolicy` and
|
|
10
|
+
* `CarbonFootprintConfigurationCompletionPolicy` for the code → fields map).
|
|
11
|
+
*
|
|
12
|
+
* Dates keep the domain calendar format (`DD/MM/YYYY`) except `evaluatedAt`,
|
|
13
|
+
* which is the ISO-8601 instant the requirement was evaluated at.
|
|
14
|
+
*/
|
|
15
|
+
export type CarbonFootprintConfigurationRequirementContext = Readonly<{
|
|
16
|
+
configurationId?: string;
|
|
17
|
+
currentStatus?: ConfigurationStatus;
|
|
18
|
+
index?: number;
|
|
19
|
+
segmentConfigurationId?: string;
|
|
20
|
+
lifecycleStageConfigurationId?: string;
|
|
21
|
+
facilityId?: string;
|
|
22
|
+
commercialBranchName?: string;
|
|
23
|
+
startDate?: string;
|
|
24
|
+
endDate?: string;
|
|
25
|
+
earliestAllowedStartDate?: string;
|
|
26
|
+
evaluatedAt?: string;
|
|
27
|
+
minimumLength?: number;
|
|
28
|
+
reportingStandard?: ReportingStandard;
|
|
29
|
+
receivedValue?: string;
|
|
30
|
+
parseErrorMessage?: string;
|
|
31
|
+
activeCalculationProcessCount?: number;
|
|
32
|
+
emissionScopesFound?: ReadonlyArray<GHGScope | ISOCategory>;
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=CarbonFootprintConfigurationRequirementContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarbonFootprintConfigurationRequirementContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/carbon-footprint-configurations/shared/domain/types/CarbonFootprintConfigurationRequirementContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;;;;;;;;GASG;AACH,MAAM,MAAM,8CAA8C,GAAG,QAAQ,CAAC;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,mBAAmB,CAAC,EAAE,aAAa,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;CAC7D,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Facts outside the configuration aggregate that
|
|
3
|
+
* `CarbonFootprintConfigurationActivationPolicy` needs to evaluate a
|
|
4
|
+
* corporate configuration. The caller (application layer) gathers them; the
|
|
5
|
+
* policy never loads data.
|
|
6
|
+
*
|
|
7
|
+
* - `evaluatedAt`: the instant the evaluation refers to ("now"); the
|
|
8
|
+
* execution period start date may be at most one year before it.
|
|
9
|
+
* - `isCarbonClientEntitledToFootprintType`: whether the carbon client that
|
|
10
|
+
* owns the configuration has bought a service available for corporate
|
|
11
|
+
* footprints. A command that already passed the entitlement gate passes
|
|
12
|
+
* `true`.
|
|
13
|
+
* - `existingFacilityIds`: ids of the referenced facilities that exist. Only
|
|
14
|
+
* complete facility references (with `id` and `commercialBranchName`) need
|
|
15
|
+
* to be looked up; the policy ignores this list for incomplete ones.
|
|
16
|
+
*/
|
|
17
|
+
export type CorporateCarbonFootprintConfigurationActivationFacts = Readonly<{
|
|
18
|
+
evaluatedAt: Date;
|
|
19
|
+
isCarbonClientEntitledToFootprintType: boolean;
|
|
20
|
+
existingFacilityIds: ReadonlyArray<string>;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=CorporateCarbonFootprintConfigurationActivationFacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CorporateCarbonFootprintConfigurationActivationFacts.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/carbon-footprint-configurations/shared/domain/types/CorporateCarbonFootprintConfigurationActivationFacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,oDAAoD,GAAG,QAAQ,CAAC;IAC1E,WAAW,EAAE,IAAI,CAAC;IAClB,qCAAqC,EAAE,OAAO,CAAC;IAC/C,mBAAmB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CarbonFootprintConfigurationActivationRequirement } from '../enums/CarbonFootprintConfigurationActivationRequirement';
|
|
2
|
+
import { CarbonFootprintConfigurationRequirementContext } from './CarbonFootprintConfigurationRequirementContext';
|
|
3
|
+
/**
|
|
4
|
+
* One activation requirement a carbon footprint configuration does not meet,
|
|
5
|
+
* as returned by `CarbonFootprintConfigurationActivationPolicy`.
|
|
6
|
+
*/
|
|
7
|
+
export type UnmetCarbonFootprintConfigurationActivationRequirement = Readonly<{
|
|
8
|
+
code: CarbonFootprintConfigurationActivationRequirement;
|
|
9
|
+
context: CarbonFootprintConfigurationRequirementContext;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=UnmetCarbonFootprintConfigurationActivationRequirement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnmetCarbonFootprintConfigurationActivationRequirement.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/carbon-footprint-configurations/shared/domain/types/UnmetCarbonFootprintConfigurationActivationRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iDAAiD,EAAE,MAAM,4DAA4D,CAAC;AAC/H,OAAO,EAAE,8CAA8C,EAAE,MAAM,kDAAkD,CAAC;AAElH;;;GAGG;AACH,MAAM,MAAM,sDAAsD,GAAG,QAAQ,CAAC;IAC5E,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,8CAA8C,CAAC;CACzD,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CarbonFootprintConfigurationCompletionRequirement } from '../enums/CarbonFootprintConfigurationCompletionRequirement';
|
|
2
|
+
import { CarbonFootprintConfigurationRequirementContext } from './CarbonFootprintConfigurationRequirementContext';
|
|
3
|
+
/**
|
|
4
|
+
* One completion requirement a carbon footprint configuration does not meet,
|
|
5
|
+
* as returned by `CarbonFootprintConfigurationCompletionPolicy`.
|
|
6
|
+
*/
|
|
7
|
+
export type UnmetCarbonFootprintConfigurationCompletionRequirement = Readonly<{
|
|
8
|
+
code: CarbonFootprintConfigurationCompletionRequirement;
|
|
9
|
+
context: CarbonFootprintConfigurationRequirementContext;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=UnmetCarbonFootprintConfigurationCompletionRequirement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnmetCarbonFootprintConfigurationCompletionRequirement.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/carbon-footprint-configurations/shared/domain/types/UnmetCarbonFootprintConfigurationCompletionRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iDAAiD,EAAE,MAAM,4DAA4D,CAAC;AAC/H,OAAO,EAAE,8CAA8C,EAAE,MAAM,kDAAkD,CAAC;AAElH;;;GAGG;AACH,MAAM,MAAM,sDAAsD,GAAG,QAAQ,CAAC;IAC5E,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,8CAA8C,CAAC;CACzD,CAAC,CAAC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - RPT: Reporting
|
|
15
15
|
* - SHR: Shared/Common
|
|
16
16
|
*
|
|
17
|
-
* Total Codes:
|
|
17
|
+
* Total Codes: 177
|
|
18
18
|
* Total Exceptions Migrated: 171 (100%)
|
|
19
19
|
*
|
|
20
20
|
* @since 1.0.0
|
|
@@ -70,6 +70,9 @@ export declare enum ErrorCode {
|
|
|
70
70
|
MANAGER_REQUIRED = "CBX-STK-006",
|
|
71
71
|
INVALID_CARBON_CLIENT_ACCOUNT_TYPE = "CBX-STK-007",
|
|
72
72
|
INVALID_CARBON_COORDINATOR_AVAILABILITY_STATUS = "CBX-STK-008",
|
|
73
|
+
INVALID_USER_PREFERENCE_CODE = "CBX-STK-009",
|
|
74
|
+
DUPLICATE_USER_PREFERENCE_CODE = "CBX-STK-010",
|
|
75
|
+
USER_PREFERENCE_CODE_LIMIT_EXCEEDED = "CBX-STK-011",
|
|
73
76
|
CONFIGURATION_NOT_FOUND = "CBX-CFC-001",
|
|
74
77
|
INVALID_REPORTING_STANDARD = "CBX-CFC-002",
|
|
75
78
|
INVALID_COLLECTION_PERIOD = "CBX-CFC-003",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorCode.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/enums/ErrorCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,SAAS;IAEnB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AgB;IAG5C,iBAAiB,gBAAgB;IACjC,sBAAsB,gBAAgB;IACtC,6BAA6B,gBAAgB;IAC7C,+BAA+B,gBAAgB;IAC/C,oBAAoB,gBAAgB;IACpC,8BAA8B,gBAAgB;IAC9C,qBAAqB,gBAAgB;IACrC,gCAAgC,gBAAgB;IAChD,uBAAuB,gBAAgB;IACvC,4BAA4B,gBAAgB;IAG5C,uBAAuB,gBAAgB;IACvC,mBAAmB,gBAAgB;IACnC,iBAAiB,gBAAgB;IACjC,gBAAgB,gBAAgB;IAChC,eAAe,gBAAgB;IAC/B,WAAW,gBAAgB;IAC3B,cAAc,gBAAgB;IAC9B,gBAAgB,gBAAgB;IAChC,iBAAiB,gBAAgB;IACjC,kBAAkB,gBAAgB;IAGlC,gCAAgC,gBAAgB;IAChD,8BAA8B,gBAAgB;IAC9C,kCAAkC,gBAAgB;IAClD,kBAAkB,gBAAgB;IAClC,kBAAkB,gBAAgB;IAClC,+BAA+B,gBAAgB;IAC/C,wCAAwC,gBAAgB;IACxD,wCAAwC,gBAAgB;IACxD,iDAAiD,gBAAgB;IACjE,kDAAkD,gBAAgB;IAGlE,iCAAiC,gBAAgB;IACjD,iCAAiC,gBAAgB;IAGjD,qBAAqB,gBAAgB;IACrC,qCAAqC,gBAAgB;IACrD,4BAA4B,gBAAgB;IAC5C,mBAAmB,gBAAgB;IACnC,uBAAuB,gBAAgB;IACvC,wBAAwB,gBAAgB;IACxC,iCAAiC,gBAAgB;CAClD"}
|
|
1
|
+
{"version":3,"file":"ErrorCode.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/enums/ErrorCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,SAAS;IAEnB,mBAAmB,iBAAiB;IACpC,aAAa,iBAAiB;IAC9B,aAAa,iBAAiB;IAC9B,mBAAmB,iBAAiB;IACpC,cAAc,iBAAiB;IAC/B,kBAAkB,iBAAiB;IACnC,sBAAsB,iBAAi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C7C,+BAA+B,gBAAgB;IAC/C,oBAAoB,gBAAgB;IACpC,8BAA8B,gBAAgB;IAC9C,qBAAqB,gBAAgB;IACrC,gCAAgC,gBAAgB;IAChD,uBAAuB,gBAAgB;IACvC,4BAA4B,gBAAgB;IAG5C,uBAAuB,gBAAgB;IACvC,mBAAmB,gBAAgB;IACnC,iBAAiB,gBAAgB;IACjC,gBAAgB,gBAAgB;IAChC,eAAe,gBAAgB;IAC/B,WAAW,gBAAgB;IAC3B,cAAc,gBAAgB;IAC9B,gBAAgB,gBAAgB;IAChC,iBAAiB,gBAAgB;IACjC,kBAAkB,gBAAgB;IAGlC,gCAAgC,gBAAgB;IAChD,8BAA8B,gBAAgB;IAC9C,kCAAkC,gBAAgB;IAClD,kBAAkB,gBAAgB;IAClC,kBAAkB,gBAAgB;IAClC,+BAA+B,gBAAgB;IAC/C,wCAAwC,gBAAgB;IACxD,wCAAwC,gBAAgB;IACxD,iDAAiD,gBAAgB;IACjE,kDAAkD,gBAAgB;IAGlE,iCAAiC,gBAAgB;IACjD,iCAAiC,gBAAgB;IAGjD,qBAAqB,gBAAgB;IACrC,qCAAqC,gBAAgB;IACrD,4BAA4B,gBAAgB;IAC5C,mBAAmB,gBAAgB;IACnC,uBAAuB,gBAAgB;IACvC,wBAAwB,gBAAgB;IACxC,iCAAiC,gBAAgB;CAClD"}
|
package/build/types/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyBlockingReason.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carbon client journey blocking reason enumeration
|
|
3
|
+
* Reason codes attached to a journey step that is not DONE, explaining what keeps it from advancing.
|
|
4
|
+
* Unmet activation and completion requirements are reported separately (their own enums), so each
|
|
5
|
+
* array of the step carries a single type of code.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum CarbonClientJourneyBlockingReason {
|
|
8
|
+
/**
|
|
9
|
+
* A purchase contract is waiting for the carbon client signature
|
|
10
|
+
*/
|
|
11
|
+
CONTRACT_PENDING_CLIENT_SIGNATURE = "CONTRACT_PENDING_CLIENT_SIGNATURE",
|
|
12
|
+
/**
|
|
13
|
+
* A purchase contract is waiting for the CarbonBox signature
|
|
14
|
+
*/
|
|
15
|
+
CONTRACT_PENDING_CARBONBOX_SIGNATURE = "CONTRACT_PENDING_CARBONBOX_SIGNATURE",
|
|
16
|
+
/**
|
|
17
|
+
* A purchase contract is fully signed but not activated yet
|
|
18
|
+
*/
|
|
19
|
+
CONTRACT_PENDING_ACTIVATION = "CONTRACT_PENDING_ACTIVATION",
|
|
20
|
+
/**
|
|
21
|
+
* The carbon client has no purchase contract
|
|
22
|
+
*/
|
|
23
|
+
NO_CONTRACT = "NO_CONTRACT",
|
|
24
|
+
/**
|
|
25
|
+
* The validity window of the entitlement already ended
|
|
26
|
+
*/
|
|
27
|
+
ENTITLEMENT_EXPIRED = "ENTITLEMENT_EXPIRED",
|
|
28
|
+
/**
|
|
29
|
+
* The validity window of the entitlement has not started yet
|
|
30
|
+
*/
|
|
31
|
+
ENTITLEMENT_NOT_YET_ACTIVE = "ENTITLEMENT_NOT_YET_ACTIVE",
|
|
32
|
+
/**
|
|
33
|
+
* The carbon client has no facility
|
|
34
|
+
*/
|
|
35
|
+
NO_FACILITY = "NO_FACILITY",
|
|
36
|
+
/**
|
|
37
|
+
* The carbon client has facilities but none (or more than one) is marked as primary
|
|
38
|
+
*/
|
|
39
|
+
NO_PRIMARY_FACILITY = "NO_PRIMARY_FACILITY",
|
|
40
|
+
/**
|
|
41
|
+
* The carbon client has no carbon footprint configuration for an entitled footprint type
|
|
42
|
+
*/
|
|
43
|
+
NO_CARBON_FOOTPRINT_CONFIGURATION = "NO_CARBON_FOOTPRINT_CONFIGURATION",
|
|
44
|
+
/**
|
|
45
|
+
* The DRAFT carbon footprint configuration does not meet its activation requirements
|
|
46
|
+
*/
|
|
47
|
+
ACTIVATION_REQUIREMENTS_UNMET = "ACTIVATION_REQUIREMENTS_UNMET",
|
|
48
|
+
/**
|
|
49
|
+
* Submitted activity data records are waiting for review
|
|
50
|
+
*/
|
|
51
|
+
SUBMISSIONS_AWAITING_REVIEW = "SUBMISSIONS_AWAITING_REVIEW",
|
|
52
|
+
/**
|
|
53
|
+
* Activity data records were rejected and must be corrected and submitted again
|
|
54
|
+
*/
|
|
55
|
+
SUBMISSIONS_REJECTED = "SUBMISSIONS_REJECTED",
|
|
56
|
+
/**
|
|
57
|
+
* Activity data records are still in DRAFT and were not submitted
|
|
58
|
+
*/
|
|
59
|
+
DRAFT_SUBMISSIONS_NOT_SUBMITTED = "DRAFT_SUBMISSIONS_NOT_SUBMITTED",
|
|
60
|
+
/**
|
|
61
|
+
* There is no ACTIVE calculation workflow for the carbon client and footprint type
|
|
62
|
+
*/
|
|
63
|
+
NO_ACTIVE_CALCULATION_WORKFLOW = "NO_ACTIVE_CALCULATION_WORKFLOW",
|
|
64
|
+
/**
|
|
65
|
+
* A calculation process of the carbon footprint configuration is running
|
|
66
|
+
*/
|
|
67
|
+
CALCULATION_RUNNING = "CALCULATION_RUNNING",
|
|
68
|
+
/**
|
|
69
|
+
* Approved activity data records were not included in a completed calculation yet
|
|
70
|
+
*/
|
|
71
|
+
APPROVED_SUBMISSIONS_NOT_CALCULATED = "APPROVED_SUBMISSIONS_NOT_CALCULATED",
|
|
72
|
+
/**
|
|
73
|
+
* The calculation workflow exists but the caller is not one of its allowed executors
|
|
74
|
+
*/
|
|
75
|
+
CALLER_NOT_ALLOWED_EXECUTOR = "CALLER_NOT_ALLOWED_EXECUTOR",
|
|
76
|
+
/**
|
|
77
|
+
* The report is waiting for the internal approval
|
|
78
|
+
*/
|
|
79
|
+
REPORT_AWAITING_INTERNAL_APPROVAL = "REPORT_AWAITING_INTERNAL_APPROVAL",
|
|
80
|
+
/**
|
|
81
|
+
* The report is waiting for the carbon client approval
|
|
82
|
+
*/
|
|
83
|
+
REPORT_AWAITING_CLIENT_APPROVAL = "REPORT_AWAITING_CLIENT_APPROVAL",
|
|
84
|
+
/**
|
|
85
|
+
* The ACTIVE carbon footprint configuration does not meet its completion requirements
|
|
86
|
+
*/
|
|
87
|
+
COMPLETION_REQUIREMENTS_UNMET = "COMPLETION_REQUIREMENTS_UNMET",
|
|
88
|
+
/**
|
|
89
|
+
* The caller lacks the view permission of the step owner, so the step is reported as NOT_APPLICABLE
|
|
90
|
+
*/
|
|
91
|
+
CALLER_LACKS_VIEW_PERMISSION = "CALLER_LACKS_VIEW_PERMISSION"
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=CarbonClientJourneyBlockingReason.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarbonClientJourneyBlockingReason.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyBlockingReason.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,iCAAiC;IAG3C;;OAEG;IACH,iCAAiC,sCAAsC;IAEvE;;OAEG;IACH,oCAAoC,yCAAyC;IAE7E;;OAEG;IACH,2BAA2B,gCAAgC;IAE3D;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,0BAA0B,+BAA+B;IAIzD;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,mBAAmB,wBAAwB;IAI3C;;OAEG;IACH,iCAAiC,sCAAsC;IAEvE;;OAEG;IACH,6BAA6B,kCAAkC;IAI/D;;OAEG;IACH,2BAA2B,gCAAgC;IAE3D;;OAEG;IACH,oBAAoB,yBAAyB;IAE7C;;OAEG;IACH,+BAA+B,oCAAoC;IAInE;;OAEG;IACH,8BAA8B,mCAAmC;IAEjE;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,mCAAmC,wCAAwC;IAE3E;;OAEG;IACH,2BAA2B,gCAAgC;IAI3D;;OAEG;IACH,iCAAiC,sCAAsC;IAEvE;;OAEG;IACH,+BAA+B,oCAAoC;IAInE;;OAEG;IACH,6BAA6B,kCAAkC;IAI/D;;OAEG;IACH,4BAA4B,iCAAiC;CAC9D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carbon client journey step enumeration
|
|
3
|
+
* Ordered steps a carbon client goes through, from an active contract to a completed carbon footprint.
|
|
4
|
+
* ACTIVE_CONTRACT and FACILITIES are evaluated once per carbon client; the remaining steps are
|
|
5
|
+
* evaluated per carbon footprint configuration.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum CarbonClientJourneyStep {
|
|
8
|
+
/**
|
|
9
|
+
* Step 1 - The carbon client has an entitlement whose validity window is active
|
|
10
|
+
*/
|
|
11
|
+
ACTIVE_CONTRACT = "ACTIVE_CONTRACT",
|
|
12
|
+
/**
|
|
13
|
+
* Step 2 - The carbon client has at least one facility and exactly one primary facility
|
|
14
|
+
*/
|
|
15
|
+
FACILITIES = "FACILITIES",
|
|
16
|
+
/**
|
|
17
|
+
* Step 3 - The carbon footprint configuration meets every activation requirement
|
|
18
|
+
*/
|
|
19
|
+
FOOTPRINT_CONFIGURED = "FOOTPRINT_CONFIGURED",
|
|
20
|
+
/**
|
|
21
|
+
* Step 4 - The carbon footprint configuration is ACTIVE (or already COMPLETED)
|
|
22
|
+
*/
|
|
23
|
+
FOOTPRINT_ACTIVE = "FOOTPRINT_ACTIVE",
|
|
24
|
+
/**
|
|
25
|
+
* Step 5 - Activity data was loaded for every expected emission source
|
|
26
|
+
*/
|
|
27
|
+
ACTIVITY_DATA_LOADED = "ACTIVITY_DATA_LOADED",
|
|
28
|
+
/**
|
|
29
|
+
* Step 6 - Every submitted activity data record was reviewed (none awaiting review nor rejected)
|
|
30
|
+
*/
|
|
31
|
+
ACTIVITY_DATA_REVIEWED = "ACTIVITY_DATA_REVIEWED",
|
|
32
|
+
/**
|
|
33
|
+
* Step 7 - Every approved activity data record was included in a completed calculation
|
|
34
|
+
*/
|
|
35
|
+
FOOTPRINT_CALCULATED = "FOOTPRINT_CALCULATED",
|
|
36
|
+
/**
|
|
37
|
+
* Step 8 - The report preparation questionnaire for the footprint type is COMPLETED
|
|
38
|
+
*/
|
|
39
|
+
REPORT_QUESTIONNAIRE_COMPLETED = "REPORT_QUESTIONNAIRE_COMPLETED",
|
|
40
|
+
/**
|
|
41
|
+
* Step 9 - The report for the footprint type (and period, for corporate footprints) is PUBLISHED
|
|
42
|
+
*/
|
|
43
|
+
REPORT_PUBLISHED = "REPORT_PUBLISHED",
|
|
44
|
+
/**
|
|
45
|
+
* Step 10 - The carbon footprint configuration is COMPLETED
|
|
46
|
+
*/
|
|
47
|
+
FOOTPRINT_COMPLETED = "FOOTPRINT_COMPLETED"
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=CarbonClientJourneyStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarbonClientJourneyStep.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStep.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,uBAAuB;IACjC;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,UAAU,eAAe;IAEzB;;OAEG;IACH,oBAAoB,yBAAyB;IAE7C;;OAEG;IACH,gBAAgB,qBAAqB;IAErC;;OAEG;IACH,oBAAoB,yBAAyB;IAE7C;;OAEG;IACH,sBAAsB,2BAA2B;IAEjD;;OAEG;IACH,oBAAoB,yBAAyB;IAE7C;;OAEG;IACH,8BAA8B,mCAAmC;IAEjE;;OAEG;IACH,gBAAgB,qBAAqB;IAErC;;OAEG;IACH,mBAAmB,wBAAwB;CAC5C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carbon client journey step status enumeration
|
|
3
|
+
* State of a single step of the carbon client journey, evaluated against the current facts
|
|
4
|
+
*/
|
|
5
|
+
export declare enum CarbonClientJourneyStepStatus {
|
|
6
|
+
/**
|
|
7
|
+
* The step condition is met
|
|
8
|
+
*/
|
|
9
|
+
DONE = "DONE",
|
|
10
|
+
/**
|
|
11
|
+
* The step was started but its condition is only partially met
|
|
12
|
+
*/
|
|
13
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
14
|
+
/**
|
|
15
|
+
* The step cannot advance until the reasons listed in its blocking reason codes are resolved
|
|
16
|
+
*/
|
|
17
|
+
BLOCKED = "BLOCKED",
|
|
18
|
+
/**
|
|
19
|
+
* The step can be performed now but has not been started
|
|
20
|
+
*/
|
|
21
|
+
PENDING = "PENDING",
|
|
22
|
+
/**
|
|
23
|
+
* The step does not apply (e.g. footprint type not entitled, or the caller cannot view its data)
|
|
24
|
+
*/
|
|
25
|
+
NOT_APPLICABLE = "NOT_APPLICABLE"
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=CarbonClientJourneyStepStatus.d.ts.map
|
package/build/types/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStepStatus.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarbonClientJourneyStepStatus.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/shared/domain/journeys/enums/CarbonClientJourneyStepStatus.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,6BAA6B;IACvC;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,cAAc,mBAAmB;CAClC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pending action type enumeration
|
|
3
|
+
* Kinds of work waiting for the caller, counted per carbon client in the pending actions inbox.
|
|
4
|
+
* Each type is only reported when the caller holds the permission that acts on it.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum PendingActionType {
|
|
7
|
+
/**
|
|
8
|
+
* Activity data records in SUBMITTED status, waiting for review (approve or reject)
|
|
9
|
+
*/
|
|
10
|
+
ACTIVITY_DATA_SUBMISSIONS_TO_REVIEW = "ACTIVITY_DATA_SUBMISSIONS_TO_REVIEW",
|
|
11
|
+
/**
|
|
12
|
+
* Activity data records in DRAFT status, waiting to be submitted
|
|
13
|
+
*/
|
|
14
|
+
ACTIVITY_DATA_SUBMISSIONS_TO_SUBMIT = "ACTIVITY_DATA_SUBMISSIONS_TO_SUBMIT",
|
|
15
|
+
/**
|
|
16
|
+
* Activity data records in REJECTED status, waiting to be corrected and submitted again
|
|
17
|
+
*/
|
|
18
|
+
ACTIVITY_DATA_SUBMISSIONS_TO_CORRECT = "ACTIVITY_DATA_SUBMISSIONS_TO_CORRECT",
|
|
19
|
+
/**
|
|
20
|
+
* Purchase contracts waiting for the carbon client signature
|
|
21
|
+
*/
|
|
22
|
+
PURCHASE_CONTRACTS_TO_SIGN_BY_CLIENT = "PURCHASE_CONTRACTS_TO_SIGN_BY_CLIENT",
|
|
23
|
+
/**
|
|
24
|
+
* Purchase contracts waiting for the CarbonBox signature
|
|
25
|
+
*/
|
|
26
|
+
PURCHASE_CONTRACTS_TO_SIGN_BY_CARBONBOX = "PURCHASE_CONTRACTS_TO_SIGN_BY_CARBONBOX",
|
|
27
|
+
/**
|
|
28
|
+
* Fully signed purchase contracts waiting to be activated
|
|
29
|
+
*/
|
|
30
|
+
PURCHASE_CONTRACTS_TO_ACTIVATE = "PURCHASE_CONTRACTS_TO_ACTIVATE",
|
|
31
|
+
/**
|
|
32
|
+
* Reports in PENDING_INTERNAL status, waiting for the internal approval
|
|
33
|
+
*/
|
|
34
|
+
REPORTS_TO_APPROVE_INTERNALLY = "REPORTS_TO_APPROVE_INTERNALLY",
|
|
35
|
+
/**
|
|
36
|
+
* Reports in PENDING_CLIENT status, waiting for the carbon client approval
|
|
37
|
+
*/
|
|
38
|
+
REPORTS_TO_APPROVE_BY_CLIENT = "REPORTS_TO_APPROVE_BY_CLIENT",
|
|
39
|
+
/**
|
|
40
|
+
* Reports in APPROVED status, waiting to be published
|
|
41
|
+
*/
|
|
42
|
+
REPORTS_TO_PUBLISH = "REPORTS_TO_PUBLISH",
|
|
43
|
+
/**
|
|
44
|
+
* Calculation processes in FAILED or TIMEOUT status with no later COMPLETED process for the same footprint
|
|
45
|
+
*/
|
|
46
|
+
FAILED_CALCULATION_PROCESSES = "FAILED_CALCULATION_PROCESSES",
|
|
47
|
+
/**
|
|
48
|
+
* Approved activity data records not included in a completed calculation yet
|
|
49
|
+
*/
|
|
50
|
+
APPROVED_SUBMISSIONS_PENDING_CALCULATION = "APPROVED_SUBMISSIONS_PENDING_CALCULATION",
|
|
51
|
+
/**
|
|
52
|
+
* Carbon clients with an ACTIVE carbon footprint configuration of a type that has no ACTIVE calculation workflow
|
|
53
|
+
*/
|
|
54
|
+
CARBON_CLIENTS_WITHOUT_ACTIVE_CALCULATION_WORKFLOW = "CARBON_CLIENTS_WITHOUT_ACTIVE_CALCULATION_WORKFLOW"
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=PendingActionType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PendingActionType.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/shared/domain/journeys/enums/PendingActionType.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,mCAAmC,wCAAwC;IAE3E;;OAEG;IACH,mCAAmC,wCAAwC;IAE3E;;OAEG;IACH,oCAAoC,yCAAyC;IAE7E;;OAEG;IACH,oCAAoC,yCAAyC;IAE7E;;OAEG;IACH,uCAAuC,4CAA4C;IAEnF;;OAEG;IACH,8BAA8B,mCAAmC;IAEjE;;OAEG;IACH,6BAA6B,kCAAkC;IAE/D;;OAEG;IACH,4BAA4B,iCAAiC;IAE7D;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;OAEG;IACH,4BAA4B,iCAAiC;IAE7D;;OAEG;IACH,wCAAwC,6CAA6C;IAErF;;OAEG;IACH,kDAAkD,uDAAuD;CAC1G"}
|
package/build/types/carbonbox/stakeholders/user-preferences/domain/entity/IUserPreference.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAggregateRoot } from '../../../../shared/domain/entities/IAggregateRoot';
|
|
2
|
+
import { UserPreferenceUserId } from '../value-objects/UserPreferenceUserId';
|
|
3
|
+
import { UserPreferenceSeenOnboardingTourCodes } from '../value-objects/UserPreferenceSeenOnboardingTourCodes';
|
|
4
|
+
import { UserPreferenceDismissedChecklistCodes } from '../value-objects/UserPreferenceDismissedChecklistCodes';
|
|
5
|
+
export interface IUserPreference extends IAggregateRoot {
|
|
6
|
+
userId: UserPreferenceUserId;
|
|
7
|
+
seenOnboardingTourCodes: UserPreferenceSeenOnboardingTourCodes;
|
|
8
|
+
dismissedChecklistCodes: UserPreferenceDismissedChecklistCodes;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=IUserPreference.d.ts.map
|
package/build/types/carbonbox/stakeholders/user-preferences/domain/entity/IUserPreference.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUserPreference.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-preferences/domain/entity/IUserPreference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,qCAAqC,EAAE,MAAM,wDAAwD,CAAC;AAC/G,OAAO,EAAE,qCAAqC,EAAE,MAAM,wDAAwD,CAAC;AAE/G,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,MAAM,EAAE,oBAAoB,CAAC;IAC7B,uBAAuB,EAAE,qCAAqC,CAAC;IAC/D,uBAAuB,EAAE,qCAAqC,CAAC;CAChE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AggregateRoot } from '../../../../shared/domain/entities/AggregateRoot';
|
|
2
|
+
import { UserPreferencePrimitives } from '../types/UserPreferencePrimitives';
|
|
3
|
+
import { UserPreferenceProps } from '../types/UserPreferenceProps';
|
|
4
|
+
import { UserPreferenceUserId } from '../value-objects/UserPreferenceUserId';
|
|
5
|
+
import { UserPreferenceSeenOnboardingTourCodes } from '../value-objects/UserPreferenceSeenOnboardingTourCodes';
|
|
6
|
+
import { UserPreferenceDismissedChecklistCodes } from '../value-objects/UserPreferenceDismissedChecklistCodes';
|
|
7
|
+
import { IUserPreference } from './IUserPreference';
|
|
8
|
+
/**
|
|
9
|
+
* UserPreference aggregate: user interface preferences of a stakeholder user
|
|
10
|
+
* (onboarding tours seen, checklists dismissed). Its identity is the owner user id.
|
|
11
|
+
*
|
|
12
|
+
* Changes return a new instance; adding codes is a union (idempotent), so two concurrent
|
|
13
|
+
* additions never remove each other's codes.
|
|
14
|
+
*/
|
|
15
|
+
export declare class UserPreference extends AggregateRoot<UserPreferencePrimitives> implements IUserPreference {
|
|
16
|
+
#private;
|
|
17
|
+
private constructor();
|
|
18
|
+
static create(props: UserPreferenceProps): UserPreference;
|
|
19
|
+
/**
|
|
20
|
+
* Default preferences of a user who never saved any (empty lists). Not persisted by itself:
|
|
21
|
+
* reading preferences without a stored record returns this without writing.
|
|
22
|
+
*/
|
|
23
|
+
static createDefault(userId: string): UserPreference;
|
|
24
|
+
static fromPrimitives(primitives: UserPreferencePrimitives): UserPreference;
|
|
25
|
+
get toPrimitives(): UserPreferencePrimitives;
|
|
26
|
+
get userId(): UserPreferenceUserId;
|
|
27
|
+
get seenOnboardingTourCodes(): UserPreferenceSeenOnboardingTourCodes;
|
|
28
|
+
get dismissedChecklistCodes(): UserPreferenceDismissedChecklistCodes;
|
|
29
|
+
/**
|
|
30
|
+
* Returns a new preference whose seen onboarding tours are the union of the current and the added codes.
|
|
31
|
+
* Throws UserPreferenceCodeLimitExceededError when the union exceeds the maximum.
|
|
32
|
+
*/
|
|
33
|
+
withAddedSeenOnboardingTourCodes(addedCodes: UserPreferenceSeenOnboardingTourCodes): UserPreference;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a new preference whose dismissed checklists are the union of the current and the added codes.
|
|
36
|
+
* Throws UserPreferenceCodeLimitExceededError when the union exceeds the maximum.
|
|
37
|
+
*/
|
|
38
|
+
withAddedDismissedChecklistCodes(addedCodes: UserPreferenceDismissedChecklistCodes): UserPreference;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a new preference with no seen onboarding tours ("show the tours again").
|
|
41
|
+
* Dismissed checklists are kept.
|
|
42
|
+
*/
|
|
43
|
+
withSeenOnboardingToursReset(): UserPreference;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=UserPreference.d.ts.map
|
package/build/types/carbonbox/stakeholders/user-preferences/domain/entity/UserPreference.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserPreference.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-preferences/domain/entity/UserPreference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,qCAAqC,EAAE,MAAM,wDAAwD,CAAC;AAC/G,OAAO,EAAE,qCAAqC,EAAE,MAAM,wDAAwD,CAAC;AAC/G,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;GAMG;AACH,qBAAa,cACX,SAAQ,aAAa,CAAC,wBAAwB,CAC9C,YAAW,eAAe;;IAO1B,OAAO;WAoBgB,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,cAAc;IAIzE;;;OAGG;WACW,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc;WAUpC,cAAc,CAAC,UAAU,EAAE,wBAAwB,GAAG,cAAc;IAU3F,IAAoB,YAAY,IAAI,wBAAwB,CAM3D;IAED,IAAW,MAAM,IAAI,oBAAoB,CAExC;IAED,IAAW,uBAAuB,IAAI,qCAAqC,CAE1E;IAED,IAAW,uBAAuB,IAAI,qCAAqC,CAE1E;IAED;;;OAGG;IACI,gCAAgC,CAAC,UAAU,EAAE,qCAAqC,GAAG,cAAc;IAQ1G;;;OAGG;IACI,gCAAgC,CAAC,UAAU,EAAE,qCAAqC,GAAG,cAAc;IAQ1G;;;OAGG;IACI,4BAA4B,IAAI,cAAc;CAOtD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
export declare class DuplicateUserPreferenceCodeError extends CodedRootError {
|
|
3
|
+
private constructor();
|
|
4
|
+
static create(propertyName: string, duplicatedCodes: string[]): DuplicateUserPreferenceCodeError;
|
|
5
|
+
logError(): string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=DuplicateUserPreferenceCodeError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DuplicateUserPreferenceCodeError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-preferences/domain/exceptions/DuplicateUserPreferenceCodeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF,qBAAa,gCAAiC,SAAQ,cAAc;IAClE,OAAO;WAqBgB,MAAM,CAC3B,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EAAE,GACxB,gCAAgC;IAInB,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
export declare class InvalidUserPreferenceCodeError extends CodedRootError {
|
|
3
|
+
private constructor();
|
|
4
|
+
static create(propertyName: string, invalidCodes: string[], expectedPattern: string): InvalidUserPreferenceCodeError;
|
|
5
|
+
logError(): string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=InvalidUserPreferenceCodeError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvalidUserPreferenceCodeError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-preferences/domain/exceptions/InvalidUserPreferenceCodeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF,qBAAa,8BAA+B,SAAQ,cAAc;IAChE,OAAO;WAuBgB,MAAM,CAC3B,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EAAE,EACtB,eAAe,EAAE,MAAM,GACtB,8BAA8B;IAIjB,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
export declare class UserPreferenceCodeLimitExceededError extends CodedRootError {
|
|
3
|
+
private constructor();
|
|
4
|
+
static create(propertyName: string, receivedCount: number, maximumCount: number): UserPreferenceCodeLimitExceededError;
|
|
5
|
+
logError(): string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=UserPreferenceCodeLimitExceededError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserPreferenceCodeLimitExceededError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-preferences/domain/exceptions/UserPreferenceCodeLimitExceededError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF,qBAAa,oCAAqC,SAAQ,cAAc;IACtE,OAAO;WAqBgB,MAAM,CAC3B,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACnB,oCAAoC;IAIvB,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Nullable } from '../../../../shared/domain/types/Nullable';
|
|
2
|
+
import { UserPreference } from '../entity/UserPreference';
|
|
3
|
+
import { UserPreferenceUserId } from '../value-objects/UserPreferenceUserId';
|
|
4
|
+
/**
|
|
5
|
+
* Repository interface for the UserPreference aggregate (one record per stakeholder user).
|
|
6
|
+
*/
|
|
7
|
+
export interface IUserPreferenceRepository {
|
|
8
|
+
/**
|
|
9
|
+
* Persists the user preference, creating the record when it does not exist yet (upsert by user id)
|
|
10
|
+
* @param userPreference - The user preference aggregate to save
|
|
11
|
+
*/
|
|
12
|
+
save(userPreference: UserPreference): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Finds the user preference of a stakeholder user
|
|
15
|
+
* @param userId - The id of the user who owns the preferences
|
|
16
|
+
* @returns The stored preference, or null when the user never saved preferences
|
|
17
|
+
* (callers fall back to UserPreference.createDefault)
|
|
18
|
+
*/
|
|
19
|
+
findByUserId(userId: UserPreferenceUserId): Promise<Nullable<UserPreference>>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=IUserPreferenceRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUserPreferenceRepository.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-preferences/domain/repository/IUserPreferenceRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;CAC/E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UserPreferencePrimitives - Primitives representation of the UserPreference aggregate
|
|
3
|
+
*
|
|
4
|
+
* One preference record per stakeholder user, created on demand. Without a stored record the
|
|
5
|
+
* defaults are empty lists (see UserPreference.createDefault).
|
|
6
|
+
*/
|
|
7
|
+
export type UserPreferencePrimitives = {
|
|
8
|
+
/**
|
|
9
|
+
* Aggregate identity: the id of the stakeholder user who owns the preferences
|
|
10
|
+
* (persisted as `userId`, the primary key of the preference record)
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Codes of the onboarding tours the user already saw (`^[A-Z0-9_]{1,100}$`, unique, at most 200)
|
|
15
|
+
*/
|
|
16
|
+
seenOnboardingTourCodes: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Codes of the checklists the user dismissed (`^[A-Z0-9_]{1,100}$`, unique, at most 200)
|
|
19
|
+
*/
|
|
20
|
+
dismissedChecklistCodes: string[];
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=UserPreferencePrimitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserPreferencePrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-preferences/domain/types/UserPreferencePrimitives.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAElC;;OAEG;IACH,uBAAuB,EAAE,MAAM,EAAE,CAAC;CACnC,CAAC"}
|