UNPKG

@upv/ushi-shared

Version:

Shared DTOs, types, and utilities for the USHI platform (LMS, Trials, Social, Wallet).

63 lines (62 loc) 1.75 kB
"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")); /** * DemographicsProfileDto * * DTO for user identity and demographics used in trials, personalization, and segmentation. */ class DemographicsProfileDto extends BaseDto_1.default { constructor(data) { super(data); this._userId = data.userId; this._birthDate = data.birthDate; this._sex = data.sex; this._gender = data.gender; this._ethnicity = data.ethnicity; this._country = data.country; this._zipCode = data.zipCode; this._language = data.language; } async serialize() { return { ...(await this.serializeBase()), userId: this._userId, birthDate: this._birthDate ?? null, sex: this._sex ?? null, gender: this._gender ?? null, ethnicity: this._ethnicity ?? null, country: this._country ?? null, zipCode: this._zipCode ?? null, language: this._language ?? null, }; } get userId() { return this._userId; } get birthDate() { return this._birthDate; } get sex() { return this._sex; } get gender() { return this._gender; } get ethnicity() { return this._ethnicity; } get country() { return this._country; } get zipCode() { return this._zipCode; } get language() { return this._language; } } exports.default = DemographicsProfileDto;