import { ISchema } from "../base.model"; export interface ISiteVariablesSchema extends ISchema { declare: boolean; module: string; insertInterface: boolean; variables: { id: number, allowedLang: string[], defLang: string, mapCenter: { lat: number, lng: number }, androidAppId: string | null, windowSize: { mobile: number, laptop: number, } } } export class ModelSiteVariables implements Partial { id: number; allowedLang: string[]; defLang: string; mapCenter: { lat: number, lng: number }; androidAppId: string | null; windowSize: { mobile: number; laptop: number; } constructor({ id = 1, allowedLang = [], defLang = 'uk', androidAppId = null, mapCenter = { lat: 50.43, lng: 30.51 }, windowSize = { mobile: 768, laptop: 1280 } }: Partial = {}) { this.id = +id; this.allowedLang = allowedLang; this.defLang = defLang; this.androidAppId = androidAppId; this.mapCenter = { lat: +mapCenter.lat, lng: +mapCenter.lng } this.windowSize = { mobile: +windowSize.mobile, laptop: +windowSize.laptop } } }