fix(Journals): sync posting datetime with jorunal entries.

This commit is contained in:
a.bouhuolia
2021-03-29 10:50:44 +02:00
parent 40b2ba099e
commit 9a204282a2
38 changed files with 477 additions and 302 deletions

View File

@@ -164,10 +164,12 @@ export default class JournalPoster implements IJournalPoster {
);
const balanceEntries = chain(balanceChanges)
.map((change) => change.entries.map(entry => ({
...entry,
contactId: change.contactId
})))
.map((change) =>
change.entries.map((entry) => ({
...entry,
contactId: change.contactId,
}))
)
.flatten()
.value();
@@ -376,6 +378,8 @@ export default class JournalPoster implements IJournalPoster {
const { transactionsRepository } = this.repositories;
const saveOperations: Promise<void>[] = [];
this.logger.info('[journal] trying to insert accounts transactions.');
this.entries.forEach((entry) => {
const oper = transactionsRepository.create({
accountId: entry.account,