@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
115 lines (109 loc) • 2.61 kB
text/typescript
import {ModelDefinition} from './BaseModels';
import {Customer} from './Customer';
import {Log} from './Log';
declare var Object: any;
export interface DefaultEventCommentInterface {
code: string;
content: string;
created?: Date;
modified?: Date;
deleted?: Date;
id?: any;
customerId?: any;
customer?: Customer;
trackingLogs?: Log[];
}
export class DefaultEventComment implements DefaultEventCommentInterface {
code: string;
content: string;
created: Date;
modified: Date;
deleted: Date;
id: any;
customerId: any;
customer?: Customer;
trackingLogs?: Log[];
constructor(data?: DefaultEventCommentInterface) {
Object.assign(this, data);
}
/**
* The name of the model represented by this $resource,
* i.e. `DefaultEventComment`.
*/
public static getModelName(): string {
return 'DefaultEventComment';
}
/**
* @method factory
* @author Jonathan Casarrubias
* @license MIT
* This method creates an instance of DefaultEventComment for dynamic purposes.
*/
public static factory(data: DefaultEventCommentInterface): DefaultEventComment{
return new DefaultEventComment(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: 'DefaultEventComment',
plural: 'DefaultEventComments',
path: 'DefaultEventComments',
idName: 'id',
properties: {
code: {
name: 'code',
type: 'string'
},
content: {
name: 'content',
type: 'string'
},
created: {
name: 'created',
type: 'Date'
},
modified: {
name: 'modified',
type: 'Date'
},
deleted: {
name: 'deleted',
type: 'Date',
default: undefined
},
id: {
name: 'id',
type: 'any'
},
customerId: {
name: 'customerId',
type: 'any'
},
},
relations: {
customer: {
name: 'customer',
type: 'Customer',
model: 'Customer',
relationType: 'belongsTo',
keyFrom: 'customerId',
keyTo: 'id'
},
trackingLogs: {
name: 'trackingLogs',
type: 'Log[]',
model: 'Log',
relationType: 'hasMany',
keyFrom: 'id',
keyTo: 'trackingModelId'
},
}
};
}
}