import { injectable } from "inversify"; import { IJsonApiResponse, IJsonApiResource, IJsonApiRelationship, } from "../../interfaces"; export const placeType = "place"; export interface IPlaceAttributes { ancestor_ids?: number[]; calling_code?: string; center?: { coordinates: number[], type: "Point" }; name?: string; place_type?: string; } export interface IPlaceResource extends IJsonApiResource {} export interface IPlaceResponse extends IJsonApiResponse {} export interface IPlace { id?: string; ancestorIds?: number[]; center?: { coordinates: number[], type: "Point" }; name?: string; placeType?: string; ancestry?: IPlace[]; type: string; } @injectable() export default class Place implements IPlace { id?: string; ancestorIds?: number[] = []; center?: { coordinates: number[], type: "Point" } = { coordinates: [], type: "Point", }; name?: string; placeType?: string; ancestry?: IPlace[] = []; type: string = placeType; constructor(options?: IPlace) { Object.assign(this, options); } }