Skip to content

Commit 7a1d343

Browse files
committed
fix: minor types fix
1 parent bd70e66 commit 7a1d343

26 files changed

+31
-64
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ All notable changes to this project will be documented in this file.
1010

1111
### [3.9.0] - 2024-04-28
1212

13-
### Update
13+
### Update (Break Change)
1414

15-
- Update core
15+
- Update core to v1.23.0
1616
- check [Core Changelog](https://github.com/4lessandrodev/rich-domain/blob/main/CHANGELOG.md)
1717

1818
---

lib/utils/birthday.value-object.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ interface Prop {
88
export class BirthdayValueObject extends ValueObject<Prop> {
99
private readonly ONE_YEAR: number = 31536000902;
1010
protected static readonly MAX_HUMAN_AGE: number = 121;
11-
protected static readonly DISABLE_SETTER: boolean = true;
1211
protected static readonly MESSAGE: string = `Invalid age for a human. Must has less than ${BirthdayValueObject.MAX_HUMAN_AGE} years old and birth not in future`;
1312

1413
private constructor(prop: Prop) {
15-
super(prop, { disableSetters: BirthdayValueObject.DISABLE_SETTER });
14+
super(prop);
1615
}
1716

1817
/**

lib/utils/cnpj.value-object.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ interface Prop {
1313

1414
export class CNPJValueObject extends ValueObject<Prop> {
1515
protected static readonly REGEX = regexCnpj;
16-
protected static readonly DISABLE_SETTER: boolean = true;
1716
protected static readonly MESSAGE: string = 'Invalid value for cnpj';
1817

1918
private constructor(props: Prop) {
20-
super(props, { disableSetters: CNPJValueObject.DISABLE_SETTER });
19+
super(props);
2120
this.removeSpecialChars();
2221
}
2322

lib/utils/cpf.value-object.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ interface Prop {
1111

1212
export class CPFValueObject extends ValueObject<Prop> {
1313
protected static readonly REGEX = regexCpf;
14-
protected static readonly DISABLE_SETTER: boolean = true;
1514
protected static readonly MESSAGE: string = 'Invalid value for cpf';
1615

1716
private constructor(props: Prop) {
18-
super(props, { disableSetters: CPFValueObject.DISABLE_SETTER });
17+
super(props);
1918
this.removeSpecialChars();
2019
}
2120

lib/utils/currency.value-object.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ interface Prop {
5656
*/
5757
class CurrencyValueObject extends ValueObject<Prop> {
5858
private cents: number;
59-
protected static readonly DISABLE_SETTER: boolean = true;
6059
protected static readonly MESSAGE: string = `Value is not a safe number, must be between ${minSafeValue} and ${maxSafeValue}`;
6160

6261
private constructor(props: Prop) {
63-
super(props, { disableSetters: CurrencyValueObject.DISABLE_SETTER });
62+
super(props);
6463
this.cents = convertValueToCent(props.value);
6564
}
6665

lib/utils/custom-number.value-object.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ export class CustomNumberValueObject extends ValueObject<Prop> {
2121
};
2222
protected static readonly MAX: number = Number.MAX_SAFE_INTEGER;
2323
protected static readonly MIN: number = Number.MIN_SAFE_INTEGER;
24-
protected static readonly DISABLE_SETTER: boolean = true;
2524
protected static readonly MESSAGE: string =
2625
'Invalid value for a custom number';
2726

2827
private constructor(props: Prop) {
29-
super(props, {
30-
disableSetters: CustomNumberValueObject.DISABLE_SETTER,
31-
});
28+
super(props);
3229
}
3330

3431
/**

lib/utils/custom-string.value-object.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ export class CustomStringValueObject extends ValueObject<Prop> {
2121
};
2222
protected static readonly MAX_LENGTH: number = 255;
2323
protected static readonly MIN_LENGTH: number = 1;
24-
protected static readonly DISABLE_SETTER: boolean = true;
2524
protected static readonly MESSAGE: string =
2625
'Invalid value for a custom string';
2726

2827
private constructor(props: Prop) {
29-
super(props, {
30-
disableSetters: CustomStringValueObject.DISABLE_SETTER,
31-
});
28+
super(props);
3229
}
3330

3431
/**

lib/utils/date-value-object.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ export class DateValueObject extends ValueObject<Prop> {
4141
private readonly ONE_MONTH: number = 2678400000;
4242
private readonly ONE_WEEK: number = 604800000;
4343
private readonly ONE_YEAR: number = 31622400000;
44-
protected static readonly DISABLE_SETTER: boolean = true;
4544

4645
private constructor(props: Prop) {
47-
super(props, { disableSetters: DateValueObject.DISABLE_SETTER });
46+
super(props);
4847
}
4948

5049
/**

lib/utils/dimension.value-object.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ interface Props {
1414
}
1515

1616
export class DimensionValueObject extends ValueObject<DimensionValueObjectProps> {
17-
protected static readonly DISABLE_SETTER: boolean = true;
1817
protected static readonly MESSAGE: string = 'Invalid unit for Dimension';
1918

2019
private constructor(props: DimensionValueObjectProps) {
21-
super(props, { disableSetters: DimensionValueObject.DISABLE_SETTER });
20+
super(props);
2221
}
2322

2423
get dimension(): CustomNumberValueObject {

lib/utils/email.value-object.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ interface Prop {
77
}
88

99
export class EmailValueObject extends ValueObject<Prop> {
10-
protected static readonly DISABLE_SETTER: boolean = true;
1110
protected static readonly BLOCKED_DOMAINS: Array<string> = [];
1211
protected static readonly VALID_DOMAINS: Array<string> = [];
1312
protected static readonly MESSAGE: string = 'Invalid email';
1413

1514
private constructor(props: Prop) {
16-
super(props, { disableSetters: EmailValueObject.DISABLE_SETTER });
15+
super(props);
1716
}
1817

1918
value(): string {

0 commit comments

Comments
 (0)