From 7bcfdc64624471252e0da87e9ac6edbc1f3fbd89 Mon Sep 17 00:00:00 2001 From: Samuel Date: Sun, 22 Sep 2024 12:52:08 +0200 Subject: [PATCH] feat: creating invoices --- .../dashboard/src/components/ActionButton.vue | 2 +- apps/dashboard/src/components/FindUser.vue | 13 +- .../src/components/InputUserSpan.vue | 10 +- .../components/mutations/MutationsBalance.vue | 2 +- .../src/locales/en/modules/financial.json | 3 +- .../src/locales/nl/modules/financial.json | 3 +- apps/dashboard/src/main.ts | 2 + .../invoice/InvoiceAddressingCard.vue | 2 +- .../invoice/create/InvoiceCreate.vue | 86 ++++++++++ .../create/InvoiceCreateAddressingCard.vue | 35 +++++ .../create/InvoiceCreateSettingsCard.vue | 36 +++++ .../invoice/create/InvoiceCreateUserCard.vue | 111 +++++++++++++ .../create/InvoiceTransactionsCard.vue | 30 ++++ ...Form.vue => InvoiceBaseAddressingForm.vue} | 41 +---- .../invoice/forms/InvoiceBaseSettingsForm.vue | 51 ++++++ .../invoice/forms/InvoiceSettingsForm.vue | 25 +-- .../invoice/forms/InvoiceTransactionsForm.vue | 148 ++++++++++++++++++ .../forms/InvoiceUpdateAddressingForm.vue | 61 ++++++++ .../payout/forms/PayoutCreateForm.vue | 3 +- .../dashboard/src/modules/financial/routes.ts | 91 ++++++----- .../views/invoice/InvoiceCreateView.vue | 36 +++++ .../views/invoice/InvoiceOverview.vue | 17 +- apps/dashboard/src/utils/formUtils.ts | 7 + apps/dashboard/src/utils/validation-schema.ts | 23 ++- package.json | 2 +- yarn.lock | 6 +- 26 files changed, 732 insertions(+), 114 deletions(-) create mode 100644 apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreate.vue create mode 100644 apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateAddressingCard.vue create mode 100644 apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateSettingsCard.vue create mode 100644 apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateUserCard.vue create mode 100644 apps/dashboard/src/modules/financial/components/invoice/create/InvoiceTransactionsCard.vue rename apps/dashboard/src/modules/financial/components/invoice/forms/{InvoiceAddressingForm.vue => InvoiceBaseAddressingForm.vue} (75%) create mode 100644 apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceBaseSettingsForm.vue create mode 100644 apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceTransactionsForm.vue create mode 100644 apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceUpdateAddressingForm.vue create mode 100644 apps/dashboard/src/modules/financial/views/invoice/InvoiceCreateView.vue diff --git a/apps/dashboard/src/components/ActionButton.vue b/apps/dashboard/src/components/ActionButton.vue index 48a1b58c..fa8f8834 100644 --- a/apps/dashboard/src/components/ActionButton.vue +++ b/apps/dashboard/src/components/ActionButton.vue @@ -9,7 +9,7 @@ + + \ No newline at end of file diff --git a/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateAddressingCard.vue b/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateAddressingCard.vue new file mode 100644 index 00000000..79c058d6 --- /dev/null +++ b/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateAddressingCard.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateSettingsCard.vue b/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateSettingsCard.vue new file mode 100644 index 00000000..d8a19fbc --- /dev/null +++ b/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateSettingsCard.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateUserCard.vue b/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateUserCard.vue new file mode 100644 index 00000000..58e00d1e --- /dev/null +++ b/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceCreateUserCard.vue @@ -0,0 +1,111 @@ + + + + + \ No newline at end of file diff --git a/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceTransactionsCard.vue b/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceTransactionsCard.vue new file mode 100644 index 00000000..79872f30 --- /dev/null +++ b/apps/dashboard/src/modules/financial/components/invoice/create/InvoiceTransactionsCard.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceAddressingForm.vue b/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceBaseAddressingForm.vue similarity index 75% rename from apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceAddressingForm.vue rename to apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceBaseAddressingForm.vue index eaf9b2ea..670cae98 100644 --- a/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceAddressingForm.vue +++ b/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceBaseAddressingForm.vue @@ -46,28 +46,15 @@ + \ No newline at end of file diff --git a/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceBaseSettingsForm.vue b/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceBaseSettingsForm.vue new file mode 100644 index 00000000..ef44d942 --- /dev/null +++ b/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceBaseSettingsForm.vue @@ -0,0 +1,51 @@ + + + + + \ No newline at end of file diff --git a/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceSettingsForm.vue b/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceSettingsForm.vue index 15c74eda..ee6a72d8 100644 --- a/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceSettingsForm.vue +++ b/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceSettingsForm.vue @@ -1,30 +1,8 @@ + + diff --git a/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceUpdateAddressingForm.vue b/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceUpdateAddressingForm.vue new file mode 100644 index 00000000..b5c01a0e --- /dev/null +++ b/apps/dashboard/src/modules/financial/components/invoice/forms/InvoiceUpdateAddressingForm.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/apps/dashboard/src/modules/financial/components/payout/forms/PayoutCreateForm.vue b/apps/dashboard/src/modules/financial/components/payout/forms/PayoutCreateForm.vue index 09cc98bf..86b1caf8 100644 --- a/apps/dashboard/src/modules/financial/components/payout/forms/PayoutCreateForm.vue +++ b/apps/dashboard/src/modules/financial/components/payout/forms/PayoutCreateForm.vue @@ -4,8 +4,9 @@ :value="form.model.user.value.value" @update:value="form.context.setFieldValue('user', $event)" :errors="form.context.errors.value.user" - id="name" placeholder="John Doe" type="text"/> + id="name" placeholder="John Doe"/> +
diff --git a/apps/dashboard/src/modules/financial/routes.ts b/apps/dashboard/src/modules/financial/routes.ts index a4b4e57e..85644125 100644 --- a/apps/dashboard/src/modules/financial/routes.ts +++ b/apps/dashboard/src/modules/financial/routes.ts @@ -5,6 +5,7 @@ import PayoutsView from "@/modules/financial/views/payouts/PayoutsView.vue"; import { UserRole } from "@/utils/rbacUtils"; import InvoiceOverview from "@/modules/financial/views/invoice/InvoiceOverview.vue"; import InvoiceInfoView from "@/modules/financial/views/invoice/InvoiceInfoView.vue"; +import InvoiceCreateView from "@/modules/financial/views/invoice/InvoiceCreateView.vue"; export function financialRoutes(): RouteRecordRaw[] { return [ @@ -14,42 +15,62 @@ export function financialRoutes(): RouteRecordRaw[] { meta: { requiresAuth: true }, children: [ { - path: '/fine', - component: FineView, - name: 'fine', - meta: { - requiresAuth: true, - rolesAllowed: [UserRole.BAC_PM] - } - }, - { - path: '/invoice', - component: InvoiceOverview, - name: 'invoice', - meta: { - requiresAuth: true, - rolesAllowed: [UserRole.BAC_PM] - } - }, - { - path: '/invoice/:id/info', - name: 'invoiceInfo', - component: InvoiceInfoView, - props: true, - meta: { - requiresAuth: true, - rolesAllowed: [UserRole.BAC_PM] - } - }, - { - path: '/payouts', - component: PayoutsView, - name: 'payouts', - meta: { - requiresAuth: true, - rolesAllowed: [UserRole.BAC_PM] + path: '/fine', + component: FineView, + name: 'fine', + meta: { + requiresAuth: true, + rolesAllowed: [UserRole.BAC_PM] + } + }, + { + path: '/invoice', + component: InvoiceOverview, + name: 'invoice', + meta: { + requiresAuth: true, + rolesAllowed: [UserRole.BAC_PM] + } + }, + { + path: '/invoice/create', + component: InvoiceCreateView, + name: 'invoiceCreate', + meta: { + requiresAuth: true, + rolesAllowed: [UserRole.BAC_PM] + } + }, + { + path: '/invoice/:id', + redirect: to => { + const { id } = to.params; + return `/invoice/${id}/info`; + }, + meta: { + requiresAuth: true, + rolesAllowed: [UserRole.BAC_PM] + } + }, + { + path: '/invoice/:id/info', + name: 'invoiceInfo', + component: InvoiceInfoView, + props: true, + meta: { + requiresAuth: true, + rolesAllowed: [UserRole.BAC_PM] + } + }, + { + path: '/payouts', + component: PayoutsView, + name: 'payouts', + meta: { + requiresAuth: true, + rolesAllowed: [UserRole.BAC_PM] + } } - } ] } ]; diff --git a/apps/dashboard/src/modules/financial/views/invoice/InvoiceCreateView.vue b/apps/dashboard/src/modules/financial/views/invoice/InvoiceCreateView.vue new file mode 100644 index 00000000..56422e1d --- /dev/null +++ b/apps/dashboard/src/modules/financial/views/invoice/InvoiceCreateView.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/apps/dashboard/src/modules/financial/views/invoice/InvoiceOverview.vue b/apps/dashboard/src/modules/financial/views/invoice/InvoiceOverview.vue index b2a02984..1c49da52 100644 --- a/apps/dashboard/src/modules/financial/views/invoice/InvoiceOverview.vue +++ b/apps/dashboard/src/modules/financial/views/invoice/InvoiceOverview.vue @@ -1,7 +1,17 @@