ConnectDTO
This kind of DTO represents the structure of input-data to expect from 'outside' (e.g. REST API consumer) when attempting to connect
to a model through a relation field.
A Model
s ConnectDTO
class is composed of a unique'd list of isId
and isUnique
scalar fields. If the ConnectDTO
class has exactly one property, the property is marked as required. If there are more than one property, all properties are optional (since setting a single one of them is already sufficient for a unique query) - you must however specify at least one property.
ConnectDTO
s are used for relation fields in CreateDTO
s and UpdateDTO
s.
CreateDTO
annotations that generate corresponding input properties on CreateDTO
and UpdateDTO
(optional or required - depending on the nature of the relation).
When generating a Model
s CreateDTO
class, field that meet any of the following conditions are omitted (order matters):
isReadOnly
OR is annotated with@NoSet
(Note: this apparently includes relation scalar fields)- field represents a relation (
field.kind === 'object'
) and is not annotated with@RAddOnAdd
or@RLnOnAdd
- field is a relation scalar
- field is not annotated with
@OptAdd
AND
UpdateDTO
When generating a Model
s UpdateDTO
class, field that meet any of the following conditions are omitted (order matters):
- field is annotated with
@OptSet
isReadOnly
OR is annotated with@NoSet
(Note: this apparently includes relation scalar fields)isId
(id fields are not supposed to be updated by the user)- field represents a relation (
field.kind === 'object'
) and is not annotated with@RAddOnSet
or@RLnOnSet
- field is a relation scalar
- field is not annotated with
@OptSet
AND