@fiado/type-kit 3.80.0 → 3.82.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/_test_/unit/platformRbac/enums/__snapshots__/permissionBits.test.ts.snap +2 -1
- package/bin/complaint/dtos/ComplaintResponse.d.ts +1 -0
- package/bin/complaint/dtos/ComplaintResponse.js +4 -0
- package/bin/complaint/dtos/UpdateComplaintStatusRequest.d.ts +10 -0
- package/bin/complaint/dtos/UpdateComplaintStatusRequest.js +44 -0
- package/bin/complaint/enums/ComplaintStatus.d.ts +9 -0
- package/bin/complaint/enums/ComplaintStatus.js +13 -0
- package/bin/complaint/index.d.ts +2 -0
- package/bin/complaint/index.js +4 -0
- package/bin/platformRbac/enums/Permission.d.ts +2 -1
- package/bin/platformRbac/enums/Permission.js +3 -0
- package/package.json +1 -1
- package/src/complaint/dtos/ComplaintResponse.ts +1 -0
- package/src/complaint/dtos/UpdateComplaintStatusRequest.ts +29 -0
- package/src/complaint/enums/ComplaintStatus.ts +9 -0
- package/src/complaint/index.ts +5 -0
- package/src/platformRbac/enums/Permission.ts +3 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
-
exports[`PERMISSION_BIT_ORDER PERMS_VERSION es número estable 1`] = `
|
|
3
|
+
exports[`PERMISSION_BIT_ORDER PERMS_VERSION es número estable 1`] = `231160135`;
|
|
4
4
|
|
|
5
5
|
exports[`PERMISSION_BIT_ORDER append-only: snapshot del ORDEN COMPLETO (rompe ante cualquier reorden/inserción) 1`] = `
|
|
6
6
|
[
|
|
@@ -117,5 +117,6 @@ exports[`PERMISSION_BIT_ORDER append-only: snapshot del ORDEN COMPLETO (rompe an
|
|
|
117
117
|
"agents.notification.send",
|
|
118
118
|
"agents.export.run",
|
|
119
119
|
"agents.catalog.view",
|
|
120
|
+
"agents.group.manage",
|
|
120
121
|
]
|
|
121
122
|
`;
|
|
@@ -59,6 +59,10 @@ __decorate([
|
|
|
59
59
|
(0, class_transformer_1.Expose)(),
|
|
60
60
|
__metadata("design:type", String)
|
|
61
61
|
], ComplaintResponse.prototype, "dictamenBy", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_transformer_1.Expose)(),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], ComplaintResponse.prototype, "dictamenNotes", void 0);
|
|
62
66
|
__decorate([
|
|
63
67
|
(0, class_transformer_1.Expose)(),
|
|
64
68
|
__metadata("design:type", String)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request del hook de dictamen (`POST /complaints/{complaintId}/status`, BO-19b).
|
|
3
|
+
* Sincroniza el estado de la denuncia tras el dictamen del OC.
|
|
4
|
+
* `status` solo acepta los estados de cierre (`OPEN` no es válido como entrada).
|
|
5
|
+
*/
|
|
6
|
+
export declare class UpdateComplaintStatusRequest {
|
|
7
|
+
status: string;
|
|
8
|
+
dictamenBy: string;
|
|
9
|
+
dictamenNotes?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.UpdateComplaintStatusRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const ComplaintStatus_1 = require("../enums/ComplaintStatus");
|
|
16
|
+
/**
|
|
17
|
+
* Request del hook de dictamen (`POST /complaints/{complaintId}/status`, BO-19b).
|
|
18
|
+
* Sincroniza el estado de la denuncia tras el dictamen del OC.
|
|
19
|
+
* `status` solo acepta los estados de cierre (`OPEN` no es válido como entrada).
|
|
20
|
+
*/
|
|
21
|
+
class UpdateComplaintStatusRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.UpdateComplaintStatusRequest = UpdateComplaintStatusRequest;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_transformer_1.Expose)(),
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.IsIn)([ComplaintStatus_1.ComplaintStatus.CLOSE_JUSTIFIED, ComplaintStatus_1.ComplaintStatus.CLOSE_RULED], {
|
|
28
|
+
message: "status debe ser CLOSE_JUSTIFIED o CLOSE_RULED",
|
|
29
|
+
}),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], UpdateComplaintStatusRequest.prototype, "status", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_transformer_1.Expose)(),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], UpdateComplaintStatusRequest.prototype, "dictamenBy", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_transformer_1.Expose)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.MaxLength)(1000),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], UpdateComplaintStatusRequest.prototype, "dictamenNotes", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estados del ciclo de vida de una denuncia (`Complaints_GT`, BO-19/BO-19b).
|
|
3
|
+
* `OPEN` al crearse; pasa a `CLOSE_*` cuando el OC dictamina (hook BO-19b).
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ComplaintStatus {
|
|
6
|
+
OPEN = "OPEN",
|
|
7
|
+
CLOSE_JUSTIFIED = "CLOSE_JUSTIFIED",
|
|
8
|
+
CLOSE_RULED = "CLOSE_RULED"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComplaintStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estados del ciclo de vida de una denuncia (`Complaints_GT`, BO-19/BO-19b).
|
|
6
|
+
* `OPEN` al crearse; pasa a `CLOSE_*` cuando el OC dictamina (hook BO-19b).
|
|
7
|
+
*/
|
|
8
|
+
var ComplaintStatus;
|
|
9
|
+
(function (ComplaintStatus) {
|
|
10
|
+
ComplaintStatus["OPEN"] = "OPEN";
|
|
11
|
+
ComplaintStatus["CLOSE_JUSTIFIED"] = "CLOSE_JUSTIFIED";
|
|
12
|
+
ComplaintStatus["CLOSE_RULED"] = "CLOSE_RULED";
|
|
13
|
+
})(ComplaintStatus || (exports.ComplaintStatus = ComplaintStatus = {}));
|
package/bin/complaint/index.d.ts
CHANGED
package/bin/complaint/index.js
CHANGED
|
@@ -14,5 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
//dtos
|
|
17
18
|
__exportStar(require("./dtos/CreateComplaintRequest"), exports);
|
|
18
19
|
__exportStar(require("./dtos/ComplaintResponse"), exports);
|
|
20
|
+
__exportStar(require("./dtos/UpdateComplaintStatusRequest"), exports);
|
|
21
|
+
//enums
|
|
22
|
+
__exportStar(require("./enums/ComplaintStatus"), exports);
|
|
@@ -141,7 +141,8 @@ export declare enum Permission {
|
|
|
141
141
|
AGENTS_CHAT_SEND = "agents.chat.send",
|
|
142
142
|
AGENTS_NOTIFICATION_SEND = "agents.notification.send",
|
|
143
143
|
AGENTS_EXPORT_RUN = "agents.export.run",
|
|
144
|
-
AGENTS_CATALOG_VIEW = "agents.catalog.view"
|
|
144
|
+
AGENTS_CATALOG_VIEW = "agents.catalog.view",
|
|
145
|
+
AGENTS_GROUP_MANAGE = "agents.group.manage"
|
|
145
146
|
}
|
|
146
147
|
/**
|
|
147
148
|
* Orden CANÓNICO y APPEND-ONLY de los permisos para el bitset del token.
|
|
@@ -183,6 +183,8 @@ var Permission;
|
|
|
183
183
|
Permission["AGENTS_NOTIFICATION_SEND"] = "agents.notification.send";
|
|
184
184
|
Permission["AGENTS_EXPORT_RUN"] = "agents.export.run";
|
|
185
185
|
Permission["AGENTS_CATALOG_VIEW"] = "agents.catalog.view";
|
|
186
|
+
// Gestión de grupos del tenant AGENTS (scope TENANT — el operador). Espejo de retail.retailer.manage.
|
|
187
|
+
Permission["AGENTS_GROUP_MANAGE"] = "agents.group.manage";
|
|
186
188
|
})(Permission || (exports.Permission = Permission = {}));
|
|
187
189
|
/**
|
|
188
190
|
* Orden CANÓNICO y APPEND-ONLY de los permisos para el bitset del token.
|
|
@@ -310,6 +312,7 @@ exports.PERMISSION_BIT_ORDER = [
|
|
|
310
312
|
Permission.AGENTS_NOTIFICATION_SEND,
|
|
311
313
|
Permission.AGENTS_EXPORT_RUN,
|
|
312
314
|
Permission.AGENTS_CATALOG_VIEW,
|
|
315
|
+
Permission.AGENTS_GROUP_MANAGE,
|
|
313
316
|
];
|
|
314
317
|
function djb2(input) {
|
|
315
318
|
let h = 5381;
|
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Expose } from "class-transformer";
|
|
2
|
+
import { IsIn, IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";
|
|
3
|
+
import { ComplaintStatus } from "../enums/ComplaintStatus";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Request del hook de dictamen (`POST /complaints/{complaintId}/status`, BO-19b).
|
|
7
|
+
* Sincroniza el estado de la denuncia tras el dictamen del OC.
|
|
8
|
+
* `status` solo acepta los estados de cierre (`OPEN` no es válido como entrada).
|
|
9
|
+
*/
|
|
10
|
+
export class UpdateComplaintStatusRequest {
|
|
11
|
+
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsString()
|
|
14
|
+
@IsIn([ComplaintStatus.CLOSE_JUSTIFIED, ComplaintStatus.CLOSE_RULED], {
|
|
15
|
+
message: "status debe ser CLOSE_JUSTIFIED o CLOSE_RULED",
|
|
16
|
+
})
|
|
17
|
+
status!: string;
|
|
18
|
+
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
dictamenBy!: string; // email del operador que dictamina
|
|
23
|
+
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@IsString()
|
|
27
|
+
@MaxLength(1000)
|
|
28
|
+
dictamenNotes?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estados del ciclo de vida de una denuncia (`Complaints_GT`, BO-19/BO-19b).
|
|
3
|
+
* `OPEN` al crearse; pasa a `CLOSE_*` cuando el OC dictamina (hook BO-19b).
|
|
4
|
+
*/
|
|
5
|
+
export enum ComplaintStatus {
|
|
6
|
+
OPEN = "OPEN",
|
|
7
|
+
CLOSE_JUSTIFIED = "CLOSE_JUSTIFIED",
|
|
8
|
+
CLOSE_RULED = "CLOSE_RULED",
|
|
9
|
+
}
|
package/src/complaint/index.ts
CHANGED
|
@@ -184,6 +184,8 @@ export enum Permission {
|
|
|
184
184
|
AGENTS_NOTIFICATION_SEND = 'agents.notification.send',
|
|
185
185
|
AGENTS_EXPORT_RUN = 'agents.export.run',
|
|
186
186
|
AGENTS_CATALOG_VIEW = 'agents.catalog.view',
|
|
187
|
+
// Gestión de grupos del tenant AGENTS (scope TENANT — el operador). Espejo de retail.retailer.manage.
|
|
188
|
+
AGENTS_GROUP_MANAGE = 'agents.group.manage',
|
|
187
189
|
}
|
|
188
190
|
|
|
189
191
|
/**
|
|
@@ -312,6 +314,7 @@ export const PERMISSION_BIT_ORDER: readonly Permission[] = [
|
|
|
312
314
|
Permission.AGENTS_NOTIFICATION_SEND,
|
|
313
315
|
Permission.AGENTS_EXPORT_RUN,
|
|
314
316
|
Permission.AGENTS_CATALOG_VIEW,
|
|
317
|
+
Permission.AGENTS_GROUP_MANAGE,
|
|
315
318
|
] as const;
|
|
316
319
|
|
|
317
320
|
function djb2(input: string): number {
|