1234567891011121314151617181920212223242526272829303132333435363738 |
- import mongoose from 'mongoose'
- import { historySchema } from './core/basicSchema'
- import RESTController from './core/RESTController'
- const agencySchema = new mongoose.Schema({
- name: String,
- _history: historySchema
- })
- const jobSchema = new mongoose.Schema({
- type: {type: String, enum: ['catwalk', 'photoshoot', 'commercial']},
- description: String,
- salery: Number
- })
- const modelSchema = new mongoose.Schema({
- name: String,
- tag: String,
- _history: historySchema
- })
- const Agency = mongoose.model('Agency', agencySchema)
- const Job = mongoose.model('Job', jobSchema)
- const Model = mongoose.model('Model', modelSchema)
- export { Agency, Job, Model }
- export class AgencyController extends RESTController {
- constructor () {
- super(Agency, '_id')
- }
- }
- export class ModelController extends RESTController {
- constructor () {
- super(Model, 'name')
- }
- }
|