From 26e1f79395a557987cbf8cf7c4fce097f382bc13 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Tue, 11 Jul 2023 18:59:36 +0200
Subject: [PATCH] BMA.tx Re-introduce empty 'receiving' field

Breaking change for Silkaj/DuniterPy already in Debian
which has this field as mandatory in jsonschema
---
 app/modules/bma/lib/controllers/transactions.ts | 2 ++
 app/modules/bma/lib/dtos.ts                     | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/app/modules/bma/lib/controllers/transactions.ts b/app/modules/bma/lib/controllers/transactions.ts
index de6dd2236..046aab7b6 100644
--- a/app/modules/bma/lib/controllers/transactions.ts
+++ b/app/modules/bma/lib/controllers/transactions.ts
@@ -154,6 +154,7 @@ export class TransactionBinding extends AbstractController {
     dbTxHistory: {
       sent?: DBTx[];
       received?: DBTx[];
+      receiving?: DBTx[];
       sending?: DBTx[];
       pending?: DBTx[];
     }
@@ -164,6 +165,7 @@ export class TransactionBinding extends AbstractController {
       history: {
         sending: dbTxHistory.sending?.map(dbtx2HttpTxOfHistory) || [],
         received: dbTxHistory.received?.map(dbtx2HttpTxOfHistory) || [],
+        receiving: dbTxHistory.receiving?.map(dbtx2HttpTxOfHistory) || [],
         sent: dbTxHistory.sent?.map(dbtx2HttpTxOfHistory) || [],
         pending: dbTxHistory.pending?.map(dbtx2HttpTxOfHistory) || [],
       },
diff --git a/app/modules/bma/lib/dtos.ts b/app/modules/bma/lib/dtos.ts
index d8ed12186..4b4817336 100644
--- a/app/modules/bma/lib/dtos.ts
+++ b/app/modules/bma/lib/dtos.ts
@@ -876,6 +876,7 @@ export const TxHistory = {
     sent: [TxOfHistory],
     received: [TxOfHistory],
     sending: [TxOfHistory],
+    receiving: [TxOfHistory],
     pending: [TxOfHistory],
   },
 };
@@ -887,6 +888,7 @@ export interface HttpTxHistory {
     sent: HttpTxOfHistory[];
     received: HttpTxOfHistory[];
     sending: HttpTxOfHistory[];
+    receiving: HttpTxOfHistory[];
     pending: HttpTxOfHistory[];
   };
 }
-- 
GitLab