From 245944b6a945ead3dd370bdbdec7a89d0095802c Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 2 Nov 2020 17:39:05 +0100 Subject: [PATCH] Sync: d.ts with backend and permissions from balance plugin --- src/flaschengeist.d.ts | 11 ++++++----- src/plugins/balance/routes/index.ts | 12 +++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/flaschengeist.d.ts b/src/flaschengeist.d.ts index d43d7b7..aaf068d 100644 --- a/src/flaschengeist.d.ts +++ b/src/flaschengeist.d.ts @@ -29,9 +29,8 @@ declare namespace FG { } interface Event { id: number; - begin: Date; - end: Date; - description: string; + start: Date; + description?: any; type: EventType; slots: Array; } @@ -47,10 +46,12 @@ declare namespace FG { value: number; } interface JobSlot { - id: number; type: JobType; users: Array; required_jobs: number; } - type JobType = string; + interface JobType { + id: number; + name: string; + } } diff --git a/src/plugins/balance/routes/index.ts b/src/plugins/balance/routes/index.ts index 2639c7c..1b4a1f0 100644 --- a/src/plugins/balance/routes/index.ts +++ b/src/plugins/balance/routes/index.ts @@ -4,10 +4,12 @@ const permissions = { // Show own and others balance SHOW: 'balance_show', SHOW_OTHER: 'balance_show_others', - // Credit balance - ADD: 'balance_add', - // Debit balance - SUB: 'balance_sub', + // Credit balance (give) + CREDIT: 'balance_credit', + // Debit balance (take) + DEBIT: 'balance_debit', + // Debit own balance only + DEBIT_OWN: 'balance_debit_own', // Send from to other SEND: 'balance_send', // Send from other to another @@ -33,7 +35,7 @@ const mainRoutes: FG_Plugin.PluginRouteConfig[] = [ path: 'balance-add', name: 'balance-add', shortcut: true, - meta: { permissions: [permissions.SUB, permissions.SHOW] }, + meta: { permissions: [permissions.DEBIT_OWN, permissions.SHOW] }, component: () => import('../pages/Add.vue') } ]