refactor: use resource identifiers
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import type { EntityInterface, EntityModelInterface } from "@/types/entity";
|
||||
import type { MessageInterface } from "@/types/message";
|
||||
import { MessageObject } from "./message";
|
||||
import { clonePlain } from './clone-plain';
|
||||
import type { CollectionIdentifier, EntityIdentifier, ServiceIdentifier } from "@/services";
|
||||
|
||||
export class EntityObject implements EntityModelInterface {
|
||||
|
||||
@@ -18,8 +19,8 @@ export class EntityObject implements EntityModelInterface {
|
||||
version: 1,
|
||||
provider: '',
|
||||
service: '',
|
||||
collection: '',
|
||||
identifier: '',
|
||||
collection: null,
|
||||
identifier: null,
|
||||
signature: null,
|
||||
created: null,
|
||||
modified: null,
|
||||
@@ -54,16 +55,16 @@ export class EntityObject implements EntityModelInterface {
|
||||
return this._data.provider;
|
||||
}
|
||||
|
||||
get service(): string {
|
||||
return this._data.service;
|
||||
get service(): ServiceIdentifier {
|
||||
return this._data.service as ServiceIdentifier;
|
||||
}
|
||||
|
||||
get collection(): string|number {
|
||||
return this._data.collection;
|
||||
get collection(): CollectionIdentifier {
|
||||
return this._data.collection as CollectionIdentifier;
|
||||
}
|
||||
|
||||
get identifier(): string|number {
|
||||
return this._data.identifier;
|
||||
get identifier(): EntityIdentifier {
|
||||
return this._data.identifier as EntityIdentifier;
|
||||
}
|
||||
|
||||
get signature(): string | null {
|
||||
|
||||
Reference in New Issue
Block a user