@vario-software/vario-app-framework-backend 2026.22.1 → 2026.23.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/migrator.js +18 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vario-software/vario-app-framework-backend",
3
- "version": "2026.22.1",
3
+ "version": "2026.23.0",
4
4
  "repository": "https://github.com/vario-software/vario-app-framework",
5
5
  "author": "VARIO Software AG",
6
6
  "homepage": "https://www.vario.ag",
package/utils/migrator.js CHANGED
@@ -346,10 +346,10 @@ const Migrator = class
346
346
  children: [
347
347
  {
348
348
  type: 'FILTER',
349
- property: 'label',
349
+ property: 'appId',
350
350
  operator: 'EQUALS',
351
351
  values: [
352
- label,
352
+ this.app.client.appIdentifier,
353
353
  ],
354
354
  },
355
355
  ],
@@ -365,17 +365,28 @@ const Migrator = class
365
365
  },
366
366
  );
367
367
 
368
- const { data: finance } = await this.ApiAdapter.fetch(`/community/${this.app.version}/erp/finance/backend/${financeBackend?.data?.[0].id}`, {
368
+ const id = financeBackend?.data?.[0]?.id;
369
+
370
+ if (!id)
371
+ {
372
+ await this.methods.log(`No Finance Backend found for label "${label}"\n`, 'ERROR');
373
+
374
+ return null;
375
+ }
376
+
377
+ const { data: existingFinanceBackend } = await this.ApiAdapter.fetch(`/erp/finance/backend/${id}`, {
378
+ method: 'GET',
379
+ });
380
+
381
+ const { data: finance } = await this.ApiAdapter.fetch(`/erp/finance/backend/${id}`, {
369
382
  method: 'PUT',
370
383
  body: JSON.stringify({
371
- label,
384
+ ...existingFinanceBackend,
372
385
  description,
373
- usePerformanceDate: false,
374
- appId: this.app.client.appIdentifier,
375
386
  }),
376
387
  });
377
388
 
378
- await this.methods.log(`Finance Backend with id "${finance.id}" successfully created\n`);
389
+ await this.methods.log(`Finance Backend with id "${finance.id}" successfully updated\n`);
379
390
 
380
391
  return finance;
381
392
  },