vr-models 1.0.59 → 1.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,8 @@ import { Model, InferAttributes, InferCreationAttributes, CreationOptional, NonA
2
2
  import type { User } from "./user.models";
3
3
  export declare const CONTACT_TYPES: readonly ["EMAIL", "PHONE", "WHATSAPP"];
4
4
  export type ContactType = (typeof CONTACT_TYPES)[number];
5
+ export declare const VERIFICATION_METHODS: readonly ["OTP", "0AUTH", "EMAIL", "MANUAL"];
6
+ export type VerificationMethod = (typeof VERIFICATION_METHODS)[number];
5
7
  export interface VerificationMetadata {
6
8
  lastOtpSentAt?: Date;
7
9
  otpAttempts?: number;
@@ -22,6 +24,7 @@ export interface ContactAttributes {
22
24
  userId: string | null;
23
25
  isVerified: boolean;
24
26
  verifiedAt: Date | null;
27
+ verificationMethod: VerificationMethod;
25
28
  isPrimary: boolean;
26
29
  isActive: boolean;
27
30
  otp: string | null;
@@ -39,6 +42,7 @@ export declare class Contact extends Model<InferAttributes<Contact>, InferCreati
39
42
  id: CreationOptional<string>;
40
43
  contactValue: string;
41
44
  type: ContactType;
45
+ verificationMethod: VerificationMethod;
42
46
  userId: CreationOptional<string | null>;
43
47
  isVerified: CreationOptional<boolean>;
44
48
  verifiedAt: CreationOptional<Date | null>;
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Contact = exports.CONTACT_TYPES = void 0;
3
+ exports.Contact = exports.VERIFICATION_METHODS = exports.CONTACT_TYPES = void 0;
4
4
  // src/models/contact.models.ts
5
5
  const vr_migrations_1 = require("vr-migrations");
6
6
  // ==================== CONTACT TYPES ====================
7
7
  exports.CONTACT_TYPES = ["EMAIL", "PHONE", "WHATSAPP"];
8
+ exports.VERIFICATION_METHODS = [
9
+ "OTP",
10
+ "0AUTH",
11
+ "EMAIL",
12
+ "MANUAL",
13
+ ];
8
14
  class Contact extends vr_migrations_1.Model {
9
15
  // Static initialization method
10
16
  static initialize(sequelize) {
@@ -20,7 +26,11 @@ class Contact extends vr_migrations_1.Model {
20
26
  allowNull: false,
21
27
  },
22
28
  type: {
23
- type: vr_migrations_1.DataTypes.ENUM("EMAIL", "PHONE", "WHATSAPP"),
29
+ type: vr_migrations_1.DataTypes.ENUM(...exports.CONTACT_TYPES),
30
+ allowNull: false,
31
+ },
32
+ verificationMethod: {
33
+ type: vr_migrations_1.DataTypes.ENUM(...exports.VERIFICATION_METHODS),
24
34
  allowNull: false,
25
35
  },
26
36
  userId: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-models",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "description": "Shared database models package for VR applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",