refs https://github.com/TryGhost/Team/issues/3260
- Whenever properties of the DTO are undefined they should be removed to avoid unintentional empty assignments to the stored collection
Rather than using `require` we can add a type definition file, this allows us
to add custom types in the future if we want. We need to add some config for
ts-node to pick up the types correctly.
closes https://github.com/TryGhost/Team/issues/3259
- API output mappers (soon to be serializers) are meant to work based on allowlist set of output properties. Having the allowlist early on will allow to track the API evolution consistently.
refs https://github.com/TryGhost/Team/issues/3294
- The factory method for the Collection and validations should live close together based on our latest architectural direction
refs https://github.com/TryGhost/Team/issues/3167
- Having paging metadata is part of every API response and was missing from initial implementation
- The getAll method has all of the values as "static" as there's nothing to page on.
refs https://github.com/TryGhost/Team/issues/3167
- The core client (API) needs a way to pass in information without an ID when creating a new entity, handling it on service/repository layer makes the most sense.
- Used "require" syntax to import tpl/errors modules, otherwise TS compiler was complaining about type compatibility issues, this works as a temporary workaround and is tracked and an issue to improve in the future.
closes https://github.com/TryGhost/Team/issues/3166
- The collections service contains CRUD logic to manage collection entities through: save, getById, getAll, and destroy methods.