@upv/ushi-shared
Version:
Shared DTOs, types, and utilities for the USHI platform (LMS, Trials, Social, Wallet).
55 lines (54 loc) • 1.56 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"));
/**
* PersonDto
*
* DTO for the global Person entity in the USHI platform.
* This is the root person object shared across all systems (LMS, Trials, Social).
* Includes identity linkage via Cognito ID and optional phone number for verification.
*/
class PersonDto extends BaseDto_1.default {
constructor(data) {
super(data);
this._personId = data.personId;
this._cognitoId = data.cognitoId;
this._name = data.name;
this._email = data.email;
this._phoneNumber = data.phoneNumber;
this._status = data.status;
}
async serialize() {
return {
...(await this.serializeBase()),
personId: this._personId,
cognitoId: this._cognitoId ?? null,
name: this._name,
email: this._email,
phoneNumber: this._phoneNumber ?? null,
status: this._status,
};
}
get personId() {
return this._personId;
}
get cognitoId() {
return this._cognitoId;
}
get name() {
return this._name;
}
get email() {
return this._email;
}
get phoneNumber() {
return this._phoneNumber;
}
get status() {
return this._status;
}
}
exports.default = PersonDto;