@chift/chift-nodejs 1.0.3 → 1.0.4

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.
@@ -567,6 +567,33 @@ test('createFinancialEntry', async () => {
567
567
  }
568
568
 
569
569
  const financialEntry = await consumer.accounting.createFinancialEntry({
570
+ date: '2022-01-01',
571
+ journal_id: journal.id,
572
+ currency: 'EUR',
573
+ items: [
574
+ {
575
+ account_type: 'customer_account',
576
+ account: clients[0].id,
577
+ amount: 10,
578
+ },
579
+ ],
580
+ });
581
+ expect(financialEntry).toBeTruthy();
582
+ expect(financialEntry).toHaveProperty('journal_id', journal.id);
583
+ });
584
+
585
+ /**
586
+ * @deprecated replaced by createFinancialEntry
587
+ */
588
+ test('createFinancialEntryOld', async () => {
589
+ const journal = journals.find((journal) => journal.journal_type === 'financial_operation');
590
+ if (!journal) {
591
+ throw new Error(
592
+ 'No journal with type "financial_operation" found to create financial entry'
593
+ );
594
+ }
595
+
596
+ const financialEntry = await consumer.accounting.createFinancialEntryOld({
570
597
  date: '2022-01-01',
571
598
  journal_id: journal.id,
572
599
  currency: 'EUR',