blink
blink copied to clipboard
Add typings for mongoose
From @samerbuna :
I don't think typeof User is a good idea but I see it used in the mongoose schema too, so maybe leave it for now and create a new issue to refactor all mongoose types to use interfaces extending mongoose documents.
When we do this I would advocate a naming pattern like XxxRecord ie UserRecord to clearly associate these types with the persistence layer that will hopefully emerge.
The concept of a plain User type is then free to be used for business layer logic.