@microsoft/paris
Advanced tools
Comparing version 1.3.5 to 1.3.6
@@ -285,3 +285,3 @@ import { ModelBase } from "../config/model.base"; | ||
} | ||
else if (fieldRepository_1) | ||
else if (fieldRepository_1 && fieldRepository_1.entity) | ||
modelValue = isNilValue ? fieldRepository_1.modelConfig.getDefaultValue() || null : itemFieldValue.id; | ||
@@ -288,0 +288,0 @@ else if (fieldValueObjectType_1) |
import 'reflect-metadata'; | ||
(<any>global)['Reflect'] = Reflect; |
@@ -24,3 +24,3 @@ { | ||
"_spec": "json-stringify-safe@^5.0.1", | ||
"_where": "C:\\git\\paris\\node_modules\\conventional-changelog-writer", | ||
"_where": "C:\\repos\\Paris\\node_modules\\conventional-changelog-writer", | ||
"author": { | ||
@@ -27,0 +27,0 @@ "name": "Isaac Z. Schlueter", |
{ | ||
"name": "@microsoft/paris", | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"description": "Library for the implementation of Domain Driven Design with TypeScript + RxJS", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -0,0 +0,0 @@ import {Paris} from '../../lib/paris'; |
@@ -0,0 +0,0 @@ import {TodoList} from "./todo-list.entity"; |
@@ -0,0 +0,0 @@ import {Entity} from "../../lib/config/decorators/entity.decorator"; |
@@ -0,0 +0,0 @@ import {Todo} from "./todo.entity"; |
@@ -18,2 +18,5 @@ import {Observable, of} from 'rxjs'; | ||
import {TodoStatus} from "../mock/todo-status.entity"; | ||
import {ModelBase} from "../../lib/config/model.base"; | ||
import {ValueObject} from "../../lib/config/decorators/value-object.decorator"; | ||
import {ModelConfig} from "../../lib/config/model-config"; | ||
@@ -251,5 +254,20 @@ describe('Modeler', () => { | ||
let serializedEntityWithValueObject:{ new(data:any):any }; | ||
let serializedEntityWithValueObjectRepo:Repository<any>; | ||
beforeEach(() => { | ||
serializeItem = jest.fn(); | ||
@ValueObject({ | ||
singularName: 'property', | ||
pluralName: 'property' | ||
}) | ||
class SerializedEntityPropertyValueObject extends ModelBase { | ||
@EntityField() | ||
prop1: string; | ||
@EntityField() | ||
prop2: string; | ||
} | ||
@Entity({ | ||
@@ -265,4 +283,17 @@ singularName: "Serialized entity", | ||
@Entity({ | ||
singularName: "Serialized entity2", | ||
pluralName: "Serialized entities2", | ||
endpoint: "serialized2", | ||
}) | ||
class SerializedEntityWithValueObject extends EntityModelBase { | ||
@EntityField() name:string; | ||
@EntityField() val: SerializedEntityPropertyValueObject; | ||
} | ||
serializedEntity = SerializedEntity; | ||
serializedItemRepo = paris.getRepository(SerializedEntity); | ||
serializedEntityWithValueObject = SerializedEntityWithValueObject; | ||
serializedEntityWithValueObjectRepo = paris.getRepository(SerializedEntityWithValueObject); | ||
}); | ||
@@ -277,3 +308,9 @@ | ||
}); | ||
it ("serializes the entity with the nested value object intact", () => { | ||
const newSerializedItem = { name: 'test', val: { prop1: 'test', prop2: 'test2' } }; | ||
const serializedModel:Record<string, any> = paris.modeler.serializeModel<any>(newSerializedItem, serializedEntityWithValueObjectRepo.modelConfig as ModelConfig<any>); | ||
expect(serializedModel['val']).toBeDefined(); | ||
}); | ||
}); | ||
}); |
@@ -0,0 +0,0 @@ import { Observable, of } from 'rxjs'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242849
145
4975