@carbonbox/domain 0.9.1 → 0.10.0
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/types/carbonbox/emission-calculation-formulas/global-warming-potentials/domain/repository/IGlobalWarmingPotentialRepository.d.ts +1 -0
- package/build/types/carbonbox/emission-calculation-formulas/global-warming-potentials/domain/repository/IGlobalWarmingPotentialRepository.d.ts.map +1 -1
- package/package.json +5 -2
- package/build/carbonbox/activity-data-collection/contextual-labels/domain/types/ContextualLabelMappingPrimitives.ts.js +0 -2
- package/build/carbonbox/emission-calculation-process/calculation-workflows/domain/enums/CalculationWorkflowPrimitives.js +0 -2
- package/build/carbonbox/emission-calculation-process/calculation-workflows/domain/enums/CalculationWorkflowProps.js +0 -2
- package/build/carbonbox/shared/domain/events/DomainEventEnvelopePrimitives.js +0 -2
- package/build/types/carbonbox/activity-data-collection/contextual-labels/domain/types/ContextualLabelMappingPrimitives.ts.d.ts +0 -5
- package/build/types/carbonbox/activity-data-collection/contextual-labels/domain/types/ContextualLabelMappingPrimitives.ts.d.ts.map +0 -1
- package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/enums/CalculationWorkflowPrimitives.d.ts +0 -32
- package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/enums/CalculationWorkflowPrimitives.d.ts.map +0 -1
- package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/enums/CalculationWorkflowProps.d.ts +0 -32
- package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/enums/CalculationWorkflowProps.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/events/DomainEventEnvelopePrimitives.d.ts +0 -26
- package/build/types/carbonbox/shared/domain/events/DomainEventEnvelopePrimitives.d.ts.map +0 -1
|
@@ -7,6 +7,7 @@ import { GlobalWarmingPotentialReferenceName } from '../value-objects/GlobalWarm
|
|
|
7
7
|
import { GlobalWarmingPotentialTimeHorizonYears } from '../value-objects/GlobalWarmingPotentialTimeHorizonYears';
|
|
8
8
|
export interface IGlobalWarmingPotentialRepository {
|
|
9
9
|
save(globalWarmingPotential: GlobalWarmingPotential): Promise<void>;
|
|
10
|
+
saveMany(globalWarmingPotentials: readonly GlobalWarmingPotential[]): Promise<void>;
|
|
10
11
|
findById(id: GlobalWarmingPotentialId): Promise<Nullable<GlobalWarmingPotential>>;
|
|
11
12
|
findByReferenceName(referenceName: GlobalWarmingPotentialReferenceName): Promise<Nullable<GlobalWarmingPotential>>;
|
|
12
13
|
findAllByProtocolVersion(protocolVersion: GlobalWarmingPotentialProtocolVersion): Promise<GlobalWarmingPotential[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IGlobalWarmingPotentialRepository.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/emission-calculation-formulas/global-warming-potentials/domain/repository/IGlobalWarmingPotentialRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,uCAAuC,EAAE,MAAM,0DAA0D,CAAC;AACnH,OAAO,EAAE,qCAAqC,EAAE,MAAM,wDAAwD,CAAC;AAC/G,OAAO,EAAE,mCAAmC,EAAE,MAAM,sDAAsD,CAAC;AAC3G,OAAO,EAAE,sCAAsC,EAAE,MAAM,yDAAyD,CAAC;AAEjH,MAAM,WAAW,iCAAiC;IAChD,IAAI,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,QAAQ,CAAC,EAAE,EAAE,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAClF,mBAAmB,CAAC,aAAa,EAAE,mCAAmC,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACnH,wBAAwB,CAAC,eAAe,EAAE,qCAAqC,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACpH,yBAAyB,CAAC,gBAAgB,EAAE,sCAAsC,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACvH,0BAA0B,CAAC,iBAAiB,EAAE,uCAAuC,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAC1H,mCAAmC,CAAC,eAAe,EAAE,qCAAqC,EAAE,gBAAgB,EAAE,sCAAsC,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACjM,OAAO,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAC7C,UAAU,CAAC,EAAE,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD"}
|
|
1
|
+
{"version":3,"file":"IGlobalWarmingPotentialRepository.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/emission-calculation-formulas/global-warming-potentials/domain/repository/IGlobalWarmingPotentialRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,uCAAuC,EAAE,MAAM,0DAA0D,CAAC;AACnH,OAAO,EAAE,qCAAqC,EAAE,MAAM,wDAAwD,CAAC;AAC/G,OAAO,EAAE,mCAAmC,EAAE,MAAM,sDAAsD,CAAC;AAC3G,OAAO,EAAE,sCAAsC,EAAE,MAAM,yDAAyD,CAAC;AAEjH,MAAM,WAAW,iCAAiC;IAChD,IAAI,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,QAAQ,CAAC,uBAAuB,EAAE,SAAS,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF,QAAQ,CAAC,EAAE,EAAE,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAClF,mBAAmB,CAAC,aAAa,EAAE,mCAAmC,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACnH,wBAAwB,CAAC,eAAe,EAAE,qCAAqC,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACpH,yBAAyB,CAAC,gBAAgB,EAAE,sCAAsC,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACvH,0BAA0B,CAAC,iBAAiB,EAAE,uCAAuC,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAC1H,mCAAmC,CAAC,eAAe,EAAE,qCAAqC,EAAE,gBAAgB,EAAE,sCAAsC,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACjM,OAAO,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAC7C,UAAU,CAAC,EAAE,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"browser": false
|
|
4
4
|
},
|
|
5
5
|
"name": "@carbonbox/domain",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.10.0",
|
|
7
7
|
"description": "Domain package for CarbonBox Project",
|
|
8
8
|
"main": "build/main/index.js",
|
|
9
9
|
"types": "build/types/main/index.d.ts",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
14
|
"tsc:dev": "tsc --watch",
|
|
15
|
-
"
|
|
15
|
+
"clean": "rimraf build",
|
|
16
|
+
"build": "npm run clean && tsc",
|
|
17
|
+
"prepublishOnly": "npm run build",
|
|
16
18
|
"lint": "eslint src/ --ext .ts",
|
|
17
19
|
"lint:fix": "eslint src/ --ext .ts --fix"
|
|
18
20
|
},
|
|
@@ -45,6 +47,7 @@
|
|
|
45
47
|
"eslint-config-airbnb": "^19.0.4",
|
|
46
48
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
47
49
|
"eslint-plugin-import": "^2.31.0",
|
|
50
|
+
"rimraf": "^5.0.10",
|
|
48
51
|
"ts-node-dev": "^2.0.0",
|
|
49
52
|
"typescript": "^5.8.2"
|
|
50
53
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextualLabelMappingPrimitives.ts.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/activity-data-collection/contextual-labels/domain/types/ContextualLabelMappingPrimitives.ts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gCAAgC,GAAG;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { AggregateRootPrimitives } from '../../../../shared/domain/types/AggregateRootPrimitives';
|
|
2
|
-
import { CarbonClientReferencePrimitives } from '../../../../shared/domain/types/CarbonClientReferencePrimitives';
|
|
3
|
-
import { StakeholderReferencePrimitives } from '../../../../shared/domain/types/StakeholderReferencePrimitives';
|
|
4
|
-
import { WorkflowStatus } from './WorkflowStatus';
|
|
5
|
-
import { WorkflowTrigger } from './WorkflowTrigger';
|
|
6
|
-
export type CalculationWorkflowPrimitives = AggregateRootPrimitives & {
|
|
7
|
-
code: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
carbonClient: CarbonClientReferencePrimitives;
|
|
11
|
-
triggerType: WorkflowTrigger;
|
|
12
|
-
triggerSchedule: string | null;
|
|
13
|
-
isAutomatic: boolean;
|
|
14
|
-
jobSequence: string[];
|
|
15
|
-
parallelJobs: string[][];
|
|
16
|
-
conditionalSteps: string[];
|
|
17
|
-
maxConcurrentProcesses: number;
|
|
18
|
-
timeoutMinutes: number;
|
|
19
|
-
retryFailedJobs: boolean;
|
|
20
|
-
status: WorkflowStatus;
|
|
21
|
-
lastExecutedAt: string | null;
|
|
22
|
-
nextScheduledAt: string | null;
|
|
23
|
-
totalExecutions: number;
|
|
24
|
-
successfulExecutions: number;
|
|
25
|
-
failedExecutions: number;
|
|
26
|
-
createdByStakeholder: StakeholderReferencePrimitives;
|
|
27
|
-
allowedExecutors: string[];
|
|
28
|
-
emailNotifications: boolean;
|
|
29
|
-
notificationRecipients: string[];
|
|
30
|
-
workflowNotes: string | null;
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=CalculationWorkflowPrimitives.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CalculationWorkflowPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/emission-calculation-process/calculation-workflows/domain/enums/CalculationWorkflowPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,EAAE,8BAA8B,EAAE,MAAM,gEAAgE,CAAC;AAChH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,MAAM,6BAA6B,GAAG,uBAAuB,GAAG;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IAGpB,YAAY,EAAE,+BAA+B,CAAC;IAG9C,WAAW,EAAE,eAAe,CAAC;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;IAGrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAG3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IAGzB,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IAGzB,oBAAoB,EAAE,8BAA8B,CAAC;IACrD,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAG3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { AggregateRootProps } from '../../../../shared/domain/types/AggregateRootProps';
|
|
2
|
-
import { CarbonClientReference } from '../../../../shared/domain/types/CarbonClientReference';
|
|
3
|
-
import { StakeholderReference } from '../../../../shared/domain/types/StakeholderReference';
|
|
4
|
-
import { WorkflowStatus } from './WorkflowStatus';
|
|
5
|
-
import { WorkflowTrigger } from './WorkflowTrigger';
|
|
6
|
-
export type CalculationWorkflowProps = AggregateRootProps & {
|
|
7
|
-
code: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
carbonClient: CarbonClientReference;
|
|
11
|
-
triggerType: WorkflowTrigger;
|
|
12
|
-
triggerSchedule: string | null;
|
|
13
|
-
isAutomatic: boolean;
|
|
14
|
-
jobSequence: string[];
|
|
15
|
-
parallelJobs: string[][];
|
|
16
|
-
conditionalSteps: string[];
|
|
17
|
-
maxConcurrentProcesses: number;
|
|
18
|
-
timeoutMinutes: number;
|
|
19
|
-
retryFailedJobs: boolean;
|
|
20
|
-
status: WorkflowStatus;
|
|
21
|
-
lastExecutedAt: string | null;
|
|
22
|
-
nextScheduledAt: string | null;
|
|
23
|
-
totalExecutions: number;
|
|
24
|
-
successfulExecutions: number;
|
|
25
|
-
failedExecutions: number;
|
|
26
|
-
createdByStakeholder: StakeholderReference;
|
|
27
|
-
allowedExecutors: string[];
|
|
28
|
-
emailNotifications: boolean;
|
|
29
|
-
notificationRecipients: string[];
|
|
30
|
-
workflowNotes: string | null;
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=CalculationWorkflowProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CalculationWorkflowProps.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/emission-calculation-process/calculation-workflows/domain/enums/CalculationWorkflowProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,GAAG;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IAGpB,YAAY,EAAE,qBAAqB,CAAC;IAGpC,WAAW,EAAE,eAAe,CAAC;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;IAGrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAG3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IAGzB,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IAGzB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAG3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lossless serialisation of a domain event used by infrastructure
|
|
3
|
-
* adapters to project the event onto a concrete transport.
|
|
4
|
-
*
|
|
5
|
-
* This type lives in the domain because it is the contract between the
|
|
6
|
-
* domain and any transport adapter (EventBridge, SNS, in-memory bus,
|
|
7
|
-
* Kafka, etc.). Keeping it here ensures the domain remains pure while
|
|
8
|
-
* still letting infrastructure consume a strongly-typed representation
|
|
9
|
-
* of an event without owning the projection logic itself.
|
|
10
|
-
*
|
|
11
|
-
* Naming convention:
|
|
12
|
-
* - `name` is the validated PascalCase past-tense string from
|
|
13
|
-
* `DomainEventName.value`.
|
|
14
|
-
* - `aggregateId` is the originating aggregate's primary key, used for
|
|
15
|
-
* ordering (FIFO group key) and consumer-side idempotency.
|
|
16
|
-
* - `occurredAt` is the producer-side wall-clock instant.
|
|
17
|
-
* - `payload` is a JSON-serialisable, immutable snapshot of the domain
|
|
18
|
-
* facts the consumer needs to react.
|
|
19
|
-
*/
|
|
20
|
-
export type DomainEventEnvelopePrimitives<TPayload extends Readonly<Record<string, unknown>>> = {
|
|
21
|
-
readonly name: string;
|
|
22
|
-
readonly aggregateId: string;
|
|
23
|
-
readonly occurredAt: Date;
|
|
24
|
-
readonly payload: TPayload;
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=DomainEventEnvelopePrimitives.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DomainEventEnvelopePrimitives.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/events/DomainEventEnvelopePrimitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,6BAA6B,CAAC,QAAQ,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI;IAC9F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;CAC5B,CAAC"}
|