vr-commons 1.0.128 → 1.0.129

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.
@@ -91,6 +91,7 @@ export declare const JACKET_ID_REGEX: RegExp;
91
91
  export declare const JACKET_ID_PREFIX = "JKT";
92
92
  /**
93
93
  * Format user profile based on viewer type and options
94
+ * FIXED: Removed email and nationalId references
94
95
  */
95
96
  export declare const formatUserProfile: (user: User, viewerType?: UserType, options?: ProfileFormatOptions) => RiderProfile | PassengerProfile | AgentProfile | AdminProfile | SuperAdminProfile;
96
97
  /**
@@ -18,13 +18,17 @@ exports.JACKET_ID_PREFIX = "JKT";
18
18
  // ============================================================================
19
19
  /**
20
20
  * Format user profile based on viewer type and options
21
+ * FIXED: Removed email and nationalId references
21
22
  */
22
23
  const formatUserProfile = (user, viewerType = "ADMIN", options = {}) => {
24
+ // Get primary contact
25
+ const primaryContact = user.primaryContact ||
26
+ user.contacts?.find((c) => c.isPrimary === true);
23
27
  const baseProfile = {
24
28
  id: user.id,
25
29
  firstName: user.firstName,
26
30
  lastName: user.lastName,
27
- primaryContact: user.primaryContact?.contactValue,
31
+ primaryContact: primaryContact?.contactValue,
28
32
  gender: user.gender || "male",
29
33
  birthDate: user.birthDate || null,
30
34
  birthMonth: user.birthMonth || null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.128",
3
+ "version": "1.0.129",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",