@loyal-ix/loyalix-shared-types 1.0.0 → 1.1.0

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.
package/dist/index.d.mts CHANGED
@@ -174,7 +174,6 @@ interface UpdateUserDto {
174
174
  interface UserDto {
175
175
  id: string;
176
176
  email: string;
177
- username?: string;
178
177
  firstName?: string;
179
178
  lastName?: string;
180
179
  phoneNumber?: string;
@@ -182,6 +181,15 @@ interface UserDto {
182
181
  createdAt: string;
183
182
  updatedAt: string;
184
183
  }
184
+ /**
185
+ * User response DTO with roles and profile photo
186
+ * Used for API responses - excludes sensitive fields (password, deviceToken)
187
+ */
188
+ interface UserResponseDto extends UserDto {
189
+ roles: string[];
190
+ profilePhotoUrl?: string;
191
+ lastActive?: string;
192
+ }
185
193
 
186
194
  interface CreateBusinessDto {
187
195
  name: string;
@@ -213,6 +221,32 @@ interface BusinessDto {
213
221
  createdAt: string;
214
222
  updatedAt: string;
215
223
  }
224
+ /**
225
+ * Minimal business DTO for list endpoints (public-facing)
226
+ * Excludes sensitive fields: qrSecret, staffMembers details
227
+ */
228
+ interface BusinessListItemDto {
229
+ id: string;
230
+ name: string;
231
+ description?: string;
232
+ address?: string;
233
+ status: string;
234
+ industryType?: string;
235
+ activeProgramCount?: number;
236
+ totalCustomers?: number;
237
+ }
238
+ /**
239
+ * Detailed business DTO for admin views
240
+ * Excludes: qrSecret (never exposed)
241
+ */
242
+ interface BusinessDetailDto extends BusinessListItemDto {
243
+ email?: string;
244
+ phone?: string;
245
+ staffCount?: number;
246
+ programCount?: number;
247
+ createdAt: string;
248
+ updatedAt: string;
249
+ }
216
250
 
217
251
  interface CreateCustomerDto {
218
252
  userId: string;
@@ -234,6 +268,31 @@ interface CustomerDto {
234
268
  createdAt: string;
235
269
  updatedAt: string;
236
270
  }
271
+ /**
272
+ * Customer response DTO with nested user info
273
+ * Excludes sensitive user fields: password, deviceToken
274
+ */
275
+ interface CustomerResponseDto {
276
+ id: string;
277
+ status: string;
278
+ user: {
279
+ id: string;
280
+ email: string;
281
+ firstName?: string;
282
+ lastName?: string;
283
+ phoneNumber?: string;
284
+ profilePhotoUrl?: string;
285
+ };
286
+ enrollmentCount?: number;
287
+ createdAt: string;
288
+ updatedAt: string;
289
+ }
290
+ /**
291
+ * Customer response for admin views - includes notes
292
+ */
293
+ interface CustomerAdminResponseDto extends CustomerResponseDto {
294
+ notes?: string;
295
+ }
237
296
 
238
297
  interface CreateLoyaltyProgramDto {
239
298
  businessId: string;
@@ -253,4 +312,4 @@ interface LoyaltyProgramDto {
253
312
  updatedAt: string;
254
313
  }
255
314
 
256
- export { type ApiResponse, type BusinessDto, BusinessStatus, type CreateBusinessDto, type CreateCustomerDto, type CreateLoyaltyProgramDto, type CreateUserDto, type CustomerDto, type ErrorDetail, type ErrorResponse, type LoggedInUserDto, type LoginDto, type LoginResponseDto, type LoyaltyProgramDto, type PaginatedResult, type PaginationMeta, type PaginationQuery, Permission, type RefreshTokenDto, type RegisterDto, Role, type SuccessResponse, type UpdateBusinessDto, type UpdateCustomerDto, type UpdateLoyaltyProgramDto, type UpdateUserDto, type UserDto };
315
+ export { type ApiResponse, type BusinessDetailDto, type BusinessDto, type BusinessListItemDto, BusinessStatus, type CreateBusinessDto, type CreateCustomerDto, type CreateLoyaltyProgramDto, type CreateUserDto, type CustomerAdminResponseDto, type CustomerDto, type CustomerResponseDto, type ErrorDetail, type ErrorResponse, type LoggedInUserDto, type LoginDto, type LoginResponseDto, type LoyaltyProgramDto, type PaginatedResult, type PaginationMeta, type PaginationQuery, Permission, type RefreshTokenDto, type RegisterDto, Role, type SuccessResponse, type UpdateBusinessDto, type UpdateCustomerDto, type UpdateLoyaltyProgramDto, type UpdateUserDto, type UserDto, type UserResponseDto };
package/dist/index.d.ts CHANGED
@@ -174,7 +174,6 @@ interface UpdateUserDto {
174
174
  interface UserDto {
175
175
  id: string;
176
176
  email: string;
177
- username?: string;
178
177
  firstName?: string;
179
178
  lastName?: string;
180
179
  phoneNumber?: string;
@@ -182,6 +181,15 @@ interface UserDto {
182
181
  createdAt: string;
183
182
  updatedAt: string;
184
183
  }
184
+ /**
185
+ * User response DTO with roles and profile photo
186
+ * Used for API responses - excludes sensitive fields (password, deviceToken)
187
+ */
188
+ interface UserResponseDto extends UserDto {
189
+ roles: string[];
190
+ profilePhotoUrl?: string;
191
+ lastActive?: string;
192
+ }
185
193
 
186
194
  interface CreateBusinessDto {
187
195
  name: string;
@@ -213,6 +221,32 @@ interface BusinessDto {
213
221
  createdAt: string;
214
222
  updatedAt: string;
215
223
  }
224
+ /**
225
+ * Minimal business DTO for list endpoints (public-facing)
226
+ * Excludes sensitive fields: qrSecret, staffMembers details
227
+ */
228
+ interface BusinessListItemDto {
229
+ id: string;
230
+ name: string;
231
+ description?: string;
232
+ address?: string;
233
+ status: string;
234
+ industryType?: string;
235
+ activeProgramCount?: number;
236
+ totalCustomers?: number;
237
+ }
238
+ /**
239
+ * Detailed business DTO for admin views
240
+ * Excludes: qrSecret (never exposed)
241
+ */
242
+ interface BusinessDetailDto extends BusinessListItemDto {
243
+ email?: string;
244
+ phone?: string;
245
+ staffCount?: number;
246
+ programCount?: number;
247
+ createdAt: string;
248
+ updatedAt: string;
249
+ }
216
250
 
217
251
  interface CreateCustomerDto {
218
252
  userId: string;
@@ -234,6 +268,31 @@ interface CustomerDto {
234
268
  createdAt: string;
235
269
  updatedAt: string;
236
270
  }
271
+ /**
272
+ * Customer response DTO with nested user info
273
+ * Excludes sensitive user fields: password, deviceToken
274
+ */
275
+ interface CustomerResponseDto {
276
+ id: string;
277
+ status: string;
278
+ user: {
279
+ id: string;
280
+ email: string;
281
+ firstName?: string;
282
+ lastName?: string;
283
+ phoneNumber?: string;
284
+ profilePhotoUrl?: string;
285
+ };
286
+ enrollmentCount?: number;
287
+ createdAt: string;
288
+ updatedAt: string;
289
+ }
290
+ /**
291
+ * Customer response for admin views - includes notes
292
+ */
293
+ interface CustomerAdminResponseDto extends CustomerResponseDto {
294
+ notes?: string;
295
+ }
237
296
 
238
297
  interface CreateLoyaltyProgramDto {
239
298
  businessId: string;
@@ -253,4 +312,4 @@ interface LoyaltyProgramDto {
253
312
  updatedAt: string;
254
313
  }
255
314
 
256
- export { type ApiResponse, type BusinessDto, BusinessStatus, type CreateBusinessDto, type CreateCustomerDto, type CreateLoyaltyProgramDto, type CreateUserDto, type CustomerDto, type ErrorDetail, type ErrorResponse, type LoggedInUserDto, type LoginDto, type LoginResponseDto, type LoyaltyProgramDto, type PaginatedResult, type PaginationMeta, type PaginationQuery, Permission, type RefreshTokenDto, type RegisterDto, Role, type SuccessResponse, type UpdateBusinessDto, type UpdateCustomerDto, type UpdateLoyaltyProgramDto, type UpdateUserDto, type UserDto };
315
+ export { type ApiResponse, type BusinessDetailDto, type BusinessDto, type BusinessListItemDto, BusinessStatus, type CreateBusinessDto, type CreateCustomerDto, type CreateLoyaltyProgramDto, type CreateUserDto, type CustomerAdminResponseDto, type CustomerDto, type CustomerResponseDto, type ErrorDetail, type ErrorResponse, type LoggedInUserDto, type LoginDto, type LoginResponseDto, type LoyaltyProgramDto, type PaginatedResult, type PaginationMeta, type PaginationQuery, Permission, type RefreshTokenDto, type RegisterDto, Role, type SuccessResponse, type UpdateBusinessDto, type UpdateCustomerDto, type UpdateLoyaltyProgramDto, type UpdateUserDto, type UserDto, type UserResponseDto };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loyal-ix/loyalix-shared-types",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Shared TypeScript types for Loyalix frontend and backend",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -12,6 +12,12 @@
12
12
  "require": "./dist/index.js"
13
13
  }
14
14
  },
15
+ "scripts": {
16
+ "build": "tsup src/index.ts --format cjs,esm --dts",
17
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
18
+ "clean": "rm -rf dist",
19
+ "prepublishOnly": "pnpm run build"
20
+ },
15
21
  "devDependencies": {
16
22
  "tsup": "^8.0.0",
17
23
  "typescript": "^5.0.0"
@@ -29,14 +35,9 @@
29
35
  "license": "MIT",
30
36
  "repository": {
31
37
  "type": "git",
32
- "url": "https://github.com/loyalix/shared-types.git"
38
+ "url": "https://github.com/zeufack/loyalix-shared-type"
33
39
  },
34
40
  "publishConfig": {
35
41
  "access": "public"
36
- },
37
- "scripts": {
38
- "build": "tsup src/index.ts --format cjs,esm --dts",
39
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
40
- "clean": "rm -rf dist"
41
42
  }
42
- }
43
+ }