ocpi-types
Version:
TypeScript DTOs and enums for OCPI 2.2.1 specification.
229 lines • 9.64 kB
JavaScript
;
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.LocationDto = void 0;
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
const is_ocpi_datetime_decorator_1 = require("../../../decorators/is-ocpi-datetime.decorator");
const is_ocpi_ci_string_decorator_1 = require("../../../decorators/is-ocpi-ci-string.decorator");
const publish_token_type_dto_1 = require("./publish-token-type.dto");
const geo_location_dto_1 = require("./geo-location.dto");
const additional_geo_location_dto_1 = require("./additional-geo-location.dto");
const EVSEDto_1 = require("./EVSEDto");
const display_text_dto_1 = require("../../../dtos/display-text.dto");
const business_details_dto_1 = require("./business-details.dto");
const hours_dto_1 = require("./hours.dto");
const image_dto_1 = require("./image.dto");
const energy_mix_dto_1 = require("./energy-mix.dto");
const parking_type_enum_1 = require("../enums/parking-type.enum");
class LocationDto {
countryCode;
partyId;
id;
publish;
publishAllowedTo;
name;
address;
city;
postalCode;
state;
country;
coordinates;
relatedLocations;
parkingType;
evses;
directions;
operator;
suboperator;
owner;
facilities;
timeZone;
openingTimes;
chargingWhenClosed;
images;
energyMix;
lastUpdated;
}
exports.LocationDto = LocationDto;
__decorate([
(0, is_ocpi_ci_string_decorator_1.IsOcpiCiString)(),
(0, class_validator_1.MinLength)(2),
(0, class_validator_1.MaxLength)(2),
(0, class_transformer_1.Expose)({ name: 'country_code' }),
__metadata("design:type", String)
], LocationDto.prototype, "countryCode", void 0);
__decorate([
(0, is_ocpi_ci_string_decorator_1.IsOcpiCiString)(),
(0, class_validator_1.MinLength)(3),
(0, class_validator_1.MaxLength)(3),
(0, class_transformer_1.Expose)({ name: 'party_id' }),
__metadata("design:type", String)
], LocationDto.prototype, "partyId", void 0);
__decorate([
(0, is_ocpi_ci_string_decorator_1.IsOcpiCiString)(),
(0, class_validator_1.MaxLength)(36),
(0, class_transformer_1.Expose)(),
__metadata("design:type", String)
], LocationDto.prototype, "id", void 0);
__decorate([
(0, class_validator_1.IsBoolean)(),
(0, class_transformer_1.Expose)(),
__metadata("design:type", Boolean)
], LocationDto.prototype, "publish", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.ValidateNested)({ each: true }),
(0, class_transformer_1.Type)(() => publish_token_type_dto_1.PublishTokenTypeDto),
(0, class_transformer_1.Expose)({ name: 'publish_allowed_to' }),
__metadata("design:type", Array)
], LocationDto.prototype, "publishAllowedTo", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.MaxLength)(255),
(0, class_transformer_1.Expose)(),
__metadata("design:type", String)
], LocationDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MaxLength)(45),
(0, class_transformer_1.Expose)(),
__metadata("design:type", String)
], LocationDto.prototype, "address", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MaxLength)(45),
(0, class_transformer_1.Expose)(),
__metadata("design:type", String)
], LocationDto.prototype, "city", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.MaxLength)(10),
(0, class_transformer_1.Expose)({ name: 'postal_code' }),
__metadata("design:type", String)
], LocationDto.prototype, "postalCode", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.MaxLength)(20),
(0, class_transformer_1.Expose)(),
__metadata("design:type", String)
], LocationDto.prototype, "state", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MaxLength)(3),
(0, class_transformer_1.Expose)(),
__metadata("design:type", String)
], LocationDto.prototype, "country", void 0);
__decorate([
(0, class_validator_1.ValidateNested)(),
(0, class_transformer_1.Type)(() => geo_location_dto_1.GeoLocationDto),
(0, class_transformer_1.Expose)(),
__metadata("design:type", geo_location_dto_1.GeoLocationDto)
], LocationDto.prototype, "coordinates", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.ValidateNested)({ each: true }),
(0, class_transformer_1.Type)(() => additional_geo_location_dto_1.AdditionalGeoLocationDto),
(0, class_transformer_1.Expose)({ name: 'related_locations' }),
__metadata("design:type", Array)
], LocationDto.prototype, "relatedLocations", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_transformer_1.Expose)({ name: 'parking_type' }),
__metadata("design:type", String)
], LocationDto.prototype, "parkingType", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.ValidateNested)({ each: true }),
(0, class_transformer_1.Type)(() => EVSEDto_1.EVSEDto),
(0, class_transformer_1.Expose)(),
__metadata("design:type", Array)
], LocationDto.prototype, "evses", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.ValidateNested)({ each: true }),
(0, class_transformer_1.Type)(() => display_text_dto_1.DisplayTextDto),
(0, class_transformer_1.Expose)(),
__metadata("design:type", Array)
], LocationDto.prototype, "directions", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.ValidateNested)(),
(0, class_transformer_1.Type)(() => business_details_dto_1.BusinessDetailsDto),
(0, class_transformer_1.Expose)(),
__metadata("design:type", business_details_dto_1.BusinessDetailsDto)
], LocationDto.prototype, "operator", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.ValidateNested)(),
(0, class_transformer_1.Type)(() => business_details_dto_1.BusinessDetailsDto),
(0, class_transformer_1.Expose)(),
__metadata("design:type", business_details_dto_1.BusinessDetailsDto)
], LocationDto.prototype, "suboperator", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.ValidateNested)(),
(0, class_transformer_1.Type)(() => business_details_dto_1.BusinessDetailsDto),
(0, class_transformer_1.Expose)(),
__metadata("design:type", business_details_dto_1.BusinessDetailsDto)
], LocationDto.prototype, "owner", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_transformer_1.Expose)(),
__metadata("design:type", Array)
], LocationDto.prototype, "facilities", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MaxLength)(255),
(0, class_transformer_1.Expose)({ name: 'time_zone' }),
__metadata("design:type", String)
], LocationDto.prototype, "timeZone", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.ValidateNested)(),
(0, class_transformer_1.Type)(() => hours_dto_1.HoursDto),
(0, class_transformer_1.Expose)({ name: 'opening_times' }),
__metadata("design:type", hours_dto_1.HoursDto)
], LocationDto.prototype, "openingTimes", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
(0, class_transformer_1.Expose)({ name: 'charging_when_closed' }),
__metadata("design:type", Boolean)
], LocationDto.prototype, "chargingWhenClosed", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.ValidateNested)({ each: true }),
(0, class_transformer_1.Type)(() => image_dto_1.ImageDto),
(0, class_transformer_1.Expose)(),
__metadata("design:type", Array)
], LocationDto.prototype, "images", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.ValidateNested)(),
(0, class_transformer_1.Type)(() => energy_mix_dto_1.EnergyMixDto),
(0, class_transformer_1.Expose)({ name: 'energy_mix' }),
__metadata("design:type", energy_mix_dto_1.EnergyMixDto)
], LocationDto.prototype, "energyMix", void 0);
__decorate([
(0, is_ocpi_datetime_decorator_1.IsOcpiDateTime)(),
(0, class_transformer_1.Expose)({ name: 'last_updated' }),
__metadata("design:type", String)
], LocationDto.prototype, "lastUpdated", void 0);
//# sourceMappingURL=location.dto.js.map