@hg-ts/repository 0.7.22 → 0.7.23
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/dist/exceptions/aggregate-event.already-exists.exception.js +1 -1
- package/dist/exceptions/aggregate-event.already-exists.exception.js.map +1 -1
- package/dist/exceptions/aggregate-event.not-found.exception.js +1 -1
- package/dist/exceptions/aggregate-event.not-found.exception.js.map +1 -1
- package/dist/exceptions/aggregate.already-exists.exception.d.ts +5 -5
- package/dist/exceptions/aggregate.already-exists.exception.d.ts.map +1 -1
- package/dist/exceptions/aggregate.already-exists.exception.js +1 -2
- package/dist/exceptions/aggregate.already-exists.exception.js.map +1 -1
- package/dist/exceptions/aggregate.not-found.exception.d.ts +5 -5
- package/dist/exceptions/aggregate.not-found.exception.d.ts.map +1 -1
- package/dist/exceptions/aggregate.not-found.exception.js +1 -2
- package/dist/exceptions/aggregate.not-found.exception.js.map +1 -1
- package/dist/tests/test.already-exists.exception.js +1 -1
- package/dist/tests/test.already-exists.exception.js.map +1 -1
- package/dist/tests/test.not-found.exception.js +1 -1
- package/dist/tests/test.not-found.exception.js.map +1 -1
- package/package.json +11 -11
- package/src/exceptions/aggregate-event.already-exists.exception.ts +1 -1
- package/src/exceptions/aggregate-event.not-found.exception.ts +1 -1
- package/src/exceptions/aggregate.already-exists.exception.ts +6 -7
- package/src/exceptions/aggregate.not-found.exception.ts +6 -7
- package/src/tests/test.already-exists.exception.ts +1 -1
- package/src/tests/test.not-found.exception.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AggregateAlreadyExistsException } from './aggregate.already-exists.exception.js';
|
|
2
2
|
export class AggregateEventAlreadyExistsException extends AggregateAlreadyExistsException {
|
|
3
3
|
constructor(id) {
|
|
4
|
-
super('DomainEvent', { id });
|
|
4
|
+
super('DomainEvent', id ? { id } : {});
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=aggregate-event.already-exists.exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-event.already-exists.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate-event.already-exists.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAE1F,MAAM,OAAO,oCAAqC,SAAQ,+BAA+B;IACxF,YAAmB,EAAW;QAC7B,KAAK,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate-event.already-exists.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate-event.already-exists.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAE1F,MAAM,OAAO,oCAAqC,SAAQ,+BAA+B;IACxF,YAAmB,EAAW;QAC7B,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;CACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AggregateNotFoundException } from './aggregate.not-found.exception.js';
|
|
2
2
|
export class AggregateEventNotFoundException extends AggregateNotFoundException {
|
|
3
3
|
constructor(id) {
|
|
4
|
-
super('DomainEvent', { id });
|
|
4
|
+
super('DomainEvent', id ? { id } : {});
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=aggregate-event.not-found.exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-event.not-found.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate-event.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,MAAM,OAAO,+BAAgC,SAAQ,0BAA0B;IAC9E,YAAmB,EAAW;QAC7B,KAAK,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate-event.not-found.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate-event.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,MAAM,OAAO,+BAAgC,SAAQ,0BAA0B;IAC9E,YAAmB,EAAW;QAC7B,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;CACD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseException } from '@hg-ts/exception';
|
|
2
|
-
export type AggregateAlreadyExistsParams
|
|
3
|
-
id?:
|
|
2
|
+
export type AggregateAlreadyExistsParams = {
|
|
3
|
+
id?: string;
|
|
4
4
|
code?: number;
|
|
5
5
|
};
|
|
6
|
-
export declare abstract class AggregateAlreadyExistsException
|
|
7
|
-
readonly id?:
|
|
8
|
-
constructor(aggregateName: string, params?: AggregateAlreadyExistsParams
|
|
6
|
+
export declare abstract class AggregateAlreadyExistsException extends BaseException {
|
|
7
|
+
readonly id?: string;
|
|
8
|
+
constructor(aggregateName: string, params?: AggregateAlreadyExistsParams);
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=aggregate.already-exists.exception.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.already-exists.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/aggregate.already-exists.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate.already-exists.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/aggregate.already-exists.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,4BAA4B,GAAG;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAA;AAED,8BAAsB,+BAAgC,SAAQ,aAAa;IAC1E,SAAgB,EAAE,CAAC,EAAE,MAAM,CAAC;gBAET,aAAa,EAAE,MAAM,EAAE,MAAM,GAAE,4BAAiC;CAiBnF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { BaseException } from '@hg-ts/exception';
|
|
2
|
-
import { format } from 'util';
|
|
3
2
|
export class AggregateAlreadyExistsException extends BaseException {
|
|
4
3
|
id;
|
|
5
4
|
constructor(aggregateName, params = {}) {
|
|
6
5
|
const { code, id } = params;
|
|
7
6
|
const messageParts = [aggregateName];
|
|
8
7
|
if (id) {
|
|
9
|
-
messageParts.push(`with id ${
|
|
8
|
+
messageParts.push(`with id "${id}"`);
|
|
10
9
|
}
|
|
11
10
|
messageParts.push('already exists');
|
|
12
11
|
super(messageParts.join(' '), { code });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.already-exists.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate.already-exists.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate.already-exists.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate.already-exists.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjD,MAAM,OAAgB,+BAAgC,SAAQ,aAAa;IAC1D,EAAE,CAAU;IAE5B,YAAmB,aAAqB,EAAE,SAAuC,EAAE;QAClF,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QAC5B,MAAM,YAAY,GAAG,CAAC,aAAa,CAAC,CAAC;QAErC,IAAI,EAAE,EAAE,CAAC;YACR,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;QACtC,CAAC;QAED,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAEpC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAGxC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACd,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseException } from '@hg-ts/exception';
|
|
2
|
-
export type AggregateNotFoundParams
|
|
3
|
-
id?:
|
|
2
|
+
export type AggregateNotFoundParams = {
|
|
3
|
+
id?: string;
|
|
4
4
|
code?: number;
|
|
5
5
|
};
|
|
6
|
-
export declare abstract class AggregateNotFoundException
|
|
7
|
-
readonly id?:
|
|
8
|
-
constructor(aggregateName: string, params?: AggregateNotFoundParams
|
|
6
|
+
export declare abstract class AggregateNotFoundException extends BaseException {
|
|
7
|
+
readonly id?: string;
|
|
8
|
+
constructor(aggregateName: string, params?: AggregateNotFoundParams);
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=aggregate.not-found.exception.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.not-found.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/aggregate.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate.not-found.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/aggregate.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,uBAAuB,GAAG;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAA;AAED,8BAAsB,0BAA2B,SAAQ,aAAa;IACrE,SAAgB,EAAE,CAAC,EAAE,MAAM,CAAC;gBAET,aAAa,EAAE,MAAM,EAAE,MAAM,GAAE,uBAA4B;CAiB9E"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { BaseException } from '@hg-ts/exception';
|
|
2
|
-
import { format } from 'util';
|
|
3
2
|
export class AggregateNotFoundException extends BaseException {
|
|
4
3
|
id;
|
|
5
4
|
constructor(aggregateName, params = {}) {
|
|
6
5
|
const { code, id } = params;
|
|
7
6
|
const messageParts = [aggregateName];
|
|
8
7
|
if (id) {
|
|
9
|
-
messageParts.push(`with id ${
|
|
8
|
+
messageParts.push(`with id "${id}"`);
|
|
10
9
|
}
|
|
11
10
|
messageParts.push('not found');
|
|
12
11
|
super(messageParts.join(' '), { code });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.not-found.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate.not-found.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjD,MAAM,OAAgB,0BAA2B,SAAQ,aAAa;IACrD,EAAE,CAAU;IAE5B,YAAmB,aAAqB,EAAE,SAAkC,EAAE;QAC7E,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QAC5B,MAAM,YAAY,GAAG,CAAC,aAAa,CAAC,CAAC;QAErC,IAAI,EAAE,EAAE,CAAC;YACR,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;QACtC,CAAC;QAED,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE/B,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAGxC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACd,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AggregateAlreadyExistsException } from '../exceptions/index.js';
|
|
2
2
|
export class TestAlreadyExistsException extends AggregateAlreadyExistsException {
|
|
3
3
|
constructor(id = null) {
|
|
4
|
-
super('Test', { id, code: 0 });
|
|
4
|
+
super('Test', id ? { id, code: 0 } : { code: 0 });
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=test.already-exists.exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.already-exists.exception.js","sourceRoot":"","sources":["../../src/tests/test.already-exists.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAGzE,MAAM,OAAO,0BAA2B,SAAQ,+BAA+B;IAC9E,YAAmB,KAAoC,IAAI;QAC1D,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"test.already-exists.exception.js","sourceRoot":"","sources":["../../src/tests/test.already-exists.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAGzE,MAAM,OAAO,0BAA2B,SAAQ,+BAA+B;IAC9E,YAAmB,KAAoC,IAAI;QAC1D,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;CACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AggregateNotFoundException } from '../exceptions/index.js';
|
|
2
2
|
export class TestNotFoundException extends AggregateNotFoundException {
|
|
3
3
|
constructor(id = null) {
|
|
4
|
-
super('Test', { id, code: 0 });
|
|
4
|
+
super('Test', id ? { id, code: 0 } : { code: 0 });
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=test.not-found.exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.not-found.exception.js","sourceRoot":"","sources":["../../src/tests/test.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAGpE,MAAM,OAAO,qBAAsB,SAAQ,0BAA0B;IACpE,YAAmB,KAAoC,IAAI;QAC1D,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"test.not-found.exception.js","sourceRoot":"","sources":["../../src/tests/test.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAGpE,MAAM,OAAO,qBAAsB,SAAQ,0BAA0B;IACpE,YAAmB,KAAoC,IAAI;QAC1D,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hg-ts/repository",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.23",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"test:dev": "vitest watch"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@hg-ts-config/typescript": "0.7.
|
|
22
|
-
"@hg-ts/domain": "0.7.
|
|
23
|
-
"@hg-ts/events": "0.7.
|
|
24
|
-
"@hg-ts/exception": "0.7.
|
|
25
|
-
"@hg-ts/linter": "0.7.
|
|
26
|
-
"@hg-ts/tests": "0.7.
|
|
27
|
-
"@hg-ts/types": "0.7.
|
|
21
|
+
"@hg-ts-config/typescript": "0.7.23",
|
|
22
|
+
"@hg-ts/domain": "0.7.23",
|
|
23
|
+
"@hg-ts/events": "0.7.23",
|
|
24
|
+
"@hg-ts/exception": "0.7.23",
|
|
25
|
+
"@hg-ts/linter": "0.7.23",
|
|
26
|
+
"@hg-ts/tests": "0.7.23",
|
|
27
|
+
"@hg-ts/types": "0.7.23",
|
|
28
28
|
"@types/node": "22.19.1",
|
|
29
29
|
"@types/uuid": "10.0.0",
|
|
30
30
|
"@vitest/coverage-v8": "4.0.14",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"vitest": "4.0.14"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@hg-ts/domain": "0.7.
|
|
42
|
-
"@hg-ts/events": "0.7.
|
|
43
|
-
"@hg-ts/exception": "0.7.
|
|
41
|
+
"@hg-ts/domain": "0.7.23",
|
|
42
|
+
"@hg-ts/events": "0.7.23",
|
|
43
|
+
"@hg-ts/exception": "0.7.23",
|
|
44
44
|
"reflect-metadata": "*",
|
|
45
45
|
"tslib": "*",
|
|
46
46
|
"uuid": "*",
|
|
@@ -2,6 +2,6 @@ import { AggregateAlreadyExistsException } from './aggregate.already-exists.exce
|
|
|
2
2
|
|
|
3
3
|
export class AggregateEventAlreadyExistsException extends AggregateAlreadyExistsException {
|
|
4
4
|
public constructor(id?: string) {
|
|
5
|
-
super('DomainEvent', { id });
|
|
5
|
+
super('DomainEvent', id ? { id } : {});
|
|
6
6
|
}
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@ import { AggregateNotFoundException } from './aggregate.not-found.exception.js';
|
|
|
2
2
|
|
|
3
3
|
export class AggregateEventNotFoundException extends AggregateNotFoundException {
|
|
4
4
|
public constructor(id?: string) {
|
|
5
|
-
super('DomainEvent', { id });
|
|
5
|
+
super('DomainEvent', id ? { id } : {});
|
|
6
6
|
}
|
|
7
7
|
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { BaseException } from '@hg-ts/exception';
|
|
2
|
-
import { format } from 'util';
|
|
3
2
|
|
|
4
|
-
export type AggregateAlreadyExistsParams
|
|
5
|
-
id?:
|
|
3
|
+
export type AggregateAlreadyExistsParams = {
|
|
4
|
+
id?: string;
|
|
6
5
|
code?: number;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
export abstract class AggregateAlreadyExistsException
|
|
10
|
-
public readonly id?:
|
|
8
|
+
export abstract class AggregateAlreadyExistsException extends BaseException {
|
|
9
|
+
public readonly id?: string;
|
|
11
10
|
|
|
12
|
-
public constructor(aggregateName: string, params: AggregateAlreadyExistsParams
|
|
11
|
+
public constructor(aggregateName: string, params: AggregateAlreadyExistsParams = {}) {
|
|
13
12
|
const { code, id } = params;
|
|
14
13
|
const messageParts = [aggregateName];
|
|
15
14
|
|
|
16
15
|
if (id) {
|
|
17
|
-
messageParts.push(`with id ${
|
|
16
|
+
messageParts.push(`with id "${id}"`);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
messageParts.push('already exists');
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { BaseException } from '@hg-ts/exception';
|
|
2
|
-
import { format } from 'util';
|
|
3
2
|
|
|
4
|
-
export type AggregateNotFoundParams
|
|
5
|
-
id?:
|
|
3
|
+
export type AggregateNotFoundParams = {
|
|
4
|
+
id?: string;
|
|
6
5
|
code?: number;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
export abstract class AggregateNotFoundException
|
|
10
|
-
public readonly id?:
|
|
8
|
+
export abstract class AggregateNotFoundException extends BaseException {
|
|
9
|
+
public readonly id?: string;
|
|
11
10
|
|
|
12
|
-
public constructor(aggregateName: string, params: AggregateNotFoundParams
|
|
11
|
+
public constructor(aggregateName: string, params: AggregateNotFoundParams = {}) {
|
|
13
12
|
const { code, id } = params;
|
|
14
13
|
const messageParts = [aggregateName];
|
|
15
14
|
|
|
16
15
|
if (id) {
|
|
17
|
-
messageParts.push(`with id ${
|
|
16
|
+
messageParts.push(`with id "${id}"`);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
messageParts.push('not found');
|
|
@@ -3,6 +3,6 @@ import type { TestAggregate } from './test.aggregate.js';
|
|
|
3
3
|
|
|
4
4
|
export class TestAlreadyExistsException extends AggregateAlreadyExistsException {
|
|
5
5
|
public constructor(id: Nullable<TestAggregate['id']> = null) {
|
|
6
|
-
super('Test', { id, code: 0 });
|
|
6
|
+
super('Test', id ? { id, code: 0 } : { code: 0 });
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -3,6 +3,6 @@ import type { TestAggregate } from './test.aggregate.js';
|
|
|
3
3
|
|
|
4
4
|
export class TestNotFoundException extends AggregateNotFoundException {
|
|
5
5
|
public constructor(id: Nullable<TestAggregate['id']> = null) {
|
|
6
|
-
super('Test', { id, code: 0 });
|
|
6
|
+
super('Test', id ? { id, code: 0 } : { code: 0 });
|
|
7
7
|
}
|
|
8
8
|
}
|