UNPKG

amocrm-client

Version:
53 lines (49 loc) 1.91 kB
import { ICustomerAttributes, ICustomerEmbedded, ICustomerSegmentAttributes } from "../interfaces/customer"; import { ICustomFieldValue } from "../interfaces/custom_field"; import { ResourceCollection } from '../api/ResourceCollection'; import { ITag } from '../api/models/Tag'; import { IContact } from '../api/models/Contact'; import { ICompany } from '../api/models/Company'; import { ISelfLinkResponse } from "../interfaces/api"; import { ICustomerFactory } from "../api/factories/CustomerFactory"; import ResourceEntity from "../api/ResourceEntity"; import { SelfLinkDTO } from "./link.dto"; import { Moment } from "../interfaces/common"; export class CustomerDTO extends ResourceEntity<ICustomerFactory> implements ICustomerAttributes { id: number; name: string; next_price: number; next_date: Date; responsible_user_id: number; periodcity: number; closest_task_at: Date; is_deleted: boolean; custom_fields_values: ICustomFieldValue[] | null; ltv: number; purchases_count: number; avarage_check: number; _embedded: CustomerEmbeddedDTO; created_by: number; updated_by: number; created_at: Date; account_id?: number | undefined; _links?: SelfLinkDTO; } class CustomerEmbeddedDTO implements ICustomerEmbedded { tags: ResourceCollection<ITag>; segments?: ResourceCollection<ICustomerSegmentAttributes>; contacts?: ResourceCollection<IContact>; companies?: ResourceCollection<ICompany>; catalog_elements?: ResourceCollection<any>; } class CustomerSegmentDTO implements ICustomerSegmentAttributes { _links?: ISelfLinkResponse | undefined; name: string; color: string; customers_count: number; available_products_price_types: number[]; created_at: Date; updated_at: Date; id?: number | undefined; account_id?: number | undefined; }