Files
Autonomous-Bug-Explorer/dist/modules/integrations/domain/entities/Integration.js
2026-03-06 07:22:00 -05:00

23 lines
941 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Integration = void 0;
const Entity_1 = require("../../../../shared/domain/Entity");
const UniqueId_1 = require("../../../../shared/domain/UniqueId");
class Integration extends Entity_1.Entity {
static create(props, id) {
return new Integration({ ...props, enabled: true, createdAt: new Date() }, id ?? UniqueId_1.UniqueId.create());
}
static reconstitute(props, id) {
return new Integration(props, id);
}
get name() { return this.props.name; }
get type() { return this.props.type; }
get enabled() { return this.props.enabled; }
get config() { return this.props.config; }
get createdAt() { return this.props.createdAt; }
enable() { this.props.enabled = true; }
disable() { this.props.enabled = false; }
updateConfig(config) { this.props.config = config; }
}
exports.Integration = Integration;