Releases: 4lessandrodev/rich-domain
Releases · 4lessandrodev/rich-domain
v1.19.1
What's Changed
- rebase by @4lessandrodev in #74
- refactor: remove support for history by @4lessandrodev in #85
- chore(deps-dev): bump @types/node from 20.8.0 to 20.8.1 by @dependabot in #86
- chore(deps-dev): bump @types/node from 20.8.1 to 20.8.4 by @dependabot in #87
- chore(deps-dev): bump @types/node from 20.8.4 to 20.8.6 by @dependabot in #88
- chore(deps-dev): bump @types/node from 20.8.6 to 20.8.7 by @dependabot in #89
- chore(deps-dev): bump @types/node from 20.8.7 to 20.8.9 by @dependabot in #90
- rebase by @4lessandrodev in #91
- rebase by @4lessandrodev in #92
- chore(deps-dev): bump @types/node from 20.8.9 to 20.8.10 by @dependabot in #93
- chore(deps-dev): bump @types/node from 20.8.10 to 20.9.0 by @dependabot in #94
- docs: update docs (readme) by @4lessandrodev in #95
- docs: update docs (readme) by @4lessandrodev in #96
- docs: update docs (readme) by @4lessandrodev in #97
- chore(deps-dev): bump @types/node from 20.9.0 to 20.10.0 by @dependabot in #100
- chore(deps-dev): bump typescript from 5.2.2 to 5.3.2 by @dependabot in #99
- chore(deps-dev): bump ts-node from 10.9.1 to 10.9.2 by @dependabot in #104
- chore(deps-dev): bump @types/node from 20.10.0 to 20.10.4 by @dependabot in #103
- chore(deps-dev): bump typescript from 5.3.2 to 5.3.3 by @dependabot in #102
Full Changelog: v1.19.0...v1.19.1
v1.19.0
What's Changed
- Fix/compare null undefined by @4lessandrodev in #78
- chore(deps-dev): bump @types/node from 20.5.4 to 20.5.7 by @dependabot in #79
- chore(deps-dev): bump typescript from 5.1.6 to 5.2.2 by @dependabot in #80
- chore(deps-dev): bump @types/node from 20.5.7 to 20.5.9 by @dependabot in #81
- chore(deps-dev): bump @types/node from 20.5.9 to 20.6.0 by @dependabot in #82
- chore(deps-dev): bump @types/node from 20.6.0 to 20.6.2 by @dependabot in #83
- chore(deps-dev): bump @types/node from 20.6.2 to 20.7.0 by @dependabot in #84
Full Changelog: v1.18.4...v1.19.0
v1.18.4
What's Changed
- test: added tests to ensure types inference by @4lessandrodev in #72
- feat: added adapter custom err type (#282) by @4lessandrodev in #73
- chore(deps-dev): bump @types/node from 20.4.5 to 20.5.0 by @dependabot in #76
- chore(deps-dev): bump @types/node from 20.5.0 to 20.5.1 by @dependabot in #77
Full Changelog: v1.18.3...v1.18.4
v1.18.3
What's Changed
- fix: solve types error on create method by @4lessandrodev in #68
- chore(deps-dev): bump @types/node from 20.3.3 to 20.4.1 by @dependabot in #69
- chore(deps-dev): bump @types/node from 20.4.1 to 20.4.2 by @dependabot in #70
- chore(deps-dev): bump @types/node from 20.4.2 to 20.4.4 by @dependabot in #71
Full Changelog: v1.18.2...v1.18.3
v1.18.2
What's Changed
- Fix/to object by @4lessandrodev in #66
- chore(deps-dev): bump @types/node from 20.3.2 to 20.3.3 by @dependabot in #67
Full Changelog: v1.18.1...v1.18.2
v1.18.0
Full Changelog: v1.17.4...v1.18.0
v1.17.4
What's Changed
- Feat/event handler by @4lessandrodev in #39
- chore(deps-dev): bump @types/node from 18.15.0 to 18.15.2 by @dependabot in #40
- chore(deps-dev): bump @types/node from 18.15.2 to 18.15.3 by @dependabot in #42
- chore(deps-dev): bump typescript from 4.9.5 to 5.0.2 by @dependabot in #41
- chore(deps-dev): bump rimraf from 4.4.0 to 4.4.1 by @dependabot in #44
- chore(deps-dev): bump @types/node from 18.15.3 to 18.15.10 by @dependabot in #43
- chore(deps-dev): bump typescript from 5.0.2 to 5.0.3 by @dependabot in #46
- chore(deps-dev): bump @types/node from 18.15.10 to 18.15.11 by @dependabot in #45
- chore(deps-dev): bump rimraf from 4.4.1 to 5.0.0 by @dependabot in #49
- chore(deps-dev): bump typescript from 5.0.3 to 5.0.4 by @dependabot in #48
- Domain events state from aggregate by @hikinine in #50
New Contributors
Full Changelog: v1.17.2...v1.17.4
v1.17.2
What's Changed
- Refactor/set clone by @4lessandrodev in #33
- Fix/calc precision by @4lessandrodev in #34
- docs(readme): update documentation by @4lessandrodev in #35
- chore(deps-dev): bump madge from 5.0.1 to 6.0.0 by @dependabot in #36
- chore(deps-dev): bump typescript from 4.9.4 to 4.9.5 by @dependabot in #37
- chore(deps-dev): bump rimraf from 4.1.2 to 4.3.1 by @dependabot in #38
Full Changelog: v1.17.0...v1.17.2
v1.17.0
1.17.0 - 2022-01-21
Changed
- ValueObject, Entity, Aggregate:
clone
method now returns an instance insteadResult
- ValueObject, Entity, Aggregate:
set
andchange
method now returnstrue
if the value has changed and returnsfalse
if the value has not changed.
- Util: added method date. pull request 32
onst date = new Date('2001-09-09T01:46:39.999Z');
const result = Utils.date(date).add(5).days();
result.toISOString()
> "2001-09-14T01:46:39.999Z"
- Aggregate, Entity, ValueObject: added
util
method to instance. - Util: added class to domain with some utils functions. pull request 31
Example:
// remove spaces from string
const text = " Some Text With Space ";
const result = Utils.string(text).removeSpaces();
> "SomeTextWithSpace"
// remove special chars
const text = "Some #Text @With Special&* Chars";
const result = Utils.string(text).removeSpecialChars();
> "Some Text With Special Chars"
// calculate values as number
const result = Utils.number(100).multiplyBy(3);
> 300
// also works case leak value as string
const result = Utils.number("100").multiplyBy("3");
> 300
// instance available on domain instances
interface Props { value: number };
class Example extends ValueObject<Props>{
private constructor(props: Props){
super(props)
}
sum(x: number): number {
const current = this.props.value;
return this.util.number(current).sum(x);
}
}
Added
- Aggregate: added method
dispatchEvent
to handle domain events from aggregate instance. - Validator: added method
isSpecialChar
andhasSpecialChar
to check special character.
// dispatch event from aggregate instance
// dispatch all events for aggregate
product.dispatchEvent();
// OR
// dispatch an specific event name
product.dispatchEvent("ProductCreated");
Utils function available to domain instances, ValueObject, Entity and Aggregate
const result = Utils.date(date).add(5).minutes();
result.toISOString()
> "2001-09-09T01:51:39.999Z"
const result = Utils.number('70' as any).sum('7' as any);
> 77
const result = Utils.number(70).multiplyBy(7);
> 490
const target = "Hi, My Name Is Jane Doe, I am 18 years old";
const char = 'a';
const value = '4';
const result = Utils.string(target).replace(char).to(value);
> "Hi, My N4me Is J4ne Doe, I 4m 18 ye4rs old"
What's Changed
- Feat/equal by @4lessandrodev in #28
- chore(deps-dev): bump rimraf from 3.0.2 to 4.0.7 by @dependabot in #29
- Feat/validator by @4lessandrodev in #30
- Feat/util by @4lessandrodev in #31
- feat(utils): added date on util class to domain by @4lessandrodev in #32
Full Changelog: v1.16.0...v1.17.0
v1.16.0
1.16.0 - 2022-01-12
Added
- Entity: added method
isEqual
to compare current instance with another one. - ValueObject: added method
isEqual
to compare current instance with another one. Issue 27
class EntityExample extends Entity<Props>{
private constructor(props: Props) {
super(props)
}
public static create(props: Props): Result<EntityExample> {
return Ok(new EntityExample(props));
}
}
const a = EntityExample.create({...props, id }).value();
const b = EntityExample.create({...props, id }).value();
console.log(a.isEqual(b));
> true