amocrm-client
Version:
JS Library for AmoCRM
72 lines • 3.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LeadDTO = void 0;
const tslib_1 = require("tslib");
const class_transformer_1 = require("class-transformer");
const ResourceEntity_1 = tslib_1.__importDefault(require("../api/ResourceEntity"));
const ContactFactory_1 = require("../api/factories/ContactFactory");
const util_1 = require("../util");
const CatalogElementFactory_1 = require("../api/factories/CatalogElementFactory");
const ResourceEntityEmbedded_1 = require("../api/ResourceEntityEmbedded");
let LeadEmbeddedDTO = class LeadEmbeddedDTO extends ResourceEntityEmbedded_1.ResourceEntityEmbedded {
constructor(factory, attributes) {
super(factory, attributes);
this.contacts = this.parseEmbedded(attributes === null || attributes === void 0 ? void 0 : attributes.contacts, ContactFactory_1.ContactFactory);
this.catalog_elements = this.parseEmbedded(attributes.catalog_elements, CatalogElementFactory_1.CatalogElementFactory);
}
};
tslib_1.__decorate([
(0, util_1.CollectionType)(),
tslib_1.__metadata("design:type", Array)
], LeadEmbeddedDTO.prototype, "catalog_elements", void 0);
tslib_1.__decorate([
(0, util_1.CollectionType)(),
tslib_1.__metadata("design:type", Array)
], LeadEmbeddedDTO.prototype, "loss_reason", void 0);
tslib_1.__decorate([
(0, util_1.CollectionType)(),
tslib_1.__metadata("design:type", Array)
], LeadEmbeddedDTO.prototype, "contacts", void 0);
LeadEmbeddedDTO = tslib_1.__decorate([
(0, class_transformer_1.Expose)(),
tslib_1.__metadata("design:paramtypes", [Object, Object])
], LeadEmbeddedDTO);
let LeadDTO = class LeadDTO extends ResourceEntity_1.default {
constructor(factory, attributes) {
super(factory, attributes);
if (attributes._embedded)
this._embedded = new LeadEmbeddedDTO(factory, attributes._embedded);
}
};
tslib_1.__decorate([
(0, util_1.CollectionType)(),
tslib_1.__metadata("design:type", Array)
], LeadDTO.prototype, "custom_fields_values", void 0);
tslib_1.__decorate([
(0, class_transformer_1.Type)(() => LeadEmbeddedDTO),
tslib_1.__metadata("design:type", LeadEmbeddedDTO)
], LeadDTO.prototype, "_embedded", void 0);
tslib_1.__decorate([
(0, util_1.MomentType)(),
tslib_1.__metadata("design:type", Object)
], LeadDTO.prototype, "created_at", void 0);
tslib_1.__decorate([
(0, util_1.MomentType)(),
tslib_1.__metadata("design:type", Object)
], LeadDTO.prototype, "updated_at", void 0);
tslib_1.__decorate([
(0, util_1.MomentType)(),
tslib_1.__metadata("design:type", Object)
], LeadDTO.prototype, "closed_at", void 0);
tslib_1.__decorate([
(0, util_1.MomentType)(),
tslib_1.__metadata("design:type", Object)
], LeadDTO.prototype, "closest_task_at", void 0);
LeadDTO = tslib_1.__decorate([
(0, class_transformer_1.Expose)(),
tslib_1.__metadata("design:paramtypes", [Object, Object])
], LeadDTO);
exports.LeadDTO = LeadDTO;
class LossReasonDTO {
}
//# sourceMappingURL=lead.dto.js.map