tychat-contracts 1.0.51 → 1.0.53

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/README.md CHANGED
@@ -5,7 +5,8 @@ DTOs compartilhados com **class-validator** usados pela **tychat-api** e pelos m
5
5
  ## Estrutura
6
6
 
7
7
  - **auth**: `LoginDto`, `RefreshTokenDto`, `RequestPasswordResetDto`, `ConfirmPasswordResetDto`, `AuthLoginResponseDto`, payloads Kafka (`LoginPayload`, `RequestPasswordResetPayload`, etc.)
8
- - **users**: `CreateUserDto` (sem password para criação por admin), `UserListItemDto`, `UpdateSelfUserDto`, `UpdateUserByAdminDto`, `UpdatedUserDto`, `ChangeForcePasswordDto`
8
+ - **users**: `CreateUserDto` (sem password para criação por admin), `UserListItemDto`, `UpdateSelfUserDto` (name/email), `UpdateUserByAdminDto` (name/email/role), `UpdatedUserDto`, `ChangeForcePasswordDto`
9
+ - **professionals**: `ProfessionalProfileDto`, `UpdateProfessionalProfileDto`, `CreateProfessionalWithProfileDto`
9
10
 
10
11
  ## Uso
11
12
 
package/dist/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export * from './payments';
10
10
  export * from './billing';
11
11
  export * from './ai';
12
12
  export * from './storage';
13
+ export * from './notifications';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -26,3 +26,4 @@ __exportStar(require("./payments"), exports);
26
26
  __exportStar(require("./billing"), exports);
27
27
  __exportStar(require("./ai"), exports);
28
28
  __exportStar(require("./storage"), exports);
29
+ __exportStar(require("./notifications"), exports);
@@ -0,0 +1,2 @@
1
+ export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, } from './notifications-kafka.payloads';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,GAC/C,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
4
+ var notifications_kafka_payloads_1 = require("./notifications-kafka.payloads");
5
+ Object.defineProperty(exports, "NotificationUserCreatedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationUserCreatedEventPayload; } });
6
+ Object.defineProperty(exports, "NotificationPasswordResetRequestedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationPasswordResetRequestedEventPayload; } });
@@ -0,0 +1,16 @@
1
+ export declare class NotificationUserCreatedEventPayload {
2
+ eventId: string;
3
+ tenant: string;
4
+ email: string;
5
+ name: string;
6
+ password: string;
7
+ occurredAt: string;
8
+ }
9
+ export declare class NotificationPasswordResetRequestedEventPayload {
10
+ eventId: string;
11
+ tenant: string;
12
+ email: string;
13
+ verifyToken: string;
14
+ occurredAt: string;
15
+ }
16
+ //# sourceMappingURL=notifications-kafka.payloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications-kafka.payloads.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka.payloads.ts"],"names":[],"mappings":"AAGA,qBAAa,mCAAmC;IAM9C,OAAO,EAAE,MAAM,CAAC;IAShB,MAAM,EAAE,MAAM,CAAC;IAQf,KAAK,EAAE,MAAM,CAAC;IASd,IAAI,EAAE,MAAM,CAAC;IASb,QAAQ,EAAE,MAAM,CAAC;IAOjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,8CAA8C;IAMzD,OAAO,EAAE,MAAM,CAAC;IAShB,MAAM,EAAE,MAAM,CAAC;IAQf,KAAK,EAAE,MAAM,CAAC;IASd,WAAW,EAAE,MAAM,CAAC;IAOpB,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class NotificationUserCreatedEventPayload {
16
+ eventId;
17
+ tenant;
18
+ email;
19
+ name;
20
+ password;
21
+ occurredAt;
22
+ }
23
+ exports.NotificationUserCreatedEventPayload = NotificationUserCreatedEventPayload;
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)({
26
+ description: 'Unique event id used for idempotent processing',
27
+ example: '2d3ecf0d-8d38-4b95-95c8-d3e903e6f1fe',
28
+ }),
29
+ (0, class_validator_1.IsUUID)(),
30
+ __metadata("design:type", String)
31
+ ], NotificationUserCreatedEventPayload.prototype, "eventId", void 0);
32
+ __decorate([
33
+ (0, swagger_1.ApiProperty)({
34
+ description: 'Tenant slug that owns the user',
35
+ example: 'default',
36
+ }),
37
+ (0, class_validator_1.IsString)(),
38
+ (0, class_validator_1.MinLength)(1),
39
+ (0, class_validator_1.MaxLength)(255),
40
+ __metadata("design:type", String)
41
+ ], NotificationUserCreatedEventPayload.prototype, "tenant", void 0);
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({
44
+ description: 'Created user email address',
45
+ example: 'maria.silva@example.com',
46
+ }),
47
+ (0, class_validator_1.IsEmail)(),
48
+ (0, class_validator_1.MaxLength)(255),
49
+ __metadata("design:type", String)
50
+ ], NotificationUserCreatedEventPayload.prototype, "email", void 0);
51
+ __decorate([
52
+ (0, swagger_1.ApiProperty)({
53
+ description: 'Created user display name',
54
+ example: 'Maria Silva',
55
+ }),
56
+ (0, class_validator_1.IsString)(),
57
+ (0, class_validator_1.MinLength)(1),
58
+ (0, class_validator_1.MaxLength)(255),
59
+ __metadata("design:type", String)
60
+ ], NotificationUserCreatedEventPayload.prototype, "name", void 0);
61
+ __decorate([
62
+ (0, swagger_1.ApiProperty)({
63
+ description: 'Temporary generated password',
64
+ example: 'tmp-9f2adce',
65
+ }),
66
+ (0, class_validator_1.IsString)(),
67
+ (0, class_validator_1.MinLength)(6),
68
+ (0, class_validator_1.MaxLength)(255),
69
+ __metadata("design:type", String)
70
+ ], NotificationUserCreatedEventPayload.prototype, "password", void 0);
71
+ __decorate([
72
+ (0, swagger_1.ApiProperty)({
73
+ description: 'Timestamp when the event was created',
74
+ example: '2026-03-22T12:30:00.000Z',
75
+ }),
76
+ (0, class_validator_1.IsISO8601)(),
77
+ __metadata("design:type", String)
78
+ ], NotificationUserCreatedEventPayload.prototype, "occurredAt", void 0);
79
+ class NotificationPasswordResetRequestedEventPayload {
80
+ eventId;
81
+ tenant;
82
+ email;
83
+ verifyToken;
84
+ occurredAt;
85
+ }
86
+ exports.NotificationPasswordResetRequestedEventPayload = NotificationPasswordResetRequestedEventPayload;
87
+ __decorate([
88
+ (0, swagger_1.ApiProperty)({
89
+ description: 'Unique event id used for idempotent processing',
90
+ example: 'f5b3790a-1134-4db2-b4e0-ff40ce59d047',
91
+ }),
92
+ (0, class_validator_1.IsUUID)(),
93
+ __metadata("design:type", String)
94
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "eventId", void 0);
95
+ __decorate([
96
+ (0, swagger_1.ApiProperty)({
97
+ description: 'Tenant slug that owns the user',
98
+ example: 'default',
99
+ }),
100
+ (0, class_validator_1.IsString)(),
101
+ (0, class_validator_1.MinLength)(1),
102
+ (0, class_validator_1.MaxLength)(255),
103
+ __metadata("design:type", String)
104
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "tenant", void 0);
105
+ __decorate([
106
+ (0, swagger_1.ApiProperty)({
107
+ description: 'User email that requested password reset',
108
+ example: 'maria.silva@example.com',
109
+ }),
110
+ (0, class_validator_1.IsEmail)(),
111
+ (0, class_validator_1.MaxLength)(255),
112
+ __metadata("design:type", String)
113
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "email", void 0);
114
+ __decorate([
115
+ (0, swagger_1.ApiProperty)({
116
+ description: 'Password reset verification token',
117
+ example: 'a3b5f3c1f3c6ef',
118
+ }),
119
+ (0, class_validator_1.IsString)(),
120
+ (0, class_validator_1.MinLength)(1),
121
+ (0, class_validator_1.MaxLength)(255),
122
+ __metadata("design:type", String)
123
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "verifyToken", void 0);
124
+ __decorate([
125
+ (0, swagger_1.ApiProperty)({
126
+ description: 'Timestamp when the event was created',
127
+ example: '2026-03-22T12:30:00.000Z',
128
+ }),
129
+ (0, class_validator_1.IsISO8601)(),
130
+ __metadata("design:type", String)
131
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "occurredAt", void 0);
@@ -3,6 +3,5 @@ export declare class UpdateSelfUserDto {
3
3
  _atLeastOne?: string;
4
4
  name?: string;
5
5
  email?: string;
6
- password?: string;
7
6
  }
8
7
  //# sourceMappingURL=update-self-user.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-self-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-self-user.dto.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,qBAAa,iBAAiB;IAG5B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,KAAK,CAAC,EAAE,MAAM,CAAC;IAWf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"update-self-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-self-user.dto.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,qBAAa,iBAAiB;IAG5B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,KAAK,CAAC,EAAE,MAAM,CAAC;CAEhB"}
@@ -18,12 +18,11 @@ class UpdateSelfUserDto {
18
18
  _atLeastOne;
19
19
  name;
20
20
  email;
21
- password;
22
21
  }
23
22
  exports.UpdateSelfUserDto = UpdateSelfUserDto;
24
23
  __decorate([
25
24
  (0, swagger_1.ApiHideProperty)(),
26
- (0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email', 'password']),
25
+ (0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email']),
27
26
  __metadata("design:type", String)
28
27
  ], UpdateSelfUserDto.prototype, "_atLeastOne", void 0);
29
28
  __decorate([
@@ -49,15 +48,3 @@ __decorate([
49
48
  (0, class_validator_1.MaxLength)(255),
50
49
  __metadata("design:type", String)
51
50
  ], UpdateSelfUserDto.prototype, "email", void 0);
52
- __decorate([
53
- (0, swagger_1.ApiPropertyOptional)({
54
- description: 'New password (bcrypt-hashed on the auth service)',
55
- example: 'senha123',
56
- minLength: 6,
57
- }),
58
- (0, class_validator_1.IsOptional)(),
59
- (0, class_validator_1.IsString)(),
60
- (0, class_validator_1.MinLength)(6, { message: 'password must be at least 6 characters' }),
61
- (0, class_validator_1.MaxLength)(255),
62
- __metadata("design:type", String)
63
- ], UpdateSelfUserDto.prototype, "password", void 0);
@@ -5,7 +5,6 @@ export declare class UpdateUserByAdminDto {
5
5
  _atLeastOne?: string;
6
6
  name?: string;
7
7
  email?: string;
8
- password?: string;
9
8
  role?: AllUserRole;
10
9
  }
11
10
  //# sourceMappingURL=update-user-by-admin.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-user-by-admin.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-user-by-admin.dto.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,gEAIjB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,wEAAwE;AACxE,qBAAa,oBAAoB;IAG/B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,KAAK,CAAC,EAAE,MAAM,CAAC;IAWf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAYlB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
1
+ {"version":3,"file":"update-user-by-admin.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-user-by-admin.dto.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,gEAIjB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,wEAAwE;AACxE,qBAAa,oBAAoB;IAG/B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,KAAK,CAAC,EAAE,MAAM,CAAC;IAYf,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
@@ -23,13 +23,12 @@ class UpdateUserByAdminDto {
23
23
  _atLeastOne;
24
24
  name;
25
25
  email;
26
- password;
27
26
  role;
28
27
  }
29
28
  exports.UpdateUserByAdminDto = UpdateUserByAdminDto;
30
29
  __decorate([
31
30
  (0, swagger_1.ApiHideProperty)(),
32
- (0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email', 'password', 'role']),
31
+ (0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email', 'role']),
33
32
  __metadata("design:type", String)
34
33
  ], UpdateUserByAdminDto.prototype, "_atLeastOne", void 0);
35
34
  __decorate([
@@ -55,18 +54,6 @@ __decorate([
55
54
  (0, class_validator_1.MaxLength)(255),
56
55
  __metadata("design:type", String)
57
56
  ], UpdateUserByAdminDto.prototype, "email", void 0);
58
- __decorate([
59
- (0, swagger_1.ApiPropertyOptional)({
60
- description: 'New password (bcrypt-hashed on the auth service)',
61
- example: 'senha123',
62
- minLength: 6,
63
- }),
64
- (0, class_validator_1.IsOptional)(),
65
- (0, class_validator_1.IsString)(),
66
- (0, class_validator_1.MinLength)(6, { message: 'password must be at least 6 characters' }),
67
- (0, class_validator_1.MaxLength)(255),
68
- __metadata("design:type", String)
69
- ], UpdateUserByAdminDto.prototype, "password", void 0);
70
57
  __decorate([
71
58
  (0, swagger_1.ApiPropertyOptional)({
72
59
  description: 'User role',
@@ -6,7 +6,6 @@ export interface AuthUpdateSelfPayload {
6
6
  userId: string;
7
7
  name?: string;
8
8
  email?: string;
9
- password?: string;
10
9
  }
11
10
  /**
12
11
  * Kafka payload for auth.update_user_admin (tychat-api → tychat-auth-service).
@@ -18,7 +17,6 @@ export interface AuthUpdateUserAdminPayload {
18
17
  targetUserId: string;
19
18
  name?: string;
20
19
  email?: string;
21
- password?: string;
22
20
  role?: 'administrator' | 'attendant' | 'health_professional';
23
21
  }
24
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"user-update-kafka-payloads.d.ts","sourceRoot":"","sources":["../../src/users/user-update-kafka-payloads.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,eAAe,GAAG,WAAW,GAAG,qBAAqB,CAAC;CAC9D;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"user-update-kafka-payloads.d.ts","sourceRoot":"","sources":["../../src/users/user-update-kafka-payloads.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,eAAe,GAAG,WAAW,GAAG,qBAAqB,CAAC;CAC9D;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -10,3 +10,4 @@ export * from './payments';
10
10
  export * from './billing';
11
11
  export * from './ai';
12
12
  export * from './storage';
13
+ export * from './notifications';
@@ -0,0 +1,4 @@
1
+ export {
2
+ NotificationUserCreatedEventPayload,
3
+ NotificationPasswordResetRequestedEventPayload,
4
+ } from './notifications-kafka.payloads';
@@ -0,0 +1,95 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsEmail, IsISO8601, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
3
+
4
+ export class NotificationUserCreatedEventPayload {
5
+ @ApiProperty({
6
+ description: 'Unique event id used for idempotent processing',
7
+ example: '2d3ecf0d-8d38-4b95-95c8-d3e903e6f1fe',
8
+ })
9
+ @IsUUID()
10
+ eventId: string;
11
+
12
+ @ApiProperty({
13
+ description: 'Tenant slug that owns the user',
14
+ example: 'default',
15
+ })
16
+ @IsString()
17
+ @MinLength(1)
18
+ @MaxLength(255)
19
+ tenant: string;
20
+
21
+ @ApiProperty({
22
+ description: 'Created user email address',
23
+ example: 'maria.silva@example.com',
24
+ })
25
+ @IsEmail()
26
+ @MaxLength(255)
27
+ email: string;
28
+
29
+ @ApiProperty({
30
+ description: 'Created user display name',
31
+ example: 'Maria Silva',
32
+ })
33
+ @IsString()
34
+ @MinLength(1)
35
+ @MaxLength(255)
36
+ name: string;
37
+
38
+ @ApiProperty({
39
+ description: 'Temporary generated password',
40
+ example: 'tmp-9f2adce',
41
+ })
42
+ @IsString()
43
+ @MinLength(6)
44
+ @MaxLength(255)
45
+ password: string;
46
+
47
+ @ApiProperty({
48
+ description: 'Timestamp when the event was created',
49
+ example: '2026-03-22T12:30:00.000Z',
50
+ })
51
+ @IsISO8601()
52
+ occurredAt: string;
53
+ }
54
+
55
+ export class NotificationPasswordResetRequestedEventPayload {
56
+ @ApiProperty({
57
+ description: 'Unique event id used for idempotent processing',
58
+ example: 'f5b3790a-1134-4db2-b4e0-ff40ce59d047',
59
+ })
60
+ @IsUUID()
61
+ eventId: string;
62
+
63
+ @ApiProperty({
64
+ description: 'Tenant slug that owns the user',
65
+ example: 'default',
66
+ })
67
+ @IsString()
68
+ @MinLength(1)
69
+ @MaxLength(255)
70
+ tenant: string;
71
+
72
+ @ApiProperty({
73
+ description: 'User email that requested password reset',
74
+ example: 'maria.silva@example.com',
75
+ })
76
+ @IsEmail()
77
+ @MaxLength(255)
78
+ email: string;
79
+
80
+ @ApiProperty({
81
+ description: 'Password reset verification token',
82
+ example: 'a3b5f3c1f3c6ef',
83
+ })
84
+ @IsString()
85
+ @MinLength(1)
86
+ @MaxLength(255)
87
+ verifyToken: string;
88
+
89
+ @ApiProperty({
90
+ description: 'Timestamp when the event was created',
91
+ example: '2026-03-22T12:30:00.000Z',
92
+ })
93
+ @IsISO8601()
94
+ occurredAt: string;
95
+ }
@@ -5,7 +5,7 @@ import { AtLeastOneOf } from './at-least-one-of.decorator';
5
5
  /** Fields the authenticated user may change on their own profile (no role change). */
6
6
  export class UpdateSelfUserDto {
7
7
  @ApiHideProperty()
8
- @AtLeastOneOf(['name', 'email', 'password'])
8
+ @AtLeastOneOf(['name', 'email'])
9
9
  _atLeastOne?: string;
10
10
 
11
11
  @ApiPropertyOptional({
@@ -29,14 +29,4 @@ export class UpdateSelfUserDto {
29
29
  @MaxLength(255)
30
30
  email?: string;
31
31
 
32
- @ApiPropertyOptional({
33
- description: 'New password (bcrypt-hashed on the auth service)',
34
- example: 'senha123',
35
- minLength: 6,
36
- })
37
- @IsOptional()
38
- @IsString()
39
- @MinLength(6, { message: 'password must be at least 6 characters' })
40
- @MaxLength(255)
41
- password?: string;
42
32
  }
@@ -12,7 +12,7 @@ export type AllUserRole = (typeof ALL_USER_ROLES)[number];
12
12
  /** Fields an administrator may change for any user (including role). */
13
13
  export class UpdateUserByAdminDto {
14
14
  @ApiHideProperty()
15
- @AtLeastOneOf(['name', 'email', 'password', 'role'])
15
+ @AtLeastOneOf(['name', 'email', 'role'])
16
16
  _atLeastOne?: string;
17
17
 
18
18
  @ApiPropertyOptional({
@@ -36,17 +36,6 @@ export class UpdateUserByAdminDto {
36
36
  @MaxLength(255)
37
37
  email?: string;
38
38
 
39
- @ApiPropertyOptional({
40
- description: 'New password (bcrypt-hashed on the auth service)',
41
- example: 'senha123',
42
- minLength: 6,
43
- })
44
- @IsOptional()
45
- @IsString()
46
- @MinLength(6, { message: 'password must be at least 6 characters' })
47
- @MaxLength(255)
48
- password?: string;
49
-
50
39
  @ApiPropertyOptional({
51
40
  description: 'User role',
52
41
  enum: ALL_USER_ROLES,
@@ -6,7 +6,6 @@ export interface AuthUpdateSelfPayload {
6
6
  userId: string;
7
7
  name?: string;
8
8
  email?: string;
9
- password?: string;
10
9
  }
11
10
 
12
11
  /**
@@ -19,7 +18,6 @@ export interface AuthUpdateUserAdminPayload {
19
18
  targetUserId: string;
20
19
  name?: string;
21
20
  email?: string;
22
- password?: string;
23
21
  role?: 'administrator' | 'attendant' | 'health_professional';
24
22
  }
25
23