Skip to main content

Function: ReadOnly()

ReadOnly(target, propertyKey): void

Defined in: service-core/src/decorators/ModelDecorators.ts:104

Apply this to a property that must never be settable by a client. RepoUtils.create()/update() strip any client-supplied value for a @ReadOnly property before persisting — the property's existing/declared-default value is kept instead, regardless of what the request body contains. Use this for fields that should only ever be changed by application/business logic (e.g. roles, ownership fields, computed/derived state).

Parameters​

target​

any

propertyKey​

string | symbol

Returns​

void