@carbonbox/domain 0.31.0 → 0.32.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.
Files changed (98) hide show
  1. package/build/carbonbox/reporting/report-instances/domain/entity/IReportInstance.js +2 -0
  2. package/build/carbonbox/reporting/report-instances/domain/entity/ReportInstance.js +371 -0
  3. package/build/carbonbox/reporting/report-instances/domain/enums/ReportInstanceStatus.js +38 -0
  4. package/build/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeApprovedByClientError.js +32 -0
  5. package/build/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeApprovedInternallyError.js +32 -0
  6. package/build/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeGeneratedError.js +32 -0
  7. package/build/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBePublishedError.js +32 -0
  8. package/build/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeRejectedError.js +32 -0
  9. package/build/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceInvalidStatusTransitionError.js +32 -0
  10. package/build/carbonbox/reporting/report-instances/domain/repository/IReportInstanceRepository.js +2 -0
  11. package/build/carbonbox/reporting/report-instances/domain/types/ReportInstancePrimitives.js +2 -0
  12. package/build/carbonbox/reporting/report-instances/domain/types/ReportInstanceProps.js +2 -0
  13. package/build/carbonbox/reporting/report-templates/domain/entity/IReportTemplate.js +2 -0
  14. package/build/carbonbox/reporting/report-templates/domain/entity/ReportTemplate.js +275 -0
  15. package/build/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeActivatedError.js +32 -0
  16. package/build/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeDeprecatedError.js +32 -0
  17. package/build/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeVersionedError.js +32 -0
  18. package/build/carbonbox/reporting/report-templates/domain/repository/IReportTemplateRepository.js +2 -0
  19. package/build/carbonbox/reporting/shared/domain/types/AIExecutionRecordPrimitives.js +2 -0
  20. package/build/carbonbox/reporting/shared/domain/types/ApprovalRecordPrimitives.js +2 -0
  21. package/build/carbonbox/reporting/shared/domain/types/QuestionnaireAnswerPrimitives.js +2 -0
  22. package/build/carbonbox/reporting/shared/domain/types/ReportPeriodPrimitives.js +2 -0
  23. package/build/carbonbox/reporting/text-banks/domain/entity/ITextBank.js +2 -0
  24. package/build/carbonbox/reporting/text-banks/domain/entity/TextBank.js +173 -0
  25. package/build/carbonbox/reporting/text-banks/domain/repository/ITextBankRepository.js +2 -0
  26. package/build/carbonbox/reporting/text-banks/domain/types/TextBankEntryPrimitives.js +2 -0
  27. package/build/carbonbox/reporting/text-banks/domain/types/TextBankEntryProps.js +2 -0
  28. package/build/carbonbox/reporting/text-banks/domain/types/TextBankPrimitives.js +2 -0
  29. package/build/carbonbox/reporting/text-banks/domain/types/TextBankProps.js +2 -0
  30. package/build/carbonbox/shared/domain/enums/ErrorCode.js +11 -0
  31. package/build/main/index.js +75 -8
  32. package/build/types/carbonbox/reporting/report-instances/domain/entity/IReportInstance.d.ts +36 -0
  33. package/build/types/carbonbox/reporting/report-instances/domain/entity/IReportInstance.d.ts.map +1 -0
  34. package/build/types/carbonbox/reporting/report-instances/domain/entity/ReportInstance.d.ts +59 -0
  35. package/build/types/carbonbox/reporting/report-instances/domain/entity/ReportInstance.d.ts.map +1 -0
  36. package/build/types/carbonbox/reporting/report-instances/domain/enums/ReportInstanceStatus.d.ts +35 -0
  37. package/build/types/carbonbox/reporting/report-instances/domain/enums/ReportInstanceStatus.d.ts.map +1 -0
  38. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeApprovedByClientError.d.ts +7 -0
  39. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeApprovedByClientError.d.ts.map +1 -0
  40. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeApprovedInternallyError.d.ts +7 -0
  41. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeApprovedInternallyError.d.ts.map +1 -0
  42. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeGeneratedError.d.ts +7 -0
  43. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeGeneratedError.d.ts.map +1 -0
  44. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBePublishedError.d.ts +7 -0
  45. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBePublishedError.d.ts.map +1 -0
  46. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeRejectedError.d.ts +7 -0
  47. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceCannotBeRejectedError.d.ts.map +1 -0
  48. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceInvalidStatusTransitionError.d.ts +7 -0
  49. package/build/types/carbonbox/reporting/report-instances/domain/exceptions/ReportInstanceInvalidStatusTransitionError.d.ts.map +1 -0
  50. package/build/types/carbonbox/reporting/report-instances/domain/repository/IReportInstanceRepository.d.ts +84 -0
  51. package/build/types/carbonbox/reporting/report-instances/domain/repository/IReportInstanceRepository.d.ts.map +1 -0
  52. package/build/types/carbonbox/reporting/report-instances/domain/types/ReportInstancePrimitives.d.ts +28 -0
  53. package/build/types/carbonbox/reporting/report-instances/domain/types/ReportInstancePrimitives.d.ts.map +1 -0
  54. package/build/types/carbonbox/reporting/report-instances/domain/types/ReportInstanceProps.d.ts +28 -0
  55. package/build/types/carbonbox/reporting/report-instances/domain/types/ReportInstanceProps.d.ts.map +1 -0
  56. package/build/types/carbonbox/reporting/report-templates/domain/entity/IReportTemplate.d.ts +24 -0
  57. package/build/types/carbonbox/reporting/report-templates/domain/entity/IReportTemplate.d.ts.map +1 -0
  58. package/build/types/carbonbox/reporting/report-templates/domain/entity/ReportTemplate.d.ts +43 -0
  59. package/build/types/carbonbox/reporting/report-templates/domain/entity/ReportTemplate.d.ts.map +1 -0
  60. package/build/types/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeActivatedError.d.ts +7 -0
  61. package/build/types/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeActivatedError.d.ts.map +1 -0
  62. package/build/types/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeDeprecatedError.d.ts +7 -0
  63. package/build/types/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeDeprecatedError.d.ts.map +1 -0
  64. package/build/types/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeVersionedError.d.ts +7 -0
  65. package/build/types/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeVersionedError.d.ts.map +1 -0
  66. package/build/types/carbonbox/reporting/report-templates/domain/repository/IReportTemplateRepository.d.ts +97 -0
  67. package/build/types/carbonbox/reporting/report-templates/domain/repository/IReportTemplateRepository.d.ts.map +1 -0
  68. package/build/types/carbonbox/reporting/report-templates/domain/types/ReportTemplatePrimitives.d.ts +15 -15
  69. package/build/types/carbonbox/reporting/report-templates/domain/types/ReportTemplatePrimitives.d.ts.map +1 -1
  70. package/build/types/carbonbox/reporting/report-templates/domain/types/ReportTemplateProps.d.ts +20 -16
  71. package/build/types/carbonbox/reporting/report-templates/domain/types/ReportTemplateProps.d.ts.map +1 -1
  72. package/build/types/carbonbox/reporting/shared/domain/types/AIExecutionRecordPrimitives.d.ts +14 -0
  73. package/build/types/carbonbox/reporting/shared/domain/types/AIExecutionRecordPrimitives.d.ts.map +1 -0
  74. package/build/types/carbonbox/reporting/shared/domain/types/ApprovalRecordPrimitives.d.ts +12 -0
  75. package/build/types/carbonbox/reporting/shared/domain/types/ApprovalRecordPrimitives.d.ts.map +1 -0
  76. package/build/types/carbonbox/reporting/shared/domain/types/QuestionnaireAnswerPrimitives.d.ts +11 -0
  77. package/build/types/carbonbox/reporting/shared/domain/types/QuestionnaireAnswerPrimitives.d.ts.map +1 -0
  78. package/build/types/carbonbox/reporting/shared/domain/types/ReportPeriodPrimitives.d.ts +9 -0
  79. package/build/types/carbonbox/reporting/shared/domain/types/ReportPeriodPrimitives.d.ts.map +1 -0
  80. package/build/types/carbonbox/reporting/text-banks/domain/entity/ITextBank.d.ts +16 -0
  81. package/build/types/carbonbox/reporting/text-banks/domain/entity/ITextBank.d.ts.map +1 -0
  82. package/build/types/carbonbox/reporting/text-banks/domain/entity/TextBank.d.ts +36 -0
  83. package/build/types/carbonbox/reporting/text-banks/domain/entity/TextBank.d.ts.map +1 -0
  84. package/build/types/carbonbox/reporting/text-banks/domain/repository/ITextBankRepository.d.ts +52 -0
  85. package/build/types/carbonbox/reporting/text-banks/domain/repository/ITextBankRepository.d.ts.map +1 -0
  86. package/build/types/carbonbox/reporting/text-banks/domain/types/TextBankEntryPrimitives.d.ts +45 -0
  87. package/build/types/carbonbox/reporting/text-banks/domain/types/TextBankEntryPrimitives.d.ts.map +1 -0
  88. package/build/types/carbonbox/reporting/text-banks/domain/types/TextBankEntryProps.d.ts +46 -0
  89. package/build/types/carbonbox/reporting/text-banks/domain/types/TextBankEntryProps.d.ts.map +1 -0
  90. package/build/types/carbonbox/reporting/text-banks/domain/types/TextBankPrimitives.d.ts +33 -0
  91. package/build/types/carbonbox/reporting/text-banks/domain/types/TextBankPrimitives.d.ts.map +1 -0
  92. package/build/types/carbonbox/reporting/text-banks/domain/types/TextBankProps.d.ts +37 -0
  93. package/build/types/carbonbox/reporting/text-banks/domain/types/TextBankProps.d.ts.map +1 -0
  94. package/build/types/carbonbox/shared/domain/enums/ErrorCode.d.ts +11 -0
  95. package/build/types/carbonbox/shared/domain/enums/ErrorCode.d.ts.map +1 -1
  96. package/build/types/main/index.d.ts +48 -0
  97. package/build/types/main/index.d.ts.map +1 -1
  98. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ import { AggregateRoot } from '../../../../shared/domain/entities/AggregateRoot';
2
+ import { ReportTemplateProps } from '../types/ReportTemplateProps';
3
+ import { ReportTemplatePrimitives } from '../types/ReportTemplatePrimitives';
4
+ import { IReportTemplate } from './IReportTemplate';
5
+ import { ReportSectionPrimitives } from '../../../shared/domain/types/ReportSectionPrimitives';
6
+ export declare class ReportTemplate extends AggregateRoot<ReportTemplatePrimitives> implements IReportTemplate {
7
+ #private;
8
+ private constructor();
9
+ static create(props: Omit<ReportTemplateProps, 'id' | 'createdAt' | 'updatedAt'>): ReportTemplate;
10
+ static fromPrimitives(primitives: ReportTemplatePrimitives): ReportTemplate;
11
+ get toPrimitives(): ReportTemplatePrimitives;
12
+ toProps(): ReportTemplateProps;
13
+ getId(): string;
14
+ getVersion(): number;
15
+ getPreviousVersionId(): string | null;
16
+ getType(): string;
17
+ getFootprintType(): string;
18
+ getReportingStandard(): string;
19
+ requiresClientApproval(): boolean;
20
+ getStatus(): string;
21
+ getSections(): readonly ReportSectionPrimitives[];
22
+ getTextBankId(): string;
23
+ getCreatedBy(): string;
24
+ getCreatedAt(): string;
25
+ getUpdatedAt(): string;
26
+ isActive(): boolean;
27
+ isDraft(): boolean;
28
+ isDeprecated(): boolean;
29
+ canBeActivated(): boolean;
30
+ canBeModified(): boolean;
31
+ canBeDeprecated(): boolean;
32
+ activate(): void;
33
+ deprecate(): void;
34
+ createNewVersion(createdBy: string): ReportTemplate;
35
+ isAuditable(): boolean;
36
+ isTechnical(): boolean;
37
+ isExecutive(): boolean;
38
+ isCustom(): boolean;
39
+ getTemplateTypeLabel(): string;
40
+ getTotalBlocks(): number;
41
+ hasTextBank(): boolean;
42
+ }
43
+ //# sourceMappingURL=ReportTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportTemplate.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/entity/ReportTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAO/F,qBAAa,cAAe,SAAQ,aAAa,CAAC,wBAAwB,CAAE,YAAW,eAAe;;IAyBpG,OAAO;WA4BgB,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG,cAAc;WAc1F,cAAc,CAAC,UAAU,EAAE,wBAAwB,GAAG,cAAc;IAoB3F,IAAoB,YAAY,IAAI,wBAAwB,CAgB3D;IAEM,OAAO,IAAI,mBAAmB;IAmB9B,KAAK,IAAI,MAAM;IAIf,UAAU,IAAI,MAAM;IAIpB,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAIrC,OAAO,IAAI,MAAM;IAIjB,gBAAgB,IAAI,MAAM;IAI1B,oBAAoB,IAAI,MAAM;IAI9B,sBAAsB,IAAI,OAAO;IAIjC,SAAS,IAAI,MAAM;IAInB,WAAW,IAAI,SAAS,uBAAuB,EAAE;IAIjD,aAAa,IAAI,MAAM;IAIvB,YAAY,IAAI,MAAM;IAItB,YAAY,IAAI,MAAM;IAItB,YAAY,IAAI,MAAM;IAKtB,QAAQ,IAAI,OAAO;IAInB,OAAO,IAAI,OAAO;IAIlB,YAAY,IAAI,OAAO;IAKvB,cAAc,IAAI,OAAO;IAkBzB,aAAa,IAAI,OAAO;IAMxB,eAAe,IAAI,OAAO;IAM1B,QAAQ,IAAI,IAAI;IAuBhB,SAAS,IAAI,IAAI;IAejB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;IA+BnD,WAAW,IAAI,OAAO;IAItB,WAAW,IAAI,OAAO;IAItB,WAAW,IAAI,OAAO;IAItB,QAAQ,IAAI,OAAO;IAInB,oBAAoB,IAAI,MAAM;IAW9B,cAAc,IAAI,MAAM;IAIxB,WAAW,IAAI,OAAO;CAG9B"}
@@ -0,0 +1,7 @@
1
+ import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
2
+ export declare class ReportTemplateCannotBeActivatedError extends CodedRootError {
3
+ private constructor();
4
+ static create(templateId: string, currentStatus: string, reason: string): ReportTemplateCannotBeActivatedError;
5
+ logError(): string;
6
+ }
7
+ //# sourceMappingURL=ReportTemplateCannotBeActivatedError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportTemplateCannotBeActivatedError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeActivatedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF,qBAAa,oCAAqC,SAAQ,cAAc;IACtE,OAAO;WAsBgB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,oCAAoC;IAI9G,QAAQ,IAAI,MAAM;CAGnC"}
@@ -0,0 +1,7 @@
1
+ import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
2
+ export declare class ReportTemplateCannotBeDeprecatedError extends CodedRootError {
3
+ private constructor();
4
+ static create(templateId: string, currentStatus: string, reason: string): ReportTemplateCannotBeDeprecatedError;
5
+ logError(): string;
6
+ }
7
+ //# sourceMappingURL=ReportTemplateCannotBeDeprecatedError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportTemplateCannotBeDeprecatedError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeDeprecatedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF,qBAAa,qCAAsC,SAAQ,cAAc;IACvE,OAAO;WAsBgB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,qCAAqC;IAI/G,QAAQ,IAAI,MAAM;CAGnC"}
@@ -0,0 +1,7 @@
1
+ import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
2
+ export declare class ReportTemplateCannotBeVersionedError extends CodedRootError {
3
+ private constructor();
4
+ static create(templateId: string, currentStatus: string, reason: string): ReportTemplateCannotBeVersionedError;
5
+ logError(): string;
6
+ }
7
+ //# sourceMappingURL=ReportTemplateCannotBeVersionedError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportTemplateCannotBeVersionedError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/exceptions/ReportTemplateCannotBeVersionedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF,qBAAa,oCAAqC,SAAQ,cAAc;IACtE,OAAO;WAsBgB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,oCAAoC;IAI9G,QAAQ,IAAI,MAAM;CAGnC"}
@@ -0,0 +1,97 @@
1
+ import { Nullable } from '../../../../shared/domain/types/Nullable';
2
+ import { ReportTemplate } from '../entity/ReportTemplate';
3
+ import { ReportTemplateId } from '../value-objects/ReportTemplateId';
4
+ import { ReportType } from '../../../shared/domain/enums/ReportType';
5
+ import { ReportTemplateStatus } from '../enums/ReportTemplateStatus';
6
+ import { CarbonFootprint } from '../../../../carbon-footprint-configurations/shared/domain/enums/CarbonFootprint';
7
+ import { ReportingStandard } from '../../../../shared/domain/enums/ReportingStandard';
8
+ /**
9
+ * Repository interface for ReportTemplate aggregate following DDD principles.
10
+ * Manages persistence operations for report templates configured by the host.
11
+ */
12
+ export interface IReportTemplateRepository {
13
+ /**
14
+ * Persists a report template (create or update)
15
+ * @param template - The report template aggregate to save
16
+ * @returns Promise that resolves when the operation completes
17
+ */
18
+ save(template: ReportTemplate): Promise<void>;
19
+ /**
20
+ * Finds a report template by its ID
21
+ * @param id - The report template ID
22
+ * @returns Promise resolving to the template or null if not found
23
+ */
24
+ findById(id: ReportTemplateId): Promise<Nullable<ReportTemplate>>;
25
+ /**
26
+ * Finds a report template by type, footprint type, reporting standard, and version
27
+ * @param type - The report type
28
+ * @param footprintType - The carbon footprint type
29
+ * @param reportingStandard - The reporting standard
30
+ * @param version - The template version
31
+ * @returns Promise resolving to the template or null if not found
32
+ */
33
+ findByTypeAndStandardAndVersion(type: ReportType, footprintType: CarbonFootprint, reportingStandard: ReportingStandard, version: number): Promise<Nullable<ReportTemplate>>;
34
+ /**
35
+ * Finds all templates for a specific report type
36
+ * @param type - The report type to filter by
37
+ * @returns Promise resolving to an array of matching templates
38
+ */
39
+ findAllByType(type: ReportType): Promise<ReportTemplate[]>;
40
+ /**
41
+ * Finds all templates with a specific status
42
+ * @param status - The template status to filter by
43
+ * @returns Promise resolving to an array of matching templates
44
+ */
45
+ findAllByStatus(status: ReportTemplateStatus): Promise<ReportTemplate[]>;
46
+ /**
47
+ * Finds all active templates
48
+ * @returns Promise resolving to an array of active templates
49
+ */
50
+ findAllActive(): Promise<ReportTemplate[]>;
51
+ /**
52
+ * Finds all templates for a specific footprint type
53
+ * @param footprintType - The carbon footprint type to filter by
54
+ * @returns Promise resolving to an array of matching templates
55
+ */
56
+ findAllByFootprintType(footprintType: CarbonFootprint): Promise<ReportTemplate[]>;
57
+ /**
58
+ * Finds all templates for a specific reporting standard
59
+ * @param reportingStandard - The reporting standard to filter by
60
+ * @returns Promise resolving to an array of matching templates
61
+ */
62
+ findAllByReportingStandard(reportingStandard: ReportingStandard): Promise<ReportTemplate[]>;
63
+ /**
64
+ * Finds all versions of a template
65
+ * @param type - The report type
66
+ * @param footprintType - The carbon footprint type
67
+ * @param reportingStandard - The reporting standard
68
+ * @returns Promise resolving to an array of all versions, sorted by version number
69
+ */
70
+ findAllVersions(type: ReportType, footprintType: CarbonFootprint, reportingStandard: ReportingStandard): Promise<ReportTemplate[]>;
71
+ /**
72
+ * Finds the latest version of a template
73
+ * @param type - The report type
74
+ * @param footprintType - The carbon footprint type
75
+ * @param reportingStandard - The reporting standard
76
+ * @returns Promise resolving to the latest version or null if not found
77
+ */
78
+ findLatestVersion(type: ReportType, footprintType: CarbonFootprint, reportingStandard: ReportingStandard): Promise<Nullable<ReportTemplate>>;
79
+ /**
80
+ * Finds all templates created by a specific user
81
+ * @param createdBy - The user ID of the creator
82
+ * @returns Promise resolving to an array of templates created by the user
83
+ */
84
+ findAllByCreatedBy(createdBy: string): Promise<ReportTemplate[]>;
85
+ /**
86
+ * Finds all report templates in the system
87
+ * @returns Promise resolving to an array of all templates
88
+ */
89
+ findAll(): Promise<ReportTemplate[]>;
90
+ /**
91
+ * Deletes a report template by its ID
92
+ * @param id - The template ID to delete
93
+ * @returns Promise that resolves when the operation completes
94
+ */
95
+ deleteById(id: ReportTemplateId): Promise<void>;
96
+ }
97
+ //# sourceMappingURL=IReportTemplateRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IReportTemplateRepository.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/repository/IReportTemplateRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iFAAiF,CAAC;AAClH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAEtF;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAElE;;;;;;;OAOG;IACH,+BAA+B,CAC7B,IAAI,EAAE,UAAU,EAChB,aAAa,EAAE,eAAe,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAErC;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE3D;;;;OAIG;IACH,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAEzE;;;OAGG;IACH,aAAa,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE3C;;;;OAIG;IACH,sBAAsB,CAAC,aAAa,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAElF;;;;OAIG;IACH,0BAA0B,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE5F;;;;;;OAMG;IACH,eAAe,CACb,IAAI,EAAE,UAAU,EAChB,aAAa,EAAE,eAAe,EAC9B,iBAAiB,EAAE,iBAAiB,GACnC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE7B;;;;;;OAMG;IACH,iBAAiB,CACf,IAAI,EAAE,UAAU,EAChB,aAAa,EAAE,eAAe,EAC9B,iBAAiB,EAAE,iBAAiB,GACnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAErC;;;;OAIG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAEjE;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAErC;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD"}
@@ -3,19 +3,19 @@ import { ReportType } from '../../../shared/domain/enums/ReportType';
3
3
  import { CarbonFootprint } from '../../../../carbon-footprint-configurations/shared/domain/enums/CarbonFootprint';
4
4
  import { ReportingStandard } from '../../../../shared/domain/enums/ReportingStandard';
5
5
  import { ReportTemplateStatus } from '../enums/ReportTemplateStatus';
6
- export interface ReportTemplatePrimitives {
7
- readonly id: string;
8
- readonly version: number;
9
- readonly previousVersionId: string | null;
10
- readonly type: ReportType;
11
- readonly footprintType: CarbonFootprint;
12
- readonly reportingStandard: ReportingStandard;
13
- readonly requiresClientApproval: boolean;
14
- readonly status: ReportTemplateStatus;
15
- readonly sections: ReportSectionPrimitives[];
16
- readonly textBankId: string;
17
- readonly createdBy: string;
18
- readonly createdAt: string;
19
- readonly updatedAt: string;
20
- }
6
+ import { AggregateRootPrimitives } from '../../../../shared/domain/types/AggregateRootPrimitives';
7
+ export type ReportTemplatePrimitives = AggregateRootPrimitives & {
8
+ version: number;
9
+ previousVersionId: string | null;
10
+ type: ReportType;
11
+ footprintType: CarbonFootprint;
12
+ reportingStandard: ReportingStandard;
13
+ requiresClientApproval: boolean;
14
+ status: ReportTemplateStatus;
15
+ sections: ReportSectionPrimitives[];
16
+ textBankId: string;
17
+ createdBy: string;
18
+ createdAt: string;
19
+ updatedAt: string;
20
+ };
21
21
  //# sourceMappingURL=ReportTemplatePrimitives.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReportTemplatePrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/types/ReportTemplatePrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iFAAiF,CAAC;AAClH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;IACxC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}
1
+ {"version":3,"file":"ReportTemplatePrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/types/ReportTemplatePrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iFAAiF,CAAC;AAClH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAElG,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,GAAG;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1,17 +1,21 @@
1
- import { ReportSectionPrimitives } from '../../../shared/domain/types/ReportSectionPrimitives';
2
- export interface ReportTemplateProps {
3
- readonly id: string;
4
- readonly version: number;
5
- readonly previousVersionId: string | null;
6
- readonly type: string;
7
- readonly footprintType: string;
8
- readonly reportingStandard: string;
9
- readonly requiresClientApproval: boolean;
10
- readonly status: string;
11
- readonly sections: ReportSectionPrimitives[];
12
- readonly textBankId: string;
13
- readonly createdBy: string;
14
- readonly createdAt: string;
15
- readonly updatedAt: string;
16
- }
1
+ import { ReportSection } from '../../../shared/domain/value-objects/ReportSection';
2
+ import { ReportType } from '../../../shared/domain/enums/ReportType';
3
+ import { CarbonFootprint } from '../../../../carbon-footprint-configurations/shared/domain/enums/CarbonFootprint';
4
+ import { ReportingStandard } from '../../../../shared/domain/enums/ReportingStandard';
5
+ import { ReportTemplateStatus } from '../enums/ReportTemplateStatus';
6
+ import { AggregateRootProps } from '../../../../shared/domain/types/AggregateRootProps';
7
+ export type ReportTemplateProps = AggregateRootProps & {
8
+ version: number;
9
+ previousVersionId: string | null;
10
+ type: ReportType;
11
+ footprintType: CarbonFootprint;
12
+ reportingStandard: ReportingStandard;
13
+ requiresClientApproval: boolean;
14
+ status: ReportTemplateStatus;
15
+ sections: ReportSection[];
16
+ textBankId: string;
17
+ createdBy: string;
18
+ createdAt: string;
19
+ updatedAt: string;
20
+ };
17
21
  //# sourceMappingURL=ReportTemplateProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReportTemplateProps.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/types/ReportTemplateProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAE/F,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}
1
+ {"version":3,"file":"ReportTemplateProps.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/report-templates/domain/types/ReportTemplateProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iFAAiF,CAAC;AAClH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * AI Execution Record primitives
3
+ * Tracks AI model executions for auditability
4
+ */
5
+ export interface AIExecutionRecordPrimitives {
6
+ readonly executionId: string;
7
+ readonly modelId: string;
8
+ readonly promptVersion: string;
9
+ readonly inputHash: string;
10
+ readonly executedAt: string;
11
+ readonly durationMs: number;
12
+ readonly tokenCount: number;
13
+ }
14
+ //# sourceMappingURL=AIExecutionRecordPrimitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIExecutionRecordPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/shared/domain/types/AIExecutionRecordPrimitives.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Approval Record primitives
3
+ * Represents an approval or rejection of a report
4
+ */
5
+ export interface ApprovalRecordPrimitives {
6
+ readonly approvedBy: string;
7
+ readonly approvedAt: string;
8
+ readonly role: 'INTERNAL' | 'CLIENT';
9
+ readonly comments: string | null;
10
+ readonly decision: 'APPROVED' | 'REJECTED';
11
+ }
12
+ //# sourceMappingURL=ApprovalRecordPrimitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApprovalRecordPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/shared/domain/types/ApprovalRecordPrimitives.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;CAC5C"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Questionnaire Answer primitives
3
+ * Represents a client's answer to a questionnaire question
4
+ */
5
+ export interface QuestionnaireAnswerPrimitives {
6
+ readonly blockId: string;
7
+ readonly answer: string;
8
+ readonly answeredAt: string;
9
+ readonly answeredBy: string;
10
+ }
11
+ //# sourceMappingURL=QuestionnaireAnswerPrimitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuestionnaireAnswerPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/shared/domain/types/QuestionnaireAnswerPrimitives.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Report Period primitives
3
+ * Represents the time period covered by a report
4
+ */
5
+ export interface ReportPeriodPrimitives {
6
+ readonly startDate: string;
7
+ readonly endDate: string;
8
+ }
9
+ //# sourceMappingURL=ReportPeriodPrimitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportPeriodPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/shared/domain/types/ReportPeriodPrimitives.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,16 @@
1
+ import { IAggregateRoot } from '../../../../shared/domain/entities/IAggregateRoot';
2
+ import { TextBankEntryPrimitives } from '../types/TextBankEntryPrimitives';
3
+ export interface ITextBank extends IAggregateRoot {
4
+ getId(): string;
5
+ getTemplateId(): string;
6
+ getVersion(): number;
7
+ getEntries(): TextBankEntryPrimitives[];
8
+ getCreatedAt(): string;
9
+ getUpdatedAt(): string;
10
+ getEntriesByCategory(category: string): TextBankEntryPrimitives[];
11
+ getEntryById(entryId: string): TextBankEntryPrimitives | null;
12
+ hasEntries(): boolean;
13
+ getTotalEntries(): number;
14
+ getCategories(): string[];
15
+ }
16
+ //# sourceMappingURL=ITextBank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITextBank.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/text-banks/domain/entity/ITextBank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,WAAW,SAAU,SAAQ,cAAc;IAE/C,KAAK,IAAI,MAAM,CAAC;IAChB,aAAa,IAAI,MAAM,CAAC;IACxB,UAAU,IAAI,MAAM,CAAC;IACrB,UAAU,IAAI,uBAAuB,EAAE,CAAC;IACxC,YAAY,IAAI,MAAM,CAAC;IACvB,YAAY,IAAI,MAAM,CAAC;IAGvB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,EAAE,CAAC;IAClE,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI,CAAC;IAC9D,UAAU,IAAI,OAAO,CAAC;IACtB,eAAe,IAAI,MAAM,CAAC;IAC1B,aAAa,IAAI,MAAM,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,36 @@
1
+ import { AggregateRoot } from '../../../../shared/domain/entities/AggregateRoot';
2
+ import { TextBankProps } from '../types/TextBankProps';
3
+ import { TextBankPrimitives } from '../types/TextBankPrimitives';
4
+ import { ITextBank } from './ITextBank';
5
+ import { TextBankEntryPrimitives } from '../types/TextBankEntryPrimitives';
6
+ import { TextBankEntryProps } from '../types/TextBankEntryProps';
7
+ export declare class TextBank extends AggregateRoot<TextBankPrimitives> implements ITextBank {
8
+ #private;
9
+ private constructor();
10
+ static create(props: Omit<TextBankProps, 'id' | 'createdAt' | 'updatedAt'>): TextBank;
11
+ static fromPrimitives(primitives: TextBankPrimitives): TextBank;
12
+ get toPrimitives(): TextBankPrimitives;
13
+ toProps(): TextBankProps;
14
+ getId(): string;
15
+ getTemplateId(): string;
16
+ getVersion(): number;
17
+ getEntries(): TextBankEntryPrimitives[];
18
+ getCreatedAt(): string;
19
+ getUpdatedAt(): string;
20
+ getEntriesByCategory(category: string): TextBankEntryPrimitives[];
21
+ getEntryById(entryId: string): TextBankEntryPrimitives | null;
22
+ getEntriesBySubcategory(category: string, subcategory: string): TextBankEntryPrimitives[];
23
+ getEntriesByTags(tags: string[]): TextBankEntryPrimitives[];
24
+ getEntriesByLanguage(language: string): TextBankEntryPrimitives[];
25
+ searchEntries(query: string): TextBankEntryPrimitives[];
26
+ hasEntries(): boolean;
27
+ getTotalEntries(): number;
28
+ getCategories(): string[];
29
+ getSubcategories(category: string): string[];
30
+ getAllTags(): string[];
31
+ getLanguages(): string[];
32
+ addEntry(entry: TextBankEntryProps): void;
33
+ removeEntry(entryId: string): boolean;
34
+ updateEntry(entryId: string, updatedEntry: Partial<TextBankEntryProps>): boolean;
35
+ }
36
+ //# sourceMappingURL=TextBank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextBank.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/text-banks/domain/entity/TextBank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,qBAAa,QAAS,SAAQ,aAAa,CAAC,kBAAkB,CAAE,YAAW,SAAS;;IAWlF,OAAO;WAcgB,MAAM,CAC3B,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,GAC3D,QAAQ;WAcY,cAAc,CAAC,UAAU,EAAE,kBAAkB,GAAG,QAAQ;IAa/E,IAAoB,YAAY,IAAI,kBAAkB,CASrD;IAEM,OAAO,IAAI,aAAa;IAYxB,KAAK,IAAI,MAAM;IAIf,aAAa,IAAI,MAAM;IAIvB,UAAU,IAAI,MAAM;IAIpB,UAAU,IAAI,uBAAuB,EAAE;IAIvC,YAAY,IAAI,MAAM;IAItB,YAAY,IAAI,MAAM;IAKtB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,EAAE;IAIjE,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI;IAK7D,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,uBAAuB,EAAE;IAMzF,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,uBAAuB,EAAE;IAI3D,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,EAAE;IAIjE,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,uBAAuB,EAAE;IAWvD,UAAU,IAAI,OAAO;IAIrB,eAAe,IAAI,MAAM;IAIzB,aAAa,IAAI,MAAM,EAAE;IAKzB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAS5C,UAAU,IAAI,MAAM,EAAE;IAKtB,YAAY,IAAI,MAAM,EAAE;IAKxB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAKzC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAWrC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO;CAcxF"}
@@ -0,0 +1,52 @@
1
+ import { Nullable } from '../../../../shared/domain/types/Nullable';
2
+ import { TextBank } from '../entity/TextBank';
3
+ import { TextBankId } from '../value-objects/TextBankId';
4
+ /**
5
+ * Repository interface for TextBank aggregate following DDD principles.
6
+ * Manages persistence operations for text banks containing curated content.
7
+ */
8
+ export interface ITextBankRepository {
9
+ /**
10
+ * Persists a text bank (create or update)
11
+ * @param textBank - The text bank aggregate to save
12
+ * @returns Promise that resolves when the operation completes
13
+ */
14
+ save(textBank: TextBank): Promise<void>;
15
+ /**
16
+ * Finds a text bank by its ID
17
+ * @param id - The text bank ID
18
+ * @returns Promise resolving to the text bank or null if not found
19
+ */
20
+ findById(id: TextBankId): Promise<Nullable<TextBank>>;
21
+ /**
22
+ * Finds a text bank by template ID and version
23
+ * @param templateId - The report template ID
24
+ * @param version - The text bank version
25
+ * @returns Promise resolving to the text bank or null if not found
26
+ */
27
+ findByTemplateIdAndVersion(templateId: string, version: number): Promise<Nullable<TextBank>>;
28
+ /**
29
+ * Finds all text banks for a specific template
30
+ * @param templateId - The report template ID to filter by
31
+ * @returns Promise resolving to an array of matching text banks, sorted by version
32
+ */
33
+ findAllByTemplateId(templateId: string): Promise<TextBank[]>;
34
+ /**
35
+ * Finds the latest text bank for a specific template
36
+ * @param templateId - The report template ID
37
+ * @returns Promise resolving to the latest version or null if not found
38
+ */
39
+ findLatestByTemplateId(templateId: string): Promise<Nullable<TextBank>>;
40
+ /**
41
+ * Finds all text banks in the system
42
+ * @returns Promise resolving to an array of all text banks
43
+ */
44
+ findAll(): Promise<TextBank[]>;
45
+ /**
46
+ * Deletes a text bank by its ID
47
+ * @param id - The text bank ID to delete
48
+ * @returns Promise that resolves when the operation completes
49
+ */
50
+ deleteById(id: TextBankId): Promise<void>;
51
+ }
52
+ //# sourceMappingURL=ITextBankRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITextBankRepository.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/text-banks/domain/repository/ITextBankRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEtD;;;;;OAKG;IACH,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE7F;;;;OAIG;IACH,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE7D;;;;OAIG;IACH,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAExE;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * TextBankEntryPrimitives - Primitives representation of a text bank entry
3
+ *
4
+ * A TextBankEntry represents a curated piece of content stored in a text bank.
5
+ * Entries are categorized and can be selected by AI during report generation.
6
+ */
7
+ export type TextBankEntryPrimitives = {
8
+ /**
9
+ * Unique identifier for this entry
10
+ */
11
+ id: string;
12
+ /**
13
+ * Category used for filtering entries (e.g., 'executive-summary', 'methodology', 'conclusions')
14
+ */
15
+ category: string;
16
+ /**
17
+ * Subcategory for finer-grained filtering (optional)
18
+ */
19
+ subcategory?: string;
20
+ /**
21
+ * The curated text content
22
+ */
23
+ content: string;
24
+ /**
25
+ * Language code (ISO 639-1) - e.g., 'en', 'es'
26
+ */
27
+ language: string;
28
+ /**
29
+ * Tags for additional categorization and search
30
+ */
31
+ tags: string[];
32
+ /**
33
+ * Additional metadata for AI selection and context
34
+ */
35
+ metadata?: Record<string, unknown>;
36
+ /**
37
+ * Creation timestamp (ISO 8601 date string)
38
+ */
39
+ createdAt: string;
40
+ /**
41
+ * Last update timestamp (ISO 8601 date string)
42
+ */
43
+ updatedAt: string;
44
+ };
45
+ //# sourceMappingURL=TextBankEntryPrimitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextBankEntryPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/text-banks/domain/types/TextBankEntryPrimitives.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * TextBankEntryProps - Props representation of a text bank entry
3
+ *
4
+ * For internal use in aggregates. Currently uses primitives.
5
+ * TODO: Consider creating Value Objects for strongly-typed properties if needed
6
+ * (e.g., Language VO, Category VO, etc.)
7
+ */
8
+ export type TextBankEntryProps = {
9
+ /**
10
+ * Unique identifier for this entry
11
+ */
12
+ id: string;
13
+ /**
14
+ * Category used for filtering entries (e.g., 'executive-summary', 'methodology', 'conclusions')
15
+ */
16
+ category: string;
17
+ /**
18
+ * Subcategory for finer-grained filtering (optional)
19
+ */
20
+ subcategory?: string;
21
+ /**
22
+ * The curated text content
23
+ */
24
+ content: string;
25
+ /**
26
+ * Language code (ISO 639-1) - e.g., 'en', 'es'
27
+ */
28
+ language: string;
29
+ /**
30
+ * Tags for additional categorization and search
31
+ */
32
+ tags: string[];
33
+ /**
34
+ * Additional metadata for AI selection and context
35
+ */
36
+ metadata?: Record<string, unknown>;
37
+ /**
38
+ * Creation timestamp (ISO 8601 date string)
39
+ */
40
+ createdAt: string;
41
+ /**
42
+ * Last update timestamp (ISO 8601 date string)
43
+ */
44
+ updatedAt: string;
45
+ };
46
+ //# sourceMappingURL=TextBankEntryProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextBankEntryProps.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/text-banks/domain/types/TextBankEntryProps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { AggregateRootPrimitives } from '../../../../shared/domain/types/AggregateRootPrimitives';
2
+ import { TextBankEntryPrimitives } from './TextBankEntryPrimitives';
3
+ /**
4
+ * TextBankPrimitives - Primitives representation of TextBank aggregate
5
+ *
6
+ * A TextBank is a collection of curated text entries associated with a ReportTemplate.
7
+ * It provides pre-approved content that can be used during AI-assisted report generation.
8
+ *
9
+ * Uses primitives for serialization/deserialization.
10
+ */
11
+ export type TextBankPrimitives = AggregateRootPrimitives & {
12
+ /**
13
+ * Reference to the associated ReportTemplate
14
+ */
15
+ templateId: string;
16
+ /**
17
+ * Version number of this text bank (incremented on updates)
18
+ */
19
+ version: number;
20
+ /**
21
+ * Collection of curated text entries
22
+ */
23
+ entries: TextBankEntryPrimitives[];
24
+ /**
25
+ * Creation timestamp (ISO 8601 date string)
26
+ */
27
+ createdAt: string;
28
+ /**
29
+ * Last update timestamp (ISO 8601 date string)
30
+ */
31
+ updatedAt: string;
32
+ };
33
+ //# sourceMappingURL=TextBankPrimitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextBankPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/reporting/text-banks/domain/types/TextBankPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG;IACzD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,uBAAuB,EAAE,CAAC;IAEnC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}