import { IGenericModel } from "./IGenericModel"; import { ModelBase } from "./ModelBase"; import { IKey } from "./IKey"; import { Key } from "./Key"; const uuid = require("uuid"); export class GenericModel extends ModelBase implements IGenericModel { primaryKey: string; secondaryKey: string; data: TData; metadata: any; constructor(data?: TData) { super(); if (data) { this.data = data; } this.primaryKey = uuid.v4().replace(/-/g, ""); this.secondaryKey = uuid.v4().replace(/-/g, ""); } getStorageKey(): IKey { return new Key(this.primaryKey, this.secondaryKey); } }