@fiado/api-invoker 3.17.0 → 3.18.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.
@@ -0,0 +1,46 @@
1
+ import { ChangePasswordRequest, GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector";
2
+ export interface ICognitoApi {
3
+ /**
4
+ * Healthcheck for the cognito-connector
5
+ */
6
+ healthcheck(): Promise<HealthcheckResponse>;
7
+ /**
8
+ * Create a new user in Cognito
9
+ */
10
+ signUp(request: SignUpRequest): Promise<SignUpResponse>;
11
+ /**
12
+ * Confirm sign-up for a user in Cognito
13
+ */
14
+ signUpConfirm(request: SignUpConfirmRequest): Promise<void>;
15
+ /**
16
+ * Sign in a user
17
+ */
18
+ signIn(request: SignInRequest): Promise<SignInResponse>;
19
+ /**
20
+ * Sign out a user
21
+ */
22
+ signOut(): Promise<void>;
23
+ /**
24
+ * Change a user's password
25
+ */
26
+ changePassword(request: ChangePasswordRequest): Promise<void>;
27
+ /**
28
+ * Retrieve user details
29
+ */
30
+ getUser(request: GetUserRequest): Promise<GetUserResponse>;
31
+ /**
32
+ * Refresh a user's tokens
33
+ */
34
+ refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse>;
35
+ /**
36
+ * Respond to an auth challenge
37
+ */
38
+ respondToAuthChallenge(request: RespondToAuthChallengeRequest): Promise<any>;
39
+ /**
40
+ * Reset a user's password
41
+ */
42
+ resetPassword(request: SetPasswordRequest): Promise<void>;
43
+ }
44
+ export interface HealthcheckResponse {
45
+ status: string;
46
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ export interface IReportProcessorBusiness {
2
+ processReports(key: string): Promise<void>;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,8 @@ import { IHttpRequest } from "@fiado/http-client";
3
3
  import { CreatePrivateAlarm, CreateRiskProfileRequest } from "@fiado/type-kit/bin/riskProfile";
4
4
  import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
5
5
  import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
6
+ import { ResponseOptions } from "@fiado/gateway-adapter";
7
+ import { SetCustomAlarmRequest, SetCustomAlarmResponse, SetDeclaredIncomeRequest, SetDeclaredIncomeResponse, SetManualRiskLevelRequest, SetManualRiskLevelResponse } from "@fiado/type-kit/bin/riskProfile";
6
8
  export default class RiskProfileApi implements IRiskProfileApi {
7
9
  private httpRequest;
8
10
  private readonly baseUrl;
@@ -12,4 +14,7 @@ export default class RiskProfileApi implements IRiskProfileApi {
12
14
  updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any>;
13
15
  getRiskProfileByDirectoryId(directoryId: string): Promise<any>;
14
16
  createAlarm(params: CreatePrivateAlarm): Promise<any>;
17
+ setManualRiskLevel(directoryId: string, request: SetManualRiskLevelRequest): Promise<ResponseOptions<SetManualRiskLevelResponse>>;
18
+ setCustomAlarm(directoryId: string, request: SetCustomAlarmRequest): Promise<ResponseOptions<SetCustomAlarmResponse>>;
19
+ setDeclaredIncome(directoryId: string, request: SetDeclaredIncomeRequest): Promise<ResponseOptions<SetDeclaredIncomeResponse>>;
15
20
  }
@@ -38,6 +38,18 @@ let RiskProfileApi = class RiskProfileApi {
38
38
  const url = `${this.baseUrl}/alarms/create`;
39
39
  return await this.httpRequest.post(url, params);
40
40
  }
41
+ async setManualRiskLevel(directoryId, request) {
42
+ const url = `${this.baseUrl}/profiles/${directoryId}/manual-risk`;
43
+ return await this.httpRequest.put(url, request);
44
+ }
45
+ async setCustomAlarm(directoryId, request) {
46
+ const url = `${this.baseUrl}/profiles/${directoryId}/custom-alarm`;
47
+ return await this.httpRequest.put(url, request);
48
+ }
49
+ async setDeclaredIncome(directoryId, request) {
50
+ const url = `${this.baseUrl}/profiles/${directoryId}/declared-income`;
51
+ return await this.httpRequest.put(url, request);
52
+ }
41
53
  };
42
54
  RiskProfileApi = __decorate([
43
55
  (0, inversify_1.injectable)(),
@@ -1,6 +1,6 @@
1
1
  import { ITransactionAlertApi } from "./interfaces/ITransactionAlertApi";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
- import { AlarmOperationType, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
3
+ import { AlarmOperationType, AppendAlertNoteRequest, AppendAlertNoteResponse, CreateBlockedListAlertRequest, CreateBlockedListAlertResponse, DictaminateAlertRequest, DictaminateAlertResponse, MarkAlertReportedRequest, MarkAlertReportedResponse, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
4
4
  import { ResponseOptions } from "@fiado/gateway-adapter";
5
5
  export default class TransactionAlertApi implements ITransactionAlertApi {
6
6
  private httpRequest;
@@ -10,4 +10,8 @@ export default class TransactionAlertApi implements ITransactionAlertApi {
10
10
  items: TransactionAlertResponse[];
11
11
  lastKey: any;
12
12
  }>>;
13
+ dictaminateAlert(alertId: string, request: DictaminateAlertRequest): Promise<ResponseOptions<DictaminateAlertResponse>>;
14
+ appendAlertNote(alertId: string, request: AppendAlertNoteRequest): Promise<ResponseOptions<AppendAlertNoteResponse>>;
15
+ createBlockedListAlert(request: CreateBlockedListAlertRequest): Promise<ResponseOptions<CreateBlockedListAlertResponse>>;
16
+ markAlertReported(alertId: string, request: MarkAlertReportedRequest): Promise<ResponseOptions<MarkAlertReportedResponse>>;
13
17
  }
@@ -22,6 +22,22 @@ let TransactionAlertApi = class TransactionAlertApi {
22
22
  const url = `${this.baseUrl}/alarms?status=${status}&reported=${reported}`;
23
23
  return await this.httpRequest.get(url);
24
24
  }
25
+ async dictaminateAlert(alertId, request) {
26
+ const url = `${this.baseUrl}/alerts/${alertId}/dictamen`;
27
+ return await this.httpRequest.post(url, request);
28
+ }
29
+ async appendAlertNote(alertId, request) {
30
+ const url = `${this.baseUrl}/alerts/${alertId}/notes`;
31
+ return await this.httpRequest.post(url, request);
32
+ }
33
+ async createBlockedListAlert(request) {
34
+ const url = `${this.baseUrl}/alerts/blocked-list`;
35
+ return await this.httpRequest.post(url, request);
36
+ }
37
+ async markAlertReported(alertId, request) {
38
+ const url = `${this.baseUrl}/alerts/${alertId}/reported`;
39
+ return await this.httpRequest.post(url, request);
40
+ }
25
41
  };
26
42
  TransactionAlertApi = __decorate([
27
43
  (0, inversify_1.injectable)(),
@@ -1,10 +1,37 @@
1
1
  import { CreatePrivateAlarm, CreateRiskProfileRequest } from "@fiado/type-kit/bin/riskProfile";
2
2
  import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
3
3
  import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
4
+ import { ResponseOptions } from "@fiado/gateway-adapter";
5
+ import { SetCustomAlarmRequest, SetCustomAlarmResponse, SetDeclaredIncomeRequest, SetDeclaredIncomeResponse, SetManualRiskLevelRequest, SetManualRiskLevelResponse } from "@fiado/type-kit/bin/riskProfile";
4
6
  export interface IRiskProfileApi {
5
7
  createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
6
8
  updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any>;
7
9
  updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any>;
8
10
  getRiskProfileByDirectoryId(directoryId: string): Promise<any>;
9
11
  createAlarm(params: CreatePrivateAlarm): Promise<any>;
12
+ /**
13
+ * Cambia el manualRiskLevel del perfil con recálculo de alarmas base y posible creación
14
+ * de alerta MANUAL_RISK_INCREASE si el nivel sube.
15
+ * Endpoint: `PUT /profiles/{directoryId}/manual-risk`
16
+ *
17
+ * Idempotencia: si previousLevel === newLevel, devuelve 200 con noop=true sin escribir.
18
+ *
19
+ * Errores:
20
+ * - 404 NOT_FOUND si el perfil no existe.
21
+ */
22
+ setManualRiskLevel(directoryId: string, request: SetManualRiskLevelRequest): Promise<ResponseOptions<SetManualRiskLevelResponse>>;
23
+ /**
24
+ * Cambia el umbral de una alarma custom (customHighAmount o customMonthlyIncrease).
25
+ * Endpoint: `PUT /profiles/{directoryId}/custom-alarm`
26
+ *
27
+ * Idempotencia: si previousValue === newValue, devuelve 200 con noop=true.
28
+ */
29
+ setCustomAlarm(directoryId: string, request: SetCustomAlarmRequest): Promise<ResponseOptions<SetCustomAlarmResponse>>;
30
+ /**
31
+ * Cambia el declaredMonthlyIncome del perfil y recalcula las 5 alarmas base.
32
+ * Endpoint: `PUT /profiles/{directoryId}/declared-income`
33
+ *
34
+ * Idempotencia: si previousIncome === newValue, devuelve 200 con noop=true.
35
+ */
36
+ setDeclaredIncome(directoryId: string, request: SetDeclaredIncomeRequest): Promise<ResponseOptions<SetDeclaredIncomeResponse>>;
10
37
  }
@@ -1,8 +1,56 @@
1
1
  import { ResponseOptions } from "@fiado/gateway-adapter";
2
- import { AlarmOperationType, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
2
+ import { AlarmOperationType, AppendAlertNoteRequest, AppendAlertNoteResponse, CreateBlockedListAlertRequest, CreateBlockedListAlertResponse, DictaminateAlertRequest, DictaminateAlertResponse, MarkAlertReportedRequest, MarkAlertReportedResponse, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
3
+ /**
4
+ * Cliente para invocar los endpoints privados de alertas del Lambda `risk-profile-business`.
5
+ *
6
+ * Los endpoints viven bajo `RISK_PROFILE_LAMBDA_URL` (API Gateway privado, VPC-only).
7
+ * Todos requieren `email` en el body como audit trail del autor del cambio.
8
+ */
3
9
  export interface ITransactionAlertApi {
10
+ /**
11
+ * Lista alertas filtradas por status y reported.
12
+ * Endpoint: `GET /alarms?status={status}&reported={reported}`
13
+ */
4
14
  getAlerts(status: AlarmOperationType, reported: 1 | 0): Promise<ResponseOptions<{
5
15
  items: TransactionAlertResponse[];
6
16
  lastKey: any;
7
17
  }>>;
18
+ /**
19
+ * Dictamina una alerta en estado NEW o PENDING.
20
+ * Endpoint: `POST /alerts/{alertId}/dictamen`
21
+ *
22
+ * Side effects:
23
+ * - Update de TransactionAlert_GT con nuevos campos de dictamen y dictamenSnapshotHash.
24
+ * - Crea Observation con tag ALARM_DICTAMEN.
25
+ * - Sube snapshot inmutable a S3.
26
+ *
27
+ * Errores:
28
+ * - 404 NOT_FOUND si la alerta no existe.
29
+ * - 409 ALREADY_DICTATED si la alerta no está en NEW/PENDING.
30
+ */
31
+ dictaminateAlert(alertId: string, request: DictaminateAlertRequest): Promise<ResponseOptions<DictaminateAlertResponse>>;
32
+ /**
33
+ * Agrega o reemplaza nota a una alerta sin dictaminar.
34
+ * Endpoint: `POST /alerts/{alertId}/notes`
35
+ */
36
+ appendAlertNote(alertId: string, request: AppendAlertNoteRequest): Promise<ResponseOptions<AppendAlertNoteResponse>>;
37
+ /**
38
+ * Crea una alerta BLOCKED_LIST manualmente.
39
+ * Endpoint: `POST /alerts/blocked-list`
40
+ *
41
+ * Errores:
42
+ * - 409 ALERT_ALREADY_EXISTS si ya existe una alerta BLOCKED_LIST abierta para el directoryId.
43
+ */
44
+ createBlockedListAlert(request: CreateBlockedListAlertRequest): Promise<ResponseOptions<CreateBlockedListAlertResponse>>;
45
+ /**
46
+ * Marca una alerta como reportada a SITI (ROI enviado).
47
+ * Endpoint: `POST /alerts/{alertId}/reported`
48
+ *
49
+ * Precondiciones:
50
+ * - Alerta en estado CLOSE_RULED y reported=0.
51
+ *
52
+ * Errores:
53
+ * - 409 ALERT_NOT_ELIGIBLE si no cumple precondiciones.
54
+ */
55
+ markAlertReported(alertId: string, request: MarkAlertReportedRequest): Promise<ResponseOptions<MarkAlertReportedResponse>>;
8
56
  }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.17.0",
3
+ "version": "3.18.0",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
7
7
  "scripts": {
8
8
  "test": "test",
9
- "build": "tsc"
9
+ "build": "tsc",
10
+ "prepublishOnly": "npm run build"
10
11
  },
11
12
  "keywords": [],
12
13
  "author": "Fiado Inc",
@@ -16,7 +17,7 @@
16
17
  "@fiado/gateway-adapter": "^1.1.50",
17
18
  "@fiado/http-client": "^1.0.7",
18
19
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^3.26.0",
20
+ "@fiado/type-kit": "^3.27.0",
20
21
  "dotenv": "^16.4.7",
21
22
  "i": "^0.3.7",
22
23
  "inversify": "^6.2.2",
@@ -4,6 +4,15 @@ import {IHttpRequest} from "@fiado/http-client";
4
4
  import {CreatePrivateAlarm, CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
5
5
  import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
6
6
  import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
7
+ import { ResponseOptions } from "@fiado/gateway-adapter";
8
+ import {
9
+ SetCustomAlarmRequest,
10
+ SetCustomAlarmResponse,
11
+ SetDeclaredIncomeRequest,
12
+ SetDeclaredIncomeResponse,
13
+ SetManualRiskLevelRequest,
14
+ SetManualRiskLevelResponse,
15
+ } from "@fiado/type-kit/bin/riskProfile";
7
16
 
8
17
  @injectable()
9
18
  export default class RiskProfileApi implements IRiskProfileApi {
@@ -37,4 +46,19 @@ export default class RiskProfileApi implements IRiskProfileApi {
37
46
  return await this.httpRequest.post(url,params);
38
47
  }
39
48
 
49
+ async setManualRiskLevel(directoryId: string, request: SetManualRiskLevelRequest): Promise<ResponseOptions<SetManualRiskLevelResponse>> {
50
+ const url = `${this.baseUrl}/profiles/${directoryId}/manual-risk`;
51
+ return await this.httpRequest.put(url, request);
52
+ }
53
+
54
+ async setCustomAlarm(directoryId: string, request: SetCustomAlarmRequest): Promise<ResponseOptions<SetCustomAlarmResponse>> {
55
+ const url = `${this.baseUrl}/profiles/${directoryId}/custom-alarm`;
56
+ return await this.httpRequest.put(url, request);
57
+ }
58
+
59
+ async setDeclaredIncome(directoryId: string, request: SetDeclaredIncomeRequest): Promise<ResponseOptions<SetDeclaredIncomeResponse>> {
60
+ const url = `${this.baseUrl}/profiles/${directoryId}/declared-income`;
61
+ return await this.httpRequest.put(url, request);
62
+ }
63
+
40
64
  }
@@ -1,23 +1,49 @@
1
1
  import { inject, injectable } from "inversify";
2
2
  import { ITransactionAlertApi } from "./interfaces/ITransactionAlertApi";
3
3
  import { IHttpRequest } from "@fiado/http-client";
4
- import { AlarmOperationType, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
4
+ import {
5
+ AlarmOperationType,
6
+ AppendAlertNoteRequest,
7
+ AppendAlertNoteResponse,
8
+ CreateBlockedListAlertRequest,
9
+ CreateBlockedListAlertResponse,
10
+ DictaminateAlertRequest,
11
+ DictaminateAlertResponse,
12
+ MarkAlertReportedRequest,
13
+ MarkAlertReportedResponse,
14
+ TransactionAlertResponse,
15
+ } from "@fiado/type-kit/bin/riskProfile";
5
16
  import { ResponseOptions } from "@fiado/gateway-adapter";
6
17
 
7
-
8
-
9
-
10
18
  @injectable()
11
19
  export default class TransactionAlertApi implements ITransactionAlertApi {
12
20
  private readonly baseUrl = process.env.RISK_PROFILE_LAMBDA_URL || "";
13
21
 
14
-
15
22
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
16
23
  }
17
24
 
18
25
  async getAlerts(status: AlarmOperationType, reported: 1 | 0): Promise<ResponseOptions<{ items: TransactionAlertResponse[], lastKey: any }>> {
19
26
  const url = `${this.baseUrl}/alarms?status=${status}&reported=${reported}`;
20
-
21
27
  return await this.httpRequest.get(url);
22
28
  }
23
- }
29
+
30
+ async dictaminateAlert(alertId: string, request: DictaminateAlertRequest): Promise<ResponseOptions<DictaminateAlertResponse>> {
31
+ const url = `${this.baseUrl}/alerts/${alertId}/dictamen`;
32
+ return await this.httpRequest.post(url, request);
33
+ }
34
+
35
+ async appendAlertNote(alertId: string, request: AppendAlertNoteRequest): Promise<ResponseOptions<AppendAlertNoteResponse>> {
36
+ const url = `${this.baseUrl}/alerts/${alertId}/notes`;
37
+ return await this.httpRequest.post(url, request);
38
+ }
39
+
40
+ async createBlockedListAlert(request: CreateBlockedListAlertRequest): Promise<ResponseOptions<CreateBlockedListAlertResponse>> {
41
+ const url = `${this.baseUrl}/alerts/blocked-list`;
42
+ return await this.httpRequest.post(url, request);
43
+ }
44
+
45
+ async markAlertReported(alertId: string, request: MarkAlertReportedRequest): Promise<ResponseOptions<MarkAlertReportedResponse>> {
46
+ const url = `${this.baseUrl}/alerts/${alertId}/reported`;
47
+ return await this.httpRequest.post(url, request);
48
+ }
49
+ }
@@ -1,6 +1,15 @@
1
1
  import {CreatePrivateAlarm, CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
2
2
  import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
3
3
  import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
4
+ import { ResponseOptions } from "@fiado/gateway-adapter";
5
+ import {
6
+ SetCustomAlarmRequest,
7
+ SetCustomAlarmResponse,
8
+ SetDeclaredIncomeRequest,
9
+ SetDeclaredIncomeResponse,
10
+ SetManualRiskLevelRequest,
11
+ SetManualRiskLevelResponse,
12
+ } from "@fiado/type-kit/bin/riskProfile";
4
13
 
5
14
  export interface IRiskProfileApi {
6
15
  createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
@@ -12,4 +21,32 @@ export interface IRiskProfileApi {
12
21
  getRiskProfileByDirectoryId(directoryId: string): Promise<any>
13
22
 
14
23
  createAlarm(params: CreatePrivateAlarm): Promise<any>
24
+
25
+ /**
26
+ * Cambia el manualRiskLevel del perfil con recálculo de alarmas base y posible creación
27
+ * de alerta MANUAL_RISK_INCREASE si el nivel sube.
28
+ * Endpoint: `PUT /profiles/{directoryId}/manual-risk`
29
+ *
30
+ * Idempotencia: si previousLevel === newLevel, devuelve 200 con noop=true sin escribir.
31
+ *
32
+ * Errores:
33
+ * - 404 NOT_FOUND si el perfil no existe.
34
+ */
35
+ setManualRiskLevel(directoryId: string, request: SetManualRiskLevelRequest): Promise<ResponseOptions<SetManualRiskLevelResponse>>;
36
+
37
+ /**
38
+ * Cambia el umbral de una alarma custom (customHighAmount o customMonthlyIncrease).
39
+ * Endpoint: `PUT /profiles/{directoryId}/custom-alarm`
40
+ *
41
+ * Idempotencia: si previousValue === newValue, devuelve 200 con noop=true.
42
+ */
43
+ setCustomAlarm(directoryId: string, request: SetCustomAlarmRequest): Promise<ResponseOptions<SetCustomAlarmResponse>>;
44
+
45
+ /**
46
+ * Cambia el declaredMonthlyIncome del perfil y recalcula las 5 alarmas base.
47
+ * Endpoint: `PUT /profiles/{directoryId}/declared-income`
48
+ *
49
+ * Idempotencia: si previousIncome === newValue, devuelve 200 con noop=true.
50
+ */
51
+ setDeclaredIncome(directoryId: string, request: SetDeclaredIncomeRequest): Promise<ResponseOptions<SetDeclaredIncomeResponse>>;
15
52
  }
@@ -1,8 +1,70 @@
1
1
  import { ResponseOptions } from "@fiado/gateway-adapter";
2
- import { AlarmOperationType, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
2
+ import {
3
+ AlarmOperationType,
4
+ AppendAlertNoteRequest,
5
+ AppendAlertNoteResponse,
6
+ CreateBlockedListAlertRequest,
7
+ CreateBlockedListAlertResponse,
8
+ DictaminateAlertRequest,
9
+ DictaminateAlertResponse,
10
+ MarkAlertReportedRequest,
11
+ MarkAlertReportedResponse,
12
+ TransactionAlertResponse,
13
+ } from "@fiado/type-kit/bin/riskProfile";
3
14
 
15
+ /**
16
+ * Cliente para invocar los endpoints privados de alertas del Lambda `risk-profile-business`.
17
+ *
18
+ * Los endpoints viven bajo `RISK_PROFILE_LAMBDA_URL` (API Gateway privado, VPC-only).
19
+ * Todos requieren `email` en el body como audit trail del autor del cambio.
20
+ */
4
21
  export interface ITransactionAlertApi {
5
22
 
6
- getAlerts(status: AlarmOperationType, reported: 1 | 0): Promise<ResponseOptions<{ items: TransactionAlertResponse[], lastKey: any }>>
23
+ /**
24
+ * Lista alertas filtradas por status y reported.
25
+ * Endpoint: `GET /alarms?status={status}&reported={reported}`
26
+ */
27
+ getAlerts(status: AlarmOperationType, reported: 1 | 0): Promise<ResponseOptions<{ items: TransactionAlertResponse[], lastKey: any }>>;
7
28
 
8
- }
29
+ /**
30
+ * Dictamina una alerta en estado NEW o PENDING.
31
+ * Endpoint: `POST /alerts/{alertId}/dictamen`
32
+ *
33
+ * Side effects:
34
+ * - Update de TransactionAlert_GT con nuevos campos de dictamen y dictamenSnapshotHash.
35
+ * - Crea Observation con tag ALARM_DICTAMEN.
36
+ * - Sube snapshot inmutable a S3.
37
+ *
38
+ * Errores:
39
+ * - 404 NOT_FOUND si la alerta no existe.
40
+ * - 409 ALREADY_DICTATED si la alerta no está en NEW/PENDING.
41
+ */
42
+ dictaminateAlert(alertId: string, request: DictaminateAlertRequest): Promise<ResponseOptions<DictaminateAlertResponse>>;
43
+
44
+ /**
45
+ * Agrega o reemplaza nota a una alerta sin dictaminar.
46
+ * Endpoint: `POST /alerts/{alertId}/notes`
47
+ */
48
+ appendAlertNote(alertId: string, request: AppendAlertNoteRequest): Promise<ResponseOptions<AppendAlertNoteResponse>>;
49
+
50
+ /**
51
+ * Crea una alerta BLOCKED_LIST manualmente.
52
+ * Endpoint: `POST /alerts/blocked-list`
53
+ *
54
+ * Errores:
55
+ * - 409 ALERT_ALREADY_EXISTS si ya existe una alerta BLOCKED_LIST abierta para el directoryId.
56
+ */
57
+ createBlockedListAlert(request: CreateBlockedListAlertRequest): Promise<ResponseOptions<CreateBlockedListAlertResponse>>;
58
+
59
+ /**
60
+ * Marca una alerta como reportada a SITI (ROI enviado).
61
+ * Endpoint: `POST /alerts/{alertId}/reported`
62
+ *
63
+ * Precondiciones:
64
+ * - Alerta en estado CLOSE_RULED y reported=0.
65
+ *
66
+ * Errores:
67
+ * - 409 ALERT_NOT_ELIGIBLE si no cumple precondiciones.
68
+ */
69
+ markAlertReported(alertId: string, request: MarkAlertReportedRequest): Promise<ResponseOptions<MarkAlertReportedResponse>>;
70
+ }