feat: Split v1 and v2 apis
This commit is contained in:
25
v2/server/src/Shared/Models/Objection/locations.model.js
Normal file
25
v2/server/src/Shared/Models/Objection/locations.model.js
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
const { Model } = require('objection');
|
||||
|
||||
class Locations extends Model {
|
||||
static get tableName() { return 'locations'; }
|
||||
static get idColumn() { return 'id'; }
|
||||
static get jsonSchema() {
|
||||
return {
|
||||
type : 'object',
|
||||
required : ['company_id','type','state','city','country','zipcode','address_line1'],
|
||||
properties : {
|
||||
company_id : { type : 'integer', minimum : 0 },
|
||||
type : { type : 'string' , enum : ['loading', 'unloading', 'both'] },
|
||||
state : { type : 'string', maxLength : 45 },
|
||||
city : { type : 'string', maxLength : 45 },
|
||||
country : { type : 'string', maxLength : 45 },
|
||||
zipcode : { type : 'string', maxLength : 10 },
|
||||
address_line1 : { type : 'string', maxLength : 100 },
|
||||
address_line2 : { type : 'string', maxLength : 100 }
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Users;
|
||||
Reference in New Issue
Block a user