@citrineos/data
Version:
The OCPP data module which includes all persistence layer implementation.
107 lines • 5.33 kB
JavaScript
;
// Copyright Contributors to the CitrineOS Project
//
// SPDX-License-Identifier: Apache 2.0
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChargingStation = void 0;
const base_1 = require("@citrineos/base");
const sequelize_typescript_1 = require("sequelize-typescript");
const Location_1 = require("./Location");
const StatusNotification_1 = require("./StatusNotification");
const ChargingStationNetworkProfile_1 = require("./ChargingStationNetworkProfile");
const SetNetworkProfile_1 = require("./SetNetworkProfile");
const Connector_1 = require("./Connector");
const BaseModelWithTenant_1 = require("../BaseModelWithTenant");
/**
* Represents a charging station.
* Currently, this data model is internal to CitrineOS. In the future, it will be analogous to an OCPI ChargingStation.
*/
let ChargingStation = class ChargingStation extends BaseModelWithTenant_1.BaseModelWithTenant {
};
exports.ChargingStation = ChargingStation;
ChargingStation.MODEL_NAME = base_1.Namespace.ChargingStation;
__decorate([
sequelize_typescript_1.PrimaryKey,
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(36)),
__metadata("design:type", String)
], ChargingStation.prototype, "id", void 0);
__decorate([
sequelize_typescript_1.Column,
__metadata("design:type", Boolean)
], ChargingStation.prototype, "isOnline", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING),
__metadata("design:type", Object)
], ChargingStation.prototype, "protocol", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(20)),
__metadata("design:type", Object)
], ChargingStation.prototype, "chargePointVendor", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(20)),
__metadata("design:type", Object)
], ChargingStation.prototype, "chargePointModel", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(25)),
__metadata("design:type", Object)
], ChargingStation.prototype, "chargePointSerialNumber", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(25)),
__metadata("design:type", Object)
], ChargingStation.prototype, "chargeBoxSerialNumber", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(50)),
__metadata("design:type", Object)
], ChargingStation.prototype, "firmwareVersion", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(20)),
__metadata("design:type", Object)
], ChargingStation.prototype, "iccid", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(20)),
__metadata("design:type", Object)
], ChargingStation.prototype, "imsi", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(25)),
__metadata("design:type", Object)
], ChargingStation.prototype, "meterType", void 0);
__decorate([
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING(25)),
__metadata("design:type", Object)
], ChargingStation.prototype, "meterSerialNumber", void 0);
__decorate([
(0, sequelize_typescript_1.ForeignKey)(() => Location_1.Location),
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.INTEGER),
__metadata("design:type", Object)
], ChargingStation.prototype, "locationId", void 0);
__decorate([
(0, sequelize_typescript_1.HasMany)(() => StatusNotification_1.StatusNotification),
__metadata("design:type", Object)
], ChargingStation.prototype, "statusNotifications", void 0);
__decorate([
(0, sequelize_typescript_1.BelongsTo)(() => Location_1.Location),
__metadata("design:type", Location_1.Location)
], ChargingStation.prototype, "location", void 0);
__decorate([
(0, sequelize_typescript_1.BelongsToMany)(() => SetNetworkProfile_1.SetNetworkProfile, () => ChargingStationNetworkProfile_1.ChargingStationNetworkProfile),
__metadata("design:type", Object)
], ChargingStation.prototype, "networkProfiles", void 0);
__decorate([
(0, sequelize_typescript_1.HasMany)(() => Connector_1.Connector, {
onDelete: 'CASCADE',
}),
__metadata("design:type", Object)
], ChargingStation.prototype, "connectors", void 0);
exports.ChargingStation = ChargingStation = __decorate([
sequelize_typescript_1.Table
], ChargingStation);
//# sourceMappingURL=ChargingStation.js.map