@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
150 lines (144 loc) • 3.38 kB
text/typescript
import {ModelDefinition} from './BaseModels';
import {Log} from './Log';
import {Project} from './Project';
import {SummaryForAsset} from './SummaryForAsset';
declare var Object: any;
export interface SummaryForProjectInterface {
id?: string;
type: string;
from: Date;
to: Date;
length: number;
detail: any;
updated: boolean;
created?: Date;
modified?: Date;
deleted?: Date;
projectId?: any;
trackingLogs?: Log[];
project?: Project;
summaryForAssets?: SummaryForAsset[];
}
export class SummaryForProject implements SummaryForProjectInterface {
id: string;
type: string;
from: Date;
to: Date;
length: number;
detail: any;
updated: boolean;
created: Date;
modified: Date;
deleted: Date;
projectId: any;
trackingLogs?: Log[];
project?: Project;
summaryForAssets?: SummaryForAsset[];
constructor(data?: SummaryForProjectInterface) {
Object.assign(this, data);
}
/**
* The name of the model represented by this $resource,
* i.e. `SummaryForProject`.
*/
public static getModelName(): string {
return 'SummaryForProject';
}
/**
* @method factory
* @author Jonathan Casarrubias
* @license MIT
* This method creates an instance of SummaryForProject for dynamic purposes.
*/
public static factory(data: SummaryForProjectInterface): SummaryForProject{
return new SummaryForProject(data);
}
/**
* @method getModelDefinition
* @author Julien Ledun
* @license MIT
* This method returns an object that represents some of the model
* definitions.
*/
public static getModelDefinition(): ModelDefinition {
return {
name: 'SummaryForProject',
plural: 'SummaryForProjects',
path: 'SummaryForProjects',
idName: 'id',
properties: {
id: {
name: 'id',
type: 'string'
},
type: {
name: 'type',
type: 'string'
},
from: {
name: 'from',
type: 'Date'
},
to: {
name: 'to',
type: 'Date'
},
length: {
name: 'length',
type: 'number'
},
detail: {
name: 'detail',
type: 'any'
},
updated: {
name: 'updated',
type: 'boolean'
},
created: {
name: 'created',
type: 'Date'
},
modified: {
name: 'modified',
type: 'Date'
},
deleted: {
name: 'deleted',
type: 'Date',
default: undefined
},
projectId: {
name: 'projectId',
type: 'any'
},
},
relations: {
trackingLogs: {
name: 'trackingLogs',
type: 'Log[]',
model: 'Log',
relationType: 'hasMany',
keyFrom: 'id',
keyTo: 'trackingModelId'
},
project: {
name: 'project',
type: 'Project',
model: 'Project',
relationType: 'belongsTo',
keyFrom: 'projectId',
keyTo: 'id'
},
summaryForAssets: {
name: 'summaryForAssets',
type: 'SummaryForAsset[]',
model: 'SummaryForAsset',
relationType: 'hasMany',
keyFrom: 'id',
keyTo: 'summaryForProjectId'
},
}
};
}
}