@imolko/ultra-ddd 1.0.35-beta → 1.0.36-beta
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-browser/aggregate-root/use-examples/product-woo/aggregate.d.ts +298 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/aggregate.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/aggregate.js +19 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/aggregate.js.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/conditions.d.ts +85 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/conditions.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/conditions.js +23 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/conditions.js.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/definition.d.ts +34 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/definition.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/definition.js +57 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/definition.js.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/errors.d.ts +4 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/errors.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/errors.js +2 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/errors.js.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/payload.d.ts +4 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/payload.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/payload.js +2 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/payload.js.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/primitive.d.ts +7 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/primitive.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/primitive.js +2 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/primitive.js.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/props.d.ts +8 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/props.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/props.js +2 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/props.js.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/security-token.d.ts +2 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/security-token.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/security-token.js +2 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/security-token.js.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/snapshot.d.ts +8 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/snapshot.d.ts.map +1 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/snapshot.js +2 -0
- package/dist-browser/aggregate-root/use-examples/product-woo/snapshot.js.map +1 -0
- package/dist-browser/entity/entity-base.d.ts.map +1 -1
- package/dist-browser/entity/entity-base.js +1 -0
- package/dist-browser/entity/entity-base.js.map +1 -1
- package/dist-browser/entity/identity/entity-id.d.ts +3 -3
- package/dist-browser/entity/identity/entity-id.d.ts.map +1 -1
- package/dist-browser/entity/identity/identity-strategy.enum.d.ts +16 -1
- package/dist-browser/entity/identity/identity-strategy.enum.d.ts.map +1 -1
- package/dist-browser/entity/identity/identity-strategy.enum.js +15 -0
- package/dist-browser/entity/identity/identity-strategy.enum.js.map +1 -1
- package/dist-browser/entity/identity/index.d.ts +3 -2
- package/dist-browser/entity/identity/index.d.ts.map +1 -1
- package/dist-browser/entity/identity/index.js +3 -2
- package/dist-browser/entity/identity/index.js.map +1 -1
- package/dist-browser/entity/identity/numericid/conditions.d.ts +5 -0
- package/dist-browser/entity/identity/numericid/conditions.d.ts.map +1 -0
- package/dist-browser/entity/identity/numericid/conditions.js +7 -0
- package/dist-browser/entity/identity/numericid/conditions.js.map +1 -0
- package/dist-browser/entity/identity/numericid/definition.d.ts +30 -0
- package/dist-browser/entity/identity/numericid/definition.d.ts.map +1 -0
- package/dist-browser/entity/identity/numericid/definition.js +53 -0
- package/dist-browser/entity/identity/numericid/definition.js.map +1 -0
- package/dist-browser/entity/identity/numericid/errors.d.ts +3 -0
- package/dist-browser/entity/identity/numericid/errors.d.ts.map +1 -0
- package/dist-browser/entity/identity/numericid/errors.js +2 -0
- package/dist-browser/entity/identity/numericid/errors.js.map +1 -0
- package/dist-browser/entity/identity/numericid/index.d.ts +5 -0
- package/dist-browser/entity/identity/numericid/index.d.ts.map +1 -0
- package/dist-browser/entity/identity/numericid/index.js +2 -0
- package/dist-browser/entity/identity/numericid/index.js.map +1 -0
- package/dist-browser/entity/identity/numericid/payload.d.ts +4 -0
- package/dist-browser/entity/identity/numericid/payload.d.ts.map +1 -0
- package/dist-browser/entity/identity/numericid/payload.js +2 -0
- package/dist-browser/entity/identity/numericid/payload.js.map +1 -0
- package/dist-browser/entity/identity/numericid/primitive.d.ts +2 -0
- package/dist-browser/entity/identity/numericid/primitive.d.ts.map +1 -0
- package/dist-browser/entity/identity/numericid/primitive.js +2 -0
- package/dist-browser/entity/identity/numericid/primitive.js.map +1 -0
- package/dist-browser/entity/identity/numericid/props.d.ts +7 -0
- package/dist-browser/entity/identity/numericid/props.d.ts.map +1 -0
- package/dist-browser/entity/identity/numericid/props.js +3 -0
- package/dist-browser/entity/identity/numericid/props.js.map +1 -0
- package/dist-browser/entity/identity/numericid/value-object.d.ts +102 -0
- package/dist-browser/entity/identity/numericid/value-object.d.ts.map +1 -0
- package/dist-browser/entity/identity/numericid/value-object.js +17 -0
- package/dist-browser/entity/identity/numericid/value-object.js.map +1 -0
- package/dist-browser/entity/identity/props-identity-base.d.ts.map +1 -1
- package/dist-browser/entity/use-examples/product-woo/conditions.d.ts +27 -0
- package/dist-browser/entity/use-examples/product-woo/conditions.d.ts.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/conditions.js +19 -0
- package/dist-browser/entity/use-examples/product-woo/conditions.js.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/definition.d.ts +25 -0
- package/dist-browser/entity/use-examples/product-woo/definition.d.ts.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/definition.js +46 -0
- package/dist-browser/entity/use-examples/product-woo/definition.js.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/entity.d.ts +254 -0
- package/dist-browser/entity/use-examples/product-woo/entity.d.ts.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/entity.js +19 -0
- package/dist-browser/entity/use-examples/product-woo/entity.js.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/errors.d.ts +4 -0
- package/dist-browser/entity/use-examples/product-woo/errors.d.ts.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/errors.js +2 -0
- package/dist-browser/entity/use-examples/product-woo/errors.js.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/payload.d.ts +4 -0
- package/dist-browser/entity/use-examples/product-woo/payload.d.ts.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/payload.js +2 -0
- package/dist-browser/entity/use-examples/product-woo/payload.js.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/primitive.d.ts +7 -0
- package/dist-browser/entity/use-examples/product-woo/primitive.d.ts.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/primitive.js +2 -0
- package/dist-browser/entity/use-examples/product-woo/primitive.js.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/props.d.ts +7 -0
- package/dist-browser/entity/use-examples/product-woo/props.d.ts.map +1 -0
- package/dist-browser/entity/use-examples/product-woo/props.js +2 -0
- package/dist-browser/entity/use-examples/product-woo/props.js.map +1 -0
- package/dist-browser/test/execute-sequentially/artifacts/aggregate.d.ts +390 -0
- package/dist-browser/test/execute-sequentially/artifacts/aggregate.d.ts.map +1 -0
- package/dist-browser/test/execute-sequentially/artifacts/aggregate.js +91 -0
- package/dist-browser/test/execute-sequentially/artifacts/aggregate.js.map +1 -0
- package/dist-browser/test/execute-sequentially/artifacts/entity.d.ts +313 -0
- package/dist-browser/test/execute-sequentially/artifacts/entity.d.ts.map +1 -0
- package/dist-browser/test/execute-sequentially/artifacts/entity.js +90 -0
- package/dist-browser/test/execute-sequentially/artifacts/entity.js.map +1 -0
- package/dist-browser/test/execute-sequentially/artifacts/index.d.ts +4 -0
- package/dist-browser/test/execute-sequentially/artifacts/index.d.ts.map +1 -0
- package/dist-browser/test/execute-sequentially/artifacts/index.js +4 -0
- package/dist-browser/test/execute-sequentially/artifacts/index.js.map +1 -0
- package/dist-browser/test/execute-sequentially/artifacts/value-object.d.ts +141 -0
- package/dist-browser/test/execute-sequentially/artifacts/value-object.d.ts.map +1 -0
- package/dist-browser/test/execute-sequentially/artifacts/value-object.js +76 -0
- package/dist-browser/test/execute-sequentially/artifacts/value-object.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/aggregate.d.ts +298 -0
- package/dist-node/aggregate-root/use-examples/product-woo/aggregate.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/aggregate.js +22 -0
- package/dist-node/aggregate-root/use-examples/product-woo/aggregate.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/conditions.d.ts +85 -0
- package/dist-node/aggregate-root/use-examples/product-woo/conditions.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/conditions.js +26 -0
- package/dist-node/aggregate-root/use-examples/product-woo/conditions.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/definition.d.ts +34 -0
- package/dist-node/aggregate-root/use-examples/product-woo/definition.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/definition.js +60 -0
- package/dist-node/aggregate-root/use-examples/product-woo/definition.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/errors.d.ts +4 -0
- package/dist-node/aggregate-root/use-examples/product-woo/errors.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/errors.js +3 -0
- package/dist-node/aggregate-root/use-examples/product-woo/errors.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/payload.d.ts +4 -0
- package/dist-node/aggregate-root/use-examples/product-woo/payload.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/payload.js +3 -0
- package/dist-node/aggregate-root/use-examples/product-woo/payload.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/primitive.d.ts +7 -0
- package/dist-node/aggregate-root/use-examples/product-woo/primitive.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/primitive.js +3 -0
- package/dist-node/aggregate-root/use-examples/product-woo/primitive.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/props.d.ts +8 -0
- package/dist-node/aggregate-root/use-examples/product-woo/props.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/props.js +3 -0
- package/dist-node/aggregate-root/use-examples/product-woo/props.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/security-token.d.ts +2 -0
- package/dist-node/aggregate-root/use-examples/product-woo/security-token.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/security-token.js +5 -0
- package/dist-node/aggregate-root/use-examples/product-woo/security-token.js.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/snapshot.d.ts +8 -0
- package/dist-node/aggregate-root/use-examples/product-woo/snapshot.d.ts.map +1 -0
- package/dist-node/aggregate-root/use-examples/product-woo/snapshot.js +3 -0
- package/dist-node/aggregate-root/use-examples/product-woo/snapshot.js.map +1 -0
- package/dist-node/entity/entity-base.d.ts.map +1 -1
- package/dist-node/entity/entity-base.js +1 -0
- package/dist-node/entity/entity-base.js.map +1 -1
- package/dist-node/entity/identity/entity-id.d.ts +3 -3
- package/dist-node/entity/identity/entity-id.d.ts.map +1 -1
- package/dist-node/entity/identity/identity-strategy.enum.d.ts +16 -1
- package/dist-node/entity/identity/identity-strategy.enum.d.ts.map +1 -1
- package/dist-node/entity/identity/identity-strategy.enum.js +15 -0
- package/dist-node/entity/identity/identity-strategy.enum.js.map +1 -1
- package/dist-node/entity/identity/index.d.ts +3 -2
- package/dist-node/entity/identity/index.d.ts.map +1 -1
- package/dist-node/entity/identity/index.js +3 -2
- package/dist-node/entity/identity/index.js.map +1 -1
- package/dist-node/entity/identity/numericid/conditions.d.ts +5 -0
- package/dist-node/entity/identity/numericid/conditions.d.ts.map +1 -0
- package/dist-node/entity/identity/numericid/conditions.js +10 -0
- package/dist-node/entity/identity/numericid/conditions.js.map +1 -0
- package/dist-node/entity/identity/numericid/definition.d.ts +30 -0
- package/dist-node/entity/identity/numericid/definition.d.ts.map +1 -0
- package/dist-node/entity/identity/numericid/definition.js +56 -0
- package/dist-node/entity/identity/numericid/definition.js.map +1 -0
- package/dist-node/entity/identity/numericid/errors.d.ts +3 -0
- package/dist-node/entity/identity/numericid/errors.d.ts.map +1 -0
- package/dist-node/entity/identity/numericid/errors.js +3 -0
- package/dist-node/entity/identity/numericid/errors.js.map +1 -0
- package/dist-node/entity/identity/numericid/index.d.ts +5 -0
- package/dist-node/entity/identity/numericid/index.d.ts.map +1 -0
- package/dist-node/entity/identity/numericid/index.js +6 -0
- package/dist-node/entity/identity/numericid/index.js.map +1 -0
- package/dist-node/entity/identity/numericid/payload.d.ts +4 -0
- package/dist-node/entity/identity/numericid/payload.d.ts.map +1 -0
- package/dist-node/entity/identity/numericid/payload.js +3 -0
- package/dist-node/entity/identity/numericid/payload.js.map +1 -0
- package/dist-node/entity/identity/numericid/primitive.d.ts +2 -0
- package/dist-node/entity/identity/numericid/primitive.d.ts.map +1 -0
- package/dist-node/entity/identity/numericid/primitive.js +3 -0
- package/dist-node/entity/identity/numericid/primitive.js.map +1 -0
- package/dist-node/entity/identity/numericid/props.d.ts +7 -0
- package/dist-node/entity/identity/numericid/props.d.ts.map +1 -0
- package/dist-node/entity/identity/numericid/props.js +4 -0
- package/dist-node/entity/identity/numericid/props.js.map +1 -0
- package/dist-node/entity/identity/numericid/value-object.d.ts +102 -0
- package/dist-node/entity/identity/numericid/value-object.d.ts.map +1 -0
- package/dist-node/entity/identity/numericid/value-object.js +20 -0
- package/dist-node/entity/identity/numericid/value-object.js.map +1 -0
- package/dist-node/entity/identity/props-identity-base.d.ts.map +1 -1
- package/dist-node/entity/use-examples/product-woo/conditions.d.ts +27 -0
- package/dist-node/entity/use-examples/product-woo/conditions.d.ts.map +1 -0
- package/dist-node/entity/use-examples/product-woo/conditions.js +22 -0
- package/dist-node/entity/use-examples/product-woo/conditions.js.map +1 -0
- package/dist-node/entity/use-examples/product-woo/definition.d.ts +25 -0
- package/dist-node/entity/use-examples/product-woo/definition.d.ts.map +1 -0
- package/dist-node/entity/use-examples/product-woo/definition.js +49 -0
- package/dist-node/entity/use-examples/product-woo/definition.js.map +1 -0
- package/dist-node/entity/use-examples/product-woo/entity.d.ts +254 -0
- package/dist-node/entity/use-examples/product-woo/entity.d.ts.map +1 -0
- package/dist-node/entity/use-examples/product-woo/entity.js +22 -0
- package/dist-node/entity/use-examples/product-woo/entity.js.map +1 -0
- package/dist-node/entity/use-examples/product-woo/errors.d.ts +4 -0
- package/dist-node/entity/use-examples/product-woo/errors.d.ts.map +1 -0
- package/dist-node/entity/use-examples/product-woo/errors.js +3 -0
- package/dist-node/entity/use-examples/product-woo/errors.js.map +1 -0
- package/dist-node/entity/use-examples/product-woo/payload.d.ts +4 -0
- package/dist-node/entity/use-examples/product-woo/payload.d.ts.map +1 -0
- package/dist-node/entity/use-examples/product-woo/payload.js +3 -0
- package/dist-node/entity/use-examples/product-woo/payload.js.map +1 -0
- package/dist-node/entity/use-examples/product-woo/primitive.d.ts +7 -0
- package/dist-node/entity/use-examples/product-woo/primitive.d.ts.map +1 -0
- package/dist-node/entity/use-examples/product-woo/primitive.js +3 -0
- package/dist-node/entity/use-examples/product-woo/primitive.js.map +1 -0
- package/dist-node/entity/use-examples/product-woo/props.d.ts +7 -0
- package/dist-node/entity/use-examples/product-woo/props.d.ts.map +1 -0
- package/dist-node/entity/use-examples/product-woo/props.js +3 -0
- package/dist-node/entity/use-examples/product-woo/props.js.map +1 -0
- package/dist-node/test/execute-sequentially/artifacts/aggregate.d.ts +390 -0
- package/dist-node/test/execute-sequentially/artifacts/aggregate.d.ts.map +1 -0
- package/dist-node/test/execute-sequentially/artifacts/aggregate.js +92 -0
- package/dist-node/test/execute-sequentially/artifacts/aggregate.js.map +1 -0
- package/dist-node/test/execute-sequentially/artifacts/entity.d.ts +313 -0
- package/dist-node/test/execute-sequentially/artifacts/entity.d.ts.map +1 -0
- package/dist-node/test/execute-sequentially/artifacts/entity.js +91 -0
- package/dist-node/test/execute-sequentially/artifacts/entity.js.map +1 -0
- package/dist-node/test/execute-sequentially/artifacts/index.d.ts +4 -0
- package/dist-node/test/execute-sequentially/artifacts/index.d.ts.map +1 -0
- package/dist-node/test/execute-sequentially/artifacts/index.js +20 -0
- package/dist-node/test/execute-sequentially/artifacts/index.js.map +1 -0
- package/dist-node/test/execute-sequentially/artifacts/value-object.d.ts +141 -0
- package/dist-node/test/execute-sequentially/artifacts/value-object.d.ts.map +1 -0
- package/dist-node/test/execute-sequentially/artifacts/value-object.js +77 -0
- package/dist-node/test/execute-sequentially/artifacts/value-object.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { InvalidTypeError, TooBigError, TooSmallError, z, ZodSchema, ZodTypeDef } from "@imolko/ultra-v8n";
|
|
2
|
+
import { Validation } from "@imolko/ultra-result";
|
|
3
|
+
import { EntityBase, Uuid, UuidErrors } from "../../../entity";
|
|
4
|
+
/**
|
|
5
|
+
* Interfaces
|
|
6
|
+
*/
|
|
7
|
+
interface Props {
|
|
8
|
+
id: Uuid;
|
|
9
|
+
name: string;
|
|
10
|
+
age: number;
|
|
11
|
+
}
|
|
12
|
+
interface Primitive {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
age: number;
|
|
16
|
+
}
|
|
17
|
+
declare const conditions: z.ZodObject<{
|
|
18
|
+
id: z.ZodType<Uuid, z.ZodTypeDef, string>;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
age: z.ZodNumber;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
id: Uuid;
|
|
23
|
+
name: string;
|
|
24
|
+
age: number;
|
|
25
|
+
}, {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
age: number;
|
|
29
|
+
}>;
|
|
30
|
+
type Payload = z.input<typeof conditions>;
|
|
31
|
+
type Errors = InvalidTypeError | UuidErrors | TooBigError | TooSmallError;
|
|
32
|
+
/**
|
|
33
|
+
* Definicion del agregado
|
|
34
|
+
*/
|
|
35
|
+
declare abstract class Definition extends EntityBase<Uuid, Props, Primitive, Payload> {
|
|
36
|
+
static readonly NAME = "invoice-entity";
|
|
37
|
+
static PROPS_VERSION: number;
|
|
38
|
+
static readonly conditions: ZodSchema<Props, ZodTypeDef, Payload>;
|
|
39
|
+
/**
|
|
40
|
+
* Constructor
|
|
41
|
+
*/
|
|
42
|
+
constructor(props: Props);
|
|
43
|
+
/**
|
|
44
|
+
* Devuelve las propiedades serializadas que permite las reconstruccion de la entidad
|
|
45
|
+
* @returns {Payload}
|
|
46
|
+
*/
|
|
47
|
+
getPayload(): Payload;
|
|
48
|
+
/**
|
|
49
|
+
* Devuelve las propiedades serializadas para exponer en la aplicacion
|
|
50
|
+
* @returns {Primitive}
|
|
51
|
+
*/
|
|
52
|
+
getPrimitive(): Primitive;
|
|
53
|
+
/**
|
|
54
|
+
* Cambiar el nombre
|
|
55
|
+
* @param newName
|
|
56
|
+
*/
|
|
57
|
+
changeName(newName: string): Validation<InvalidTypeError, this>;
|
|
58
|
+
}
|
|
59
|
+
declare const Invoice_base: ((abstract new (...args: any[]) => {
|
|
60
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
61
|
+
readonly _id: Uuid;
|
|
62
|
+
props: Readonly<Props>;
|
|
63
|
+
getPrimitive(): Primitive;
|
|
64
|
+
getPayload(): {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
age: number;
|
|
68
|
+
};
|
|
69
|
+
equals<Implemented extends EntityBase<Uuid, Props, Primitive, {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
age: number;
|
|
73
|
+
}>>(this: Implemented, object?: Implemented | undefined): boolean;
|
|
74
|
+
readonly id: Uuid;
|
|
75
|
+
}) & {
|
|
76
|
+
factoryUsed: boolean;
|
|
77
|
+
rules<Implemented extends /*elided*/ any & {
|
|
78
|
+
new (...args: any[]): {
|
|
79
|
+
readonly _id: Uuid;
|
|
80
|
+
props: Readonly<Props>;
|
|
81
|
+
getPrimitive(): Primitive;
|
|
82
|
+
getPayload(): {
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
age: number;
|
|
86
|
+
};
|
|
87
|
+
equals<Implemented_1 extends EntityBase<Uuid, Props, Primitive, {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
age: number;
|
|
91
|
+
}>>(this: Implemented_1, object?: Implemented_1 | undefined): boolean;
|
|
92
|
+
readonly id: Uuid;
|
|
93
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
94
|
+
} & Props;
|
|
95
|
+
prototype: {
|
|
96
|
+
readonly _id: Uuid;
|
|
97
|
+
props: Readonly<Props>;
|
|
98
|
+
getPrimitive(): Primitive;
|
|
99
|
+
getPayload(): {
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
age: number;
|
|
103
|
+
};
|
|
104
|
+
equals<Implemented_1 extends EntityBase<Uuid, Props, Primitive, {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
age: number;
|
|
108
|
+
}>>(this: Implemented_1, object?: Implemented_1 | undefined): boolean;
|
|
109
|
+
readonly id: Uuid;
|
|
110
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
111
|
+
} & Props;
|
|
112
|
+
} & ((abstract new (...args: any[]) => {
|
|
113
|
+
readonly _id: Uuid;
|
|
114
|
+
props: Readonly<Props>;
|
|
115
|
+
getPrimitive(): Primitive;
|
|
116
|
+
getPayload(): {
|
|
117
|
+
id: string;
|
|
118
|
+
name: string;
|
|
119
|
+
age: number;
|
|
120
|
+
};
|
|
121
|
+
equals<Implemented_1 extends EntityBase<Uuid, Props, Primitive, {
|
|
122
|
+
id: string;
|
|
123
|
+
name: string;
|
|
124
|
+
age: number;
|
|
125
|
+
}>>(this: Implemented_1, object?: Implemented_1 | undefined): boolean;
|
|
126
|
+
readonly id: Uuid;
|
|
127
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
128
|
+
}) & {
|
|
129
|
+
conditions: z.ZodType<Props, z.ZodTypeDef, {
|
|
130
|
+
id: string;
|
|
131
|
+
name: string;
|
|
132
|
+
age: number;
|
|
133
|
+
}>;
|
|
134
|
+
builder?(value: Props): EntityBase<Uuid, Props, Primitive, {
|
|
135
|
+
id: string;
|
|
136
|
+
name: string;
|
|
137
|
+
age: number;
|
|
138
|
+
}>;
|
|
139
|
+
PROPS_VERSION: number;
|
|
140
|
+
NAME: string;
|
|
141
|
+
}) & typeof Definition>(this: Implemented): z.ZodType<InstanceType<Implemented>, z.ZodTypeDef, {
|
|
142
|
+
id: string;
|
|
143
|
+
name: string;
|
|
144
|
+
age: number;
|
|
145
|
+
}>;
|
|
146
|
+
create<Implemented extends /*elided*/ any & {
|
|
147
|
+
new (...args: any[]): {
|
|
148
|
+
readonly _id: Uuid;
|
|
149
|
+
props: Readonly<Props>;
|
|
150
|
+
getPrimitive(): Primitive;
|
|
151
|
+
getPayload(): {
|
|
152
|
+
id: string;
|
|
153
|
+
name: string;
|
|
154
|
+
age: number;
|
|
155
|
+
};
|
|
156
|
+
equals<Implemented_1 extends EntityBase<Uuid, Props, Primitive, {
|
|
157
|
+
id: string;
|
|
158
|
+
name: string;
|
|
159
|
+
age: number;
|
|
160
|
+
}>>(this: Implemented_1, object?: Implemented_1 | undefined): boolean;
|
|
161
|
+
readonly id: Uuid;
|
|
162
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
163
|
+
} & Props;
|
|
164
|
+
prototype: {
|
|
165
|
+
readonly _id: Uuid;
|
|
166
|
+
props: Readonly<Props>;
|
|
167
|
+
getPrimitive(): Primitive;
|
|
168
|
+
getPayload(): {
|
|
169
|
+
id: string;
|
|
170
|
+
name: string;
|
|
171
|
+
age: number;
|
|
172
|
+
};
|
|
173
|
+
equals<Implemented_1 extends EntityBase<Uuid, Props, Primitive, {
|
|
174
|
+
id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
age: number;
|
|
177
|
+
}>>(this: Implemented_1, object?: Implemented_1 | undefined): boolean;
|
|
178
|
+
readonly id: Uuid;
|
|
179
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
180
|
+
} & Props;
|
|
181
|
+
} & ((abstract new (...args: any[]) => {
|
|
182
|
+
readonly _id: Uuid;
|
|
183
|
+
props: Readonly<Props>;
|
|
184
|
+
getPrimitive(): Primitive;
|
|
185
|
+
getPayload(): {
|
|
186
|
+
id: string;
|
|
187
|
+
name: string;
|
|
188
|
+
age: number;
|
|
189
|
+
};
|
|
190
|
+
equals<Implemented_1 extends EntityBase<Uuid, Props, Primitive, {
|
|
191
|
+
id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
age: number;
|
|
194
|
+
}>>(this: Implemented_1, object?: Implemented_1 | undefined): boolean;
|
|
195
|
+
readonly id: Uuid;
|
|
196
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
197
|
+
}) & {
|
|
198
|
+
conditions: z.ZodType<Props, z.ZodTypeDef, {
|
|
199
|
+
id: string;
|
|
200
|
+
name: string;
|
|
201
|
+
age: number;
|
|
202
|
+
}>;
|
|
203
|
+
builder?(value: Props): EntityBase<Uuid, Props, Primitive, {
|
|
204
|
+
id: string;
|
|
205
|
+
name: string;
|
|
206
|
+
age: number;
|
|
207
|
+
}>;
|
|
208
|
+
PROPS_VERSION: number;
|
|
209
|
+
NAME: string;
|
|
210
|
+
}) & typeof Definition>(this: Implemented, payload: {
|
|
211
|
+
id: string;
|
|
212
|
+
name: string;
|
|
213
|
+
age: number;
|
|
214
|
+
}): Validation<Errors, InstanceType<Implemented>>;
|
|
215
|
+
builder(props: Props): {
|
|
216
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
217
|
+
readonly _id: Uuid;
|
|
218
|
+
props: Readonly<Props>;
|
|
219
|
+
getPrimitive(): Primitive;
|
|
220
|
+
getPayload(): {
|
|
221
|
+
id: string;
|
|
222
|
+
name: string;
|
|
223
|
+
age: number;
|
|
224
|
+
};
|
|
225
|
+
equals<Implemented extends EntityBase<Uuid, Props, Primitive, {
|
|
226
|
+
id: string;
|
|
227
|
+
name: string;
|
|
228
|
+
age: number;
|
|
229
|
+
}>>(this: Implemented, object?: Implemented | undefined): boolean;
|
|
230
|
+
readonly id: Uuid;
|
|
231
|
+
};
|
|
232
|
+
conditions: z.ZodType<Props, z.ZodTypeDef, {
|
|
233
|
+
id: string;
|
|
234
|
+
name: string;
|
|
235
|
+
age: number;
|
|
236
|
+
}>;
|
|
237
|
+
PROPS_VERSION: number;
|
|
238
|
+
NAME: string;
|
|
239
|
+
}) & {
|
|
240
|
+
new (...args: any[]): {
|
|
241
|
+
readonly _id: Uuid;
|
|
242
|
+
props: Readonly<Props>;
|
|
243
|
+
getPrimitive(): Primitive;
|
|
244
|
+
getPayload(): {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
age: number;
|
|
248
|
+
};
|
|
249
|
+
equals<Implemented extends EntityBase<Uuid, Props, Primitive, {
|
|
250
|
+
id: string;
|
|
251
|
+
name: string;
|
|
252
|
+
age: number;
|
|
253
|
+
}>>(this: Implemented, object?: Implemented | undefined): boolean;
|
|
254
|
+
readonly id: Uuid;
|
|
255
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
256
|
+
} & Props;
|
|
257
|
+
prototype: {
|
|
258
|
+
readonly _id: Uuid;
|
|
259
|
+
props: Readonly<Props>;
|
|
260
|
+
getPrimitive(): Primitive;
|
|
261
|
+
getPayload(): {
|
|
262
|
+
id: string;
|
|
263
|
+
name: string;
|
|
264
|
+
age: number;
|
|
265
|
+
};
|
|
266
|
+
equals<Implemented extends EntityBase<Uuid, Props, Primitive, {
|
|
267
|
+
id: string;
|
|
268
|
+
name: string;
|
|
269
|
+
age: number;
|
|
270
|
+
}>>(this: Implemented, object?: Implemented | undefined): boolean;
|
|
271
|
+
readonly id: Uuid;
|
|
272
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
273
|
+
} & Props;
|
|
274
|
+
} & ((abstract new (...args: any[]) => {
|
|
275
|
+
readonly _id: Uuid;
|
|
276
|
+
props: Readonly<Props>;
|
|
277
|
+
getPrimitive(): Primitive;
|
|
278
|
+
getPayload(): {
|
|
279
|
+
id: string;
|
|
280
|
+
name: string;
|
|
281
|
+
age: number;
|
|
282
|
+
};
|
|
283
|
+
equals<Implemented extends EntityBase<Uuid, Props, Primitive, {
|
|
284
|
+
id: string;
|
|
285
|
+
name: string;
|
|
286
|
+
age: number;
|
|
287
|
+
}>>(this: Implemented, object?: Implemented | undefined): boolean;
|
|
288
|
+
readonly id: Uuid;
|
|
289
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
290
|
+
}) & {
|
|
291
|
+
conditions: z.ZodType<Props, z.ZodTypeDef, {
|
|
292
|
+
id: string;
|
|
293
|
+
name: string;
|
|
294
|
+
age: number;
|
|
295
|
+
}>;
|
|
296
|
+
builder?(value: Props): EntityBase<Uuid, Props, Primitive, {
|
|
297
|
+
id: string;
|
|
298
|
+
name: string;
|
|
299
|
+
age: number;
|
|
300
|
+
}>;
|
|
301
|
+
PROPS_VERSION: number;
|
|
302
|
+
NAME: string;
|
|
303
|
+
}) & typeof Definition;
|
|
304
|
+
/**
|
|
305
|
+
* Entidad
|
|
306
|
+
*/
|
|
307
|
+
declare class Invoice extends Invoice_base {
|
|
308
|
+
}
|
|
309
|
+
export { Invoice };
|
|
310
|
+
export { Errors as InvoiceErrors };
|
|
311
|
+
export { Payload as InvoicePayload };
|
|
312
|
+
export { Primitive as InvoicePrimitive };
|
|
313
|
+
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../../src/test/execute-sequentially/artifacts/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,CAAC,EACD,SAAS,EACT,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAS,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,UAAU,EAIV,IAAI,EACJ,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AAGH,UAAU,KAAK;IACb,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,UAAU,SAAS;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAWD,QAAA,MAAM,UAAU;;;;;;;;;;;;EAAQ,CAAC;AAIzB,KAAK,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE1C,KAAK,MAAM,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;AAG1E;;GAEG;AACH,uBACe,UAAW,SAAQ,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;IAC3E,gBAAuB,IAAI,oBAAoB;IAC/C,MAAM,CAAC,aAAa,SAAM;IAC1B,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CACpD;IACb;;OAEG;gBACgB,KAAK,EAAE,KAAK;IAG/B;;;OAGG;IACI,UAAU,IAAI,OAAO;IAO5B;;;OAGG;IACI,YAAY,IAAI,SAAS;IAOhC;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC,gBAAgB,EAAE,IAAI,CAAC;CAIhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGD;;GAEG;AACH,cAIM,OAAQ,SAAQ,YAOT;CAAG;AAGhB,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,CAAC;AACrC,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { z, } from "@imolko/ultra-v8n";
|
|
11
|
+
import { valid } from "@imolko/ultra-result";
|
|
12
|
+
import { EntityBase, EntityWithPublicApi, isEntityComplete, RegisterEntity, Uuid, } from "../../../entity";
|
|
13
|
+
// ------------------------------------------------------------------------------
|
|
14
|
+
// conditions.ts
|
|
15
|
+
/**
|
|
16
|
+
* Condiciones o reglas del artefacto
|
|
17
|
+
*/
|
|
18
|
+
const build = z.object({
|
|
19
|
+
id: Uuid.rules(),
|
|
20
|
+
name: z.string().min(5),
|
|
21
|
+
age: z.number().min(18),
|
|
22
|
+
});
|
|
23
|
+
const conditions = build;
|
|
24
|
+
// ------------------------------------------------------------------------------
|
|
25
|
+
// definition.ts
|
|
26
|
+
/**
|
|
27
|
+
* Definicion del agregado
|
|
28
|
+
*/
|
|
29
|
+
let Definition = class Definition extends EntityBase {
|
|
30
|
+
/**
|
|
31
|
+
* Constructor
|
|
32
|
+
*/
|
|
33
|
+
constructor(props) {
|
|
34
|
+
super(props);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Devuelve las propiedades serializadas que permite las reconstruccion de la entidad
|
|
38
|
+
* @returns {Payload}
|
|
39
|
+
*/
|
|
40
|
+
getPayload() {
|
|
41
|
+
return {
|
|
42
|
+
name: this.props.name,
|
|
43
|
+
age: this.props.age,
|
|
44
|
+
id: this.props.id.getPrimitive(),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Devuelve las propiedades serializadas para exponer en la aplicacion
|
|
49
|
+
* @returns {Primitive}
|
|
50
|
+
*/
|
|
51
|
+
getPrimitive() {
|
|
52
|
+
return {
|
|
53
|
+
name: this.props.name,
|
|
54
|
+
age: this.props.age,
|
|
55
|
+
id: this.props.id.getPrimitive(),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Cambiar el nombre
|
|
60
|
+
* @param newName
|
|
61
|
+
*/
|
|
62
|
+
changeName(newName) {
|
|
63
|
+
const result = this.clone({ name: newName });
|
|
64
|
+
return valid(result);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
Definition.NAME = "invoice-entity";
|
|
68
|
+
Definition.PROPS_VERSION = 12;
|
|
69
|
+
Definition.conditions = conditions;
|
|
70
|
+
Definition = __decorate([
|
|
71
|
+
isEntityComplete(),
|
|
72
|
+
__metadata("design:paramtypes", [Object])
|
|
73
|
+
], Definition);
|
|
74
|
+
// ------------------------------------------------------------------------------
|
|
75
|
+
// entity.ts
|
|
76
|
+
/**
|
|
77
|
+
* Entidad
|
|
78
|
+
*/
|
|
79
|
+
let Invoice = class Invoice extends EntityWithPublicApi(Definition) {
|
|
80
|
+
};
|
|
81
|
+
Invoice = __decorate([
|
|
82
|
+
RegisterEntity({
|
|
83
|
+
description: "Factura de prueba ENTIDAD",
|
|
84
|
+
domain: "ultra-ddd",
|
|
85
|
+
})
|
|
86
|
+
], Invoice);
|
|
87
|
+
// ------------------------------------------------------------------------------
|
|
88
|
+
// index.ts
|
|
89
|
+
export { Invoice };
|
|
90
|
+
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../../src/test/execute-sequentially/artifacts/entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAIL,CAAC,GAGF,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAc,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,IAAI,GAEL,MAAM,iBAAiB,CAAC;AAmBzB,iFAAiF;AACjF,gBAAgB;AAChB;;GAEG;AACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;IACrB,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;CACxB,CAAC,CAAC;AACH,MAAM,UAAU,GAAG,KAAK,CAAC;AAOzB,iFAAiF;AACjF,gBAAgB;AAChB;;GAEG;AACH,IACe,UAAU,GADzB,MACe,UAAW,SAAQ,UAA2C;IAK3E;;OAEG;IACH,YAAmB,KAAY;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IACD;;;OAGG;IACI,UAAU;QACf,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;YACnB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE;SACjC,CAAC;IACJ,CAAC;IACD;;;OAGG;IACI,YAAY;QACjB,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;YACnB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE;SACjC,CAAC;IACJ,CAAC;IACD;;;OAGG;IACH,UAAU,CAAC,OAAe;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QAC7C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;;AAvCsB,eAAI,GAAG,gBAAgB,AAAnB,CAAoB;AACxC,wBAAa,GAAG,EAAE,AAAL,CAAM;AACV,qBAAU,GACxB,UAAU,AADc,CACb;AAJA,UAAU;IADxB,gBAAgB,EAAE;;GACJ,UAAU,CAyCxB;AACD,iFAAiF;AACjF,YAAY;AACZ;;GAEG;AAKH,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,mBAAmB,CAOvC,UAAU,CAAC;CAAG,CAAA;AAPV,OAAO;IAJZ,cAAc,CAAC;QACd,WAAW,EAAE,2BAA2B;QACxC,MAAM,EAAE,WAAW;KACpB,CAAC;GACI,OAAO,CAOG;AAChB,iFAAiF;AACjF,WAAW;AACX,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/execute-sequentially/artifacts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/test/execute-sequentially/artifacts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { InvalidTypeError, TooBigError, TooSmallError, z, ZodSchema, ZodTypeDef } from "@imolko/ultra-v8n";
|
|
2
|
+
import { ValueObjectBase } from "../../../value-object";
|
|
3
|
+
/**
|
|
4
|
+
* Interfaces
|
|
5
|
+
*/
|
|
6
|
+
interface Props {
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
type Primitive = string;
|
|
10
|
+
declare const conditions: z.ZodEffects<z.ZodString, {
|
|
11
|
+
name: string;
|
|
12
|
+
}, string>;
|
|
13
|
+
type Payload = z.input<typeof conditions>;
|
|
14
|
+
type Errors = InvalidTypeError | TooBigError | TooSmallError;
|
|
15
|
+
/**
|
|
16
|
+
* Definicion del agregado
|
|
17
|
+
*/
|
|
18
|
+
declare abstract class Definition extends ValueObjectBase<Props, Primitive, Payload> {
|
|
19
|
+
static readonly NAME = "invoice-name";
|
|
20
|
+
static PROPS_VERSION: number;
|
|
21
|
+
static readonly conditions: ZodSchema<Props, ZodTypeDef, Payload>;
|
|
22
|
+
/**
|
|
23
|
+
* Constructor
|
|
24
|
+
*/
|
|
25
|
+
constructor(props: Props);
|
|
26
|
+
/**
|
|
27
|
+
* Devuelve las propiedades serializadas que permite las reconstruccion de la entidad
|
|
28
|
+
* @returns {Payload}
|
|
29
|
+
*/
|
|
30
|
+
getPayload(): Payload;
|
|
31
|
+
/**
|
|
32
|
+
* Devuelve las propiedades serializadas para exponer en la aplicacion
|
|
33
|
+
* @returns {Primitive}
|
|
34
|
+
*/
|
|
35
|
+
getPrimitive(): Primitive;
|
|
36
|
+
}
|
|
37
|
+
declare const InvoiceName_base: ((abstract new (...args: any[]) => {
|
|
38
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
39
|
+
readonly props: Readonly<Props>;
|
|
40
|
+
equals<Implemented extends ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
41
|
+
getPrimitive(): string;
|
|
42
|
+
getPayload(): string;
|
|
43
|
+
}) & {
|
|
44
|
+
factoryUsed: boolean;
|
|
45
|
+
rules<Implemented extends /*elided*/ any & {
|
|
46
|
+
new (...args: any[]): {
|
|
47
|
+
readonly props: Readonly<Props>;
|
|
48
|
+
equals<Implemented_1 extends ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
49
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
50
|
+
getPrimitive(): string;
|
|
51
|
+
getPayload(): string;
|
|
52
|
+
} & Props;
|
|
53
|
+
prototype: {
|
|
54
|
+
readonly props: Readonly<Props>;
|
|
55
|
+
equals<Implemented_1 extends ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
56
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
57
|
+
getPrimitive(): string;
|
|
58
|
+
getPayload(): string;
|
|
59
|
+
} & Props;
|
|
60
|
+
} & ((abstract new (...args: any[]) => {
|
|
61
|
+
readonly props: Readonly<Props>;
|
|
62
|
+
equals<Implemented_1 extends ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
63
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
64
|
+
getPrimitive(): string;
|
|
65
|
+
getPayload(): string;
|
|
66
|
+
}) & {
|
|
67
|
+
conditions: ZodSchema;
|
|
68
|
+
builder?(value: Props): ValueObjectBase<Props, string, string>;
|
|
69
|
+
NAME: string;
|
|
70
|
+
}) & typeof Definition>(this: Implemented): z.ZodType<InstanceType<Implemented>, z.ZodTypeDef, string>;
|
|
71
|
+
of<Implemented extends /*elided*/ any & {
|
|
72
|
+
new (...args: any[]): {
|
|
73
|
+
readonly props: Readonly<Props>;
|
|
74
|
+
equals<Implemented_1 extends ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
75
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
76
|
+
getPrimitive(): string;
|
|
77
|
+
getPayload(): string;
|
|
78
|
+
} & Props;
|
|
79
|
+
prototype: {
|
|
80
|
+
readonly props: Readonly<Props>;
|
|
81
|
+
equals<Implemented_1 extends ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
82
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
83
|
+
getPrimitive(): string;
|
|
84
|
+
getPayload(): string;
|
|
85
|
+
} & Props;
|
|
86
|
+
} & ((abstract new (...args: any[]) => {
|
|
87
|
+
readonly props: Readonly<Props>;
|
|
88
|
+
equals<Implemented_1 extends ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
89
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
90
|
+
getPrimitive(): string;
|
|
91
|
+
getPayload(): string;
|
|
92
|
+
}) & {
|
|
93
|
+
conditions: ZodSchema;
|
|
94
|
+
builder?(value: Props): ValueObjectBase<Props, string, string>;
|
|
95
|
+
NAME: string;
|
|
96
|
+
}) & typeof Definition>(this: Implemented, payload: string): import("@imolko/ultra-result").Validation<Errors, InstanceType<Implemented>>;
|
|
97
|
+
builder(props: Props): {
|
|
98
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
99
|
+
readonly props: Readonly<Props>;
|
|
100
|
+
equals<Implemented extends ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
101
|
+
getPrimitive(): string;
|
|
102
|
+
getPayload(): string;
|
|
103
|
+
};
|
|
104
|
+
conditions: ZodSchema;
|
|
105
|
+
NAME: string;
|
|
106
|
+
}) & {
|
|
107
|
+
new (...args: any[]): {
|
|
108
|
+
readonly props: Readonly<Props>;
|
|
109
|
+
equals<Implemented extends ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
110
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
111
|
+
getPrimitive(): string;
|
|
112
|
+
getPayload(): string;
|
|
113
|
+
} & Props;
|
|
114
|
+
prototype: {
|
|
115
|
+
readonly props: Readonly<Props>;
|
|
116
|
+
equals<Implemented extends ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
117
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
118
|
+
getPrimitive(): string;
|
|
119
|
+
getPayload(): string;
|
|
120
|
+
} & Props;
|
|
121
|
+
} & ((abstract new (...args: any[]) => {
|
|
122
|
+
readonly props: Readonly<Props>;
|
|
123
|
+
equals<Implemented extends ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
124
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
125
|
+
getPrimitive(): string;
|
|
126
|
+
getPayload(): string;
|
|
127
|
+
}) & {
|
|
128
|
+
conditions: ZodSchema;
|
|
129
|
+
builder?(value: Props): ValueObjectBase<Props, string, string>;
|
|
130
|
+
NAME: string;
|
|
131
|
+
}) & typeof Definition;
|
|
132
|
+
/**
|
|
133
|
+
* Agregado
|
|
134
|
+
*/
|
|
135
|
+
declare class InvoiceName extends InvoiceName_base {
|
|
136
|
+
}
|
|
137
|
+
export { InvoiceName };
|
|
138
|
+
export { Errors as InvoiceNameErrors };
|
|
139
|
+
export { Payload as InvoiceNamePayload };
|
|
140
|
+
export { Primitive as InvoiceNamePrimitive };
|
|
141
|
+
//# sourceMappingURL=value-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-object.d.ts","sourceRoot":"","sources":["../../../../src/test/execute-sequentially/artifacts/value-object.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,CAAC,EACD,SAAS,EACT,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AAGH,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAGD,KAAK,SAAS,GAAG,MAAM,CAAC;AAaxB,QAAA,MAAM,UAAU;;UAAQ,CAAC;AAIzB,KAAK,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE1C,KAAK,MAAM,GAAG,gBAAgB,GAAG,WAAW,GAAG,aAAa,CAAC;AAG7D;;GAEG;AACH,uBACe,UAAW,SAAQ,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;IAC1E,gBAAuB,IAAI,kBAAkB;IAC7C,MAAM,CAAC,aAAa,SAAM;IAC1B,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CACpD;IACb;;OAEG;gBACgB,KAAK,EAAE,KAAK;IAG/B;;;OAGG;IACI,UAAU,IAAI,OAAO;IAG5B;;;OAGG;IACI,YAAY,IAAI,SAAS;CAGjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGD;;GAEG;AACH,cAIM,WAAY,SAAQ,gBAMb;CAAG;AAGhB,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,CAAC;AACzC,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { z, } from "@imolko/ultra-v8n";
|
|
11
|
+
import { isVOComplete, RegisterValueObject, ValueObjectBase, ValueObjectWithPublicApi, } from "../../../value-object";
|
|
12
|
+
// ------------------------------------------------------------------------------
|
|
13
|
+
// conditions.ts
|
|
14
|
+
/**
|
|
15
|
+
* Condiciones o reglas del artefacto
|
|
16
|
+
*/
|
|
17
|
+
const build = z
|
|
18
|
+
.string()
|
|
19
|
+
.trim()
|
|
20
|
+
.min(5)
|
|
21
|
+
.max(30)
|
|
22
|
+
.transform((value) => ({ name: value }));
|
|
23
|
+
const conditions = build;
|
|
24
|
+
// ------------------------------------------------------------------------------
|
|
25
|
+
// definition.ts
|
|
26
|
+
/**
|
|
27
|
+
* Definicion del agregado
|
|
28
|
+
*/
|
|
29
|
+
let Definition = class Definition extends ValueObjectBase {
|
|
30
|
+
/**
|
|
31
|
+
* Constructor
|
|
32
|
+
*/
|
|
33
|
+
constructor(props) {
|
|
34
|
+
super(props);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Devuelve las propiedades serializadas que permite las reconstruccion de la entidad
|
|
38
|
+
* @returns {Payload}
|
|
39
|
+
*/
|
|
40
|
+
getPayload() {
|
|
41
|
+
return this.props.name;
|
|
42
|
+
;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Devuelve las propiedades serializadas para exponer en la aplicacion
|
|
46
|
+
* @returns {Primitive}
|
|
47
|
+
*/
|
|
48
|
+
getPrimitive() {
|
|
49
|
+
return this.props.name;
|
|
50
|
+
;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Definition.NAME = "invoice-name";
|
|
54
|
+
Definition.PROPS_VERSION = 12;
|
|
55
|
+
Definition.conditions = conditions;
|
|
56
|
+
Definition = __decorate([
|
|
57
|
+
isVOComplete(),
|
|
58
|
+
__metadata("design:paramtypes", [Object])
|
|
59
|
+
], Definition);
|
|
60
|
+
// ------------------------------------------------------------------------------
|
|
61
|
+
// value-object.ts
|
|
62
|
+
/**
|
|
63
|
+
* Agregado
|
|
64
|
+
*/
|
|
65
|
+
let InvoiceName = class InvoiceName extends ValueObjectWithPublicApi(Definition) {
|
|
66
|
+
};
|
|
67
|
+
InvoiceName = __decorate([
|
|
68
|
+
RegisterValueObject({
|
|
69
|
+
description: "Factura de prueba ENTIDAD",
|
|
70
|
+
domain: "ultra-ddd",
|
|
71
|
+
})
|
|
72
|
+
], InvoiceName);
|
|
73
|
+
// ------------------------------------------------------------------------------
|
|
74
|
+
// index.ts
|
|
75
|
+
export { InvoiceName };
|
|
76
|
+
//# sourceMappingURL=value-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-object.js","sourceRoot":"","sources":["../../../../src/test/execute-sequentially/artifacts/value-object.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAIL,CAAC,GAGF,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAc/B,iFAAiF;AACjF,gBAAgB;AAChB;;GAEG;AACH,MAAM,KAAK,GAAG,CAAC;KACZ,MAAM,EAAE;KACR,IAAI,EAAE;KACN,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,KAAK,CAAC;AAOzB,iFAAiF;AACjF,gBAAgB;AAChB;;GAEG;AACH,IACe,UAAU,GADzB,MACe,UAAW,SAAQ,eAA0C;IAK1E;;OAEG;IACH,YAAmB,KAAY;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IACD;;;OAGG;IACI,UAAU;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAAA,CAAC;IAC1B,CAAC;IACD;;;OAGG;IACI,YAAY;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAAA,CAAC;IAC1B,CAAC;;AAvBsB,eAAI,GAAG,cAAc,AAAjB,CAAkB;AACtC,wBAAa,GAAG,EAAE,AAAL,CAAM;AACV,qBAAU,GACxB,UAAU,AADc,CACb;AAJA,UAAU;IADxB,YAAY,EAAE;;GACA,UAAU,CAyBxB;AACD,iFAAiF;AACjF,kBAAkB;AAClB;;GAEG;AAKH,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,wBAAwB,CAMhD,UAAU,CAAC;CAAG,CAAA;AANV,WAAW;IAJhB,mBAAmB,CAAC;QACnB,WAAW,EAAE,2BAA2B;QACxC,MAAM,EAAE,WAAW;KACpB,CAAC;GACI,WAAW,CAMD;AAChB,iFAAiF;AACjF,WAAW;AACX,OAAO,EAAE,WAAW,EAAE,CAAC"}
|