Skip to content

Instantly share code, notes, and snippets.

@jasir
Created October 3, 2019 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasir/c1395a19bd307fac52f58d7c86c14f4a to your computer and use it in GitHub Desktop.
Save jasir/c1395a19bd307fac52f58d7c86c14f4a to your computer and use it in GitHub Desktop.
import { BaseModel } from './BaseModel'
import Dvere from './Dvere'
import KategoriePristupu from './KategoriePristupu'
import Osoba from './Osoba'
import PristupovyBod from './PristupovyBod'
export default class Log extends BaseModel {
// This is the name used as module name of the Vuex Store.
static entity = 'Log'
static primaryKey = 'id'
// List of all fields (schema) of the post model. `this.attr` is used
// for the generic field type. The argument is the default value.
static fields () {
return {
id: this.attr(null),
pristupovy_bod_id: this.attr(null),
dvere_id: this.attr(null),
role_id: this.attr(null),
client_row_dt: this.attr(null),
ctecka_id: this.attr(null),
log_type: this.attr(null),
log_action: this.attr(null),
message: this.attr(null),
detail: this.attr(null),
tag: this.attr(null),
osoba_id: this.attr(null),
dvere_rank: this.attr(null),
pristupovy_bod_rank: this.attr(null),
pristupovyBod: this.hasOne(PristupovyBod, 'id', 'pristupovy_bod_id'),
dvere: this.hasOne(Dvere, 'uuid', 'dvere_id'),
kategoriePristupu: this.hasOne(KategoriePristupu, 'id', 'role_id'),
osoba: this.hasOne(Osoba, 'id', 'osoba_id')
}
}
}
import { BaseModel } from './BaseModel'
import Log from './Log'
import PristupovyBod from './PristupovyBod'
export default class Dvere extends BaseModel {
// This is the name used as module name of the Vuex Store.
static entity = 'Dvere'
static primaryKey = 'uuid'
// List of all fields (schema) of the post model. `this.attr` is used
// for the generic field type. The argument is the default value.
static fields () {
return {
uuid: this.attr(this.uuid),
pristupovy_bod_id: this.attr(null),
nazev: this.attr(null),
gpio: this.attr('0'),
popis: this.attr(null),
ctecka1: this.attr(false),
ctecka2: this.attr(false),
ctecka3: this.attr(false),
ctecka4: this.attr(false),
blokovane: this.attr(false),
created_at: this.attr(null),
updated_at: this.attr(null),
pristupovyBod: this.hasOne(PristupovyBod, 'id', 'pristupovy_bod_id'),
lastLog: this.belongsTo(Log, 'dvere_id', 'uuid'),
logs: this.hasMany(Log, 'dvere_id', 'uuid')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment