@fiado/type-kit 3.191.0 → 3.193.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/bin/platformRbac/dtos/CreateLevelEntityRequest.d.ts +15 -0
- package/bin/platformRbac/dtos/CreateLevelEntityRequest.js +52 -0
- package/bin/platformRbac/dtos/CreateLevelEntityResponse.d.ts +14 -0
- package/bin/platformRbac/dtos/CreateLevelEntityResponse.js +2 -0
- package/bin/platformRbac/dtos/CreateTenantUserRequest.d.ts +19 -0
- package/bin/platformRbac/dtos/CreateTenantUserRequest.js +63 -0
- package/bin/platformRbac/dtos/CreateTenantUserResponse.d.ts +7 -0
- package/bin/platformRbac/dtos/CreateTenantUserResponse.js +2 -0
- package/bin/platformRbac/index.d.ts +4 -0
- package/bin/platformRbac/index.js +5 -0
- package/bin/retailOrg/dtos/RetailUser.d.ts +7 -0
- package/bin/retailOrg/dtos/RetailUser.js +6 -0
- package/bin/retailOrg/dtos/requests/CreateRetailUserRequest.d.ts +5 -0
- package/bin/retailOrg/dtos/requests/CreateRetailUserRequest.js +6 -0
- package/bin/retailOrg/dtos/requests/UpdateRetailUserRequest.d.ts +2 -0
- package/bin/retailOrg/dtos/requests/UpdateRetailUserRequest.js +6 -0
- package/package.json +1 -1
- package/src/platformRbac/dtos/CreateLevelEntityRequest.ts +18 -0
- package/src/platformRbac/dtos/CreateLevelEntityResponse.ts +14 -0
- package/src/platformRbac/dtos/CreateTenantUserRequest.ts +22 -0
- package/src/platformRbac/dtos/CreateTenantUserResponse.ts +7 -0
- package/src/platformRbac/index.ts +8 -0
- package/src/retailOrg/dtos/RetailUser.ts +11 -0
- package/src/retailOrg/dtos/requests/CreateRetailUserRequest.ts +9 -0
- package/src/retailOrg/dtos/requests/UpdateRetailUserRequest.ts +6 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body del POST /internal/tenants/{tenantId}/users/../levels/{level}/entities (endpoint privado, VPC/ANONIMUS).
|
|
3
|
+
* `tenantId` y `level` viajan en el path (no acá). Crea una scope-entity genérica L1/L2/L3 en RBAC.
|
|
4
|
+
*
|
|
5
|
+
* Consumido por el espejo de jerarquía de SureKeep F1 (retailer→L1, zona→L2, tienda→L3) vía api-invoker.
|
|
6
|
+
* - `id` es BYOID (DEC-RBAC-027): el caller trae su propio id → creates idempotentes (PutItem overwrite).
|
|
7
|
+
* - `parentId` es obligatorio para L2/L3 (id del nivel superior); ausente en L1 (cuelga de TENANT). Lo valida el manager.
|
|
8
|
+
* - `createdBy` = cognitoSub del admin real (audit), propagado desde el evento de outbox.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CreateLevelEntityRequest {
|
|
11
|
+
displayName: string;
|
|
12
|
+
id?: string;
|
|
13
|
+
parentId?: string;
|
|
14
|
+
createdBy: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.CreateLevelEntityRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body del POST /internal/tenants/{tenantId}/users/../levels/{level}/entities (endpoint privado, VPC/ANONIMUS).
|
|
17
|
+
* `tenantId` y `level` viajan en el path (no acá). Crea una scope-entity genérica L1/L2/L3 en RBAC.
|
|
18
|
+
*
|
|
19
|
+
* Consumido por el espejo de jerarquía de SureKeep F1 (retailer→L1, zona→L2, tienda→L3) vía api-invoker.
|
|
20
|
+
* - `id` es BYOID (DEC-RBAC-027): el caller trae su propio id → creates idempotentes (PutItem overwrite).
|
|
21
|
+
* - `parentId` es obligatorio para L2/L3 (id del nivel superior); ausente en L1 (cuelga de TENANT). Lo valida el manager.
|
|
22
|
+
* - `createdBy` = cognitoSub del admin real (audit), propagado desde el evento de outbox.
|
|
23
|
+
*/
|
|
24
|
+
class CreateLevelEntityRequest {
|
|
25
|
+
}
|
|
26
|
+
exports.CreateLevelEntityRequest = CreateLevelEntityRequest;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_transformer_1.Expose)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreateLevelEntityRequest.prototype, "displayName", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Expose)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], CreateLevelEntityRequest.prototype, "id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Expose)(),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CreateLevelEntityRequest.prototype, "parentId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_transformer_1.Expose)(),
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], CreateLevelEntityRequest.prototype, "createdBy", void 0);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Respuesta del POST create-level-entity (endpoint privado). Espejo público de la scope-entity creada
|
|
3
|
+
* (SharedLevelEntityRow del rbac-business). Interface plain → export type-only.
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateLevelEntityResponse {
|
|
6
|
+
id: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
parentId?: string;
|
|
9
|
+
level: string;
|
|
10
|
+
createdAt: number;
|
|
11
|
+
updatedAt: number;
|
|
12
|
+
createdBy?: string;
|
|
13
|
+
updatedBy?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PermissionScope } from '../enums/PermissionScope';
|
|
2
|
+
/**
|
|
3
|
+
* Body del POST /internal/tenants/{tenantId}/users (endpoint privado, VPC/ANONIMUS). `tenantId` viaja en el path.
|
|
4
|
+
* Provisiona Cognito + SharedUser + RoleAssignment (rol + scopeRef) en RBAC — reusa UserProvisioningService.
|
|
5
|
+
*
|
|
6
|
+
* Consumido por el alta de usuario orquestada de SureKeep F1 (retail-org → RBAC → RetailUser) vía api-invoker.
|
|
7
|
+
* - Usuario provisionado en estado INVITED (mitiga orphan si el paso siguiente en retail-org falla).
|
|
8
|
+
* - Idempotente por identidad Cognito.
|
|
9
|
+
* - `scope`/`scopeRef` = grant del rol (ej. LEVEL_3 + storeId para un vendedor de tienda).
|
|
10
|
+
* - `createdBy` = cognitoSub del admin real (audit + grantedBy del assignment).
|
|
11
|
+
*/
|
|
12
|
+
export declare class CreateTenantUserRequest {
|
|
13
|
+
email: string;
|
|
14
|
+
displayName?: string;
|
|
15
|
+
roleId: string;
|
|
16
|
+
scope: PermissionScope;
|
|
17
|
+
scopeRef: string;
|
|
18
|
+
createdBy: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.CreateTenantUserRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const PermissionScope_1 = require("../enums/PermissionScope");
|
|
16
|
+
/**
|
|
17
|
+
* Body del POST /internal/tenants/{tenantId}/users (endpoint privado, VPC/ANONIMUS). `tenantId` viaja en el path.
|
|
18
|
+
* Provisiona Cognito + SharedUser + RoleAssignment (rol + scopeRef) en RBAC — reusa UserProvisioningService.
|
|
19
|
+
*
|
|
20
|
+
* Consumido por el alta de usuario orquestada de SureKeep F1 (retail-org → RBAC → RetailUser) vía api-invoker.
|
|
21
|
+
* - Usuario provisionado en estado INVITED (mitiga orphan si el paso siguiente en retail-org falla).
|
|
22
|
+
* - Idempotente por identidad Cognito.
|
|
23
|
+
* - `scope`/`scopeRef` = grant del rol (ej. LEVEL_3 + storeId para un vendedor de tienda).
|
|
24
|
+
* - `createdBy` = cognitoSub del admin real (audit + grantedBy del assignment).
|
|
25
|
+
*/
|
|
26
|
+
class CreateTenantUserRequest {
|
|
27
|
+
}
|
|
28
|
+
exports.CreateTenantUserRequest = CreateTenantUserRequest;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.IsEmail)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CreateTenantUserRequest.prototype, "email", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_transformer_1.Expose)(),
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], CreateTenantUserRequest.prototype, "displayName", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CreateTenantUserRequest.prototype, "roleId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_transformer_1.Expose)(),
|
|
49
|
+
(0, class_validator_1.IsEnum)(PermissionScope_1.PermissionScope),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], CreateTenantUserRequest.prototype, "scope", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_transformer_1.Expose)(),
|
|
54
|
+
(0, class_validator_1.IsString)(),
|
|
55
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], CreateTenantUserRequest.prototype, "scopeRef", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_transformer_1.Expose)(),
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], CreateTenantUserRequest.prototype, "createdBy", void 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Respuesta del POST create-tenant-user (endpoint privado). Devuelve el cognitoSub del usuario
|
|
3
|
+
* provisionado, que retail-org guarda en el RetailUser para el match F1↔RBAC. Interface plain → type-only.
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateTenantUserResponse {
|
|
6
|
+
cognitoSub: string;
|
|
7
|
+
}
|
|
@@ -48,3 +48,7 @@ export type { RoleScopeRecompute, InconsistentAssignment, CascadeTenantFailure,
|
|
|
48
48
|
export * from './dtos/SelfRegisterStartRequest';
|
|
49
49
|
export * from './dtos/SelfRegisterVerifyOtpRequest';
|
|
50
50
|
export * from './dtos/SelfRegisterCompleteRequest';
|
|
51
|
+
export * from './dtos/CreateLevelEntityRequest';
|
|
52
|
+
export type { CreateLevelEntityResponse } from './dtos/CreateLevelEntityResponse';
|
|
53
|
+
export * from './dtos/CreateTenantUserRequest';
|
|
54
|
+
export type { CreateTenantUserResponse } from './dtos/CreateTenantUserResponse';
|
|
@@ -99,3 +99,8 @@ __exportStar(require("./enums/PermissionKind"), exports);
|
|
|
99
99
|
__exportStar(require("./dtos/SelfRegisterStartRequest"), exports);
|
|
100
100
|
__exportStar(require("./dtos/SelfRegisterVerifyOtpRequest"), exports);
|
|
101
101
|
__exportStar(require("./dtos/SelfRegisterCompleteRequest"), exports);
|
|
102
|
+
// Endpoints privados de espejo de jerarquía + alta de usuario (SureKeep F1, scope mirror).
|
|
103
|
+
// Request DTOs llevan decoradores class-validator → export de valor (se hidratan con plainToInstance);
|
|
104
|
+
// Response son interfaces plain → type-only. Consumidos por retail-org vía api-invoker (Publisher).
|
|
105
|
+
__exportStar(require("./dtos/CreateLevelEntityRequest"), exports);
|
|
106
|
+
__exportStar(require("./dtos/CreateTenantUserRequest"), exports);
|
|
@@ -9,6 +9,13 @@ export declare class RetailUser {
|
|
|
9
9
|
retailUserId: string;
|
|
10
10
|
cognitoSub: string;
|
|
11
11
|
retailerId: string;
|
|
12
|
+
/**
|
|
13
|
+
* Nombre de display del usuario — ETIQUETA DE CONVENIENCIA (DEC-SKF1-021). NO es la fuente de
|
|
14
|
+
* verdad de la identidad: la identidad real (nombre/email) vive en platform-rbac (DEC-SKF1-005 /
|
|
15
|
+
* DEC-011). Es solo un rótulo que el admin teclea para reconocer al usuario en la lista; puede
|
|
16
|
+
* quedar desincronizado si el nombre cambia en RBAC. Opcional (usuarios previos no lo tienen).
|
|
17
|
+
*/
|
|
18
|
+
displayName?: string;
|
|
12
19
|
homeStoreId: string;
|
|
13
20
|
/** Zona de operación del usuario; `null` si no está acotado a una zona. */
|
|
14
21
|
zoneId: string | null;
|
|
@@ -38,6 +38,12 @@ __decorate([
|
|
|
38
38
|
(0, class_validator_1.IsString)(),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], RetailUser.prototype, "retailerId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsString)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], RetailUser.prototype, "displayName", void 0);
|
|
41
47
|
__decorate([
|
|
42
48
|
(0, class_transformer_1.Expose)(),
|
|
43
49
|
(0, class_validator_1.IsString)(),
|
|
@@ -6,6 +6,11 @@ import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class CreateRetailUserRequest {
|
|
8
8
|
cognitoSub: string;
|
|
9
|
+
/**
|
|
10
|
+
* Nombre de display — etiqueta de conveniencia (DEC-SKF1-021). La identidad real vive en RBAC
|
|
11
|
+
* (DEC-SKF1-005); esto es solo un rótulo para reconocer al usuario en el backoffice. Opcional.
|
|
12
|
+
*/
|
|
13
|
+
displayName?: string;
|
|
9
14
|
homeStoreId: string;
|
|
10
15
|
employmentType: EmploymentTypeEnum;
|
|
11
16
|
commissionTier: string;
|
|
@@ -26,6 +26,12 @@ __decorate([
|
|
|
26
26
|
(0, class_validator_1.IsString)(),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
28
|
], CreateRetailUserRequest.prototype, "cognitoSub", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsString)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], CreateRetailUserRequest.prototype, "displayName", void 0);
|
|
29
35
|
__decorate([
|
|
30
36
|
(0, class_transformer_1.Expose)(),
|
|
31
37
|
(0, class_validator_1.IsString)(),
|
|
@@ -6,6 +6,8 @@ import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
|
6
6
|
* el status se cambia con `ChangeRetailUserStatusRequest`.
|
|
7
7
|
*/
|
|
8
8
|
export declare class UpdateRetailUserRequest {
|
|
9
|
+
/** Nombre de display — etiqueta de conveniencia editable (DEC-SKF1-021, identidad real en RBAC). */
|
|
10
|
+
displayName?: string;
|
|
9
11
|
employmentType?: EmploymentTypeEnum;
|
|
10
12
|
commissionTier?: string;
|
|
11
13
|
zoneId?: string | null;
|
|
@@ -22,6 +22,12 @@ const EmploymentTypeEnum_1 = require("../../enums/EmploymentTypeEnum");
|
|
|
22
22
|
class UpdateRetailUserRequest {
|
|
23
23
|
}
|
|
24
24
|
exports.UpdateRetailUserRequest = UpdateRetailUserRequest;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], UpdateRetailUserRequest.prototype, "displayName", void 0);
|
|
25
31
|
__decorate([
|
|
26
32
|
(0, class_transformer_1.Expose)(),
|
|
27
33
|
(0, class_validator_1.IsOptional)(),
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body del POST /internal/tenants/{tenantId}/users/../levels/{level}/entities (endpoint privado, VPC/ANONIMUS).
|
|
6
|
+
* `tenantId` y `level` viajan en el path (no acá). Crea una scope-entity genérica L1/L2/L3 en RBAC.
|
|
7
|
+
*
|
|
8
|
+
* Consumido por el espejo de jerarquía de SureKeep F1 (retailer→L1, zona→L2, tienda→L3) vía api-invoker.
|
|
9
|
+
* - `id` es BYOID (DEC-RBAC-027): el caller trae su propio id → creates idempotentes (PutItem overwrite).
|
|
10
|
+
* - `parentId` es obligatorio para L2/L3 (id del nivel superior); ausente en L1 (cuelga de TENANT). Lo valida el manager.
|
|
11
|
+
* - `createdBy` = cognitoSub del admin real (audit), propagado desde el evento de outbox.
|
|
12
|
+
*/
|
|
13
|
+
export class CreateLevelEntityRequest {
|
|
14
|
+
@Expose() @IsString() @IsNotEmpty() displayName!: string;
|
|
15
|
+
@Expose() @IsOptional() @IsString() @IsNotEmpty() id?: string;
|
|
16
|
+
@Expose() @IsOptional() @IsString() @IsNotEmpty() parentId?: string;
|
|
17
|
+
@Expose() @IsString() @IsNotEmpty() createdBy!: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Respuesta del POST create-level-entity (endpoint privado). Espejo público de la scope-entity creada
|
|
3
|
+
* (SharedLevelEntityRow del rbac-business). Interface plain → export type-only.
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateLevelEntityResponse {
|
|
6
|
+
id: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
parentId?: string;
|
|
9
|
+
level: string;
|
|
10
|
+
createdAt: number;
|
|
11
|
+
updatedAt: number;
|
|
12
|
+
createdBy?: string;
|
|
13
|
+
updatedBy?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEmail, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { PermissionScope } from '../enums/PermissionScope';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Body del POST /internal/tenants/{tenantId}/users (endpoint privado, VPC/ANONIMUS). `tenantId` viaja en el path.
|
|
7
|
+
* Provisiona Cognito + SharedUser + RoleAssignment (rol + scopeRef) en RBAC — reusa UserProvisioningService.
|
|
8
|
+
*
|
|
9
|
+
* Consumido por el alta de usuario orquestada de SureKeep F1 (retail-org → RBAC → RetailUser) vía api-invoker.
|
|
10
|
+
* - Usuario provisionado en estado INVITED (mitiga orphan si el paso siguiente en retail-org falla).
|
|
11
|
+
* - Idempotente por identidad Cognito.
|
|
12
|
+
* - `scope`/`scopeRef` = grant del rol (ej. LEVEL_3 + storeId para un vendedor de tienda).
|
|
13
|
+
* - `createdBy` = cognitoSub del admin real (audit + grantedBy del assignment).
|
|
14
|
+
*/
|
|
15
|
+
export class CreateTenantUserRequest {
|
|
16
|
+
@Expose() @IsEmail() email!: string;
|
|
17
|
+
@Expose() @IsOptional() @IsString() @IsNotEmpty() displayName?: string;
|
|
18
|
+
@Expose() @IsString() @IsNotEmpty() roleId!: string;
|
|
19
|
+
@Expose() @IsEnum(PermissionScope) scope!: PermissionScope;
|
|
20
|
+
@Expose() @IsString() @IsNotEmpty() scopeRef!: string;
|
|
21
|
+
@Expose() @IsString() @IsNotEmpty() createdBy!: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Respuesta del POST create-tenant-user (endpoint privado). Devuelve el cognitoSub del usuario
|
|
3
|
+
* provisionado, que retail-org guarda en el RetailUser para el match F1↔RBAC. Interface plain → type-only.
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateTenantUserResponse {
|
|
6
|
+
cognitoSub: string;
|
|
7
|
+
}
|
|
@@ -123,3 +123,11 @@ export type {
|
|
|
123
123
|
export * from './dtos/SelfRegisterStartRequest';
|
|
124
124
|
export * from './dtos/SelfRegisterVerifyOtpRequest';
|
|
125
125
|
export * from './dtos/SelfRegisterCompleteRequest';
|
|
126
|
+
|
|
127
|
+
// Endpoints privados de espejo de jerarquía + alta de usuario (SureKeep F1, scope mirror).
|
|
128
|
+
// Request DTOs llevan decoradores class-validator → export de valor (se hidratan con plainToInstance);
|
|
129
|
+
// Response son interfaces plain → type-only. Consumidos por retail-org vía api-invoker (Publisher).
|
|
130
|
+
export * from './dtos/CreateLevelEntityRequest';
|
|
131
|
+
export type { CreateLevelEntityResponse } from './dtos/CreateLevelEntityResponse';
|
|
132
|
+
export * from './dtos/CreateTenantUserRequest';
|
|
133
|
+
export type { CreateTenantUserResponse } from './dtos/CreateTenantUserResponse';
|
|
@@ -22,6 +22,17 @@ export class RetailUser {
|
|
|
22
22
|
@IsString()
|
|
23
23
|
retailerId!: string;
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Nombre de display del usuario — ETIQUETA DE CONVENIENCIA (DEC-SKF1-021). NO es la fuente de
|
|
27
|
+
* verdad de la identidad: la identidad real (nombre/email) vive en platform-rbac (DEC-SKF1-005 /
|
|
28
|
+
* DEC-011). Es solo un rótulo que el admin teclea para reconocer al usuario en la lista; puede
|
|
29
|
+
* quedar desincronizado si el nombre cambia en RBAC. Opcional (usuarios previos no lo tienen).
|
|
30
|
+
*/
|
|
31
|
+
@Expose()
|
|
32
|
+
@IsOptional()
|
|
33
|
+
@IsString()
|
|
34
|
+
displayName?: string;
|
|
35
|
+
|
|
25
36
|
@Expose()
|
|
26
37
|
@IsString()
|
|
27
38
|
homeStoreId!: string;
|
|
@@ -12,6 +12,15 @@ export class CreateRetailUserRequest {
|
|
|
12
12
|
@IsString()
|
|
13
13
|
cognitoSub!: string;
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Nombre de display — etiqueta de conveniencia (DEC-SKF1-021). La identidad real vive en RBAC
|
|
17
|
+
* (DEC-SKF1-005); esto es solo un rótulo para reconocer al usuario en el backoffice. Opcional.
|
|
18
|
+
*/
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsString()
|
|
22
|
+
displayName?: string;
|
|
23
|
+
|
|
15
24
|
@Expose()
|
|
16
25
|
@IsString()
|
|
17
26
|
homeStoreId!: string;
|
|
@@ -9,6 +9,12 @@ import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
|
9
9
|
* el status se cambia con `ChangeRetailUserStatusRequest`.
|
|
10
10
|
*/
|
|
11
11
|
export class UpdateRetailUserRequest {
|
|
12
|
+
/** Nombre de display — etiqueta de conveniencia editable (DEC-SKF1-021, identidad real en RBAC). */
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
displayName?: string;
|
|
17
|
+
|
|
12
18
|
@Expose()
|
|
13
19
|
@IsOptional()
|
|
14
20
|
@IsEnum(EmploymentTypeEnum)
|