From 3e1437300fd9bb7d081206c48a2b036e0bd7e6ad Mon Sep 17 00:00:00 2001 From: Simon Giesel Date: Fri, 30 Jun 2023 16:18:07 +0200 Subject: [PATCH] feat(core): add employer portal with mock data --- server/pb_schema.json | 224 +++++++++++------- webapp/package.json | 1 + webapp/pnpm-lock.yaml | 11 + .../components/atoms/AtomCurrencyInput.vue | 1 + .../molecules/MoleculeDataTable.vue | 29 ++- .../molecules/MoleculeInputModal.vue | 12 +- webapp/src/components/views/ViewEmployer.vue | 19 +- .../src/components/views/ViewStatePortal.vue | 167 ++++++------- webapp/src/services/account.service.ts | 4 +- webapp/src/services/currency.service.ts | 4 +- webapp/src/services/settings.service.ts | 1 + webapp/src/types/pocketbase.types.ts | 9 + webapp/tailwind.config.js | 2 +- 13 files changed, 300 insertions(+), 184 deletions(-) diff --git a/server/pb_schema.json b/server/pb_schema.json index 4e32efe..6319b04 100644 --- a/server/pb_schema.json +++ b/server/pb_schema.json @@ -162,88 +162,6 @@ "deleteRule": null, "options": {} }, - { - "id": "74ftooxenpeq14b", - "name": "accounts", - "type": "base", - "system": false, - "schema": [ - { - "id": "as1gvc1r", - "name": "accountNumber", - "type": "text", - "system": false, - "required": true, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "id": "vxeq20lk", - "name": "firstName", - "type": "text", - "system": false, - "required": true, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "id": "bsinpdk7", - "name": "lastName", - "type": "text", - "system": false, - "required": true, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "id": "syfivtki", - "name": "lastCheckIn", - "type": "date", - "system": false, - "required": false, - "options": { - "min": "", - "max": "" - } - }, - { - "id": "pkoynx7h", - "name": "personalData", - "type": "relation", - "system": false, - "required": false, - "options": { - "collectionId": "p0gixtx6jwria0d", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": [ - "firstNameParent", - "lastNameParent", - "email" - ] - } - } - ], - "indexes": [ - "CREATE UNIQUE INDEX `idx_mPdvrAQ` ON `accounts` (`accountNumber`)" - ], - "listRule": "", - "viewRule": null, - "createRule": null, - "updateRule": "@request.data.id = null && @request.data.accountNumber = null && @request.data.firstName = null && @request.data.lastName = null && @request.data.created = null && @request.data.updated = null", - "deleteRule": null, - "options": {} - }, { "id": "c3zz98wpbn7m6zw", "name": "accountsList", @@ -358,5 +276,147 @@ "updateRule": null, "deleteRule": null, "options": {} + }, + { + "id": "s854d2w72fvyl54", + "name": "companies", + "type": "auth", + "system": false, + "schema": [], + "indexes": [], + "listRule": null, + "viewRule": null, + "createRule": null, + "updateRule": null, + "deleteRule": null, + "options": { + "allowEmailAuth": true, + "allowOAuth2Auth": true, + "allowUsernameAuth": true, + "exceptEmailDomains": null, + "manageRule": null, + "minPasswordLength": 8, + "onlyEmailDomains": null, + "requireEmail": false + } + }, + { + "id": "74ftooxenpeq14b", + "name": "accounts", + "type": "base", + "system": false, + "schema": [ + { + "id": "as1gvc1r", + "name": "accountNumber", + "type": "text", + "system": false, + "required": true, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "id": "vxeq20lk", + "name": "firstName", + "type": "text", + "system": false, + "required": true, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "id": "bsinpdk7", + "name": "lastName", + "type": "text", + "system": false, + "required": true, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "id": "syfivtki", + "name": "lastCheckIn", + "type": "date", + "system": false, + "required": false, + "options": { + "min": "", + "max": "" + } + }, + { + "id": "pkoynx7h", + "name": "personalData", + "type": "relation", + "system": false, + "required": false, + "options": { + "collectionId": "p0gixtx6jwria0d", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": [ + "firstNameParent", + "lastNameParent", + "email" + ] + } + }, + { + "id": "gwrzizpu", + "name": "company", + "type": "relation", + "system": false, + "required": true, + "options": { + "collectionId": "s854d2w72fvyl54", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": [] + } + }, + { + "id": "rtvjzpxw", + "name": "shift", + "type": "text", + "system": false, + "required": true, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "id": "ma5ckyk1", + "name": "wageFactor", + "type": "number", + "system": false, + "required": true, + "options": { + "min": 0, + "max": null + } + } + ], + "indexes": [ + "CREATE UNIQUE INDEX `idx_mPdvrAQ` ON `accounts` (`accountNumber`)" + ], + "listRule": "", + "viewRule": null, + "createRule": null, + "updateRule": "(@request.data.id = null && @request.data.accountNumber = null && @request.data.firstName = null && @request.data.lastName = null && @request.data.created = null && @request.data.updated = null && @request.data.company = null && @request.data.shift = null && @request.data.wageFactor = null) || (@request.data.id = null && @request.data.accountNumber = null && @request.data.firstName = null && @request.data.lastName = null && @request.data.created = null && @request.data.updated = null && @request.data.company = null && @request.data.shift = null && @request.auth.id = company.id)", + "deleteRule": null, + "options": {} } ] \ No newline at end of file diff --git a/webapp/package.json b/webapp/package.json index ebd2cde..78d6408 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -21,6 +21,7 @@ "vue-router": "4.2.2" }, "devDependencies": { + "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/typography": "^0.5.9", "@types/canvas-confetti": "^1.6.0", "@typescript-eslint/eslint-plugin": "^5.60.1", diff --git a/webapp/pnpm-lock.yaml b/webapp/pnpm-lock.yaml index 13a0fb2..89c6981 100644 --- a/webapp/pnpm-lock.yaml +++ b/webapp/pnpm-lock.yaml @@ -28,6 +28,9 @@ dependencies: version: 4.2.2(vue@3.3.4) devDependencies: + '@tailwindcss/container-queries': + specifier: ^0.1.1 + version: 0.1.1(tailwindcss@3.3.2) '@tailwindcss/typography': specifier: ^0.5.9 version: 0.5.9(tailwindcss@3.3.2) @@ -460,6 +463,14 @@ packages: dev: true optional: true + /@tailwindcss/container-queries@0.1.1(tailwindcss@3.3.2): + resolution: {integrity: sha512-p18dswChx6WnTSaJCSGx6lTmrGzNNvm2FtXmiO6AuA1V4U5REyoqwmT6kgAsIMdjo07QdAfYXHJ4hnMtfHzWgA==} + peerDependencies: + tailwindcss: '>=3.2.0' + dependencies: + tailwindcss: 3.3.2 + dev: true + /@tailwindcss/typography@0.5.9(tailwindcss@3.3.2): resolution: {integrity: sha512-t8Sg3DyynFysV9f4JDOVISGsjazNb48AeIYQwcL+Bsq5uf4RYL75C1giZ43KISjeDGBaTN3Kxh7Xj/vRSMJUUg==} peerDependencies: diff --git a/webapp/src/components/atoms/AtomCurrencyInput.vue b/webapp/src/components/atoms/AtomCurrencyInput.vue index 074ee37..ef6f57d 100644 --- a/webapp/src/components/atoms/AtomCurrencyInput.vue +++ b/webapp/src/components/atoms/AtomCurrencyInput.vue @@ -1,6 +1,7 @@ @@ -81,6 +103,7 @@ export enum TableHeaderType { DATETIME, BUTTON_CONTACT, BUTTON_ACCOUNT, + WAGE, } diff --git a/webapp/src/components/molecules/MoleculeInputModal.vue b/webapp/src/components/molecules/MoleculeInputModal.vue index a6514d8..d2844bf 100644 --- a/webapp/src/components/molecules/MoleculeInputModal.vue +++ b/webapp/src/components/molecules/MoleculeInputModal.vue @@ -7,7 +7,7 @@
{{ inputLabel }} 100) { + if(amount.value <= 0) { return; } - emit('submit', input.value.$refs.input.$refs.input.value); + emit('submit', amount.value); abortButton.value.click(); } diff --git a/webapp/src/components/views/ViewEmployer.vue b/webapp/src/components/views/ViewEmployer.vue index fde06f4..05e9921 100644 --- a/webapp/src/components/views/ViewEmployer.vue +++ b/webapp/src/components/views/ViewEmployer.vue @@ -30,19 +30,24 @@ const initAccounts = ref[]>([]); const searchQuery = ref(''); const tableHeaders = [ { - title: 'Name', - key: 'name', + title: 'Vorname', + key: 'firstName', + type: TableHeaderType.STRING, + }, + { + title: 'Nachname', + key: 'lastName', type: TableHeaderType.STRING, }, { title: 'Schicht', - key: 'lastCheckIn', - type: TableHeaderType.DATETIME, + key: 'shift', + type: TableHeaderType.STRING, }, { title: 'Lohn', - key: 'balance', - type: TableHeaderType.CURRENCY, + key: 'wageFactor', + type: TableHeaderType.WAGE, }, ]; @@ -54,7 +59,7 @@ useEventBus('isAuthenticated').on(state => { }); async function getData() { - initAccounts.value = await AccountService.getAccounts(); + initAccounts.value = await AccountService.getAccountsByCompanyId('c09ncb3l2pi6i0u'); accounts.value = initAccounts.value; } diff --git a/webapp/src/components/views/ViewStatePortal.vue b/webapp/src/components/views/ViewStatePortal.vue index 1d5d2a7..5e25c0a 100644 --- a/webapp/src/components/views/ViewStatePortal.vue +++ b/webapp/src/components/views/ViewStatePortal.vue @@ -1,89 +1,91 @@