@rocketseat/ddd-utils

1.0.1 • Public • Published

DDD Utils

Shared utils to build Domain-Driven Design Node.js applications.

Installation

yarn add @rocketseat/ddd-utils

Domain utils

  • AggregateRoot: Used to add Domain Events funcionality to Entity;
  • Entity: Mark a class as a Entity;
  • UniqueEntityID: Create or gereate an unique ID using UUID;
  • ValueObject: Create a entity attribute with custom validations;
  • WatchedList: Create a list that memorize added or deleted items;

Domain events utils

  • DomainEvents: Used by Aggregate Root to add Domain Events to Entity;
  • IDomainEvent: Interface used when creating a new Domain Event;
  • IHandle: Interface used when creating a new Domain Event Handler;

Infra utils

  • BaseController: Extendable class used inside controllers in our application;
  • IMapper: Interface used when creating mappers (WIP);

Logic utils

  • AppError: Default errors caused by malfunctioning of our application;
  • Guard: Simple validation class used to validate domain entities;
  • Result: Result class, do not throw errors, use always the result class;
  • UseCaseError: Extendable class used to define a Use Case error;

Tests utils

  • BaseFakeRepo: Extendable class to create fake repositories used for testing;

Readme

Keywords

none

Package Sidebar

Install

npm i @rocketseat/ddd-utils

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

21.9 kB

Total Files

34

Last publish

Collaborators

  • diogojhony
  • dieegosf