Initial commit of framework

This commit is contained in:
2020-11-01 12:50:03 -06:00
commit ad0abe5b84
47 changed files with 5416 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
const { Model } = require('flitter-orm')
/*
* Example Model
* -------------------------------------------------------------
* This is a sample model. The schema or structure of the model should
* be specified here. It is then passed to flitter-orm and can be accessed
* globally using the canonical models service.
*/
class Example extends Model {
static get services() {
return [...super.services, 'output']
}
/*
* Define the flitter-orm schema of the model.
*/
static get schema() {
return {
name: String,
create_date: {type: Date, default: () => new Date},
}
}
log_name() {
this.output.info(`[Example Model] ${this.name}`)
}
}
module.exports = exports = Example