@upv/ushi-shared
Version:
Shared DTOs, types, and utilities for the USHI platform (LMS, Trials, Social, Wallet).
44 lines (43 loc) • 1.21 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const BaseDto_1 = __importDefault(require("../base/BaseDto"));
/**
* RegionDto
*
* DTO class for Region entities in the USHI platform.
*/
class RegionDto extends BaseDto_1.default {
constructor(data) {
super(data);
this._name = data.name;
this._label = data.label;
this._languageCode = data.languageCode;
}
/**
* Serializes the RegionDto into a plain object.
*/
async serialize() {
return {
...(await this.serializeBase()),
name: this._name,
label: this._label,
languageCode: this._languageCode,
};
}
/** Get the region's internal name */
get name() {
return this._name;
}
/** Get the region's user-facing label */
get label() {
return this._label;
}
/** Get the region's associated language code (e.g., 'en', 'fr') */
get languageCode() {
return this._languageCode;
}
}
exports.default = RegionDto;