@woltz/rich-domain 1.2.4 → 1.3.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 (94) hide show
  1. package/dist/aggregate-changes.d.ts +56 -14
  2. package/dist/aggregate-changes.d.ts.map +1 -1
  3. package/dist/aggregate-changes.js +103 -23
  4. package/dist/aggregate-changes.js.map +1 -1
  5. package/dist/base-entity.d.ts +1 -1
  6. package/dist/base-entity.d.ts.map +1 -1
  7. package/dist/base-entity.js +28 -13
  8. package/dist/base-entity.js.map +1 -1
  9. package/dist/change-tracker.d.ts +2 -1
  10. package/dist/change-tracker.d.ts.map +1 -1
  11. package/dist/change-tracker.js +61 -35
  12. package/dist/change-tracker.js.map +1 -1
  13. package/dist/criteria.d.ts +7 -15
  14. package/dist/criteria.d.ts.map +1 -1
  15. package/dist/criteria.js +105 -81
  16. package/dist/criteria.js.map +1 -1
  17. package/dist/domain-event-bus.js +4 -4
  18. package/dist/domain-event-bus.js.map +1 -1
  19. package/dist/domain-event.js +3 -0
  20. package/dist/domain-event.js.map +1 -1
  21. package/dist/entity-changes.js +1 -0
  22. package/dist/entity-changes.js.map +1 -1
  23. package/dist/entity-schema-registry.d.ts +137 -3
  24. package/dist/entity-schema-registry.d.ts.map +1 -1
  25. package/dist/entity-schema-registry.js +160 -7
  26. package/dist/entity-schema-registry.js.map +1 -1
  27. package/dist/exceptions.js +26 -1
  28. package/dist/exceptions.js.map +1 -1
  29. package/dist/id.js +2 -0
  30. package/dist/id.js.map +1 -1
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/paginated-result.d.ts +4 -4
  34. package/dist/paginated-result.d.ts.map +1 -1
  35. package/dist/paginated-result.js +14 -19
  36. package/dist/paginated-result.js.map +1 -1
  37. package/dist/repository/unit-of-work.js +3 -7
  38. package/dist/repository/unit-of-work.js.map +1 -1
  39. package/dist/types/change-tracker.d.ts +30 -0
  40. package/dist/types/change-tracker.d.ts.map +1 -1
  41. package/dist/types/criteria.d.ts +1 -4
  42. package/dist/types/criteria.d.ts.map +1 -1
  43. package/dist/types/domain.d.ts +2 -1
  44. package/dist/types/domain.d.ts.map +1 -1
  45. package/dist/types/utils.d.ts +2 -2
  46. package/dist/utils/helpers.d.ts +1 -0
  47. package/dist/utils/helpers.d.ts.map +1 -1
  48. package/dist/utils/helpers.js +23 -0
  49. package/dist/utils/helpers.js.map +1 -1
  50. package/dist/validation-error.d.ts +15 -1
  51. package/dist/validation-error.d.ts.map +1 -1
  52. package/dist/validation-error.js +46 -3
  53. package/dist/validation-error.js.map +1 -1
  54. package/dist/value-object.d.ts +1 -1
  55. package/dist/value-object.d.ts.map +1 -1
  56. package/dist/value-object.js +30 -2
  57. package/dist/value-object.js.map +1 -1
  58. package/package.json +17 -3
  59. package/src/aggregate-changes.ts +133 -24
  60. package/src/base-entity.ts +22 -11
  61. package/src/change-tracker.ts +113 -54
  62. package/src/criteria.ts +151 -109
  63. package/src/entity-schema-registry.ts +256 -6
  64. package/src/index.ts +1 -1
  65. package/src/paginated-result.ts +21 -29
  66. package/src/types/change-tracker.ts +31 -0
  67. package/src/types/criteria.ts +1 -4
  68. package/src/types/domain.ts +2 -1
  69. package/src/types/utils.ts +2 -2
  70. package/src/utils/helpers.ts +28 -0
  71. package/src/validation-error.ts +54 -4
  72. package/src/value-object.ts +6 -1
  73. package/.versionrc.json +0 -21
  74. package/CHANGELOG.md +0 -163
  75. package/tests/aggregate-changes.test.ts +0 -284
  76. package/tests/criteria.test.ts +0 -716
  77. package/tests/depth/deep-tracking.test.ts +0 -554
  78. package/tests/domain-events.test.ts +0 -431
  79. package/tests/entity-equality.test.ts +0 -464
  80. package/tests/entity-schema-registry.test.ts +0 -382
  81. package/tests/entity-validation.test.ts +0 -252
  82. package/tests/history-tracker.spec.ts +0 -439
  83. package/tests/id.test.ts +0 -338
  84. package/tests/load-test/data.json +0 -347211
  85. package/tests/load-test/entities.ts +0 -97
  86. package/tests/load-test/generate-data.ts +0 -81
  87. package/tests/load-test/lead-to-domain.mapper.ts +0 -24
  88. package/tests/load-test/load.test.ts +0 -38
  89. package/tests/repository.test.ts +0 -635
  90. package/tests/to-json.test.ts +0 -99
  91. package/tests/utils.ts +0 -290
  92. package/tests/value-object-validation.test.ts +0 -219
  93. package/tests/value-objects.test.ts +0 -80
  94. package/tsconfig.json +0 -9
@@ -4,10 +4,10 @@ import type { Pagination, PaginationMeta, Filter } from "./types";
4
4
 
5
5
  /**
6
6
  * Infers the JSON result type from T
7
- * - If T has toJson(), returns its return type
7
+ * - If T has toJSON(), returns its return type
8
8
  * - Otherwise returns T as-is
9
9
  */
10
- type InferJsonResult<T> = T extends { toJson(): infer R } ? R : T;
10
+ type InferJsonResult<T> = T extends { toJSON(): infer R } ? R : T;
11
11
 
12
12
  /**
13
13
  * Type for the serialized result of PaginatedResult.toJSON()
@@ -58,18 +58,6 @@ export class PaginatedResult<T> {
58
58
  let result = [...items];
59
59
  let total = result.length;
60
60
 
61
- const search = criteria.getSearch();
62
- if (search) {
63
- result = result.filter((item) => {
64
- return search.fields.some((field) => {
65
- return String(getNestedValue(item, field))
66
- .toLowerCase()
67
- .includes(search.value.trim().toLowerCase());
68
- });
69
- });
70
- total = result.length;
71
- }
72
-
73
61
  for (const filter of criteria.getFilters()) {
74
62
  result = result.filter((item) => applyFilter(item, filter));
75
63
  total = result.length;
@@ -89,25 +77,29 @@ export class PaginatedResult<T> {
89
77
  }
90
78
 
91
79
  const pagination = criteria.getPagination();
92
- if (pagination && !criteria.hasSearch()) {
93
- result = result.slice(
94
- pagination.offset,
95
- pagination.offset + pagination.limit
96
- );
97
- return PaginatedResult.create(result, pagination, total);
80
+ result = result.slice(
81
+ pagination.offset,
82
+ pagination.offset + pagination.limit
83
+ );
84
+
85
+ const search = criteria.getSearch();
86
+
87
+ if (search) {
88
+ result = result.filter((item) => {
89
+ const values = Object.values(item as Record<string, unknown>);
90
+ return values.some((val) =>
91
+ String(val).toLowerCase().includes(search.toLowerCase())
92
+ );
93
+ });
98
94
  }
99
95
 
100
- return PaginatedResult.create(
101
- result,
102
- { page: 1, limit: result.length, offset: 0 },
103
- total
104
- );
96
+ return PaginatedResult.create(result, pagination, total);
105
97
  }
106
98
 
107
99
  /**
108
100
  * Converts the result to JSON, deeply serializing all entities/aggregates/value objects
109
- * - Entities/Aggregates → calls toJson() recursively
110
- * - Value Objects → calls toJson()
101
+ * - Entities/Aggregates → calls toJSON() recursively
102
+ * - Value Objects → calls toJSON()
111
103
  * - Id → converts to string
112
104
  * - Arrays → maps recursively
113
105
  * - Plain objects → serializes properties recursively
@@ -134,8 +126,8 @@ export class PaginatedResult<T> {
134
126
  return obj.map((item) => this.deepSerialize(item));
135
127
  }
136
128
 
137
- if (obj && typeof obj.toJson === "function") {
138
- return obj.toJson();
129
+ if (obj && typeof obj.toJSON === "function") {
130
+ return obj.toJSON();
139
131
  }
140
132
 
141
133
  if (typeof obj === "object") {
@@ -9,6 +9,8 @@ export interface BaseOperation {
9
9
  entity: string;
10
10
  /** Depth in the aggregate tree (0 = root, 1 = direct children, etc.) */
11
11
  depth: number;
12
+ /** Name of the relation field in the parent entity (e.g., 'tags', 'comments') */
13
+ relationField?: string;
12
14
  }
13
15
 
14
16
  /**
@@ -46,6 +48,10 @@ export interface DeleteOperation<T = any> extends BaseOperation {
46
48
  id: string;
47
49
  /** Entity data (for reference) */
48
50
  data: T;
51
+ /** Parent entity name */
52
+ parentEntity?: string;
53
+ /** Parent ID */
54
+ parentId?: string;
49
55
  }
50
56
 
51
57
  /**
@@ -64,6 +70,10 @@ export interface BatchCreateItem<T = any> {
64
70
  data: T;
65
71
  /** Parent ID (for FK) */
66
72
  parentId?: string;
73
+ /** Parent entity name */
74
+ parentEntity?: string;
75
+ /** Relation field name */
76
+ relationField?: string;
67
77
  }
68
78
 
69
79
  /**
@@ -76,6 +86,16 @@ export interface BatchUpdateItem {
76
86
  changedFields: Record<string, any>;
77
87
  }
78
88
 
89
+ /**
90
+ * Item for batch delete.
91
+ */
92
+ export interface BatchDeleteItem {
93
+ /** Entity ID */
94
+ id: string;
95
+ /** Relation field name */
96
+ relationField?: string;
97
+ }
98
+
79
99
  /**
80
100
  * Grouped and ordered operations for batch execution.
81
101
  */
@@ -87,6 +107,13 @@ export interface BatchOperations {
87
107
  entity: string;
88
108
  depth: number;
89
109
  ids: string[];
110
+ parentId?: string;
111
+ /** Relation field name (for determining owned vs reference) */
112
+ relationField?: string;
113
+ /** Parent entity name */
114
+ parentEntity?: string;
115
+ /** Individual items with their relation fields (when mixed) */
116
+ items?: BatchDeleteItem[];
90
117
  }>;
91
118
 
92
119
  /**
@@ -96,6 +123,10 @@ export interface BatchOperations {
96
123
  entity: string;
97
124
  depth: number;
98
125
  items: BatchCreateItem[];
126
+ /** Relation field name (for determining owned vs reference) */
127
+ relationField?: string;
128
+ /** Parent entity name */
129
+ parentEntity?: string;
99
130
  }>;
100
131
 
101
132
  /**
@@ -129,10 +129,7 @@ export interface Pagination {
129
129
  offset: number;
130
130
  }
131
131
 
132
- export interface Search<T> {
133
- fields: FieldPath<T>[];
134
- value: string;
135
- }
132
+ export type Search = string;
136
133
 
137
134
  export interface PaginationMeta {
138
135
  page: number;
@@ -14,12 +14,13 @@ export type EntityValidation<T> = DomainValidation<T>;
14
14
  export type VOValidation<T> = DomainValidation<T>;
15
15
 
16
16
  export interface VOHooks<T, E> {
17
- onBeforeUpdate?: (entity: E, snapshot: T) => boolean;
17
+ onBeforeCreate?: (props: T) => void;
18
18
  onCreate?: (entity: E) => void;
19
19
  rules?: (entity: E) => void;
20
20
  }
21
21
 
22
22
  export interface EntityHooks<T extends BaseProps, E> {
23
+ onBeforeCreate?: (props: T) => void;
23
24
  onBeforeUpdate?: (entity: E, snapshot: T) => boolean;
24
25
  onCreate?: (entity: E) => void;
25
26
  rules?: (entity: E) => void;
@@ -3,10 +3,10 @@ import { Id } from "../id";
3
3
  export type DeepJsonResult<T> = {
4
4
  [K in keyof T]: T[K] extends Id
5
5
  ? string
6
- : T[K] extends { toJson(): infer U }
6
+ : T[K] extends { toJSON(): infer U }
7
7
  ? U
8
8
  : T[K] extends Array<infer U>
9
- ? U extends { toJson(): infer V }
9
+ ? U extends { toJSON(): infer V }
10
10
  ? V[]
11
11
  : U extends Id
12
12
  ? string[]
@@ -4,3 +4,31 @@ export function parseQueryValue(value: string): any {
4
4
  if (!isNaN(Date.parse(value))) return new Date(value); // Date
5
5
  return value; // string
6
6
  }
7
+
8
+ export function levenshteinDistance(a: string, b: string): number {
9
+ const matrix: number[][] = [];
10
+
11
+ for (let i = 0; i <= b.length; i++) {
12
+ matrix[i] = [i];
13
+ }
14
+
15
+ for (let j = 0; j <= a.length; j++) {
16
+ matrix[0][j] = j;
17
+ }
18
+
19
+ for (let i = 1; i <= b.length; i++) {
20
+ for (let j = 1; j <= a.length; j++) {
21
+ if (b.charAt(i - 1) === a.charAt(j - 1)) {
22
+ matrix[i][j] = matrix[i - 1][j - 1];
23
+ } else {
24
+ matrix[i][j] = Math.min(
25
+ matrix[i - 1][j - 1] + 1, // substitution
26
+ matrix[i][j - 1] + 1, // insertion
27
+ matrix[i - 1][j] + 1 // deletion
28
+ );
29
+ }
30
+ }
31
+ }
32
+
33
+ return matrix[b.length][a.length];
34
+ }
@@ -6,19 +6,41 @@ export interface ValidationIssue {
6
6
  export class ValidationError extends Error {
7
7
  public readonly issues: ValidationIssue[];
8
8
  public readonly __isValidationError = true;
9
+ public readonly entityName?: string;
9
10
 
10
- constructor(issues: ValidationIssue[], message?: string) {
11
- const errorMessage =
12
- message || `Validation failed: ${issues.map(i => i.message).join(', ')}`;
11
+ constructor(issues: ValidationIssue[], options?: { message?: string; entityName?: string }) {
12
+ const errorMessage = options?.message || ValidationError.formatMessage(issues, options?.entityName);
13
13
  super(errorMessage);
14
14
  this.name = 'ValidationError';
15
15
  this.issues = issues;
16
+ this.entityName = options?.entityName;
16
17
 
17
18
  if (Error.captureStackTrace) {
18
19
  Error.captureStackTrace(this, ValidationError);
19
20
  }
20
21
  }
21
22
 
23
+ private static formatMessage(issues: ValidationIssue[], entityName?: string): string {
24
+ const entityPrefix = entityName ? `[${entityName}] ` : '';
25
+
26
+ if (issues.length === 0) {
27
+ return `${entityPrefix}Validation failed`;
28
+ }
29
+
30
+ if (issues.length === 1) {
31
+ const issue = issues[0];
32
+ const pathStr = issue.path.length > 0 ? ` at "${issue.path.join('.')}"` : '';
33
+ return `${entityPrefix}Validation failed${pathStr}: ${issue.message}`;
34
+ }
35
+
36
+ const errorLines = issues.map((issue, index) => {
37
+ const pathStr = issue.path.length > 0 ? ` at "${issue.path.join('.')}"` : '';
38
+ return ` ${index + 1}. ${issue.message}${pathStr}`;
39
+ }).join('\n');
40
+
41
+ return `${entityPrefix}Validation failed with ${issues.length} error(s):\n${errorLines}`;
42
+ }
43
+
22
44
  /**
23
45
  * Check if an error is a ValidationError (works across module boundaries)
24
46
  */
@@ -58,13 +80,41 @@ export class ValidationError extends Error {
58
80
  /**
59
81
  * Convert to a plain object for serialization
60
82
  */
61
- toJSON(): { name: string; message: string; issues: ValidationIssue[] } {
83
+ toJSON(): { name: string; message: string; issues: ValidationIssue[]; entityName?: string } {
62
84
  return {
63
85
  name: this.name,
64
86
  message: this.message,
65
87
  issues: this.issues,
88
+ entityName: this.entityName,
66
89
  };
67
90
  }
91
+
92
+ /**
93
+ * Get a formatted string with all validation errors
94
+ */
95
+ getFormattedErrors(): string {
96
+ return this.issues.map((issue) => {
97
+ const pathStr = issue.path.length > 0 ? ` [${issue.path.join('.')}]` : '';
98
+ return `${pathStr} ${issue.message}`;
99
+ }).join('\n');
100
+ }
101
+
102
+ /**
103
+ * Get a summary of the error for logging
104
+ */
105
+ getSummary(): string {
106
+ const entityPrefix = this.entityName ? `[${this.entityName}] ` : '';
107
+ const paths = this.issues
108
+ .filter(i => i.path.length > 0)
109
+ .map(i => i.path.join('.'));
110
+
111
+ if (paths.length === 0) {
112
+ return `${entityPrefix}Validation failed with ${this.issues.length} error(s)`;
113
+ }
114
+
115
+ const uniquePaths = Array.from(new Set(paths));
116
+ return `${entityPrefix}Validation failed on: ${uniquePaths.join(', ')} (${this.issues.length} error(s))`;
117
+ }
68
118
  }
69
119
 
70
120
  /**
@@ -24,6 +24,7 @@ export type IdentityKeyDefinition<T> = (keyof T)[] | keyof T;
24
24
  export abstract class ValueObject<T> {
25
25
  protected readonly props!: T;
26
26
  private validationConfig: Required<ValidationConfig>;
27
+ // @ts-expect-error - This is a private property
27
28
  private domainHooks?: VOHooks<T, any>;
28
29
  private domainSchema?: StandardSchema<T>;
29
30
  private domainEvents: IDomainEvent[] = [];
@@ -57,6 +58,10 @@ export abstract class ValueObject<T> {
57
58
  );
58
59
  const hooks = getStaticProperty<VOHooks<T, any>>(this, "hooks");
59
60
 
61
+ if (hooks?.onBeforeCreate) {
62
+ hooks.onBeforeCreate(props as T);
63
+ }
64
+
60
65
  this.domainHooks = hooks;
61
66
 
62
67
  if (validation?.schema) {
@@ -229,7 +234,7 @@ export abstract class ValueObject<T> {
229
234
  return this.domainEvents.length > 0;
230
235
  }
231
236
 
232
- toJson(): T {
237
+ toJSON(): T {
233
238
  return { ...this.props };
234
239
  }
235
240
 
package/.versionrc.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "types": [
3
- { "type": "feat", "section": "Features" },
4
- { "type": "fix", "section": "Bug Fixes" },
5
- { "type": "chore", "hidden": false, "section": "Chores" },
6
- { "type": "docs", "hidden": false, "section": "Documentation" },
7
- { "type": "style", "hidden": true },
8
- { "type": "refactor", "section": "Refactoring" },
9
- { "type": "perf", "section": "Performance Improvements" },
10
- { "type": "test", "hidden": false, "section": "Tests" }
11
- ],
12
- "commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}",
13
- "compareUrlFormat": "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
14
- "issueUrlFormat": "{{host}}/{{owner}}/{{repository}}/issues/{{id}}",
15
- "userUrlFormat": "{{host}}/{{user}}",
16
- "releaseCommitMessageFormat": "chore(release): {{currentTag}}",
17
- "issuePrefixes": ["#"],
18
- "skip": {
19
- "changelog": false
20
- }
21
- }
package/CHANGELOG.md DELETED
@@ -1,163 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ### [1.2.4](https://github.com/tarcisioandrade/rich-domain/compare/v1.2.2...v1.2.4) (2025-11-30)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * critic bug ([474a8d9](https://github.com/tarcisioandrade/rich-domain/commit/474a8d90fc9fb2810dc37018c86dce234d2ac08f))
11
- * improve deep cloning logic in BaseEntity to handle structuredClone fallback ([78f8fbf](https://github.com/tarcisioandrade/rich-domain/commit/78f8fbf5846650a7e3783aa55023d94db65572f6))
12
-
13
-
14
- ### Tests
15
-
16
- * add comprehensive deep tracking tests for nested entity structures ([66b0c33](https://github.com/tarcisioandrade/rich-domain/commit/66b0c3399e825b24925a7ae3056e57a18ec6d93c))
17
-
18
-
19
- ### Refactoring
20
-
21
- * change visibility of prisma client in PrismaRepository constructor ([1cf83ed](https://github.com/tarcisioandrade/rich-domain/commit/1cf83ed97585fddd6a25125cedc1bcf72b289713))
22
-
23
- ### [1.2.3](https://github.com/tarcisioandrade/rich-domain/compare/v1.2.2...v1.2.3) (2025-11-30)
24
-
25
-
26
- ### Bug Fixes
27
-
28
- * critic bug ([474a8d9](https://github.com/tarcisioandrade/rich-domain/commit/474a8d90fc9fb2810dc37018c86dce234d2ac08f))
29
- * improve deep cloning logic in BaseEntity to handle structuredClone fallback ([78f8fbf](https://github.com/tarcisioandrade/rich-domain/commit/78f8fbf5846650a7e3783aa55023d94db65572f6))
30
-
31
-
32
- ### Tests
33
-
34
- * add comprehensive deep tracking tests for nested entity structures ([66b0c33](https://github.com/tarcisioandrade/rich-domain/commit/66b0c3399e825b24925a7ae3056e57a18ec6d93c))
35
-
36
- ### [1.2.2](https://github.com/tarcisioandrade/rich-domain/compare/v0.3.0...v1.2.2) (2025-11-30)
37
-
38
-
39
- ### Features
40
-
41
- * filter component with criteria ([a6e5a66](https://github.com/tarcisioandrade/rich-domain/commit/a6e5a664e7b175f8156832b2d42821f73efec522))
42
-
43
-
44
- ### Bug Fixes
45
-
46
- * incorrect verification in criteria operator validation ([8b4da16](https://github.com/tarcisioandrade/rich-domain/commit/8b4da16ded67a55afe64adbe60d52359cd168a17))
47
-
48
-
49
- ### Chores
50
-
51
- * update dependencies and refactor mappers to use PrismaToPersistence ([5281716](https://github.com/tarcisioandrade/rich-domain/commit/52817161667ce473ffe2f7991d55c03190d097c0))
52
-
53
-
54
- ### Refactoring
55
-
56
- * enhance criteria validation by adding field value sanitization ([9991a6b](https://github.com/tarcisioandrade/rich-domain/commit/9991a6b54dbfa8b5d2505ed17897b76f6b794a33))
57
- * improve filter component logic and UI interactions for adding filters ([3dd8d9f](https://github.com/tarcisioandrade/rich-domain/commit/3dd8d9fb8934ca15357ad62485f74c541c01a680))
58
- * migrate filter types to filter-utils for improved organization and clarity ([eeb2af4](https://github.com/tarcisioandrade/rich-domain/commit/eeb2af4f563ff7f8dc3eb1836b22392bc229f3af))
59
- * update FilterDateValue component to handle string dates and improve date handling logic ([6cb0b42](https://github.com/tarcisioandrade/rich-domain/commit/6cb0b4245ce9394389ee208c16035bc49e4aa912))
60
-
61
- ### [1.2.1](https://github.com/tarcisioandrade/rich-domain/compare/v1.2.0...v1.2.1) (2025-11-29)
62
-
63
-
64
- ### Features
65
-
66
- * implement custom UUID generation in crypto module ([4fc732a](https://github.com/tarcisioandrade/rich-domain/commit/4fc732a00237a9d63e320555acf4a8a14c941f13))
67
- * introduce TypedOrder and enhance Criteria to support nested object field paths ([9857624](https://github.com/tarcisioandrade/rich-domain/commit/9857624608eda1320ec813b165e9183f1e28a0d1))
68
- * new history-tracker structure ([aaea6d4](https://github.com/tarcisioandrade/rich-domain/commit/aaea6d4c8aed575f50917cba41936d1b1560ed3d))
69
- * update Id constructor to handle optional isNew parameter ([0aae58b](https://github.com/tarcisioandrade/rich-domain/commit/0aae58b02da69e0cb7421663335ac305ade5afa7))
70
-
71
-
72
- ### Bug Fixes
73
-
74
- * aggregate-changes type inference ([aa62138](https://github.com/tarcisioandrade/rich-domain/commit/aa62138b31cdedb63c0e1be8a19271f4ada2e71c))
75
- * history tracker not tracking when nested created ([2900e20](https://github.com/tarcisioandrade/rich-domain/commit/2900e20c18da7aa0ee960c9e5d0f5e2524e3d6f3))
76
- * uow in persistence fastify example ([fcef611](https://github.com/tarcisioandrade/rich-domain/commit/fcef61103f160c0b1adbee9cbce821ce047189eb))
77
-
78
-
79
- ### Refactoring
80
-
81
- * change prisma example to new architecture ([92dc179](https://github.com/tarcisioandrade/rich-domain/commit/92dc1798ee5a64439d6633ab5b0cc77b42265ed6))
82
- * improve deepClone method for better object handling and error management ([52ae893](https://github.com/tarcisioandrade/rich-domain/commit/52ae8930d112ba018f7944f69837edea82d45309))
83
- * prisma example unit of work with async local storage ([ca6fc16](https://github.com/tarcisioandrade/rich-domain/commit/ca6fc1663ca251dac020939080b126f3984b0eae))
84
- * remove unnosed code from ancient architecture ([19a41b1](https://github.com/tarcisioandrade/rich-domain/commit/19a41b121b4adaaea5525da20b068f43cc674db8))
85
- * update repository methods to use 'save' consistently across use cases ([aab323b](https://github.com/tarcisioandrade/rich-domain/commit/aab323be2fff86246dc0c1a14cb7ba56bf11efa7))
86
- * update repository methods to use 'save' instead of 'create' and 'update' ([6766970](https://github.com/tarcisioandrade/rich-domain/commit/6766970019781215019b492963e020ef4babcd89))
87
-
88
-
89
- ### Tests
90
-
91
- * add load test ([9bd07fb](https://github.com/tarcisioandrade/rich-domain/commit/9bd07fb019e2cc0eef3f0573af8f4dad1d8b385f))
92
- * new history-tracker structure ([d31ad0b](https://github.com/tarcisioandrade/rich-domain/commit/d31ad0b109bfa5e5ff62743d70dd51bb64107f10))
93
-
94
- ## [1.2.0](https://github.com/tarcisioandrade/rich-domain/compare/v1.1.0...v1.2.0) (2025-11-23)
95
-
96
-
97
- ### Features
98
-
99
- * add getFilterByField and getSortByField methods to useCriteria hook ([8db041a](https://github.com/tarcisioandrade/rich-domain/commit/8db041a8fbe359ec6fe3ff70e22ac87a6c221686))
100
- * add options parameter to addFilter method for enhanced filtering capabilities ([c43c164](https://github.com/tarcisioandrade/rich-domain/commit/c43c164f56831b9f0b06f2e5981ba3f540cf3378))
101
- * add quantifier support to Criteria class for enhanced filtering options ([322adf3](https://github.com/tarcisioandrade/rich-domain/commit/322adf36dfedcdc21ae6fc85c3577e1fb2835019))
102
- * criteria adapter implementation ([f387f0b](https://github.com/tarcisioandrade/rich-domain/commit/f387f0bcd601a69da74d5fff33b9d9872e049179))
103
- * enhance criteria operators with new types and validation functions ([8d30c14](https://github.com/tarcisioandrade/rich-domain/commit/8d30c1448e3d25c790d667b43d17546a441e710d))
104
-
105
-
106
- ### Bug Fixes
107
-
108
- * FieldPath infer type to array methods ([844a56e](https://github.com/tarcisioandrade/rich-domain/commit/844a56ef2cdc65fac0cb228c6936808a92ffa440))
109
- * search filter not reset page ([c8c9d8b](https://github.com/tarcisioandrade/rich-domain/commit/c8c9d8b1fecc1ce8c568f43710c8748ad9ad1f1e))
110
- * types in react-with-react-query ([6eeeb74](https://github.com/tarcisioandrade/rich-domain/commit/6eeeb74715bef50d3c5dec8dcc3e37484e0f511b))
111
-
112
-
113
- ### Chores
114
-
115
- * add TypeScript check script and enhance ([9f6347c](https://github.com/tarcisioandrade/rich-domain/commit/9f6347c4707adebb9e03bcdc952791a9c3279038))
116
- * enhance useCriteria hook and update TypeScript types for better type safety ([2bbc699](https://github.com/tarcisioandrade/rich-domain/commit/2bbc699aab415a52502ad50e7fbf67bcd52ae222))
117
- * refactor frontend example to integrate useCriteria hook ([48dccc7](https://github.com/tarcisioandrade/rich-domain/commit/48dccc7df870024f280902c22c77dcf531702781))
118
- * update ESLint configurations to include tsconfigRootDir ([b019884](https://github.com/tarcisioandrade/rich-domain/commit/b01988496b91c6c9d3e6d3d89597cf9f23e54729))
119
- * update rich domain version in examples app ([4be8a1b](https://github.com/tarcisioandrade/rich-domain/commit/4be8a1bdd4473d8274c0ec8bec1d4ec1d70109ea))
120
- * update target paths in registry.json and use-criteria.json for improved file structure ([d2f9348](https://github.com/tarcisioandrade/rich-domain/commit/d2f93486158e465d8878d92f1d80e259cc62f701))
121
-
122
-
123
- ### Refactoring
124
-
125
- * criteria adapter in fastify-with-prisma example ([8adef1e](https://github.com/tarcisioandrade/rich-domain/commit/8adef1e0c62ab94bd3665f91ca6ea29d568ea24f))
126
-
127
- ## [1.1.0](https://github.com/tarcisioandrade/rich-domain/compare/v1.0.0...v1.1.0) (2025-11-22)
128
-
129
-
130
- ### Features
131
-
132
- * add examples in monorepo ([2cba30e](https://github.com/tarcisioandrade/rich-domain/commit/2cba30e318be2575b007c8b4f9a00e35561eec5e))
133
- * add react-with-react-query example ([439589e](https://github.com/tarcisioandrade/rich-domain/commit/439589e1abbc47b1b03efab3b9dde53fe8d6253c))
134
- * domain execeptions ([e206274](https://github.com/tarcisioandrade/rich-domain/commit/e206274d8a93c09cc91b2c0514be62cb986caaa3))
135
- * implement useCriteria hook ([c00441a](https://github.com/tarcisioandrade/rich-domain/commit/c00441a105391fd06ef39b8c7e3aa0907c3ff508))
136
-
137
-
138
- ### Bug Fixes
139
-
140
- * infinite loop when multiples order are add ([2c13dc4](https://github.com/tarcisioandrade/rich-domain/commit/2c13dc472d009bf328ad45222ea1c921f588ff9a))
141
- * search not working in fromArray PaginatedResult method ([b79b2aa](https://github.com/tarcisioandrade/rich-domain/commit/b79b2aa2aa17e8b98bf2c2fcb4823452db99dcc1))
142
-
143
-
144
- ### Refactoring
145
-
146
- * clean exports ([3f8e16a](https://github.com/tarcisioandrade/rich-domain/commit/3f8e16a2103514ef7a2a928dff20f674d1e39506))
147
- * migrate eslint configuration to ES module syntax ([3ea4366](https://github.com/tarcisioandrade/rich-domain/commit/3ea43667b0857b7ae2afcbad858c16384035dc50))
148
- * monorepo implementation ([e0b1e68](https://github.com/tarcisioandrade/rich-domain/commit/e0b1e683d5ee95b54b79510d43dd957af49c65e2))
149
- * remove defaultValues from value objects ([0523479](https://github.com/tarcisioandrade/rich-domain/commit/0523479c6f272d7ea5d678638fa666e3fde71c7a))
150
- * streamline domain event imports and consolidate IDomainEvent interface ([573c689](https://github.com/tarcisioandrade/rich-domain/commit/573c689a762baecd9fb8791e66300f663d7a58c1))
151
-
152
-
153
- ### Chores
154
-
155
- * add postinstall script to generate Prisma client ([ffbe310](https://github.com/tarcisioandrade/rich-domain/commit/ffbe310db4ff9e6918d4e55096b8939c1f8f4543))
156
- * enhance linting setup for react-rich-domain and update package.json ([ac2803b](https://github.com/tarcisioandrade/rich-domain/commit/ac2803bac0d907c0513d249fc5e14390418c7530))
157
- * modify check script to target specific workspace ([d39d6d8](https://github.com/tarcisioandrade/rich-domain/commit/d39d6d8ef3a04d17207a3a0e795027040b3cf707))
158
- * update clean script to remove node_modules in backend and rich-domain packages ([2a10cab](https://github.com/tarcisioandrade/rich-domain/commit/2a10cab193ba00e504a9a301cc00cda4b68b8573))
159
- * update module entry points in package.json for react-rich-domain ([03be9ac](https://github.com/tarcisioandrade/rich-domain/commit/03be9aced05160c97eb74f771b770283c07e046b))
160
- * update package configuration and add new dependencies ([4135393](https://github.com/tarcisioandrade/rich-domain/commit/4135393ae78b1b8e6b0c9306f0ac0872971ddb3f))
161
- * update package.json scripts to target specific workspace ([8f46868](https://github.com/tarcisioandrade/rich-domain/commit/8f468688017f49cae58dff5d1a9818fe64b38017))
162
- * update package.json with homepage and repository detail ([bfb387c](https://github.com/tarcisioandrade/rich-domain/commit/bfb387cb2076989a808f25be09337a24ed3a8ff6))
163
- * update test script to target specific workspace ([6783208](https://github.com/tarcisioandrade/rich-domain/commit/678320803828a43ef588c366e59bf62c2851c126))