Skip to content

Commit 438b95e

Browse files
committed
fix: solve error on merge
1 parent eb7c55b commit 438b95e

File tree

8 files changed

+355
-368
lines changed

8 files changed

+355
-368
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ All notable changes to this project will be documented in this file.
88

99
## Released
1010

11+
### [3.9.0] - 2024-04-28
12+
13+
### Update
14+
15+
- Update core
16+
- check [Core Changelog](https://github.com/4lessandrodev/rich-domain/blob/main/CHANGELOG.md)
17+
18+
---
19+
20+
## Released
21+
1122
### [3.8.3] - 2024-04-13
1223

1324
### Update

lib/types/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
ICommand,
2626
} from 'rich-domain/types';
2727
import { IProxy, IIterator, IHistory, IEntityHistory } from 'rich-domain/types';
28-
import { IGettersAndSetters, IParentName } from 'rich-domain/types';
28+
import { IParentName } from 'rich-domain/types';
2929

3030
export interface CloneProps {
3131
isNew: boolean;
@@ -155,7 +155,6 @@ export {
155155
IIterator,
156156
IHistory,
157157
IEntityHistory,
158-
IGettersAndSetters,
159158
IParentName,
160159
IUseCase,
161160
IPropsValidation,

lib/utils/color-converter.util.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { HEXColorValueObject, RGBColorValueObject } from '..';
2-
31
const colorConverter = {
42
/**
53
*
@@ -8,8 +6,8 @@ const colorConverter = {
86
* @example #ffffff
97
* @returns rgb(255, 255, 255)
108
*/
11-
HEXToRGB(color: string) {
12-
const isValid = HEXColorValueObject.isValidProps(color);
9+
HEXToRGB(color: string, validate: (color: string) => boolean) {
10+
const isValid = validate(color);
1311

1412
if (!isValid) {
1513
return color;
@@ -32,8 +30,8 @@ const colorConverter = {
3230
* @example rgb(255, 255, 255)
3331
* @returns hex color #ffffff
3432
*/
35-
RGBToHEX(color: string) {
36-
const isValid = RGBColorValueObject.isValidProps(color);
33+
RGBToHEX(color: string, validate: (color: string) => boolean) {
34+
const isValid = validate(color);
3735

3836
if (!isValid) {
3937
return color;

lib/utils/hex-color.value-object.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ class HEXColorValueObject extends ValueObject<Prop> {
5050
* @example rgb(255, 255, 255)
5151
*/
5252
getAsRGB(): string {
53-
return colorConverter.HEXToRGB(this.props.value);
53+
return colorConverter.HEXToRGB(
54+
this.props.value,
55+
HEXColorValueObject.isValidProps,
56+
);
5457
}
5558

5659
/**

lib/utils/rgb-color.value-object.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ class RGBColorValueObject extends ValueObject<Prop> {
5252
* @example #ffffff
5353
*/
5454
getAsHex(): string {
55-
return colorConverter.RGBToHEX(this.props.value);
55+
return colorConverter.RGBToHEX(
56+
this.props.value,
57+
RGBColorValueObject.isValidProps,
58+
);
5659
}
5760

5861
/**

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "types-ddd",
3-
"version": "3.8.3",
3+
"version": "3.9.0-beta.0",
44
"description": "This package provide utils file and interfaces to assistant build a complex application with domain driving design",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -61,7 +61,7 @@
6161
"bcrypt": "^5.0.1",
6262
"pino": "^8.17.1",
6363
"pino-pretty": "^11.0.0",
64-
"rich-domain": "^1.22.0"
64+
"rich-domain": "1.23.0-beta.0"
6565
},
6666
"devDependencies": {
6767
"@microsoft/tsdoc": "^0.14.1",

tests/entity/product.entity.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ describe('entity', () => {
4141

4242
const object = orange.toObject();
4343
expect(object.additionalInfo).toEqual(['from brazil']);
44-
expect(object.name).toBe('orange');
44+
expect(object.name.value).toBe('orange');
45+
expect(orange.get('name').get('value')).toBe('orange');
4546
expect(object.price).toBe(10);
4647
});
4748
});

yarn.lock

Lines changed: 327 additions & 355 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)