cecon-interfaces
Version:
Interfaces de Projetos Cecon
63 lines (62 loc) • 2.53 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PayioActivationKeyEntity = void 0;
var activation_key_status_enum_1 = require("../enums/activation-key-status.enum");
var license_type_enum_1 = require("../enums/license-type.enum");
var PayioActivationKeyEntity = /** @class */ (function () {
function PayioActivationKeyEntity(data) {
// === CAMPOS PREENCHIDOS NA ATIVAÇÃO ===
// Data em que a chave foi ativada (null = não ativada)
this.activatedAt = null;
this.allowMultipleTrialActivations = false;
this.allowMultipleTrialCount = 0;
this.allowMultipleTrialLimit = 0;
this.amount = 0; // Valor da licença (copiado do lote ou adicionado por superadmin)
// === REFERÊNCIAS DO SISTEMA ===
// ID do aplicativo (copiado do batch)
this.appId = '';
// Slug do aplicativo (copiado do batch)
this.appSlug = null;
// ID da empresa (preenchido na ativação)
this.companyId = null;
this.companyName = null;
// === AUDITORIA ===
// Data de criação da chave
this.createdAt = new Date();
this.expiredAt = null;
this.expiresAt = null;
// Dias de tolerância (copiado do batch)
this.gracePeriodDays = 0;
// Identificador único da chave (UUID)
this.id = '';
// A chave de ativação em si (ex.: "PAYIO-XXXXX-XXXXX-XXXXX")
this.key = null;
// === DADOS COPIADOS DO LOTE (para performance) ===
// Tipo de licença (copiado do batch)
this.licenseType = license_type_enum_1.EPayioLicenseType.TRIAL;
this.logs = [];
// ID do dispositivo (preenchido na ativação)
this.machineUid = '';
// Metadados livres para suporte
this.notes = null;
this.paidAt = null;
this.paymentId = null;
this.paymentMethod = null;
this.periodDays = 15; // 15 dias;
this.revokedAt = null;
// Status da chave
this.status = activation_key_status_enum_1.EPayioActivationKeyStatus.AVAILABLE;
// Tags para categorização
this.tags = [];
this.updatedAt = new Date();
if (data) {
for (var key in data) {
if (data.hasOwnProperty(key) && key in this) {
this[key] = data[key];
}
}
}
}
return PayioActivationKeyEntity;
}());
exports.PayioActivationKeyEntity = PayioActivationKeyEntity;