@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.
- package/CHANGELOG.md +5 -0
- package/dist/src/modules/accounting.d.ts +5 -1
- package/dist/src/modules/accounting.js +12 -1
- package/dist/src/modules/api.d.ts +781 -226
- package/dist/src/modules/consumer.d.ts +52 -15
- package/dist/src/modules/consumers.d.ts +260 -75
- package/dist/src/modules/datastores.d.ts +1 -1
- package/dist/src/modules/sync.d.ts +208 -60
- package/dist/src/modules/syncs.d.ts +520 -150
- package/dist/test/modules/accounting.test.js +23 -0
- package/package.json +1 -1
- package/src/modules/accounting.ts +17 -3
- package/src/types/public-api/schema.d.ts +343 -33
- package/test/modules/accounting.test.ts +27 -0
|
@@ -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',
|