Link dataconnect package and add invoice hub
Wire up the dataconnect-generated package for the web app and add a new `hub` field to invoice mutations and queries. Updates include: add package links in apps/web package and workspace config, adjust connector.yaml JavaScript SDK output/package paths, add `hub` to invoice create/update mutations and to invoice queries, remove many example dataconnect GraphQL files and the web README, and minor formatting/newline fixes (Makefile and several .gql files).
This commit is contained in:
1
Makefile
1
Makefile
@@ -29,6 +29,7 @@ help:
|
|||||||
@echo " make web-lint - Runs linter for web frontend."
|
@echo " make web-lint - Runs linter for web frontend."
|
||||||
@echo " make web-preview - Previews the web frontend build."
|
@echo " make web-preview - Previews the web frontend build."
|
||||||
@echo " make launchpad-dev - Starts the local launchpad server (Firebase Hosting emulator)."
|
@echo " make launchpad-dev - Starts the local launchpad server (Firebase Hosting emulator)."
|
||||||
|
@echo ""
|
||||||
@echo " 📦 WEB FRONTEND (internal/api-harness)"
|
@echo " 📦 WEB FRONTEND (internal/api-harness)"
|
||||||
@echo " ────────────────────────────────────────────────────────────────────"
|
@echo " ────────────────────────────────────────────────────────────────────"
|
||||||
@echo " make install Install web frontend dependencies"
|
@echo " make install Install web frontend dependencies"
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
# React + TypeScript + Vite
|
|
||||||
|
|
||||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
||||||
|
|
||||||
Currently, two official plugins are available:
|
|
||||||
|
|
||||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
||||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
||||||
|
|
||||||
## React Compiler
|
|
||||||
|
|
||||||
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
||||||
|
|
||||||
## Expanding the ESLint configuration
|
|
||||||
|
|
||||||
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
||||||
|
|
||||||
```js
|
|
||||||
export default defineConfig([
|
|
||||||
globalIgnores(['dist']),
|
|
||||||
{
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
extends: [
|
|
||||||
// Other configs...
|
|
||||||
|
|
||||||
// Remove tseslint.configs.recommended and replace with this
|
|
||||||
tseslint.configs.recommendedTypeChecked,
|
|
||||||
// Alternatively, use this for stricter rules
|
|
||||||
tseslint.configs.strictTypeChecked,
|
|
||||||
// Optionally, add this for stylistic rules
|
|
||||||
tseslint.configs.stylisticTypeChecked,
|
|
||||||
|
|
||||||
// Other configs...
|
|
||||||
],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
// other options...
|
|
||||||
},
|
|
||||||
},
|
|
||||||
])
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// eslint.config.js
|
|
||||||
import reactX from 'eslint-plugin-react-x'
|
|
||||||
import reactDom from 'eslint-plugin-react-dom'
|
|
||||||
|
|
||||||
export default defineConfig([
|
|
||||||
globalIgnores(['dist']),
|
|
||||||
{
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
extends: [
|
|
||||||
// Other configs...
|
|
||||||
// Enable lint rules for React
|
|
||||||
reactX.configs['recommended-typescript'],
|
|
||||||
// Enable lint rules for React DOM
|
|
||||||
reactDom.configs.recommended,
|
|
||||||
],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
// other options...
|
|
||||||
},
|
|
||||||
},
|
|
||||||
])
|
|
||||||
```
|
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@dataconnect/generated": "link:src/dataconnect-generated",
|
||||||
"@firebase/analytics": "^0.10.19",
|
"@firebase/analytics": "^0.10.19",
|
||||||
"@firebase/data-connect": "^0.3.12",
|
"@firebase/data-connect": "^0.3.12",
|
||||||
"@radix-ui/react-label": "^2.1.7",
|
"@radix-ui/react-label": "^2.1.7",
|
||||||
|
|||||||
26
apps/web/pnpm-lock.yaml
generated
26
apps/web/pnpm-lock.yaml
generated
@@ -5,12 +5,17 @@ settings:
|
|||||||
excludeLinksFromLockfile: false
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
|
'@firebasegen/example-connector': link:src/dataconnect-generated
|
||||||
dataconnect-generated: link:../../../../../AppData/Local/pnpm/global/5/node_modules/src/dataconnect-generated
|
dataconnect-generated: link:../../../../../AppData/Local/pnpm/global/5/node_modules/src/dataconnect-generated
|
||||||
|
'@dataconnect/generated': link:src/dataconnect-generated
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
|
|
||||||
.:
|
.:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@dataconnect/generated':
|
||||||
|
specifier: link:src/dataconnect-generated
|
||||||
|
version: link:src/dataconnect-generated
|
||||||
'@firebase/analytics':
|
'@firebase/analytics':
|
||||||
specifier: ^0.10.19
|
specifier: ^0.10.19
|
||||||
version: 0.10.19(@firebase/app@0.14.7)
|
version: 0.10.19(@firebase/app@0.14.7)
|
||||||
@@ -1499,79 +1504,66 @@ packages:
|
|||||||
resolution: {integrity: sha512-eyrr5W08Ms9uM0mLcKfM/Uzx7hjhz2bcjv8P2uynfj0yU8GGPdz8iYrBPhiLOZqahoAMB8ZiolRZPbbU2MAi6Q==}
|
resolution: {integrity: sha512-eyrr5W08Ms9uM0mLcKfM/Uzx7hjhz2bcjv8P2uynfj0yU8GGPdz8iYrBPhiLOZqahoAMB8ZiolRZPbbU2MAi6Q==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm-musleabihf@4.57.0':
|
'@rollup/rollup-linux-arm-musleabihf@4.57.0':
|
||||||
resolution: {integrity: sha512-Xds90ITXJCNyX9pDhqf85MKWUI4lqjiPAipJ8OLp8xqI2Ehk+TCVhF9rvOoN8xTbcafow3QOThkNnrM33uCFQA==}
|
resolution: {integrity: sha512-Xds90ITXJCNyX9pDhqf85MKWUI4lqjiPAipJ8OLp8xqI2Ehk+TCVhF9rvOoN8xTbcafow3QOThkNnrM33uCFQA==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-gnu@4.57.0':
|
'@rollup/rollup-linux-arm64-gnu@4.57.0':
|
||||||
resolution: {integrity: sha512-Xws2KA4CLvZmXjy46SQaXSejuKPhwVdaNinldoYfqruZBaJHqVo6hnRa8SDo9z7PBW5x84SH64+izmldCgbezw==}
|
resolution: {integrity: sha512-Xws2KA4CLvZmXjy46SQaXSejuKPhwVdaNinldoYfqruZBaJHqVo6hnRa8SDo9z7PBW5x84SH64+izmldCgbezw==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-musl@4.57.0':
|
'@rollup/rollup-linux-arm64-musl@4.57.0':
|
||||||
resolution: {integrity: sha512-hrKXKbX5FdaRJj7lTMusmvKbhMJSGWJ+w++4KmjiDhpTgNlhYobMvKfDoIWecy4O60K6yA4SnztGuNTQF+Lplw==}
|
resolution: {integrity: sha512-hrKXKbX5FdaRJj7lTMusmvKbhMJSGWJ+w++4KmjiDhpTgNlhYobMvKfDoIWecy4O60K6yA4SnztGuNTQF+Lplw==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-loong64-gnu@4.57.0':
|
'@rollup/rollup-linux-loong64-gnu@4.57.0':
|
||||||
resolution: {integrity: sha512-6A+nccfSDGKsPm00d3xKcrsBcbqzCTAukjwWK6rbuAnB2bHaL3r9720HBVZ/no7+FhZLz/U3GwwZZEh6tOSI8Q==}
|
resolution: {integrity: sha512-6A+nccfSDGKsPm00d3xKcrsBcbqzCTAukjwWK6rbuAnB2bHaL3r9720HBVZ/no7+FhZLz/U3GwwZZEh6tOSI8Q==}
|
||||||
cpu: [loong64]
|
cpu: [loong64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-loong64-musl@4.57.0':
|
'@rollup/rollup-linux-loong64-musl@4.57.0':
|
||||||
resolution: {integrity: sha512-4P1VyYUe6XAJtQH1Hh99THxr0GKMMwIXsRNOceLrJnaHTDgk1FTcTimDgneRJPvB3LqDQxUmroBclQ1S0cIJwQ==}
|
resolution: {integrity: sha512-4P1VyYUe6XAJtQH1Hh99THxr0GKMMwIXsRNOceLrJnaHTDgk1FTcTimDgneRJPvB3LqDQxUmroBclQ1S0cIJwQ==}
|
||||||
cpu: [loong64]
|
cpu: [loong64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-ppc64-gnu@4.57.0':
|
'@rollup/rollup-linux-ppc64-gnu@4.57.0':
|
||||||
resolution: {integrity: sha512-8Vv6pLuIZCMcgXre6c3nOPhE0gjz1+nZP6T+hwWjr7sVH8k0jRkH+XnfjjOTglyMBdSKBPPz54/y1gToSKwrSQ==}
|
resolution: {integrity: sha512-8Vv6pLuIZCMcgXre6c3nOPhE0gjz1+nZP6T+hwWjr7sVH8k0jRkH+XnfjjOTglyMBdSKBPPz54/y1gToSKwrSQ==}
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-ppc64-musl@4.57.0':
|
'@rollup/rollup-linux-ppc64-musl@4.57.0':
|
||||||
resolution: {integrity: sha512-r1te1M0Sm2TBVD/RxBPC6RZVwNqUTwJTA7w+C/IW5v9Ssu6xmxWEi+iJQlpBhtUiT1raJ5b48pI8tBvEjEFnFA==}
|
resolution: {integrity: sha512-r1te1M0Sm2TBVD/RxBPC6RZVwNqUTwJTA7w+C/IW5v9Ssu6xmxWEi+iJQlpBhtUiT1raJ5b48pI8tBvEjEFnFA==}
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-gnu@4.57.0':
|
'@rollup/rollup-linux-riscv64-gnu@4.57.0':
|
||||||
resolution: {integrity: sha512-say0uMU/RaPm3CDQLxUUTF2oNWL8ysvHkAjcCzV2znxBr23kFfaxocS9qJm+NdkRhF8wtdEEAJuYcLPhSPbjuQ==}
|
resolution: {integrity: sha512-say0uMU/RaPm3CDQLxUUTF2oNWL8ysvHkAjcCzV2znxBr23kFfaxocS9qJm+NdkRhF8wtdEEAJuYcLPhSPbjuQ==}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-musl@4.57.0':
|
'@rollup/rollup-linux-riscv64-musl@4.57.0':
|
||||||
resolution: {integrity: sha512-/MU7/HizQGsnBREtRpcSbSV1zfkoxSTR7wLsRmBPQ8FwUj5sykrP1MyJTvsxP5KBq9SyE6kH8UQQQwa0ASeoQQ==}
|
resolution: {integrity: sha512-/MU7/HizQGsnBREtRpcSbSV1zfkoxSTR7wLsRmBPQ8FwUj5sykrP1MyJTvsxP5KBq9SyE6kH8UQQQwa0ASeoQQ==}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-s390x-gnu@4.57.0':
|
'@rollup/rollup-linux-s390x-gnu@4.57.0':
|
||||||
resolution: {integrity: sha512-Q9eh+gUGILIHEaJf66aF6a414jQbDnn29zeu0eX3dHMuysnhTvsUvZTCAyZ6tJhUjnvzBKE4FtuaYxutxRZpOg==}
|
resolution: {integrity: sha512-Q9eh+gUGILIHEaJf66aF6a414jQbDnn29zeu0eX3dHMuysnhTvsUvZTCAyZ6tJhUjnvzBKE4FtuaYxutxRZpOg==}
|
||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-gnu@4.57.0':
|
'@rollup/rollup-linux-x64-gnu@4.57.0':
|
||||||
resolution: {integrity: sha512-OR5p5yG5OKSxHReWmwvM0P+VTPMwoBS45PXTMYaskKQqybkS3Kmugq1W+YbNWArF8/s7jQScgzXUhArzEQ7x0A==}
|
resolution: {integrity: sha512-OR5p5yG5OKSxHReWmwvM0P+VTPMwoBS45PXTMYaskKQqybkS3Kmugq1W+YbNWArF8/s7jQScgzXUhArzEQ7x0A==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-musl@4.57.0':
|
'@rollup/rollup-linux-x64-musl@4.57.0':
|
||||||
resolution: {integrity: sha512-XeatKzo4lHDsVEbm1XDHZlhYZZSQYym6dg2X/Ko0kSFgio+KXLsxwJQprnR48GvdIKDOpqWqssC3iBCjoMcMpw==}
|
resolution: {integrity: sha512-XeatKzo4lHDsVEbm1XDHZlhYZZSQYym6dg2X/Ko0kSFgio+KXLsxwJQprnR48GvdIKDOpqWqssC3iBCjoMcMpw==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-openbsd-x64@4.57.0':
|
'@rollup/rollup-openbsd-x64@4.57.0':
|
||||||
resolution: {integrity: sha512-Lu71y78F5qOfYmubYLHPcJm74GZLU6UJ4THkf/a1K7Tz2ycwC2VUbsqbJAXaR6Bx70SRdlVrt2+n5l7F0agTUw==}
|
resolution: {integrity: sha512-Lu71y78F5qOfYmubYLHPcJm74GZLU6UJ4THkf/a1K7Tz2ycwC2VUbsqbJAXaR6Bx70SRdlVrt2+n5l7F0agTUw==}
|
||||||
@@ -1647,28 +1639,24 @@ packages:
|
|||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@tailwindcss/oxide-linux-arm64-musl@4.1.18':
|
'@tailwindcss/oxide-linux-arm64-musl@4.1.18':
|
||||||
resolution: {integrity: sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==}
|
resolution: {integrity: sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@tailwindcss/oxide-linux-x64-gnu@4.1.18':
|
'@tailwindcss/oxide-linux-x64-gnu@4.1.18':
|
||||||
resolution: {integrity: sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==}
|
resolution: {integrity: sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@tailwindcss/oxide-linux-x64-musl@4.1.18':
|
'@tailwindcss/oxide-linux-x64-musl@4.1.18':
|
||||||
resolution: {integrity: sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==}
|
resolution: {integrity: sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@tailwindcss/oxide-wasm32-wasi@4.1.18':
|
'@tailwindcss/oxide-wasm32-wasi@4.1.18':
|
||||||
resolution: {integrity: sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==}
|
resolution: {integrity: sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==}
|
||||||
@@ -2396,28 +2384,24 @@ packages:
|
|||||||
engines: {node: '>= 12.0.0'}
|
engines: {node: '>= 12.0.0'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
lightningcss-linux-arm64-musl@1.30.2:
|
lightningcss-linux-arm64-musl@1.30.2:
|
||||||
resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==}
|
resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==}
|
||||||
engines: {node: '>= 12.0.0'}
|
engines: {node: '>= 12.0.0'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
lightningcss-linux-x64-gnu@1.30.2:
|
lightningcss-linux-x64-gnu@1.30.2:
|
||||||
resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==}
|
resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==}
|
||||||
engines: {node: '>= 12.0.0'}
|
engines: {node: '>= 12.0.0'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
lightningcss-linux-x64-musl@1.30.2:
|
lightningcss-linux-x64-musl@1.30.2:
|
||||||
resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==}
|
resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==}
|
||||||
engines: {node: '>= 12.0.0'}
|
engines: {node: '>= 12.0.0'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
lightningcss-win32-arm64-msvc@1.30.2:
|
lightningcss-win32-arm64-msvc@1.30.2:
|
||||||
resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==}
|
resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==}
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
overrides:
|
overrides:
|
||||||
|
'@dataconnect/generated': link:src/dataconnect-generated
|
||||||
|
'@firebasegen/example-connector': link:src/dataconnect-generated
|
||||||
dataconnect-generated: link:../../../../../AppData/Local/pnpm/global/5/node_modules/src/dataconnect-generated
|
dataconnect-generated: link:../../../../../AppData/Local/pnpm/global/5/node_modules/src/dataconnect-generated
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ generate:
|
|||||||
- outputDir: ../../../apps/mobile/packages/data_connect/lib/src/dataconnect_generated
|
- outputDir: ../../../apps/mobile/packages/data_connect/lib/src/dataconnect_generated
|
||||||
package: dataconnect_generated/generated.dart
|
package: dataconnect_generated/generated.dart
|
||||||
javascriptSdk:
|
javascriptSdk:
|
||||||
- outputDir: ..\..\..\apps\web\src\dataconnect-generated
|
- react: true
|
||||||
package: "@dataconnect/generated"
|
|
||||||
packageJsonDir: ..\..\..\apps\web
|
|
||||||
react: true
|
|
||||||
angular: false
|
angular: false
|
||||||
|
outputDir: ../../../apps/web/src/dataconnect-generated
|
||||||
|
package: "@dataconnect/generated"
|
||||||
|
packageJsonDir: ../../../apps/web
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ mutation createInvoice(
|
|||||||
$invoiceNumber: String!
|
$invoiceNumber: String!
|
||||||
$issueDate: Timestamp!
|
$issueDate: Timestamp!
|
||||||
$dueDate: Timestamp!
|
$dueDate: Timestamp!
|
||||||
|
$hub: String
|
||||||
$managerName: String
|
$managerName: String
|
||||||
$vendorNumber: String
|
$vendorNumber: String
|
||||||
$roles: Any
|
$roles: Any
|
||||||
@@ -35,6 +36,7 @@ mutation createInvoice(
|
|||||||
invoiceNumber: $invoiceNumber
|
invoiceNumber: $invoiceNumber
|
||||||
issueDate: $issueDate
|
issueDate: $issueDate
|
||||||
dueDate: $dueDate
|
dueDate: $dueDate
|
||||||
|
hub: $hub
|
||||||
managerName: $managerName
|
managerName: $managerName
|
||||||
vendorNumber: $vendorNumber
|
vendorNumber: $vendorNumber
|
||||||
roles: $roles
|
roles: $roles
|
||||||
@@ -64,6 +66,7 @@ mutation updateInvoice(
|
|||||||
$invoiceNumber: String
|
$invoiceNumber: String
|
||||||
$issueDate: Timestamp
|
$issueDate: Timestamp
|
||||||
$dueDate: Timestamp
|
$dueDate: Timestamp
|
||||||
|
$hub: String
|
||||||
$managerName: String
|
$managerName: String
|
||||||
$vendorNumber: String
|
$vendorNumber: String
|
||||||
$roles: Any
|
$roles: Any
|
||||||
@@ -94,6 +97,7 @@ mutation updateInvoice(
|
|||||||
invoiceNumber: $invoiceNumber
|
invoiceNumber: $invoiceNumber
|
||||||
issueDate: $issueDate
|
issueDate: $issueDate
|
||||||
dueDate: $dueDate
|
dueDate: $dueDate
|
||||||
|
hub: $hub
|
||||||
managerName: $managerName
|
managerName: $managerName
|
||||||
vendorNumber: $vendorNumber
|
vendorNumber: $vendorNumber
|
||||||
roles: $roles
|
roles: $roles
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ query listInvoices(
|
|||||||
invoiceNumber
|
invoiceNumber
|
||||||
issueDate
|
issueDate
|
||||||
dueDate
|
dueDate
|
||||||
|
hub
|
||||||
managerName
|
managerName
|
||||||
vendorNumber
|
vendorNumber
|
||||||
roles
|
roles
|
||||||
@@ -78,6 +79,7 @@ query getInvoiceById($id: UUID!) @auth(level: USER) {
|
|||||||
invoiceNumber
|
invoiceNumber
|
||||||
issueDate
|
issueDate
|
||||||
dueDate
|
dueDate
|
||||||
|
hub
|
||||||
managerName
|
managerName
|
||||||
vendorNumber
|
vendorNumber
|
||||||
roles
|
roles
|
||||||
@@ -147,6 +149,7 @@ query listInvoicesByVendorId(
|
|||||||
invoiceNumber
|
invoiceNumber
|
||||||
issueDate
|
issueDate
|
||||||
dueDate
|
dueDate
|
||||||
|
hub
|
||||||
managerName
|
managerName
|
||||||
vendorNumber
|
vendorNumber
|
||||||
roles
|
roles
|
||||||
@@ -216,6 +219,7 @@ query listInvoicesByBusinessId(
|
|||||||
invoiceNumber
|
invoiceNumber
|
||||||
issueDate
|
issueDate
|
||||||
dueDate
|
dueDate
|
||||||
|
hub
|
||||||
managerName
|
managerName
|
||||||
vendorNumber
|
vendorNumber
|
||||||
roles
|
roles
|
||||||
@@ -285,6 +289,7 @@ query listInvoicesByOrderId(
|
|||||||
invoiceNumber
|
invoiceNumber
|
||||||
issueDate
|
issueDate
|
||||||
dueDate
|
dueDate
|
||||||
|
hub
|
||||||
managerName
|
managerName
|
||||||
vendorNumber
|
vendorNumber
|
||||||
roles
|
roles
|
||||||
@@ -354,6 +359,7 @@ query listInvoicesByStatus(
|
|||||||
invoiceNumber
|
invoiceNumber
|
||||||
issueDate
|
issueDate
|
||||||
dueDate
|
dueDate
|
||||||
|
hub
|
||||||
managerName
|
managerName
|
||||||
vendorNumber
|
vendorNumber
|
||||||
roles
|
roles
|
||||||
@@ -442,6 +448,7 @@ query filterInvoices(
|
|||||||
invoiceNumber
|
invoiceNumber
|
||||||
issueDate
|
issueDate
|
||||||
dueDate
|
dueDate
|
||||||
|
hub
|
||||||
managerName
|
managerName
|
||||||
vendorNumber
|
vendorNumber
|
||||||
roles
|
roles
|
||||||
@@ -515,6 +522,7 @@ query listOverdueInvoices(
|
|||||||
invoiceNumber
|
invoiceNumber
|
||||||
issueDate
|
issueDate
|
||||||
dueDate
|
dueDate
|
||||||
|
hub
|
||||||
managerName
|
managerName
|
||||||
vendorNumber
|
vendorNumber
|
||||||
roles
|
roles
|
||||||
|
|||||||
@@ -97,4 +97,4 @@ mutation updateOrder(
|
|||||||
|
|
||||||
mutation deleteOrder($id: UUID!) @auth(level: USER) {
|
mutation deleteOrder($id: UUID!) @auth(level: USER) {
|
||||||
order_delete(id: $id)
|
order_delete(id: $id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -433,44 +433,3 @@ query listOrdersByBusinessAndTeamHub(
|
|||||||
createdBy
|
createdBy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#to validate if an hub has orders before delete
|
|
||||||
query listOrdersByBusinessAndTeamHub(
|
|
||||||
$businessId: UUID!
|
|
||||||
$teamHubId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(
|
|
||||||
where: {
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
teamHubId: { eq: $teamHubId }
|
|
||||||
#status: {in: [ DRAFT POSTED FILLED PENDING FULLY_STAFFED PARTIAL_STAFFED ] }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
orderType
|
|
||||||
status
|
|
||||||
duration
|
|
||||||
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
teamHubId
|
|
||||||
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
|
|
||||||
requested
|
|
||||||
total
|
|
||||||
notes
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -480,4 +480,4 @@ query listRecentPaymentsByBusinessId(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -539,4 +539,4 @@ query getCompletedShiftsByBusinessId(
|
|||||||
#vendor { id companyName }
|
#vendor { id companyName }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,4 +202,4 @@ query listTaxFormsWhere(
|
|||||||
updatedAt
|
updatedAt
|
||||||
createdBy
|
createdBy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
mutation createAccount(
|
|
||||||
$bank: String!
|
|
||||||
$type: AccountType!
|
|
||||||
$last4: String!
|
|
||||||
$isPrimary: Boolean
|
|
||||||
$ownerId: UUID!
|
|
||||||
$accountNumber: String
|
|
||||||
$routeNumber: String
|
|
||||||
$expiryTime: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
account_insert(
|
|
||||||
data: {
|
|
||||||
bank: $bank
|
|
||||||
type: $type
|
|
||||||
last4: $last4
|
|
||||||
isPrimary: $isPrimary
|
|
||||||
ownerId: $ownerId
|
|
||||||
accountNumber: $accountNumber
|
|
||||||
routeNumber: $routeNumber
|
|
||||||
expiryTime: $expiryTime
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateAccount(
|
|
||||||
$id: UUID!
|
|
||||||
$bank: String
|
|
||||||
$type: AccountType
|
|
||||||
$last4: String
|
|
||||||
$isPrimary: Boolean
|
|
||||||
$accountNumber: String
|
|
||||||
$routeNumber: String
|
|
||||||
$expiryTime: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
account_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
bank: $bank
|
|
||||||
type: $type
|
|
||||||
last4: $last4
|
|
||||||
isPrimary: $isPrimary
|
|
||||||
accountNumber: $accountNumber
|
|
||||||
routeNumber: $routeNumber
|
|
||||||
expiryTime: $expiryTime
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteAccount($id: UUID!) @auth(level: USER) {
|
|
||||||
account_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
query listAccounts @auth(level: USER) {
|
|
||||||
accounts {
|
|
||||||
id
|
|
||||||
bank
|
|
||||||
type
|
|
||||||
last4
|
|
||||||
isPrimary
|
|
||||||
ownerId
|
|
||||||
accountNumber
|
|
||||||
routeNumber
|
|
||||||
expiryTime
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getAccountById($id: UUID!) @auth(level: USER) {
|
|
||||||
account(id: $id) {
|
|
||||||
id
|
|
||||||
bank
|
|
||||||
type
|
|
||||||
last4
|
|
||||||
isPrimary
|
|
||||||
ownerId
|
|
||||||
accountNumber
|
|
||||||
routeNumber
|
|
||||||
expiryTime
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getAccountsByOwnerId($ownerId: UUID!) @auth(level: USER) {
|
|
||||||
accounts(where: { ownerId: { eq: $ownerId } }) {
|
|
||||||
id
|
|
||||||
bank
|
|
||||||
type
|
|
||||||
last4
|
|
||||||
isPrimary
|
|
||||||
ownerId
|
|
||||||
accountNumber
|
|
||||||
routeNumber
|
|
||||||
expiryTime
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterAccounts(
|
|
||||||
$bank: String
|
|
||||||
$type: AccountType
|
|
||||||
$isPrimary: Boolean
|
|
||||||
$ownerId: UUID
|
|
||||||
) @auth(level: USER) {
|
|
||||||
accounts(
|
|
||||||
where: {
|
|
||||||
bank: { eq: $bank }
|
|
||||||
type: { eq: $type }
|
|
||||||
isPrimary: { eq: $isPrimary }
|
|
||||||
ownerId: { eq: $ownerId }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
bank
|
|
||||||
type
|
|
||||||
last4
|
|
||||||
isPrimary
|
|
||||||
ownerId
|
|
||||||
accountNumber
|
|
||||||
expiryTime
|
|
||||||
routeNumber
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
mutation createActivityLog(
|
|
||||||
$userId: String!
|
|
||||||
|
|
||||||
$date: Timestamp!
|
|
||||||
$hourStart: String
|
|
||||||
$hourEnd: String
|
|
||||||
$totalhours: String
|
|
||||||
$iconType: ActivityIconType
|
|
||||||
$iconColor: String
|
|
||||||
|
|
||||||
$title: String!
|
|
||||||
$description: String!
|
|
||||||
$isRead: Boolean
|
|
||||||
$activityType: ActivityType!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLog_insert(
|
|
||||||
data: {
|
|
||||||
userId: $userId
|
|
||||||
|
|
||||||
date: $date
|
|
||||||
hourStart: $hourStart
|
|
||||||
hourEnd: $hourEnd
|
|
||||||
totalhours: $totalhours
|
|
||||||
iconType: $iconType
|
|
||||||
iconColor: $iconColor
|
|
||||||
|
|
||||||
title: $title
|
|
||||||
description: $description
|
|
||||||
isRead: $isRead
|
|
||||||
activityType: $activityType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateActivityLog(
|
|
||||||
$id: UUID!
|
|
||||||
|
|
||||||
$userId: String
|
|
||||||
|
|
||||||
$date: Timestamp
|
|
||||||
$hourStart: String
|
|
||||||
$hourEnd: String
|
|
||||||
$totalhours: String
|
|
||||||
$iconType: ActivityIconType
|
|
||||||
$iconColor: String
|
|
||||||
|
|
||||||
$title: String
|
|
||||||
$description: String
|
|
||||||
$isRead: Boolean
|
|
||||||
$activityType: ActivityType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLog_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
userId: $userId
|
|
||||||
|
|
||||||
date: $date
|
|
||||||
hourStart: $hourStart
|
|
||||||
hourEnd: $hourEnd
|
|
||||||
totalhours: $totalhours
|
|
||||||
iconType: $iconType
|
|
||||||
iconColor: $iconColor
|
|
||||||
|
|
||||||
title: $title
|
|
||||||
description: $description
|
|
||||||
isRead: $isRead
|
|
||||||
activityType: $activityType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# MARK AS READ (single)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
mutation markActivityLogAsRead($id: UUID!) @auth(level: USER) {
|
|
||||||
activityLog_update(
|
|
||||||
id: $id
|
|
||||||
data: { isRead: true }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# MARK MANY AS READ (correct op name in your DC)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
mutation markActivityLogsAsRead(
|
|
||||||
$ids: [UUID!]!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLog_updateMany(
|
|
||||||
where: { id: { in: $ids } }
|
|
||||||
data: { isRead: true }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteActivityLog($id: UUID!) @auth(level: USER) {
|
|
||||||
activityLog_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listActivityLogs(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLogs(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
|
|
||||||
date
|
|
||||||
hourStart
|
|
||||||
hourEnd
|
|
||||||
totalhours
|
|
||||||
iconType
|
|
||||||
iconColor
|
|
||||||
|
|
||||||
title
|
|
||||||
description
|
|
||||||
isRead
|
|
||||||
activityType
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# GET BY ID
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query getActivityLogById($id: UUID!) @auth(level: USER) {
|
|
||||||
activityLog(id: $id) {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
|
|
||||||
date
|
|
||||||
hourStart
|
|
||||||
hourEnd
|
|
||||||
totalhours
|
|
||||||
iconType
|
|
||||||
iconColor
|
|
||||||
|
|
||||||
title
|
|
||||||
description
|
|
||||||
isRead
|
|
||||||
activityType
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY USER
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listActivityLogsByUserId(
|
|
||||||
$userId: String!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLogs(
|
|
||||||
where: { userId: { eq: $userId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { date: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
|
|
||||||
date
|
|
||||||
hourStart
|
|
||||||
hourEnd
|
|
||||||
totalhours
|
|
||||||
iconType
|
|
||||||
iconColor
|
|
||||||
|
|
||||||
title
|
|
||||||
description
|
|
||||||
isRead
|
|
||||||
activityType
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST UNREAD BY USER (common for notifications UI)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listUnreadActivityLogsByUserId(
|
|
||||||
$userId: String!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLogs(
|
|
||||||
where: {
|
|
||||||
userId: { eq: $userId }
|
|
||||||
isRead: { eq: false }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { date: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
|
|
||||||
date
|
|
||||||
hourStart
|
|
||||||
hourEnd
|
|
||||||
totalhours
|
|
||||||
iconType
|
|
||||||
iconColor
|
|
||||||
|
|
||||||
title
|
|
||||||
description
|
|
||||||
isRead
|
|
||||||
activityType
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# FILTER (user + date range + read status + type)
|
|
||||||
# NOTE: Timestamp filter uses ge/le (NOT gte/lte)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query filterActivityLogs(
|
|
||||||
$userId: String
|
|
||||||
$dateFrom: Timestamp
|
|
||||||
$dateTo: Timestamp
|
|
||||||
$isRead: Boolean
|
|
||||||
$activityType: ActivityType
|
|
||||||
$iconType: ActivityIconType
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLogs(
|
|
||||||
where: {
|
|
||||||
userId: { eq: $userId }
|
|
||||||
date: { ge: $dateFrom, le: $dateTo }
|
|
||||||
isRead: { eq: $isRead }
|
|
||||||
activityType: { eq: $activityType }
|
|
||||||
iconType: { eq: $iconType }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { date: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
|
|
||||||
date
|
|
||||||
hourStart
|
|
||||||
hourEnd
|
|
||||||
totalhours
|
|
||||||
iconType
|
|
||||||
iconColor
|
|
||||||
|
|
||||||
title
|
|
||||||
description
|
|
||||||
isRead
|
|
||||||
activityType
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
mutation createApplication(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$staffId: UUID!
|
|
||||||
$status: ApplicationStatus!
|
|
||||||
$checkInTime: Timestamp
|
|
||||||
$checkOutTime: Timestamp
|
|
||||||
$origin: ApplicationOrigin!
|
|
||||||
$roleId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
application_insert(
|
|
||||||
data: {
|
|
||||||
shiftId: $shiftId
|
|
||||||
staffId: $staffId
|
|
||||||
status: $status
|
|
||||||
checkInTime: $checkInTime
|
|
||||||
checkOutTime: $checkOutTime
|
|
||||||
origin: $origin
|
|
||||||
roleId: $roleId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateApplicationStatus(
|
|
||||||
$id: UUID!
|
|
||||||
$shiftId: UUID
|
|
||||||
$staffId: UUID
|
|
||||||
$status: ApplicationStatus
|
|
||||||
$checkInTime: Timestamp
|
|
||||||
$checkOutTime: Timestamp
|
|
||||||
$roleId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
application_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
shiftId: $shiftId
|
|
||||||
staffId: $staffId
|
|
||||||
status: $status
|
|
||||||
checkInTime: $checkInTime
|
|
||||||
checkOutTime: $checkOutTime
|
|
||||||
roleId: $roleId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteApplication($id: UUID!) @auth(level: USER) {
|
|
||||||
application_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,452 +0,0 @@
|
|||||||
query listApplications @auth(level: USER) {
|
|
||||||
applications {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
appliedAt
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
origin
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
location
|
|
||||||
status
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
companyLogoUrl
|
|
||||||
}
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#shifts in staff app
|
|
||||||
query getApplicationById($id: UUID!) @auth(level: USER) {
|
|
||||||
application(id: $id) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
appliedAt
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
origin
|
|
||||||
createdAt
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
location
|
|
||||||
status
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
companyLogoUrl
|
|
||||||
}
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getApplicationsByShiftId($shiftId: UUID!) @auth(level: USER) {
|
|
||||||
applications(where: { shiftId: { eq: $shiftId } }) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
appliedAt
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
origin
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
location
|
|
||||||
status
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getApplicationsByShiftIdAndStatus(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$status: ApplicationStatus!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(
|
|
||||||
where: {
|
|
||||||
shiftId: { eq: $shiftId }
|
|
||||||
status: { eq: $status }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
appliedAt
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
origin
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
location
|
|
||||||
status
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getApplicationsByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
$dayStart: Timestamp
|
|
||||||
$dayEnd: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(
|
|
||||||
where: {
|
|
||||||
staffId: { eq: $staffId }
|
|
||||||
shift: {
|
|
||||||
date: { ge: $dayStart, le: $dayEnd }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
appliedAt
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
origin
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
location
|
|
||||||
status
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
companyLogoUrl
|
|
||||||
}
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#getting staffs of an shiftrole ACCEPTED for orders view client
|
|
||||||
query listAcceptedApplicationsByShiftRoleKey(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(
|
|
||||||
where: {
|
|
||||||
shiftId: { eq: $shiftId }
|
|
||||||
roleId: { eq: $roleId }
|
|
||||||
status: { eq: ACCEPTED }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { appliedAt: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
staff { id fullName email phone photoUrl }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#getting staffs of an shiftrole ACCEPTED for orders of the day view client
|
|
||||||
query listAcceptedApplicationsByBusinessForDay(
|
|
||||||
$businessId: UUID!
|
|
||||||
$dayStart: Timestamp!
|
|
||||||
$dayEnd: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(
|
|
||||||
where: {
|
|
||||||
#status: { eq: ACCEPTED }
|
|
||||||
status: { in: [ACCEPTED, CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE] }
|
|
||||||
shift: {
|
|
||||||
date: { ge: $dayStart, le: $dayEnd }
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { appliedAt: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
appliedAt
|
|
||||||
staff { id fullName email phone photoUrl averageRating }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#coverage list and today live
|
|
||||||
query listStaffsApplicationsByBusinessForDay(
|
|
||||||
$businessId: UUID!
|
|
||||||
$dayStart: Timestamp!
|
|
||||||
$dayEnd: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(
|
|
||||||
where: {
|
|
||||||
status: {in: [ACCEPTED, CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE]}
|
|
||||||
shift: {
|
|
||||||
date: { ge: $dayStart, le: $dayEnd }
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
#status: { eq: ACCEPTED }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { appliedAt: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
appliedAt
|
|
||||||
status
|
|
||||||
|
|
||||||
shiftRole{
|
|
||||||
shift{
|
|
||||||
location
|
|
||||||
cost
|
|
||||||
}
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
hours
|
|
||||||
|
|
||||||
role{
|
|
||||||
name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
staff { id fullName email phone photoUrl }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
mutation CreateAssignment(
|
|
||||||
$workforceId: UUID!
|
|
||||||
$title: String
|
|
||||||
$description: String
|
|
||||||
$instructions: String
|
|
||||||
$status: AssignmentStatus
|
|
||||||
$tipsAvailable: Boolean
|
|
||||||
$travelTime: Boolean
|
|
||||||
$mealProvided: Boolean
|
|
||||||
$parkingAvailable: Boolean
|
|
||||||
$gasCompensation: Boolean
|
|
||||||
$managers: [Any!]
|
|
||||||
$roleId: UUID!
|
|
||||||
$shiftId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignment_insert(
|
|
||||||
data: {
|
|
||||||
workforceId: $workforceId
|
|
||||||
title: $title
|
|
||||||
description: $description
|
|
||||||
instructions: $instructions
|
|
||||||
status: $status
|
|
||||||
tipsAvailable: $tipsAvailable
|
|
||||||
travelTime: $travelTime
|
|
||||||
mealProvided: $mealProvided
|
|
||||||
parkingAvailable: $parkingAvailable
|
|
||||||
gasCompensation: $gasCompensation
|
|
||||||
managers: $managers
|
|
||||||
roleId: $roleId
|
|
||||||
shiftId: $shiftId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateAssignment(
|
|
||||||
$id: UUID!
|
|
||||||
$title: String
|
|
||||||
$description: String
|
|
||||||
$instructions: String
|
|
||||||
$status: AssignmentStatus
|
|
||||||
$tipsAvailable: Boolean
|
|
||||||
$travelTime: Boolean
|
|
||||||
$mealProvided: Boolean
|
|
||||||
$parkingAvailable: Boolean
|
|
||||||
$gasCompensation: Boolean
|
|
||||||
$managers: [Any!]
|
|
||||||
$roleId: UUID!
|
|
||||||
$shiftId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignment_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
title: $title
|
|
||||||
description: $description
|
|
||||||
instructions: $instructions
|
|
||||||
status: $status
|
|
||||||
tipsAvailable: $tipsAvailable
|
|
||||||
travelTime: $travelTime
|
|
||||||
mealProvided: $mealProvided
|
|
||||||
parkingAvailable: $parkingAvailable
|
|
||||||
gasCompensation: $gasCompensation
|
|
||||||
managers: $managers
|
|
||||||
roleId: $roleId
|
|
||||||
shiftId: $shiftId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteAssignment($id: UUID!) @auth(level: USER) {
|
|
||||||
assignment_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,278 +0,0 @@
|
|||||||
# ------------------------------------------------------------
|
|
||||||
# LIST ALL ASSIGNMENTS (admin/debug)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listAssignments(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignments(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
status
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
workforce {
|
|
||||||
id
|
|
||||||
workforceNumber
|
|
||||||
staff { id fullName }
|
|
||||||
}
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role { id name costPerHour }
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
status
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
business { id businessName email contactName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET ASSIGNMENT BY ID
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getAssignmentById($id: UUID!) @auth(level: USER) {
|
|
||||||
assignment(id: $id) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
description
|
|
||||||
instructions
|
|
||||||
status
|
|
||||||
tipsAvailable
|
|
||||||
travelTime
|
|
||||||
mealProvided
|
|
||||||
parkingAvailable
|
|
||||||
gasCompensation
|
|
||||||
managers
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
workforce {
|
|
||||||
id
|
|
||||||
workforceNumber
|
|
||||||
status
|
|
||||||
staff { id fullName }
|
|
||||||
}
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
breakType
|
|
||||||
uniform
|
|
||||||
department
|
|
||||||
role { id name costPerHour }
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
status
|
|
||||||
managers
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
orderType
|
|
||||||
business { id businessName email contactName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# MY ASSIGNMENTS (by workforceId) - Staff view
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listAssignmentsByWorkforceId(
|
|
||||||
$workforceId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignments(
|
|
||||||
where: { workforceId: { eq: $workforceId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
status
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
workforce {
|
|
||||||
id
|
|
||||||
workforceNumber
|
|
||||||
staff { id fullName }
|
|
||||||
}
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role { id name costPerHour }
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
location
|
|
||||||
status
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# ASSIGNMENTS FOR A VENDOR (Vendor dashboard)
|
|
||||||
# Approach: filter by workforce.vendorId (relation)
|
|
||||||
# If Data Connect can't filter nested, use 2-step:
|
|
||||||
# 1) listWorkforceByVendorId => workforce ids
|
|
||||||
# 2) assignments(where: { workforceId: { in: [...] } })
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listAssignmentsByWorkforceIds(
|
|
||||||
$workforceIds: [UUID!]!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignments(
|
|
||||||
where: { workforceId: { in: $workforceIds } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
status
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
workforce { id workforceNumber staff { id fullName } }
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
role { id name }
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# ASSIGNMENTS BY SHIFT ROLE (useful for staffing)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listAssignmentsByShiftRole(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignments(
|
|
||||||
where: {
|
|
||||||
shiftId: { eq: $shiftId }
|
|
||||||
roleId: { eq: $roleId }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
status
|
|
||||||
createdAt
|
|
||||||
workforce { id workforceNumber staff { id fullName } }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
|
|
||||||
# FILTER ASSIGNMENTS (status + date range)
|
|
||||||
# Date range is based on Shift.date through the relation (NOT filterable directly).
|
|
||||||
#
|
|
||||||
# Since ShiftRole uses a composite key (shiftId + roleId),
|
|
||||||
# Assignments must be filtered using BOTH fields.
|
|
||||||
#
|
|
||||||
# So the filtering flow is:
|
|
||||||
# 1) Get Shifts in the date range => shiftIds
|
|
||||||
# 2) Get ShiftRoles where shiftId IN shiftIds => (shiftId, roleId) pairs
|
|
||||||
# 3) Get Assignments where:
|
|
||||||
# - shiftId matches
|
|
||||||
# - roleId matches
|
|
||||||
# - status matches (optional)
|
|
||||||
#
|
|
||||||
# This query represents step 3.
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query filterAssignments(
|
|
||||||
$shiftIds: [UUID!]!
|
|
||||||
$roleIds: [UUID!]!
|
|
||||||
$status: AssignmentStatus
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignments(
|
|
||||||
where: {
|
|
||||||
shiftId: { in: $shiftIds }
|
|
||||||
roleId: { in: $roleIds }
|
|
||||||
status: { eq: $status }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
status
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
workforce { id workforceNumber staff { id fullName } }
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
id
|
|
||||||
role { id name }
|
|
||||||
shift { id title date location status }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
mutation createAttireOption(
|
|
||||||
$itemId: String!
|
|
||||||
$label: String!
|
|
||||||
$icon: String
|
|
||||||
$imageUrl: String
|
|
||||||
$isMandatory: Boolean
|
|
||||||
$vendorId: UUID
|
|
||||||
) @auth(level: USER) {
|
|
||||||
attireOption_insert(
|
|
||||||
data: {
|
|
||||||
itemId: $itemId
|
|
||||||
label: $label
|
|
||||||
icon: $icon
|
|
||||||
imageUrl: $imageUrl
|
|
||||||
isMandatory: $isMandatory
|
|
||||||
vendorId: $vendorId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateAttireOption(
|
|
||||||
$id: UUID!
|
|
||||||
$itemId: String
|
|
||||||
$label: String
|
|
||||||
$icon: String
|
|
||||||
$imageUrl: String
|
|
||||||
$isMandatory: Boolean
|
|
||||||
$vendorId: UUID
|
|
||||||
) @auth(level: USER) {
|
|
||||||
attireOption_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
itemId: $itemId
|
|
||||||
label: $label
|
|
||||||
icon: $icon
|
|
||||||
imageUrl: $imageUrl
|
|
||||||
isMandatory: $isMandatory
|
|
||||||
vendorId: $vendorId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteAttireOption($id: UUID!) @auth(level: USER) {
|
|
||||||
attireOption_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
query listAttireOptions @auth(level: USER) {
|
|
||||||
attireOptions {
|
|
||||||
id
|
|
||||||
itemId
|
|
||||||
label
|
|
||||||
icon
|
|
||||||
imageUrl
|
|
||||||
isMandatory
|
|
||||||
vendorId
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getAttireOptionById($id: UUID!) @auth(level: USER) {
|
|
||||||
attireOption(id: $id) {
|
|
||||||
id
|
|
||||||
itemId
|
|
||||||
label
|
|
||||||
icon
|
|
||||||
imageUrl
|
|
||||||
isMandatory
|
|
||||||
vendorId
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterAttireOptions(
|
|
||||||
$itemId: String
|
|
||||||
$isMandatory: Boolean
|
|
||||||
$vendorId: UUID
|
|
||||||
) @auth(level: USER) {
|
|
||||||
attireOptions(
|
|
||||||
where: {
|
|
||||||
itemId: { eq: $itemId }
|
|
||||||
isMandatory: { eq: $isMandatory }
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
itemId
|
|
||||||
label
|
|
||||||
icon
|
|
||||||
imageUrl
|
|
||||||
isMandatory
|
|
||||||
vendorId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
|
|
||||||
mutation createBenefitsData(
|
|
||||||
$vendorBenefitPlanId: UUID!
|
|
||||||
$staffId: UUID!
|
|
||||||
$current: Int!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
benefitsData_insert(
|
|
||||||
data: {
|
|
||||||
vendorBenefitPlanId: $vendorBenefitPlanId
|
|
||||||
staffId: $staffId
|
|
||||||
current: $current
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateBenefitsData(
|
|
||||||
$staffId: UUID!
|
|
||||||
$vendorBenefitPlanId: UUID!
|
|
||||||
$current: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
benefitsData_update(
|
|
||||||
key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }
|
|
||||||
data: {
|
|
||||||
current: $current
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteBenefitsData(
|
|
||||||
$staffId: UUID!
|
|
||||||
$vendorBenefitPlanId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
benefitsData_delete(
|
|
||||||
key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listBenefitsData(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
benefitsDatas(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
vendorBenefitPlanId
|
|
||||||
current
|
|
||||||
staffId
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendorBenefitPlan {
|
|
||||||
id
|
|
||||||
vendorId
|
|
||||||
title
|
|
||||||
description
|
|
||||||
requestLabel
|
|
||||||
total
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# GET BY KEY (staffId + vendorBenefitPlanId) ✅ (replaces getById in practice)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query getBenefitsDataByKey(
|
|
||||||
$staffId: UUID!
|
|
||||||
$vendorBenefitPlanId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
benefitsData(key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }) {
|
|
||||||
id
|
|
||||||
vendorBenefitPlanId
|
|
||||||
current
|
|
||||||
staffId
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendorBenefitPlan {
|
|
||||||
id
|
|
||||||
vendorId
|
|
||||||
title
|
|
||||||
description
|
|
||||||
requestLabel
|
|
||||||
total
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY STAFF
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listBenefitsDataByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
benefitsDatas(
|
|
||||||
where: { staffId: { eq: $staffId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
vendorBenefitPlanId
|
|
||||||
current
|
|
||||||
staffId
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendorBenefitPlan {
|
|
||||||
id
|
|
||||||
vendorId
|
|
||||||
title
|
|
||||||
description
|
|
||||||
requestLabel
|
|
||||||
total
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY VENDOR BENEFIT PLAN
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listBenefitsDataByVendorBenefitPlanId(
|
|
||||||
$vendorBenefitPlanId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
benefitsDatas(
|
|
||||||
where: { vendorBenefitPlanId: { eq: $vendorBenefitPlanId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
vendorBenefitPlanId
|
|
||||||
current
|
|
||||||
staffId
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendorBenefitPlan {
|
|
||||||
id
|
|
||||||
vendorId
|
|
||||||
title
|
|
||||||
description
|
|
||||||
requestLabel
|
|
||||||
total
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY VENDOR (2-step helper: planIds -> benefitsDatas IN)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listBenefitsDataByVendorBenefitPlanIds(
|
|
||||||
$vendorBenefitPlanIds: [UUID!]!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
benefitsDatas(
|
|
||||||
where: { vendorBenefitPlanId: { in: $vendorBenefitPlanIds } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
vendorBenefitPlanId
|
|
||||||
current
|
|
||||||
staffId
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendorBenefitPlan {
|
|
||||||
id
|
|
||||||
vendorId
|
|
||||||
title
|
|
||||||
description
|
|
||||||
requestLabel
|
|
||||||
total
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
mutation createBusiness(
|
|
||||||
$businessName: String!,
|
|
||||||
$contactName: String,
|
|
||||||
$userId: String!,
|
|
||||||
$companyLogoUrl: String,
|
|
||||||
$phone: String,
|
|
||||||
$email: String,
|
|
||||||
$hubBuilding: String,
|
|
||||||
$address: String,
|
|
||||||
$city: String,
|
|
||||||
$area: BusinessArea,
|
|
||||||
$sector: BusinessSector,
|
|
||||||
$rateGroup: BusinessRateGroup!,
|
|
||||||
$status: BusinessStatus!,
|
|
||||||
$notes: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
business_insert(
|
|
||||||
data: {
|
|
||||||
businessName: $businessName,
|
|
||||||
contactName: $contactName,
|
|
||||||
userId: $userId,
|
|
||||||
companyLogoUrl: $companyLogoUrl,
|
|
||||||
phone: $phone,
|
|
||||||
email: $email,
|
|
||||||
hubBuilding: $hubBuilding,
|
|
||||||
address: $address,
|
|
||||||
city: $city,
|
|
||||||
area: $area,
|
|
||||||
sector: $sector,
|
|
||||||
rateGroup: $rateGroup,
|
|
||||||
status: $status,
|
|
||||||
notes: $notes
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateBusiness(
|
|
||||||
$id: UUID!,
|
|
||||||
$businessName: String,
|
|
||||||
$contactName: String,
|
|
||||||
$companyLogoUrl: String,
|
|
||||||
$phone: String,
|
|
||||||
$email: String,
|
|
||||||
$hubBuilding: String,
|
|
||||||
$address: String,
|
|
||||||
$city: String,
|
|
||||||
$area: BusinessArea,
|
|
||||||
$sector: BusinessSector,
|
|
||||||
$rateGroup: BusinessRateGroup,
|
|
||||||
$status: BusinessStatus,
|
|
||||||
$notes: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
business_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
businessName: $businessName,
|
|
||||||
contactName: $contactName,
|
|
||||||
companyLogoUrl: $companyLogoUrl,
|
|
||||||
phone: $phone,
|
|
||||||
email: $email,
|
|
||||||
hubBuilding: $hubBuilding,
|
|
||||||
address: $address,
|
|
||||||
city: $city,
|
|
||||||
area: $area,
|
|
||||||
sector: $sector,
|
|
||||||
rateGroup: $rateGroup,
|
|
||||||
status: $status,
|
|
||||||
notes: $notes
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteBusiness($id: UUID!) @auth(level: USER) {
|
|
||||||
business_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
query listBusinesses @auth(level: USER) {
|
|
||||||
businesses {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
contactName
|
|
||||||
userId
|
|
||||||
companyLogoUrl
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
hubBuilding
|
|
||||||
address
|
|
||||||
city
|
|
||||||
area
|
|
||||||
sector
|
|
||||||
rateGroup
|
|
||||||
status
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getBusinessesByUserId($userId: String!) @auth(level: USER) {
|
|
||||||
businesses(where: { userId: { eq: $userId } }) {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
contactName
|
|
||||||
userId
|
|
||||||
companyLogoUrl
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
hubBuilding
|
|
||||||
address
|
|
||||||
city
|
|
||||||
area
|
|
||||||
sector
|
|
||||||
rateGroup
|
|
||||||
status
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getBusinessById($id: UUID!) @auth(level: USER) {
|
|
||||||
business(id: $id) {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
contactName
|
|
||||||
userId
|
|
||||||
companyLogoUrl
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
hubBuilding
|
|
||||||
address
|
|
||||||
city
|
|
||||||
area
|
|
||||||
sector
|
|
||||||
rateGroup
|
|
||||||
status
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
mutation createCategory(
|
|
||||||
$categoryId: String!
|
|
||||||
$label: String!
|
|
||||||
$icon: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
category_insert(
|
|
||||||
data: {
|
|
||||||
categoryId: $categoryId
|
|
||||||
label: $label
|
|
||||||
icon: $icon
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateCategory(
|
|
||||||
$id: UUID!
|
|
||||||
$categoryId: String
|
|
||||||
$label: String
|
|
||||||
$icon: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
category_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
categoryId: $categoryId
|
|
||||||
label: $label
|
|
||||||
icon: $icon
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
mutation deleteCategory($id: UUID!) @auth(level: USER) {
|
|
||||||
category_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
query listCategories @auth(level: USER) {
|
|
||||||
categories {
|
|
||||||
id
|
|
||||||
categoryId
|
|
||||||
label
|
|
||||||
icon
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getCategoryById($id: UUID!) @auth(level: USER) {
|
|
||||||
category(id: $id) {
|
|
||||||
id
|
|
||||||
categoryId
|
|
||||||
label
|
|
||||||
icon
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterCategories(
|
|
||||||
$categoryId: String
|
|
||||||
$label: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
categories(
|
|
||||||
where: {
|
|
||||||
categoryId: { eq: $categoryId }
|
|
||||||
label: { eq: $label }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
categoryId
|
|
||||||
label
|
|
||||||
icon
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
mutation CreateCertificate(
|
|
||||||
$name: String!
|
|
||||||
$description: String
|
|
||||||
$expiry: Timestamp
|
|
||||||
$status: CertificateStatus!
|
|
||||||
$fileUrl: String
|
|
||||||
$icon: String
|
|
||||||
$certificationType: ComplianceType
|
|
||||||
$issuer: String
|
|
||||||
$staffId: UUID!
|
|
||||||
$validationStatus: ValidationStatus
|
|
||||||
$certificateNumber: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
certificate_insert(
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
description: $description
|
|
||||||
expiry: $expiry
|
|
||||||
status: $status
|
|
||||||
fileUrl: $fileUrl
|
|
||||||
icon: $icon
|
|
||||||
staffId: $staffId
|
|
||||||
certificationType: $certificationType
|
|
||||||
issuer: $issuer
|
|
||||||
validationStatus: $validationStatus
|
|
||||||
certificateNumber: $certificateNumber
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateCertificate(
|
|
||||||
$id: UUID!
|
|
||||||
$name: String
|
|
||||||
$description: String
|
|
||||||
$expiry: Timestamp
|
|
||||||
$status: CertificateStatus
|
|
||||||
$fileUrl: String
|
|
||||||
$icon: String
|
|
||||||
$staffId: UUID
|
|
||||||
$certificationType: ComplianceType
|
|
||||||
$issuer: String
|
|
||||||
$validationStatus: ValidationStatus
|
|
||||||
$certificateNumber: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
certificate_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
description: $description
|
|
||||||
expiry: $expiry
|
|
||||||
status: $status
|
|
||||||
fileUrl: $fileUrl
|
|
||||||
icon: $icon
|
|
||||||
staffId: $staffId
|
|
||||||
certificationType: $certificationType
|
|
||||||
issuer: $issuer
|
|
||||||
validationStatus: $validationStatus
|
|
||||||
certificateNumber: $certificateNumber
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteCertificate($id: UUID!) @auth(level: USER) {
|
|
||||||
certificate_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
query listCertificates @auth(level: USER) {
|
|
||||||
certificates {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
description
|
|
||||||
expiry
|
|
||||||
status
|
|
||||||
fileUrl
|
|
||||||
icon
|
|
||||||
staffId
|
|
||||||
certificationType
|
|
||||||
issuer
|
|
||||||
validationStatus
|
|
||||||
certificateNumber
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getCertificateById($id: UUID!) @auth(level: USER) {
|
|
||||||
certificate(id: $id) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
description
|
|
||||||
expiry
|
|
||||||
status
|
|
||||||
fileUrl
|
|
||||||
icon
|
|
||||||
certificationType
|
|
||||||
issuer
|
|
||||||
staffId
|
|
||||||
validationStatus
|
|
||||||
certificateNumber
|
|
||||||
updatedAt
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listCertificatesByStaffId($staffId: UUID!) @auth(level: USER) {
|
|
||||||
certificates(where: { staffId: { eq: $staffId } }) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
description
|
|
||||||
expiry
|
|
||||||
status
|
|
||||||
fileUrl
|
|
||||||
icon
|
|
||||||
staffId
|
|
||||||
certificationType
|
|
||||||
issuer
|
|
||||||
validationStatus
|
|
||||||
certificateNumber
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
mutation createClientFeedback(
|
|
||||||
$businessId: UUID!
|
|
||||||
$vendorId: UUID!
|
|
||||||
$rating: Int
|
|
||||||
$comment: String
|
|
||||||
$date: Timestamp
|
|
||||||
$createdBy: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
clientFeedback_insert(
|
|
||||||
data: {
|
|
||||||
businessId: $businessId
|
|
||||||
vendorId: $vendorId
|
|
||||||
rating: $rating
|
|
||||||
comment: $comment
|
|
||||||
date: $date
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateClientFeedback(
|
|
||||||
$id: UUID!
|
|
||||||
$businessId: UUID
|
|
||||||
$vendorId: UUID
|
|
||||||
$rating: Int
|
|
||||||
$comment: String
|
|
||||||
$date: Timestamp
|
|
||||||
$createdBy: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
clientFeedback_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
businessId: $businessId
|
|
||||||
vendorId: $vendorId
|
|
||||||
rating: $rating
|
|
||||||
comment: $comment
|
|
||||||
date: $date
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteClientFeedback($id: UUID!) @auth(level: USER) {
|
|
||||||
clientFeedback_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,185 +0,0 @@
|
|||||||
# ----------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listClientFeedbacks(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
clientFeedbacks(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
rating
|
|
||||||
comment
|
|
||||||
date
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# GET BY ID
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query getClientFeedbackById($id: UUID!) @auth(level: USER) {
|
|
||||||
clientFeedback(id: $id) {
|
|
||||||
id
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
rating
|
|
||||||
comment
|
|
||||||
date
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY BUSINESS
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listClientFeedbacksByBusinessId(
|
|
||||||
$businessId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
clientFeedbacks(
|
|
||||||
where: { businessId: { eq: $businessId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { date: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
rating
|
|
||||||
comment
|
|
||||||
date
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY VENDOR
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listClientFeedbacksByVendorId(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
clientFeedbacks(
|
|
||||||
where: { vendorId: { eq: $vendorId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { date: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
rating
|
|
||||||
comment
|
|
||||||
date
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY BUSINESS + VENDOR (pair)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listClientFeedbacksByBusinessAndVendor(
|
|
||||||
$businessId: UUID!
|
|
||||||
$vendorId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
clientFeedbacks(
|
|
||||||
where: {
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { date: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
rating
|
|
||||||
comment
|
|
||||||
date
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# FILTER (rating + date range)
|
|
||||||
# NOTE: using Timestamp ops: ge/le
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query filterClientFeedbacks(
|
|
||||||
$businessId: UUID
|
|
||||||
$vendorId: UUID
|
|
||||||
$ratingMin: Int
|
|
||||||
$ratingMax: Int
|
|
||||||
$dateFrom: Timestamp
|
|
||||||
$dateTo: Timestamp
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
clientFeedbacks(
|
|
||||||
where: {
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
rating: { ge: $ratingMin, le: $ratingMax }
|
|
||||||
date: { ge: $dateFrom, le: $dateTo }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { date: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
rating
|
|
||||||
comment
|
|
||||||
date
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# QUICK KPI: average rating for a vendor (client-side aggregate)
|
|
||||||
# You fetch rows; Flutter/web computes avg.
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listClientFeedbackRatingsByVendorId(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$dateFrom: Timestamp
|
|
||||||
$dateTo: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
clientFeedbacks(
|
|
||||||
where: {
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
date: { ge: $dateFrom, le: $dateTo }
|
|
||||||
}
|
|
||||||
orderBy: { date: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
rating
|
|
||||||
comment
|
|
||||||
date
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
connectorId: example
|
|
||||||
generate:
|
|
||||||
javascriptSdk:
|
|
||||||
- outputDir: ..\..\..\apps\web\src\dataconnect-generated
|
|
||||||
package: "@dataconnect/generated"
|
|
||||||
packageJsonDir: ..\..\..\apps\web
|
|
||||||
react: true
|
|
||||||
angular: false
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
|
|
||||||
mutation createConversation(
|
|
||||||
$subject: String
|
|
||||||
$status: ConversationStatus
|
|
||||||
$conversationType: ConversationType
|
|
||||||
$isGroup: Boolean
|
|
||||||
$groupName: String
|
|
||||||
$lastMessage: String
|
|
||||||
$lastMessageAt: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversation_insert(
|
|
||||||
data: {
|
|
||||||
subject: $subject
|
|
||||||
status: $status
|
|
||||||
conversationType: $conversationType
|
|
||||||
isGroup: $isGroup
|
|
||||||
groupName: $groupName
|
|
||||||
lastMessage: $lastMessage
|
|
||||||
lastMessageAt: $lastMessageAt
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateConversation(
|
|
||||||
$id: UUID!
|
|
||||||
|
|
||||||
$subject: String
|
|
||||||
$status: ConversationStatus
|
|
||||||
$conversationType: ConversationType
|
|
||||||
$isGroup: Boolean
|
|
||||||
$groupName: String
|
|
||||||
$lastMessage: String
|
|
||||||
$lastMessageAt: Timestamp
|
|
||||||
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversation_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
subject: $subject
|
|
||||||
status: $status
|
|
||||||
conversationType: $conversationType
|
|
||||||
isGroup: $isGroup
|
|
||||||
groupName: $groupName
|
|
||||||
lastMessage: $lastMessage
|
|
||||||
lastMessageAt: $lastMessageAt
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# UPDATE LAST MESSAGE
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
mutation updateConversationLastMessage(
|
|
||||||
$id: UUID!
|
|
||||||
$lastMessage: String
|
|
||||||
$lastMessageAt: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversation_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
lastMessage: $lastMessage
|
|
||||||
lastMessageAt: $lastMessageAt
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteConversation($id: UUID!) @auth(level: USER) {
|
|
||||||
conversation_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listConversations(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversations(offset: $offset, limit: $limit, orderBy: { updatedAt: DESC }) {
|
|
||||||
id
|
|
||||||
subject
|
|
||||||
status
|
|
||||||
conversationType
|
|
||||||
isGroup
|
|
||||||
groupName
|
|
||||||
lastMessage
|
|
||||||
lastMessageAt
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# GET BY ID
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query getConversationById($id: UUID!) @auth(level: USER) {
|
|
||||||
conversation(id: $id) {
|
|
||||||
id
|
|
||||||
subject
|
|
||||||
status
|
|
||||||
conversationType
|
|
||||||
isGroup
|
|
||||||
groupName
|
|
||||||
lastMessage
|
|
||||||
lastMessageAt
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY TYPE (CLIENT_VENDOR / GROUP_STAFF)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listConversationsByType(
|
|
||||||
$conversationType: ConversationType!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversations(
|
|
||||||
where: { conversationType: { eq: $conversationType } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { lastMessageAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
subject
|
|
||||||
status
|
|
||||||
conversationType
|
|
||||||
isGroup
|
|
||||||
groupName
|
|
||||||
lastMessage
|
|
||||||
lastMessageAt
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY STATUS (ACTIVE)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listConversationsByStatus(
|
|
||||||
$status: ConversationStatus!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversations(
|
|
||||||
where: { status: { eq: $status } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { lastMessageAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
subject
|
|
||||||
status
|
|
||||||
conversationType
|
|
||||||
isGroup
|
|
||||||
groupName
|
|
||||||
lastMessage
|
|
||||||
lastMessageAt
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# FILTER (dashboard/debug)
|
|
||||||
# Supports searching by multiple optional fields
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query filterConversations(
|
|
||||||
$status: ConversationStatus
|
|
||||||
$conversationType: ConversationType
|
|
||||||
$isGroup: Boolean
|
|
||||||
$lastMessageAfter: Timestamp
|
|
||||||
$lastMessageBefore: Timestamp
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversations(
|
|
||||||
where: {
|
|
||||||
status: { eq: $status }
|
|
||||||
conversationType: { eq: $conversationType }
|
|
||||||
isGroup: { eq: $isGroup }
|
|
||||||
lastMessageAt: { ge: $lastMessageAfter, le: $lastMessageBefore }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { lastMessageAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
subject
|
|
||||||
status
|
|
||||||
conversationType
|
|
||||||
isGroup
|
|
||||||
groupName
|
|
||||||
lastMessage
|
|
||||||
lastMessageAt
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
mutation createCourse(
|
|
||||||
$title: String
|
|
||||||
$description: String
|
|
||||||
$thumbnailUrl: String
|
|
||||||
$durationMinutes: Int
|
|
||||||
$xpReward: Int
|
|
||||||
$categoryId: UUID!
|
|
||||||
$levelRequired: String
|
|
||||||
$isCertification: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
course_insert(
|
|
||||||
data: {
|
|
||||||
title: $title
|
|
||||||
description: $description
|
|
||||||
thumbnailUrl: $thumbnailUrl
|
|
||||||
durationMinutes: $durationMinutes
|
|
||||||
xpReward: $xpReward
|
|
||||||
categoryId: $categoryId
|
|
||||||
levelRequired: $levelRequired
|
|
||||||
isCertification: $isCertification
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateCourse(
|
|
||||||
$id: UUID!
|
|
||||||
$title: String
|
|
||||||
$description: String
|
|
||||||
$thumbnailUrl: String
|
|
||||||
$durationMinutes: Int
|
|
||||||
$xpReward: Int
|
|
||||||
$categoryId: UUID!
|
|
||||||
$levelRequired: String
|
|
||||||
$isCertification: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
course_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
title: $title
|
|
||||||
description: $description
|
|
||||||
thumbnailUrl: $thumbnailUrl
|
|
||||||
durationMinutes: $durationMinutes
|
|
||||||
xpReward: $xpReward
|
|
||||||
categoryId: $categoryId
|
|
||||||
levelRequired: $levelRequired
|
|
||||||
isCertification: $isCertification
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteCourse($id: UUID!) @auth(level: USER) {
|
|
||||||
course_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
query listCourses @auth(level: USER) {
|
|
||||||
courses {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
description
|
|
||||||
thumbnailUrl
|
|
||||||
durationMinutes
|
|
||||||
xpReward
|
|
||||||
categoryId
|
|
||||||
levelRequired
|
|
||||||
isCertification
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
category{
|
|
||||||
id
|
|
||||||
label
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getCourseById($id: UUID!) @auth(level: USER) {
|
|
||||||
course(id: $id) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
description
|
|
||||||
thumbnailUrl
|
|
||||||
durationMinutes
|
|
||||||
xpReward
|
|
||||||
categoryId
|
|
||||||
levelRequired
|
|
||||||
isCertification
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
category{
|
|
||||||
id
|
|
||||||
label
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterCourses(
|
|
||||||
$categoryId: UUID
|
|
||||||
$isCertification: Boolean
|
|
||||||
$levelRequired: String
|
|
||||||
$completed: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
courses(
|
|
||||||
where: {
|
|
||||||
categoryId: { eq: $categoryId }
|
|
||||||
isCertification: { eq: $isCertification }
|
|
||||||
levelRequired: { eq: $levelRequired }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
categoryId
|
|
||||||
levelRequired
|
|
||||||
isCertification
|
|
||||||
|
|
||||||
category{
|
|
||||||
id
|
|
||||||
label
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
mutation createCustomRateCard(
|
|
||||||
$name: String!,
|
|
||||||
$baseBook: String,
|
|
||||||
$discount: Float,
|
|
||||||
$isDefault: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
customRateCard_insert(
|
|
||||||
data: {
|
|
||||||
name: $name,
|
|
||||||
baseBook: $baseBook,
|
|
||||||
discount: $discount,
|
|
||||||
isDefault: $isDefault
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateCustomRateCard(
|
|
||||||
$id: UUID!,
|
|
||||||
$name: String,
|
|
||||||
$baseBook: String,
|
|
||||||
$discount: Float,
|
|
||||||
$isDefault: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
customRateCard_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
name: $name,
|
|
||||||
baseBook: $baseBook,
|
|
||||||
discount: $discount,
|
|
||||||
isDefault: $isDefault
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteCustomRateCard($id: UUID!) @auth(level: USER) {
|
|
||||||
customRateCard_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
query listCustomRateCards @auth(level: USER) {
|
|
||||||
customRateCards {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
baseBook
|
|
||||||
discount
|
|
||||||
isDefault
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getCustomRateCardById($id: UUID!) @auth(level: USER) {
|
|
||||||
customRateCard(id: $id) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
baseBook
|
|
||||||
discount
|
|
||||||
isDefault
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
mutation createDocument(
|
|
||||||
$documentType: DocumentType!
|
|
||||||
$name: String!
|
|
||||||
$description: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
document_insert(
|
|
||||||
data: {
|
|
||||||
documentType: $documentType
|
|
||||||
name: $name
|
|
||||||
description: $description
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateDocument(
|
|
||||||
$id: UUID!
|
|
||||||
$documentType: DocumentType
|
|
||||||
$name: String
|
|
||||||
$description: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
document_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
documentType: $documentType
|
|
||||||
name: $name
|
|
||||||
description: $description
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteDocument($id: UUID!) @auth(level: USER) {
|
|
||||||
document_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
query listDocuments @auth(level: USER) {
|
|
||||||
documents {
|
|
||||||
id
|
|
||||||
documentType
|
|
||||||
name
|
|
||||||
description
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getDocumentById($id: UUID!) @auth(level: USER) {
|
|
||||||
document(id: $id) {
|
|
||||||
id
|
|
||||||
documentType
|
|
||||||
name
|
|
||||||
description
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterDocuments(
|
|
||||||
$documentType: DocumentType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
documents(
|
|
||||||
where: {
|
|
||||||
documentType: { eq: $documentType }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
documentType
|
|
||||||
name
|
|
||||||
description
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
mutation createEmergencyContact(
|
|
||||||
$name: String!
|
|
||||||
$phone: String!
|
|
||||||
$relationship: RelationshipType!
|
|
||||||
$staffId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
emergencyContact_insert(
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
phone: $phone
|
|
||||||
relationship: $relationship
|
|
||||||
staffId: $staffId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateEmergencyContact(
|
|
||||||
$id: UUID!
|
|
||||||
$name: String
|
|
||||||
$phone: String
|
|
||||||
$relationship: RelationshipType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
emergencyContact_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
phone: $phone
|
|
||||||
relationship: $relationship
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteEmergencyContact($id: UUID!) @auth(level: USER) {
|
|
||||||
emergencyContact_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
query listEmergencyContacts @auth(level: USER) {
|
|
||||||
emergencyContacts {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
phone
|
|
||||||
relationship
|
|
||||||
staffId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getEmergencyContactById($id: UUID!) @auth(level: USER) {
|
|
||||||
emergencyContact(id: $id) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
phone
|
|
||||||
relationship
|
|
||||||
staffId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getEmergencyContactsByStaffId($staffId: UUID!) @auth(level: USER) {
|
|
||||||
emergencyContacts(where: { staffId: { eq: $staffId } }) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
phone
|
|
||||||
relationship
|
|
||||||
staffId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
mutation createFaqData(
|
|
||||||
$category: String!
|
|
||||||
$questions: [Any!]
|
|
||||||
) @auth(level: USER) {
|
|
||||||
faqData_insert(
|
|
||||||
data: {
|
|
||||||
category: $category
|
|
||||||
questions: $questions
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateFaqData(
|
|
||||||
$id: UUID!
|
|
||||||
$category: String
|
|
||||||
$questions: [Any!]
|
|
||||||
) @auth(level: USER) {
|
|
||||||
faqData_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
category: $category
|
|
||||||
questions: $questions
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteFaqData($id: UUID!) @auth(level: USER) {
|
|
||||||
faqData_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
query listFaqDatas @auth(level: USER) {
|
|
||||||
faqDatas {
|
|
||||||
id
|
|
||||||
category
|
|
||||||
questions
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getFaqDataById($id: UUID!) @auth(level: USER) {
|
|
||||||
faqData(id: $id) {
|
|
||||||
id
|
|
||||||
category
|
|
||||||
questions
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterFaqDatas($category: String) @auth(level: USER) {
|
|
||||||
faqDatas(where: { category: { eq: $category } }) {
|
|
||||||
id
|
|
||||||
category
|
|
||||||
questions
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
mutation createHub(
|
|
||||||
$name: String!
|
|
||||||
$locationName: String
|
|
||||||
$address: String
|
|
||||||
$nfcTagId: String
|
|
||||||
$ownerId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
hub_insert(
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
locationName: $locationName
|
|
||||||
address: $address
|
|
||||||
nfcTagId: $nfcTagId
|
|
||||||
ownerId: $ownerId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateHub(
|
|
||||||
$id: UUID!
|
|
||||||
$name: String
|
|
||||||
$locationName: String
|
|
||||||
$address: String
|
|
||||||
$nfcTagId: String
|
|
||||||
$ownerId: UUID
|
|
||||||
) @auth(level: USER) {
|
|
||||||
hub_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
locationName: $locationName
|
|
||||||
address: $address
|
|
||||||
nfcTagId: $nfcTagId
|
|
||||||
ownerId: $ownerId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteHub($id: UUID!) @auth(level: USER) {
|
|
||||||
hub_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
query listHubs @auth(level: USER) {
|
|
||||||
hubs {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
locationName
|
|
||||||
address
|
|
||||||
nfcTagId
|
|
||||||
ownerId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getHubById($id: UUID!) @auth(level: USER) {
|
|
||||||
hub(id: $id) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
locationName
|
|
||||||
address
|
|
||||||
nfcTagId
|
|
||||||
ownerId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getHubsByOwnerId($ownerId: UUID!) @auth(level: USER) {
|
|
||||||
hubs(where: { ownerId: { eq: $ownerId } }) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
locationName
|
|
||||||
address
|
|
||||||
nfcTagId
|
|
||||||
ownerId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterHubs(
|
|
||||||
$ownerId: UUID
|
|
||||||
$name: String
|
|
||||||
$nfcTagId: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
hubs(
|
|
||||||
where: {
|
|
||||||
ownerId: { eq: $ownerId }
|
|
||||||
name: { eq: $name }
|
|
||||||
nfcTagId: { eq: $nfcTagId }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
locationName
|
|
||||||
address
|
|
||||||
nfcTagId
|
|
||||||
ownerId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
|
|
||||||
mutation createInvoice(
|
|
||||||
$status: InvoiceStatus!
|
|
||||||
|
|
||||||
$vendorId: UUID!
|
|
||||||
$businessId: UUID!
|
|
||||||
$orderId: UUID!
|
|
||||||
|
|
||||||
$paymentTerms: InovicePaymentTerms
|
|
||||||
$invoiceNumber: String!
|
|
||||||
$issueDate: Timestamp!
|
|
||||||
$dueDate: Timestamp!
|
|
||||||
$hub: String
|
|
||||||
$managerName: String
|
|
||||||
$vendorNumber: String
|
|
||||||
$roles: Any
|
|
||||||
$charges: Any
|
|
||||||
$otherCharges: Float
|
|
||||||
$subtotal: Float
|
|
||||||
$amount: Float!
|
|
||||||
$notes: String
|
|
||||||
|
|
||||||
$staffCount: Int
|
|
||||||
$chargesCount: Int
|
|
||||||
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoice_insert(
|
|
||||||
data: {
|
|
||||||
status: $status
|
|
||||||
|
|
||||||
vendorId: $vendorId
|
|
||||||
businessId: $businessId
|
|
||||||
orderId: $orderId
|
|
||||||
|
|
||||||
paymentTerms: $paymentTerms
|
|
||||||
invoiceNumber: $invoiceNumber
|
|
||||||
issueDate: $issueDate
|
|
||||||
dueDate: $dueDate
|
|
||||||
hub: $hub
|
|
||||||
managerName: $managerName
|
|
||||||
vendorNumber: $vendorNumber
|
|
||||||
roles: $roles
|
|
||||||
charges: $charges
|
|
||||||
otherCharges: $otherCharges
|
|
||||||
subtotal: $subtotal
|
|
||||||
amount: $amount
|
|
||||||
notes: $notes
|
|
||||||
|
|
||||||
staffCount: $staffCount
|
|
||||||
chargesCount: $chargesCount
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateInvoice(
|
|
||||||
$id: UUID!
|
|
||||||
|
|
||||||
$status: InvoiceStatus
|
|
||||||
|
|
||||||
$vendorId: UUID
|
|
||||||
$businessId: UUID
|
|
||||||
$orderId: UUID
|
|
||||||
|
|
||||||
$paymentTerms: InovicePaymentTerms
|
|
||||||
$invoiceNumber: String
|
|
||||||
$issueDate: Timestamp
|
|
||||||
$dueDate: Timestamp
|
|
||||||
$hub: String
|
|
||||||
$managerName: String
|
|
||||||
$vendorNumber: String
|
|
||||||
$roles: Any
|
|
||||||
$charges: Any
|
|
||||||
$otherCharges: Float
|
|
||||||
$subtotal: Float
|
|
||||||
$amount: Float
|
|
||||||
$notes: String
|
|
||||||
|
|
||||||
$staffCount: Int
|
|
||||||
$chargesCount: Int
|
|
||||||
|
|
||||||
|
|
||||||
$disputedItems: Any
|
|
||||||
$disputeReason: String
|
|
||||||
$disputeDetails: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoice_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
status: $status
|
|
||||||
|
|
||||||
vendorId: $vendorId
|
|
||||||
businessId: $businessId
|
|
||||||
orderId: $orderId
|
|
||||||
|
|
||||||
paymentTerms: $paymentTerms
|
|
||||||
invoiceNumber: $invoiceNumber
|
|
||||||
issueDate: $issueDate
|
|
||||||
dueDate: $dueDate
|
|
||||||
hub: $hub
|
|
||||||
managerName: $managerName
|
|
||||||
vendorNumber: $vendorNumber
|
|
||||||
roles: $roles
|
|
||||||
charges: $charges
|
|
||||||
otherCharges: $otherCharges
|
|
||||||
subtotal: $subtotal
|
|
||||||
amount: $amount
|
|
||||||
notes: $notes
|
|
||||||
|
|
||||||
staffCount: $staffCount
|
|
||||||
chargesCount: $chargesCount
|
|
||||||
|
|
||||||
disputedItems: $disputedItems
|
|
||||||
disputeReason: $disputeReason
|
|
||||||
disputeDetails: $disputeDetails
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteInvoice($id: UUID!) @auth(level: USER) {
|
|
||||||
invoice_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,568 +0,0 @@
|
|||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST ALL INVOICES (admin/debug)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listInvoices(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
disputedItems
|
|
||||||
disputeReason
|
|
||||||
disputeDetails
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
companyName
|
|
||||||
address
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
businessName
|
|
||||||
address
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
}
|
|
||||||
order {
|
|
||||||
eventName
|
|
||||||
deparment
|
|
||||||
poReference
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET INVOICE BY ID
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getInvoiceById($id: UUID!) @auth(level: USER) {
|
|
||||||
invoice(id: $id) {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
disputedItems
|
|
||||||
disputeReason
|
|
||||||
disputeDetails
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
companyName
|
|
||||||
address
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
businessName
|
|
||||||
address
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
}
|
|
||||||
order {
|
|
||||||
eventName
|
|
||||||
deparment
|
|
||||||
poReference
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST INVOICES BY VENDOR
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listInvoicesByVendorId(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: { vendorId: { eq: $vendorId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { issueDate: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
disputedItems
|
|
||||||
disputeReason
|
|
||||||
disputeDetails
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
companyName
|
|
||||||
address
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
businessName
|
|
||||||
address
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
}
|
|
||||||
order {
|
|
||||||
eventName
|
|
||||||
deparment
|
|
||||||
poReference
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST INVOICES BY BUSINESS
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listInvoicesByBusinessId(
|
|
||||||
$businessId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: { businessId: { eq: $businessId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { issueDate: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
disputedItems
|
|
||||||
disputeReason
|
|
||||||
disputeDetails
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
companyName
|
|
||||||
address
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
businessName
|
|
||||||
address
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
}
|
|
||||||
order {
|
|
||||||
eventName
|
|
||||||
deparment
|
|
||||||
poReference
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST INVOICES BY ORDER
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listInvoicesByOrderId(
|
|
||||||
$orderId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: { orderId: { eq: $orderId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { issueDate: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
disputedItems
|
|
||||||
disputeReason
|
|
||||||
disputeDetails
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
companyName
|
|
||||||
address
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
businessName
|
|
||||||
address
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
}
|
|
||||||
order {
|
|
||||||
eventName
|
|
||||||
deparment
|
|
||||||
poReference
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST INVOICES BY STATUS
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listInvoicesByStatus(
|
|
||||||
$status: InvoiceStatus!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: { status: { eq: $status } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { dueDate: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
disputedItems
|
|
||||||
disputeReason
|
|
||||||
disputeDetails
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
companyName
|
|
||||||
address
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
businessName
|
|
||||||
address
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
}
|
|
||||||
order {
|
|
||||||
eventName
|
|
||||||
deparment
|
|
||||||
poReference
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# FILTER INVOICES (multi filters)
|
|
||||||
# NOTE: Timestamp filters use ge/le (NOT gte/lte)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query filterInvoices(
|
|
||||||
$vendorId: UUID
|
|
||||||
$businessId: UUID
|
|
||||||
$orderId: UUID
|
|
||||||
$status: InvoiceStatus
|
|
||||||
|
|
||||||
$issueDateFrom: Timestamp
|
|
||||||
$issueDateTo: Timestamp
|
|
||||||
|
|
||||||
$dueDateFrom: Timestamp
|
|
||||||
$dueDateTo: Timestamp
|
|
||||||
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: {
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
orderId: { eq: $orderId }
|
|
||||||
status: { eq: $status }
|
|
||||||
|
|
||||||
issueDate: { ge: $issueDateFrom, le: $issueDateTo }
|
|
||||||
dueDate: { ge: $dueDateFrom, le: $dueDateTo }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { issueDate: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
disputedItems
|
|
||||||
disputeReason
|
|
||||||
disputeDetails
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
companyName
|
|
||||||
address
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
businessName
|
|
||||||
address
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
}
|
|
||||||
order {
|
|
||||||
eventName
|
|
||||||
deparment
|
|
||||||
poReference
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# OVERDUE INVOICES (dueDate < now and not PAID)
|
|
||||||
# NOTE: request.time works in @default; for filters, pass $now from client
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listOverdueInvoices(
|
|
||||||
$now: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: {
|
|
||||||
dueDate: { lt: $now }
|
|
||||||
status: { ne: PAID }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { dueDate: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
disputedItems
|
|
||||||
disputeReason
|
|
||||||
disputeDetails
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
companyName
|
|
||||||
address
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
business {
|
|
||||||
businessName
|
|
||||||
address
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
}
|
|
||||||
order {
|
|
||||||
eventName
|
|
||||||
deparment
|
|
||||||
poReference
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
|
|
||||||
mutation createInvoiceTemplate(
|
|
||||||
$name: String!
|
|
||||||
$ownerId: UUID!
|
|
||||||
|
|
||||||
$vendorId: UUID
|
|
||||||
$businessId: UUID
|
|
||||||
$orderId: UUID
|
|
||||||
|
|
||||||
$paymentTerms: InovicePaymentTermsTemp
|
|
||||||
$invoiceNumber: String
|
|
||||||
$issueDate: Timestamp
|
|
||||||
$dueDate: Timestamp
|
|
||||||
$hub: String
|
|
||||||
$managerName: String
|
|
||||||
$vendorNumber: String
|
|
||||||
$roles: Any
|
|
||||||
$charges: Any
|
|
||||||
$otherCharges: Float
|
|
||||||
$subtotal: Float
|
|
||||||
$amount: Float
|
|
||||||
$notes: String
|
|
||||||
|
|
||||||
$staffCount: Int
|
|
||||||
$chargesCount: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoiceTemplate_insert(
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
ownerId: $ownerId
|
|
||||||
|
|
||||||
vendorId: $vendorId
|
|
||||||
businessId: $businessId
|
|
||||||
orderId: $orderId
|
|
||||||
|
|
||||||
paymentTerms: $paymentTerms
|
|
||||||
invoiceNumber: $invoiceNumber
|
|
||||||
issueDate: $issueDate
|
|
||||||
dueDate: $dueDate
|
|
||||||
hub: $hub
|
|
||||||
managerName: $managerName
|
|
||||||
vendorNumber: $vendorNumber
|
|
||||||
roles: $roles
|
|
||||||
charges: $charges
|
|
||||||
otherCharges: $otherCharges
|
|
||||||
subtotal: $subtotal
|
|
||||||
amount: $amount
|
|
||||||
notes: $notes
|
|
||||||
|
|
||||||
staffCount: $staffCount
|
|
||||||
chargesCount: $chargesCount
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateInvoiceTemplate(
|
|
||||||
$id: UUID!
|
|
||||||
|
|
||||||
$name: String
|
|
||||||
$ownerId: UUID
|
|
||||||
|
|
||||||
$vendorId: UUID
|
|
||||||
$businessId: UUID
|
|
||||||
$orderId: UUID
|
|
||||||
|
|
||||||
$paymentTerms: InovicePaymentTermsTemp
|
|
||||||
$invoiceNumber: String
|
|
||||||
$issueDate: Timestamp
|
|
||||||
$dueDate: Timestamp
|
|
||||||
$hub: String
|
|
||||||
$managerName: String
|
|
||||||
$vendorNumber: String
|
|
||||||
$roles: Any
|
|
||||||
$charges: Any
|
|
||||||
$otherCharges: Float
|
|
||||||
$subtotal: Float
|
|
||||||
$amount: Float
|
|
||||||
$notes: String
|
|
||||||
|
|
||||||
$staffCount: Int
|
|
||||||
$chargesCount: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoiceTemplate_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
ownerId: $ownerId
|
|
||||||
|
|
||||||
vendorId: $vendorId
|
|
||||||
businessId: $businessId
|
|
||||||
orderId: $orderId
|
|
||||||
|
|
||||||
paymentTerms: $paymentTerms
|
|
||||||
invoiceNumber: $invoiceNumber
|
|
||||||
issueDate: $issueDate
|
|
||||||
dueDate: $dueDate
|
|
||||||
hub: $hub
|
|
||||||
managerName: $managerName
|
|
||||||
vendorNumber: $vendorNumber
|
|
||||||
roles: $roles
|
|
||||||
charges: $charges
|
|
||||||
otherCharges: $otherCharges
|
|
||||||
subtotal: $subtotal
|
|
||||||
amount: $amount
|
|
||||||
notes: $notes
|
|
||||||
|
|
||||||
staffCount: $staffCount
|
|
||||||
chargesCount: $chargesCount
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteInvoiceTemplate($id: UUID!) @auth(level: USER) {
|
|
||||||
invoiceTemplate_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,325 +0,0 @@
|
|||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listInvoiceTemplates(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoiceTemplates(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
ownerId
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName email contactName }
|
|
||||||
order { id eventName status orderType }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# GET BY ID
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query getInvoiceTemplateById($id: UUID!) @auth(level: USER) {
|
|
||||||
invoiceTemplate(id: $id) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
ownerId
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName email contactName }
|
|
||||||
order { id eventName status orderType }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY OWNER (my templates)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listInvoiceTemplatesByOwnerId(
|
|
||||||
$ownerId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoiceTemplates(
|
|
||||||
where: { ownerId: { eq: $ownerId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { updatedAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
ownerId
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName email contactName }
|
|
||||||
order { id eventName status orderType }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY VENDOR (templates tied to a vendor)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listInvoiceTemplatesByVendorId(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoiceTemplates(
|
|
||||||
where: { vendorId: { eq: $vendorId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { updatedAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
ownerId
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName email contactName }
|
|
||||||
order { id eventName status orderType }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY BUSINESS (templates tied to a business)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listInvoiceTemplatesByBusinessId(
|
|
||||||
$businessId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoiceTemplates(
|
|
||||||
where: { businessId: { eq: $businessId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { updatedAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
ownerId
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName email contactName }
|
|
||||||
order { id eventName status orderType }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY ORDER (templates tied to a specific order)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listInvoiceTemplatesByOrderId(
|
|
||||||
$orderId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoiceTemplates(
|
|
||||||
where: { orderId: { eq: $orderId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { updatedAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
ownerId
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName email contactName }
|
|
||||||
order { id eventName status orderType }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# SEARCH (by name) within an owner
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query searchInvoiceTemplatesByOwnerAndName(
|
|
||||||
$ownerId: UUID!
|
|
||||||
$name: String!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoiceTemplates(
|
|
||||||
where: {
|
|
||||||
ownerId: { eq: $ownerId }
|
|
||||||
name: { eq: $name }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { updatedAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
ownerId
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderId
|
|
||||||
|
|
||||||
paymentTerms
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
hub
|
|
||||||
managerName
|
|
||||||
vendorNumber
|
|
||||||
roles
|
|
||||||
charges
|
|
||||||
otherCharges
|
|
||||||
subtotal
|
|
||||||
amount
|
|
||||||
notes
|
|
||||||
staffCount
|
|
||||||
chargesCount
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName email contactName }
|
|
||||||
order { id eventName status orderType }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
mutation createLevel(
|
|
||||||
$name: String!
|
|
||||||
$xpRequired: Int!
|
|
||||||
$icon: String
|
|
||||||
$colors: Any
|
|
||||||
) @auth(level: USER) {
|
|
||||||
level_insert(
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
xpRequired: $xpRequired
|
|
||||||
icon: $icon
|
|
||||||
colors: $colors
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateLevel(
|
|
||||||
$id: UUID!
|
|
||||||
$name: String
|
|
||||||
$xpRequired: Int
|
|
||||||
$icon: String
|
|
||||||
$colors: Any
|
|
||||||
) @auth(level: USER) {
|
|
||||||
level_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
xpRequired: $xpRequired
|
|
||||||
icon: $icon
|
|
||||||
colors: $colors
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteLevel($id: UUID!) @auth(level: USER) {
|
|
||||||
level_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
query listLevels @auth(level: USER) {
|
|
||||||
levels {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
xpRequired
|
|
||||||
icon
|
|
||||||
colors
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getLevelById($id: UUID!) @auth(level: USER) {
|
|
||||||
level(id: $id) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
xpRequired
|
|
||||||
icon
|
|
||||||
colors
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterLevels(
|
|
||||||
$name: String
|
|
||||||
$xpRequired: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
levels(
|
|
||||||
where: {
|
|
||||||
name: { eq: $name }
|
|
||||||
xpRequired: { eq: $xpRequired }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
xpRequired
|
|
||||||
icon
|
|
||||||
colors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
|
|
||||||
mutation createMemberTask(
|
|
||||||
$teamMemberId: UUID!
|
|
||||||
$taskId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
memberTask_insert(
|
|
||||||
data: {
|
|
||||||
teamMemberId: $teamMemberId
|
|
||||||
taskId: $taskId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteMemberTask(
|
|
||||||
$teamMemberId: UUID!
|
|
||||||
$taskId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
memberTask_delete(
|
|
||||||
key: { teamMemberId: $teamMemberId, taskId: $taskId }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
|
|
||||||
query getMyTasks($teamMemberId: UUID!) @auth(level: USER) {
|
|
||||||
memberTasks(where: { teamMemberId: { eq: $teamMemberId } }) {
|
|
||||||
id
|
|
||||||
task {
|
|
||||||
id
|
|
||||||
taskName
|
|
||||||
description
|
|
||||||
status
|
|
||||||
dueDate
|
|
||||||
progress
|
|
||||||
priority
|
|
||||||
}
|
|
||||||
|
|
||||||
teamMember{
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#before named getMemberTaskByIdKey
|
|
||||||
query getMemberTaskByIdKey(
|
|
||||||
$teamMemberId: UUID!
|
|
||||||
$taskId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
memberTask(key: { teamMemberId: $teamMemberId, taskId: $taskId }) {
|
|
||||||
id
|
|
||||||
task {
|
|
||||||
id
|
|
||||||
taskName
|
|
||||||
description
|
|
||||||
status
|
|
||||||
dueDate
|
|
||||||
progress
|
|
||||||
priority
|
|
||||||
}
|
|
||||||
|
|
||||||
teamMember{
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getMemberTasksByTaskId($taskId: UUID!) @auth(level: USER) {
|
|
||||||
memberTasks(where: { taskId: { eq: $taskId } }) {
|
|
||||||
id
|
|
||||||
task {
|
|
||||||
id
|
|
||||||
taskName
|
|
||||||
description
|
|
||||||
status
|
|
||||||
dueDate
|
|
||||||
progress
|
|
||||||
priority
|
|
||||||
}
|
|
||||||
|
|
||||||
teamMember{
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
mutation createMessage(
|
|
||||||
$conversationId: UUID!,
|
|
||||||
$senderId: String!,
|
|
||||||
$content: String!,
|
|
||||||
$isSystem: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
message_insert(
|
|
||||||
data: {
|
|
||||||
conversationId: $conversationId,
|
|
||||||
senderId: $senderId,
|
|
||||||
content: $content,
|
|
||||||
isSystem: $isSystem
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateMessage(
|
|
||||||
$id: UUID!,
|
|
||||||
$conversationId: UUID,
|
|
||||||
$senderId: String,
|
|
||||||
$content: String,
|
|
||||||
$isSystem: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
message_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
conversationId: $conversationId,
|
|
||||||
senderId: $senderId,
|
|
||||||
content: $content,
|
|
||||||
isSystem: $isSystem
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteMessage($id: UUID!) @auth(level: USER) {
|
|
||||||
message_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
query listMessages @auth(level: USER) {
|
|
||||||
messages {
|
|
||||||
id
|
|
||||||
conversationId
|
|
||||||
senderId
|
|
||||||
content
|
|
||||||
isSystem
|
|
||||||
createdAt
|
|
||||||
user{
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getMessageById($id: UUID!) @auth(level: USER) {
|
|
||||||
message(id: $id) {
|
|
||||||
id
|
|
||||||
conversationId
|
|
||||||
senderId
|
|
||||||
content
|
|
||||||
isSystem
|
|
||||||
createdAt
|
|
||||||
user{
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getMessagesByConversationId($conversationId: UUID!) @auth(level: USER) {
|
|
||||||
messages(where: { conversationId: { eq: $conversationId } }) {
|
|
||||||
id
|
|
||||||
conversationId
|
|
||||||
senderId
|
|
||||||
content
|
|
||||||
isSystem
|
|
||||||
createdAt
|
|
||||||
user{
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
mutation createOrder(
|
|
||||||
$vendorId: UUID
|
|
||||||
$businessId: UUID!
|
|
||||||
$orderType: OrderType!
|
|
||||||
#$location: String
|
|
||||||
$status: OrderStatus
|
|
||||||
$date: Timestamp
|
|
||||||
$startDate: Timestamp
|
|
||||||
$endDate: Timestamp
|
|
||||||
$duration: OrderDuration
|
|
||||||
$lunchBreak: Int
|
|
||||||
$total: Float
|
|
||||||
$eventName: String
|
|
||||||
$assignedStaff: Any
|
|
||||||
$shifts: Any
|
|
||||||
$requested: Int
|
|
||||||
$teamHubId: UUID!
|
|
||||||
$recurringDays: Any
|
|
||||||
$permanentStartDate: Timestamp
|
|
||||||
$permanentDays: Any
|
|
||||||
$notes: String
|
|
||||||
$detectedConflicts: Any
|
|
||||||
$poReference: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
order_insert(
|
|
||||||
data: {
|
|
||||||
vendorId: $vendorId
|
|
||||||
businessId: $businessId
|
|
||||||
orderType: $orderType
|
|
||||||
#location: $location
|
|
||||||
status: $status
|
|
||||||
date: $date
|
|
||||||
startDate: $startDate
|
|
||||||
endDate: $endDate
|
|
||||||
duration: $duration
|
|
||||||
lunchBreak: $lunchBreak
|
|
||||||
total: $total
|
|
||||||
eventName: $eventName
|
|
||||||
assignedStaff: $assignedStaff
|
|
||||||
shifts: $shifts
|
|
||||||
requested: $requested
|
|
||||||
teamHubId: $teamHubId
|
|
||||||
recurringDays: $recurringDays
|
|
||||||
permanentDays: $permanentDays
|
|
||||||
notes: $notes
|
|
||||||
detectedConflicts: $detectedConflicts
|
|
||||||
poReference: $poReference
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateOrder(
|
|
||||||
$id: UUID!
|
|
||||||
$vendorId: UUID
|
|
||||||
$businessId: UUID
|
|
||||||
#$location: String
|
|
||||||
$status: OrderStatus
|
|
||||||
$date: Timestamp
|
|
||||||
$startDate: Timestamp
|
|
||||||
$endDate: Timestamp
|
|
||||||
$total: Float
|
|
||||||
$eventName: String
|
|
||||||
$assignedStaff: Any
|
|
||||||
$shifts: Any
|
|
||||||
$requested: Int
|
|
||||||
$teamHubId: UUID!
|
|
||||||
$recurringDays: Any
|
|
||||||
$permanentDays: Any
|
|
||||||
$notes: String
|
|
||||||
$detectedConflicts: Any
|
|
||||||
$poReference: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
order_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
vendorId: $vendorId
|
|
||||||
businessId: $businessId
|
|
||||||
#location: $location
|
|
||||||
status: $status
|
|
||||||
date: $date
|
|
||||||
startDate: $startDate
|
|
||||||
endDate: $endDate
|
|
||||||
total: $total
|
|
||||||
eventName: $eventName
|
|
||||||
assignedStaff: $assignedStaff
|
|
||||||
shifts: $shifts
|
|
||||||
requested: $requested
|
|
||||||
teamHubId: $teamHubId
|
|
||||||
recurringDays: $recurringDays
|
|
||||||
permanentDays: $permanentDays
|
|
||||||
notes: $notes
|
|
||||||
detectedConflicts: $detectedConflicts
|
|
||||||
poReference: $poReference
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteOrder($id: UUID!) @auth(level: USER) {
|
|
||||||
order_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,435 +0,0 @@
|
|||||||
# ------------------------------------------------------------
|
|
||||||
# LIST ALL ORDERS
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listOrders(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
#location
|
|
||||||
status
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
duration
|
|
||||||
lunchBreak
|
|
||||||
total
|
|
||||||
assignedStaff
|
|
||||||
shifts
|
|
||||||
requested
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
poReference
|
|
||||||
detectedConflicts
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET ORDER BY ID
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getOrderById($id: UUID!) @auth(level: USER) {
|
|
||||||
order(id: $id) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
#location
|
|
||||||
status
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
duration
|
|
||||||
lunchBreak
|
|
||||||
total
|
|
||||||
assignedStaff
|
|
||||||
shifts
|
|
||||||
requested
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
poReference
|
|
||||||
detectedConflicts
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET ORDERS BY BUSINESS
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getOrdersByBusinessId(
|
|
||||||
$businessId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(
|
|
||||||
where: { businessId: { eq: $businessId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
#location
|
|
||||||
status
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
duration
|
|
||||||
lunchBreak
|
|
||||||
total
|
|
||||||
assignedStaff
|
|
||||||
shifts
|
|
||||||
requested
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
poReference
|
|
||||||
detectedConflicts
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET ORDERS BY VENDOR
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getOrdersByVendorId(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(
|
|
||||||
where: { vendorId: { eq: $vendorId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
#location
|
|
||||||
status
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
duration
|
|
||||||
lunchBreak
|
|
||||||
total
|
|
||||||
assignedStaff
|
|
||||||
shifts
|
|
||||||
requested
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
poReference
|
|
||||||
detectedConflicts
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET ORDERS BY STATUS
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getOrdersByStatus(
|
|
||||||
$status: OrderStatus!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(
|
|
||||||
where: { status: { eq: $status } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
#location
|
|
||||||
status
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
duration
|
|
||||||
lunchBreak
|
|
||||||
total
|
|
||||||
assignedStaff
|
|
||||||
shifts
|
|
||||||
requested
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
poReference
|
|
||||||
detectedConflicts
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET ORDERS BY DATE RANGE
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getOrdersByDateRange(
|
|
||||||
$start: Timestamp!
|
|
||||||
$end: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(
|
|
||||||
where: {
|
|
||||||
date: { ge: $start, le: $end }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
#location
|
|
||||||
status
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
duration
|
|
||||||
lunchBreak
|
|
||||||
total
|
|
||||||
assignedStaff
|
|
||||||
shifts
|
|
||||||
requested
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
poReference
|
|
||||||
detectedConflicts
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET RAPID ORDERS
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getRapidOrders(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(
|
|
||||||
where: { orderType: { eq: RAPID } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
#location
|
|
||||||
status
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
duration
|
|
||||||
lunchBreak
|
|
||||||
total
|
|
||||||
assignedStaff
|
|
||||||
shifts
|
|
||||||
requested
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
poReference
|
|
||||||
detectedConflicts
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
business {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
email
|
|
||||||
contactName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor {
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#to validate if an hub has orders before delete
|
|
||||||
query listOrdersByBusinessAndTeamHub(
|
|
||||||
$businessId: UUID!
|
|
||||||
$teamHubId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(
|
|
||||||
where: {
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
teamHubId: { eq: $teamHubId }
|
|
||||||
#status: {in: [ DRAFT POSTED FILLED PENDING FULLY_STAFFED PARTIAL_STAFFED ] }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
orderType
|
|
||||||
status
|
|
||||||
duration
|
|
||||||
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
teamHubId
|
|
||||||
|
|
||||||
date
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
|
|
||||||
requested
|
|
||||||
total
|
|
||||||
notes
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
mutation createRecentPayment(
|
|
||||||
$workedTime: String
|
|
||||||
$status: RecentPaymentStatus
|
|
||||||
$staffId: UUID!
|
|
||||||
$applicationId: UUID!
|
|
||||||
$invoiceId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayment_insert(
|
|
||||||
data: {
|
|
||||||
workedTime: $workedTime
|
|
||||||
status: $status
|
|
||||||
staffId: $staffId
|
|
||||||
applicationId: $applicationId
|
|
||||||
invoiceId: $invoiceId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateRecentPayment(
|
|
||||||
$id: UUID!
|
|
||||||
$workedTime: String
|
|
||||||
$status: RecentPaymentStatus
|
|
||||||
$staffId: UUID
|
|
||||||
$applicationId: UUID
|
|
||||||
$invoiceId: UUID
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayment_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
workedTime: $workedTime
|
|
||||||
status: $status
|
|
||||||
staffId: $staffId
|
|
||||||
applicationId: $applicationId
|
|
||||||
invoiceId: $invoiceId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteRecentPayment($id: UUID!) @auth(level: USER) {
|
|
||||||
recentPayment_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,483 +0,0 @@
|
|||||||
# ------------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listRecentPayments(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayments(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
workedTime
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
applicationId
|
|
||||||
invoiceId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
application {
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
|
|
||||||
role {
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift {
|
|
||||||
title
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice {
|
|
||||||
status
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
order { id eventName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET BY ID
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getRecentPaymentById($id: UUID!) @auth(level: USER) {
|
|
||||||
recentPayment(id: $id) {
|
|
||||||
id
|
|
||||||
workedTime
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
applicationId
|
|
||||||
invoiceId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
application {
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
|
|
||||||
shiftRole {
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
|
|
||||||
role {
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift {
|
|
||||||
title
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice {
|
|
||||||
status
|
|
||||||
invoiceNumber
|
|
||||||
issueDate
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
order { id eventName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST BY STAFF (Staff view)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listRecentPaymentsByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayments(
|
|
||||||
where: { staffId: { eq: $staffId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workedTime
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
applicationId
|
|
||||||
invoiceId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
application {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
shiftRole {
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
|
|
||||||
role { id name costPerHour }
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
locationAddress
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
status
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
amount
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST BY APPLICATION (debug / trace)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listRecentPaymentsByApplicationId(
|
|
||||||
$applicationId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayments(
|
|
||||||
where: { applicationId: { eq: $applicationId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workedTime
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
applicationId
|
|
||||||
invoiceId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
application {
|
|
||||||
id
|
|
||||||
status
|
|
||||||
shiftRole {
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role { id name costPerHour }
|
|
||||||
shift { id title date locationAddress }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
status
|
|
||||||
amount
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST BY INVOICE (Vendor/Business can see all payments for invoice)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listRecentPaymentsByInvoiceId(
|
|
||||||
$invoiceId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayments(
|
|
||||||
where: { invoiceId: { eq: $invoiceId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workedTime
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
applicationId
|
|
||||||
invoiceId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
application {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
shiftRole {
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role { id name costPerHour }
|
|
||||||
shift { id title date locationAddress }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
status
|
|
||||||
amount
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# FILTER BY STATUS (common)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listRecentPaymentsByStatus(
|
|
||||||
$status: RecentPaymentStatus!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayments(
|
|
||||||
where: { status: { eq: $status } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workedTime
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
applicationId
|
|
||||||
invoiceId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
application {
|
|
||||||
id
|
|
||||||
shiftRole {
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role { id name costPerHour }
|
|
||||||
shift { id title date locationAddress }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
status
|
|
||||||
amount
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# BY BUSINESS (2-step)
|
|
||||||
# Step 2: pass invoiceIds (from query: listInvoicesByBusinessId)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listRecentPaymentsByInvoiceIds(
|
|
||||||
$invoiceIds: [UUID!]!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayments(
|
|
||||||
where: { invoiceId: { in: $invoiceIds } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workedTime
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
applicationId
|
|
||||||
invoiceId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
application {
|
|
||||||
id
|
|
||||||
shiftRole {
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role { id name costPerHour }
|
|
||||||
shift { id title date locationAddress }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
status
|
|
||||||
amount
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST BY BUSINESS ID (direct)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listRecentPaymentsByBusinessId(
|
|
||||||
$businessId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
recentPayments(
|
|
||||||
where: {
|
|
||||||
invoice: {
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workedTime
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
applicationId
|
|
||||||
invoiceId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
application {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
shiftRole {
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
|
|
||||||
role { id name costPerHour }
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
status
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
amount
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,455 +0,0 @@
|
|||||||
# ==========================================================
|
|
||||||
# Reports Connector - For MVP
|
|
||||||
# ==========================================================
|
|
||||||
# This file exposes SOURCE-DATA queries for all report screens.
|
|
||||||
# All aggregation (group by day/week, percentages, averages)
|
|
||||||
# is intentionally done on the client (Flutter).
|
|
||||||
#
|
|
||||||
# Entities used:
|
|
||||||
# - Shift
|
|
||||||
# - Application
|
|
||||||
# - Staff
|
|
||||||
# - Invoice
|
|
||||||
# - TimeSheet
|
|
||||||
#
|
|
||||||
# NOTE:
|
|
||||||
# Data Connect does NOT support custom root resolvers.
|
|
||||||
# These queries return raw rows from @table entities.
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
|
|
||||||
# ==========================================================
|
|
||||||
# 1) COVERAGE REPORT (Next 7 days)
|
|
||||||
# ==========================================================
|
|
||||||
# Coverage definition:
|
|
||||||
# - Needed: sum(Shift.workersNeeded) grouped by date
|
|
||||||
# - Confirmed: count(Application) where status IN (...)
|
|
||||||
#
|
|
||||||
# Client groups by Shift.date and calculates:
|
|
||||||
# coveragePercentage = confirmed / needed * 100
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
query listShiftsForCoverage(
|
|
||||||
$businessId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
date: { ge: $startDate, le: $endDate }
|
|
||||||
}
|
|
||||||
orderBy: { date: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
date
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#I comment here because I have an error en sdk
|
|
||||||
query listApplicationsForCoverage(
|
|
||||||
$shiftIds: [UUID!]!
|
|
||||||
#$statuses: [ApplicationStatus!]!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(
|
|
||||||
where: {
|
|
||||||
shiftId: { in: $shiftIds }
|
|
||||||
#status: { in: $statuses }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# ==========================================================
|
|
||||||
# 2) DAILY OPS REPORT (Single day)
|
|
||||||
# ==========================================================
|
|
||||||
# Metrics derived on client:
|
|
||||||
# - scheduledShifts = shifts.length
|
|
||||||
# - workersConfirmed = confirmedApps / totalNeeded
|
|
||||||
# - inProgressShifts = status == IN_PROGRESS
|
|
||||||
# - completedShifts = status == COMPLETED
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
query listShiftsForDailyOpsByBusiness(
|
|
||||||
$businessId: UUID!
|
|
||||||
$date: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
date: { eq: $date }
|
|
||||||
}
|
|
||||||
orderBy: { startTime: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
location
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listShiftsForDailyOpsByVendor(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$date: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { vendorId: { eq: $vendorId } }
|
|
||||||
date: { eq: $date }
|
|
||||||
}
|
|
||||||
orderBy: { startTime: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
location
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listApplicationsForDailyOps(
|
|
||||||
$shiftIds: [UUID!]!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(where: { shiftId: { in: $shiftIds } }) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# ==========================================================
|
|
||||||
# 3) FORECAST REPORT (Next N weeks)
|
|
||||||
# ==========================================================
|
|
||||||
# Projected spend formula (client):
|
|
||||||
# projectedCost = workersNeeded * hours * hourlyRate
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
query listShiftsForForecastByBusiness(
|
|
||||||
$businessId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
date: { ge: $startDate, le: $endDate }
|
|
||||||
}
|
|
||||||
orderBy: { date: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
date
|
|
||||||
workersNeeded
|
|
||||||
hours
|
|
||||||
cost
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listShiftsForForecastByVendor(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { vendorId: { eq: $vendorId } }
|
|
||||||
date: { ge: $startDate, le: $endDate }
|
|
||||||
}
|
|
||||||
orderBy: { date: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
date
|
|
||||||
workersNeeded
|
|
||||||
hours
|
|
||||||
cost
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ==========================================================
|
|
||||||
# 4) NO-SHOW REPORT (Historical range)
|
|
||||||
# ==========================================================
|
|
||||||
# Now fully supported because ApplicationStatus includes NO_SHOW.
|
|
||||||
#
|
|
||||||
# Metrics:
|
|
||||||
# - totalNoShows = count(status == NO_SHOW)
|
|
||||||
# - noShowRate = noShows / totalApplications
|
|
||||||
# - breakdown by staff
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
query listShiftsForNoShowRangeByBusiness(
|
|
||||||
$businessId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
date: { ge: $startDate, le: $endDate }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
date
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listShiftsForNoShowRangeByVendor(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { vendorId: { eq: $vendorId } }
|
|
||||||
date: { ge: $startDate, le: $endDate }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
date
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
query listApplicationsForNoShowRange(
|
|
||||||
$shiftIds: [UUID!]!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(where: { shiftId: { in: $shiftIds } }) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffForNoShowReport(
|
|
||||||
$staffIds: [UUID!]!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffs(where: { id: { in: $staffIds } }) {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
noShowCount
|
|
||||||
reliabilityScore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# ==========================================================
|
|
||||||
# 5) SPEND REPORT (Financial)
|
|
||||||
# ==========================================================
|
|
||||||
# Uses Invoice as source of truth for money.
|
|
||||||
# Filter is now based on:
|
|
||||||
# - businessId (business dashboard)
|
|
||||||
# - vendorId (vendor dashboard)
|
|
||||||
# since Invoice no longer has ownerId.
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
query listInvoicesForSpendByBusiness(
|
|
||||||
$businessId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: {
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
issueDate: { ge: $startDate, le: $endDate }
|
|
||||||
}
|
|
||||||
orderBy: { issueDate: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
amount
|
|
||||||
status
|
|
||||||
invoiceNumber
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName }
|
|
||||||
order { id eventName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listInvoicesForSpendByVendor(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: {
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
issueDate: { ge: $startDate, le: $endDate }
|
|
||||||
}
|
|
||||||
orderBy: { issueDate: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
amount
|
|
||||||
status
|
|
||||||
invoiceNumber
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName }
|
|
||||||
order { id eventName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Optional: Spend by Order (if you need it)
|
|
||||||
query listInvoicesForSpendByOrder(
|
|
||||||
$orderId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: {
|
|
||||||
orderId: { eq: $orderId }
|
|
||||||
issueDate: { ge: $startDate, le: $endDate }
|
|
||||||
}
|
|
||||||
orderBy: { issueDate: ASC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
amount
|
|
||||||
status
|
|
||||||
invoiceNumber
|
|
||||||
|
|
||||||
vendor { id companyName }
|
|
||||||
business { id businessName }
|
|
||||||
order { id eventName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listTimesheetsForSpend(
|
|
||||||
$startTime: Timestamp!
|
|
||||||
$endTime: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: {
|
|
||||||
shift: {
|
|
||||||
date: { ge: $startTime, le: $endTime }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
|
|
||||||
shift{
|
|
||||||
title
|
|
||||||
location
|
|
||||||
status
|
|
||||||
date
|
|
||||||
|
|
||||||
order{
|
|
||||||
business{
|
|
||||||
businessName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
role{
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# ==========================================================
|
|
||||||
# 6) PERFORMANCE REPORT (Historical KPIs)
|
|
||||||
# ==========================================================
|
|
||||||
# Metrics derivable:
|
|
||||||
# - fillRate
|
|
||||||
# - completionRate
|
|
||||||
# - onTimeRate
|
|
||||||
# - avgFillTimeHours (NOW POSSIBLE 🎉)
|
|
||||||
#
|
|
||||||
# avgFillTimeHours formula:
|
|
||||||
# (filledAt - createdAt) averaged across FILLED shifts
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
query listShiftsForPerformanceByBusiness(
|
|
||||||
$businessId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
date: { ge: $startDate, le: $endDate }
|
|
||||||
filledAt: { isNull: false }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
status
|
|
||||||
createdAt
|
|
||||||
filledAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listShiftsForPerformanceByVendor(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$startDate: Timestamp!
|
|
||||||
$endDate: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { vendorId: { eq: $vendorId } }
|
|
||||||
date: { ge: $startDate, le: $endDate }
|
|
||||||
filledAt: { isNull: false }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
status
|
|
||||||
createdAt
|
|
||||||
filledAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listApplicationsForPerformance(
|
|
||||||
$shiftIds: [UUID!]!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
applications(where: { shiftId: { in: $shiftIds } }) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
staffId
|
|
||||||
status
|
|
||||||
checkInTime
|
|
||||||
checkOutTime
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffForPerformance(
|
|
||||||
$staffIds: [UUID!]!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffs(where: { id: { in: $staffIds } }) {
|
|
||||||
id
|
|
||||||
averageRating
|
|
||||||
onTimeRate
|
|
||||||
noShowCount
|
|
||||||
reliabilityScore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
mutation createRole(
|
|
||||||
$name: String!
|
|
||||||
$costPerHour: Float!
|
|
||||||
$vendorId: UUID!
|
|
||||||
$roleCategoryId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
role_insert(
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
costPerHour: $costPerHour
|
|
||||||
vendorId: $vendorId
|
|
||||||
roleCategoryId: $roleCategoryId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
mutation updateRole(
|
|
||||||
$id: UUID!
|
|
||||||
$name: String
|
|
||||||
$costPerHour: Float
|
|
||||||
$roleCategoryId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
role_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
costPerHour: $costPerHour
|
|
||||||
roleCategoryId: $roleCategoryId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteRole($id: UUID!) @auth(level: USER) {
|
|
||||||
role_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
query listRoles @auth(level: USER) {
|
|
||||||
roles {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
vendorId
|
|
||||||
roleCategoryId
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getRoleById($id: UUID!) @auth(level: USER) {
|
|
||||||
role(id: $id) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
vendorId
|
|
||||||
roleCategoryId
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listRolesByVendorId($vendorId: UUID!) @auth(level: USER) {
|
|
||||||
roles(where: { vendorId: { eq: $vendorId } }) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
vendorId
|
|
||||||
roleCategoryId
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listRolesByroleCategoryId($roleCategoryId: UUID!) @auth(level: USER) {
|
|
||||||
roles(where: { roleCategoryId: { eq: $roleCategoryId } }) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
vendorId
|
|
||||||
roleCategoryId
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
mutation createRoleCategory(
|
|
||||||
$roleName: String!,
|
|
||||||
$category: RoleCategoryType!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
roleCategory_insert(
|
|
||||||
data: {
|
|
||||||
roleName: $roleName,
|
|
||||||
category: $category
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateRoleCategory(
|
|
||||||
$id: UUID!,
|
|
||||||
$roleName: String,
|
|
||||||
$category: RoleCategoryType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
roleCategory_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
roleName: $roleName,
|
|
||||||
category: $category
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteRoleCategory($id: UUID!) @auth(level: USER) {
|
|
||||||
roleCategory_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
query listRoleCategories @auth(level: USER) {
|
|
||||||
roleCategories {
|
|
||||||
id
|
|
||||||
roleName
|
|
||||||
category
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getRoleCategoryById($id: UUID!) @auth(level: USER) {
|
|
||||||
roleCategory(id: $id) {
|
|
||||||
id
|
|
||||||
roleName
|
|
||||||
category
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getRoleCategoriesByCategory($category: RoleCategoryType!) @auth(level: USER) {
|
|
||||||
roleCategories(where: { category: { eq: $category } }) {
|
|
||||||
id
|
|
||||||
roleName
|
|
||||||
category
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
|
|
||||||
mutation createShift(
|
|
||||||
$title: String!
|
|
||||||
$orderId: UUID!
|
|
||||||
|
|
||||||
$date: Timestamp
|
|
||||||
$startTime: Timestamp
|
|
||||||
$endTime: Timestamp
|
|
||||||
$hours: Float
|
|
||||||
$cost: Float
|
|
||||||
|
|
||||||
$location: String
|
|
||||||
$locationAddress: String
|
|
||||||
$latitude: Float
|
|
||||||
$longitude: Float
|
|
||||||
$placeId: String
|
|
||||||
$city: String
|
|
||||||
$state: String
|
|
||||||
$street: String
|
|
||||||
$country: String
|
|
||||||
$description: String
|
|
||||||
|
|
||||||
$status: ShiftStatus
|
|
||||||
$workersNeeded: Int
|
|
||||||
$filled: Int
|
|
||||||
$filledAt: Timestamp
|
|
||||||
|
|
||||||
$managers: [Any!]
|
|
||||||
$durationDays: Int
|
|
||||||
|
|
||||||
$createdBy: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shift_insert(
|
|
||||||
data: {
|
|
||||||
title: $title
|
|
||||||
orderId: $orderId
|
|
||||||
|
|
||||||
date: $date
|
|
||||||
startTime: $startTime
|
|
||||||
endTime: $endTime
|
|
||||||
hours: $hours
|
|
||||||
cost: $cost
|
|
||||||
|
|
||||||
location: $location
|
|
||||||
locationAddress: $locationAddress
|
|
||||||
latitude: $latitude
|
|
||||||
longitude: $longitude
|
|
||||||
placeId: $placeId
|
|
||||||
city: $city
|
|
||||||
state: $state
|
|
||||||
street: $street
|
|
||||||
country: $country
|
|
||||||
description: $description
|
|
||||||
|
|
||||||
status: $status
|
|
||||||
workersNeeded: $workersNeeded
|
|
||||||
filled: $filled
|
|
||||||
filledAt: $filledAt
|
|
||||||
|
|
||||||
managers: $managers
|
|
||||||
durationDays: $durationDays
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateShift(
|
|
||||||
$id: UUID!
|
|
||||||
$title: String
|
|
||||||
$orderId: UUID
|
|
||||||
|
|
||||||
$date: Timestamp
|
|
||||||
$startTime: Timestamp
|
|
||||||
$endTime: Timestamp
|
|
||||||
$hours: Float
|
|
||||||
$cost: Float
|
|
||||||
|
|
||||||
$location: String
|
|
||||||
$locationAddress: String
|
|
||||||
$latitude: Float
|
|
||||||
$longitude: Float
|
|
||||||
$placeId: String
|
|
||||||
$city: String
|
|
||||||
$state: String
|
|
||||||
$street: String
|
|
||||||
$country: String
|
|
||||||
$description: String
|
|
||||||
|
|
||||||
$status: ShiftStatus
|
|
||||||
$workersNeeded: Int
|
|
||||||
$filled: Int
|
|
||||||
$filledAt: Timestamp
|
|
||||||
|
|
||||||
$managers: [Any!]
|
|
||||||
$durationDays: Int
|
|
||||||
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shift_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
title: $title
|
|
||||||
orderId: $orderId
|
|
||||||
|
|
||||||
date: $date
|
|
||||||
startTime: $startTime
|
|
||||||
endTime: $endTime
|
|
||||||
hours: $hours
|
|
||||||
cost: $cost
|
|
||||||
|
|
||||||
location: $location
|
|
||||||
locationAddress: $locationAddress
|
|
||||||
latitude: $latitude
|
|
||||||
longitude: $longitude
|
|
||||||
placeId: $placeId
|
|
||||||
city: $city
|
|
||||||
state: $state
|
|
||||||
street: $street
|
|
||||||
country: $country
|
|
||||||
description: $description
|
|
||||||
|
|
||||||
status: $status
|
|
||||||
workersNeeded: $workersNeeded
|
|
||||||
filled: $filled
|
|
||||||
filledAt: $filledAt
|
|
||||||
|
|
||||||
managers: $managers
|
|
||||||
durationDays: $durationDays
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteShift($id: UUID!) @auth(level: USER) {
|
|
||||||
shift_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,307 +0,0 @@
|
|||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST SHIFTS (paginated)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listShifts(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
|
|
||||||
orderId
|
|
||||||
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
cost
|
|
||||||
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
placeId
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
description
|
|
||||||
|
|
||||||
status
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
filledAt
|
|
||||||
|
|
||||||
managers
|
|
||||||
durationDays
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
status
|
|
||||||
orderType
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
business { id businessName email contactName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# GET SHIFT BY ID
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getShiftById($id: UUID!) @auth(level: USER) {
|
|
||||||
shift(id: $id) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
|
|
||||||
orderId
|
|
||||||
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
cost
|
|
||||||
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
placeId
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
description
|
|
||||||
|
|
||||||
status
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
filledAt
|
|
||||||
|
|
||||||
managers
|
|
||||||
durationDays
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
status
|
|
||||||
orderType
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
business { id businessName email contactName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# FILTER SHIFTS (by status/orderId/date range)
|
|
||||||
# NOTE: Timestamp filters use ge/le (not gte/lte)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query filterShifts(
|
|
||||||
$status: ShiftStatus
|
|
||||||
$orderId: UUID
|
|
||||||
|
|
||||||
$dateFrom: Timestamp
|
|
||||||
$dateTo: Timestamp
|
|
||||||
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
status: { eq: $status }
|
|
||||||
orderId: { eq: $orderId }
|
|
||||||
date: { ge: $dateFrom, le: $dateTo }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
|
|
||||||
orderId
|
|
||||||
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
cost
|
|
||||||
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
placeId
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
description
|
|
||||||
|
|
||||||
status
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
filledAt
|
|
||||||
|
|
||||||
managers
|
|
||||||
durationDays
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
status
|
|
||||||
orderType
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
business { id businessName email contactName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# BUSINESS: GET SHIFTS FOR A BUSINESS (via order.businessId)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getShiftsByBusinessId(
|
|
||||||
$businessId: UUID!
|
|
||||||
$dateFrom: Timestamp
|
|
||||||
$dateTo: Timestamp
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
date: { ge: $dateFrom, le: $dateTo }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
|
|
||||||
orderId
|
|
||||||
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
cost
|
|
||||||
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
placeId
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
description
|
|
||||||
|
|
||||||
status
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
filledAt
|
|
||||||
|
|
||||||
managers
|
|
||||||
durationDays
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
status
|
|
||||||
orderType
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
business { id businessName email contactName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# VENDOR: GET SHIFTS FOR A VENDOR (via order.vendorId)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query getShiftsByVendorId(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$dateFrom: Timestamp
|
|
||||||
$dateTo: Timestamp
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { vendorId: { eq: $vendorId } }
|
|
||||||
date: { ge: $dateFrom, le: $dateTo }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
|
|
||||||
orderId
|
|
||||||
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
cost
|
|
||||||
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
placeId
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
description
|
|
||||||
|
|
||||||
status
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
filledAt
|
|
||||||
|
|
||||||
managers
|
|
||||||
durationDays
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
status
|
|
||||||
orderType
|
|
||||||
businessId
|
|
||||||
vendorId
|
|
||||||
business { id businessName email contactName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
mutation createShiftRole(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
$count: Int!
|
|
||||||
$assigned: Int
|
|
||||||
$startTime: Timestamp
|
|
||||||
$endTime: Timestamp
|
|
||||||
$hours: Float
|
|
||||||
$department: String
|
|
||||||
$uniform: String
|
|
||||||
$breakType: BreakDuration
|
|
||||||
$totalValue: Float
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRole_insert(
|
|
||||||
data: {
|
|
||||||
shiftId: $shiftId
|
|
||||||
roleId: $roleId
|
|
||||||
count: $count
|
|
||||||
assigned: $assigned
|
|
||||||
startTime: $startTime
|
|
||||||
endTime: $endTime
|
|
||||||
hours: $hours
|
|
||||||
department: $department
|
|
||||||
uniform: $uniform
|
|
||||||
breakType: $breakType
|
|
||||||
totalValue: $totalValue
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateShiftRole(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
$count: Int
|
|
||||||
$assigned: Int
|
|
||||||
$startTime: Timestamp
|
|
||||||
$endTime: Timestamp
|
|
||||||
$hours: Float
|
|
||||||
$department: String
|
|
||||||
$uniform: String
|
|
||||||
$breakType: BreakDuration
|
|
||||||
$totalValue: Float
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRole_update(
|
|
||||||
key: { shiftId: $shiftId, roleId: $roleId }
|
|
||||||
data: {
|
|
||||||
count: $count
|
|
||||||
assigned: $assigned
|
|
||||||
startTime: $startTime
|
|
||||||
endTime: $endTime
|
|
||||||
hours: $hours
|
|
||||||
department: $department
|
|
||||||
uniform: $uniform
|
|
||||||
breakType: $breakType
|
|
||||||
totalValue: $totalValue
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteShiftRole(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRole_delete(key: { shiftId: $shiftId, roleId: $roleId })
|
|
||||||
}
|
|
||||||
@@ -1,609 +0,0 @@
|
|||||||
|
|
||||||
query getShiftRoleById(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRole(key: { shiftId: $shiftId, roleId: $roleId }) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
department
|
|
||||||
uniform
|
|
||||||
breakType
|
|
||||||
totalValue
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift{
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
orderId
|
|
||||||
|
|
||||||
order{
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
notes
|
|
||||||
|
|
||||||
business{
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor{
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listShiftRolesByShiftId(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: { shiftId: { eq: $shiftId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
department
|
|
||||||
uniform
|
|
||||||
breakType
|
|
||||||
totalValue
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift{
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
orderId
|
|
||||||
|
|
||||||
order{
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
notes
|
|
||||||
|
|
||||||
business{
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor{
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listShiftRolesByRoleId(
|
|
||||||
$roleId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: { roleId: { eq: $roleId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
department
|
|
||||||
uniform
|
|
||||||
breakType
|
|
||||||
totalValue
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift{
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
orderId
|
|
||||||
|
|
||||||
order{
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
notes
|
|
||||||
|
|
||||||
business{
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor{
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listShiftRolesByShiftIdAndTimeRange(
|
|
||||||
$shiftId: UUID!
|
|
||||||
$start: Timestamp!
|
|
||||||
$end: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: {
|
|
||||||
shiftId: { eq: $shiftId }
|
|
||||||
startTime: { ge: $start }
|
|
||||||
endTime: { le: $end }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
department
|
|
||||||
uniform
|
|
||||||
breakType
|
|
||||||
totalValue
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift{
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
orderId
|
|
||||||
|
|
||||||
order{
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
notes
|
|
||||||
|
|
||||||
business{
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor{
|
|
||||||
id
|
|
||||||
companyName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST SHIFT ROLES BY VENDOR (via Shift -> Order)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listShiftRolesByVendorId(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: {
|
|
||||||
shift: {
|
|
||||||
order: {
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
department
|
|
||||||
uniform
|
|
||||||
breakType
|
|
||||||
totalValue
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
orderId
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
status
|
|
||||||
date
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
notes
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST SHIFT ROLES BY VENDOR and Date Range (via Shift -> Order)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
#for find shifts in staff app
|
|
||||||
query listShiftRolesByVendorIdAndDateRange(
|
|
||||||
$vendorId: UUID!
|
|
||||||
$start: Timestamp!
|
|
||||||
$end: Timestamp!
|
|
||||||
$status: ShiftStatus
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: {
|
|
||||||
shift: {
|
|
||||||
date: { ge: $start, le: $end }
|
|
||||||
status: { eq: $status }
|
|
||||||
order: {
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
department
|
|
||||||
uniform
|
|
||||||
breakType
|
|
||||||
totalValue
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
description
|
|
||||||
orderId
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
vendorId
|
|
||||||
businessId
|
|
||||||
orderType
|
|
||||||
status
|
|
||||||
date
|
|
||||||
recurringDays
|
|
||||||
permanentDays
|
|
||||||
notes
|
|
||||||
|
|
||||||
business { id businessName }
|
|
||||||
vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#orders view client
|
|
||||||
query listShiftRolesByBusinessAndDateRange(
|
|
||||||
$businessId: UUID!
|
|
||||||
$start: Timestamp!
|
|
||||||
$end: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
$status: ShiftStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: {
|
|
||||||
shift: {
|
|
||||||
date: { ge: $start, le: $end }
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
status: { eq: $status }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
hours
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
totalValue
|
|
||||||
role { id name }
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
title
|
|
||||||
status
|
|
||||||
order { id eventName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#list shiftsroles for update order in client app
|
|
||||||
query listShiftRolesByBusinessAndOrder(
|
|
||||||
$businessId: UUID!
|
|
||||||
$orderId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: {
|
|
||||||
shift: {
|
|
||||||
orderId: { eq: $orderId }
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
breakType
|
|
||||||
totalValue
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
role { id name costPerHour }
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
date
|
|
||||||
orderId
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
|
|
||||||
order{
|
|
||||||
vendorId
|
|
||||||
eventName
|
|
||||||
date
|
|
||||||
#location
|
|
||||||
|
|
||||||
teamHub {
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#reorder get list by businessId
|
|
||||||
query listShiftRolesByBusinessDateRangeCompletedOrders(
|
|
||||||
$businessId: UUID!
|
|
||||||
$start: Timestamp!
|
|
||||||
$end: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: {
|
|
||||||
shift: {
|
|
||||||
date: { ge: $start, le: $end }
|
|
||||||
order: {
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
status: { eq: COMPLETED }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
shiftId
|
|
||||||
roleId
|
|
||||||
count
|
|
||||||
assigned
|
|
||||||
hours
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
totalValue
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
|
|
||||||
shift {
|
|
||||||
id
|
|
||||||
date
|
|
||||||
location
|
|
||||||
locationAddress
|
|
||||||
title
|
|
||||||
status
|
|
||||||
|
|
||||||
order {
|
|
||||||
id
|
|
||||||
orderType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#view for billing period
|
|
||||||
query listShiftRolesByBusinessAndDatesSummary(
|
|
||||||
$businessId: UUID!
|
|
||||||
$start: Timestamp!
|
|
||||||
$end: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shiftRoles(
|
|
||||||
where: {
|
|
||||||
shift: {
|
|
||||||
date: { ge: $start, le: $end }
|
|
||||||
status: { eq: COMPLETED }
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
roleId
|
|
||||||
hours
|
|
||||||
totalValue
|
|
||||||
role { id name }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# BUSINESS: GET COMPLETED SHIFTS FOR A BUSINESS (via order.businessId)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
#for spending insights in home view
|
|
||||||
query getCompletedShiftsByBusinessId(
|
|
||||||
$businessId: UUID!
|
|
||||||
$dateFrom: Timestamp!
|
|
||||||
$dateTo: Timestamp!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
order: { businessId: { eq: $businessId } }
|
|
||||||
status: {in: [IN_PROGRESS, CONFIRMED, COMPLETED, OPEN]}
|
|
||||||
date: { ge: $dateFrom, le: $dateTo }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
#title
|
|
||||||
|
|
||||||
#orderId
|
|
||||||
|
|
||||||
date
|
|
||||||
startTime
|
|
||||||
endTime
|
|
||||||
hours
|
|
||||||
cost
|
|
||||||
|
|
||||||
#location
|
|
||||||
#locationAddress
|
|
||||||
#latitude
|
|
||||||
#longitude
|
|
||||||
#description
|
|
||||||
|
|
||||||
#status
|
|
||||||
workersNeeded
|
|
||||||
filled
|
|
||||||
#filledAt
|
|
||||||
|
|
||||||
#managers
|
|
||||||
#durationDays
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
order {
|
|
||||||
#id
|
|
||||||
#eventName
|
|
||||||
status
|
|
||||||
#orderType
|
|
||||||
#businessId
|
|
||||||
#vendorId
|
|
||||||
#business { id businessName email contactName }
|
|
||||||
#vendor { id companyName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
mutation CreateStaff(
|
|
||||||
$userId: String!
|
|
||||||
$fullName: String!
|
|
||||||
$level: String
|
|
||||||
$role: String
|
|
||||||
$phone: String
|
|
||||||
$email: String
|
|
||||||
$photoUrl: String
|
|
||||||
|
|
||||||
$totalShifts: Int
|
|
||||||
$averageRating: Float
|
|
||||||
$onTimeRate: Int
|
|
||||||
$noShowCount: Int
|
|
||||||
$cancellationCount: Int
|
|
||||||
$reliabilityScore: Int
|
|
||||||
|
|
||||||
$bio: String
|
|
||||||
$skills: [String!]
|
|
||||||
$industries: [String!]
|
|
||||||
$preferredLocations: [String!]
|
|
||||||
$maxDistanceMiles: Int
|
|
||||||
$languages: Any
|
|
||||||
$itemsAttire: Any
|
|
||||||
|
|
||||||
$xp: Int
|
|
||||||
$badges: Any
|
|
||||||
$isRecommended: Boolean
|
|
||||||
|
|
||||||
$ownerId: UUID
|
|
||||||
$department: DepartmentType
|
|
||||||
$hubId: UUID
|
|
||||||
$manager: UUID
|
|
||||||
$english: EnglishProficiency
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$backgroundCheckStatus: BackgroundCheckStatus
|
|
||||||
$employmentType: EmploymentType
|
|
||||||
$initial: String
|
|
||||||
$englishRequired: Boolean
|
|
||||||
$city: String
|
|
||||||
$addres: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staff_insert(
|
|
||||||
data: {
|
|
||||||
userId: $userId
|
|
||||||
fullName: $fullName
|
|
||||||
level: $level
|
|
||||||
role: $role
|
|
||||||
phone: $phone
|
|
||||||
email: $email
|
|
||||||
photoUrl: $photoUrl
|
|
||||||
|
|
||||||
totalShifts: $totalShifts
|
|
||||||
averageRating: $averageRating
|
|
||||||
onTimeRate: $onTimeRate
|
|
||||||
noShowCount: $noShowCount
|
|
||||||
cancellationCount: $cancellationCount
|
|
||||||
reliabilityScore: $reliabilityScore
|
|
||||||
|
|
||||||
bio: $bio
|
|
||||||
skills: $skills
|
|
||||||
industries: $industries
|
|
||||||
preferredLocations: $preferredLocations
|
|
||||||
maxDistanceMiles: $maxDistanceMiles
|
|
||||||
languages: $languages
|
|
||||||
itemsAttire: $itemsAttire
|
|
||||||
|
|
||||||
xp: $xp
|
|
||||||
badges: $badges
|
|
||||||
isRecommended: $isRecommended
|
|
||||||
|
|
||||||
ownerId: $ownerId
|
|
||||||
department: $department
|
|
||||||
hubId: $hubId
|
|
||||||
manager: $manager
|
|
||||||
english: $english
|
|
||||||
|
|
||||||
backgroundCheckStatus: $backgroundCheckStatus
|
|
||||||
employmentType: $employmentType
|
|
||||||
initial: $initial
|
|
||||||
englishRequired: $englishRequired
|
|
||||||
city: $city
|
|
||||||
addres: $addres
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateStaff(
|
|
||||||
$id: UUID!
|
|
||||||
|
|
||||||
$userId: String
|
|
||||||
$fullName: String
|
|
||||||
$level: String
|
|
||||||
$role: String
|
|
||||||
$phone: String
|
|
||||||
$email: String
|
|
||||||
$photoUrl: String
|
|
||||||
|
|
||||||
$totalShifts: Int
|
|
||||||
$averageRating: Float
|
|
||||||
$onTimeRate: Int
|
|
||||||
$noShowCount: Int
|
|
||||||
$cancellationCount: Int
|
|
||||||
$reliabilityScore: Int
|
|
||||||
|
|
||||||
$bio: String
|
|
||||||
$skills: [String!]
|
|
||||||
$industries: [String!]
|
|
||||||
$preferredLocations: [String!]
|
|
||||||
$maxDistanceMiles: Int
|
|
||||||
$languages: Any
|
|
||||||
$itemsAttire: Any
|
|
||||||
|
|
||||||
$xp: Int
|
|
||||||
$badges: Any
|
|
||||||
$isRecommended: Boolean
|
|
||||||
|
|
||||||
$ownerId: UUID
|
|
||||||
$department: DepartmentType
|
|
||||||
$hubId: UUID
|
|
||||||
$manager: UUID
|
|
||||||
$english: EnglishProficiency
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$backgroundCheckStatus: BackgroundCheckStatus
|
|
||||||
$employmentType: EmploymentType
|
|
||||||
$initial: String
|
|
||||||
$englishRequired: Boolean
|
|
||||||
$city: String
|
|
||||||
$addres: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staff_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
userId: $userId
|
|
||||||
fullName: $fullName
|
|
||||||
level: $level
|
|
||||||
role: $role
|
|
||||||
phone: $phone
|
|
||||||
email: $email
|
|
||||||
photoUrl: $photoUrl
|
|
||||||
|
|
||||||
totalShifts: $totalShifts
|
|
||||||
averageRating: $averageRating
|
|
||||||
onTimeRate: $onTimeRate
|
|
||||||
noShowCount: $noShowCount
|
|
||||||
cancellationCount: $cancellationCount
|
|
||||||
reliabilityScore: $reliabilityScore
|
|
||||||
|
|
||||||
bio: $bio
|
|
||||||
skills: $skills
|
|
||||||
industries: $industries
|
|
||||||
preferredLocations: $preferredLocations
|
|
||||||
maxDistanceMiles: $maxDistanceMiles
|
|
||||||
languages: $languages
|
|
||||||
itemsAttire: $itemsAttire
|
|
||||||
|
|
||||||
xp: $xp
|
|
||||||
badges: $badges
|
|
||||||
isRecommended: $isRecommended
|
|
||||||
|
|
||||||
ownerId: $ownerId
|
|
||||||
department: $department
|
|
||||||
hubId: $hubId
|
|
||||||
manager: $manager
|
|
||||||
english: $english
|
|
||||||
|
|
||||||
backgroundCheckStatus: $backgroundCheckStatus
|
|
||||||
employmentType: $employmentType
|
|
||||||
initial: $initial
|
|
||||||
englishRequired: $englishRequired
|
|
||||||
city: $city
|
|
||||||
addres: $addres
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteStaff($id: UUID!) @auth(level: USER) {
|
|
||||||
staff_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
query listStaff @auth(level: USER) {
|
|
||||||
staffs {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
fullName
|
|
||||||
level
|
|
||||||
role
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
photoUrl
|
|
||||||
|
|
||||||
totalShifts
|
|
||||||
averageRating
|
|
||||||
onTimeRate
|
|
||||||
noShowCount
|
|
||||||
cancellationCount
|
|
||||||
reliabilityScore
|
|
||||||
xp
|
|
||||||
badges
|
|
||||||
isRecommended
|
|
||||||
|
|
||||||
bio
|
|
||||||
skills
|
|
||||||
industries
|
|
||||||
preferredLocations
|
|
||||||
maxDistanceMiles
|
|
||||||
languages
|
|
||||||
itemsAttire
|
|
||||||
|
|
||||||
ownerId
|
|
||||||
createdAt
|
|
||||||
department
|
|
||||||
hubId
|
|
||||||
manager
|
|
||||||
english
|
|
||||||
|
|
||||||
backgroundCheckStatus
|
|
||||||
employmentType
|
|
||||||
initial
|
|
||||||
englishRequired
|
|
||||||
city
|
|
||||||
addres
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getStaffById($id: UUID!) @auth(level: USER) {
|
|
||||||
staff(id: $id) {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
fullName
|
|
||||||
role
|
|
||||||
level
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
photoUrl
|
|
||||||
|
|
||||||
totalShifts
|
|
||||||
averageRating
|
|
||||||
onTimeRate
|
|
||||||
noShowCount
|
|
||||||
cancellationCount
|
|
||||||
reliabilityScore
|
|
||||||
xp
|
|
||||||
badges
|
|
||||||
isRecommended
|
|
||||||
|
|
||||||
bio
|
|
||||||
skills
|
|
||||||
industries
|
|
||||||
preferredLocations
|
|
||||||
maxDistanceMiles
|
|
||||||
languages
|
|
||||||
itemsAttire
|
|
||||||
|
|
||||||
ownerId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
department
|
|
||||||
hubId
|
|
||||||
manager
|
|
||||||
english
|
|
||||||
|
|
||||||
backgroundCheckStatus
|
|
||||||
employmentType
|
|
||||||
initial
|
|
||||||
englishRequired
|
|
||||||
city
|
|
||||||
addres
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getStaffByUserId($userId: String!) @auth(level: USER) {
|
|
||||||
staffs(where: { userId: { eq: $userId } }) {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
fullName
|
|
||||||
level
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
photoUrl
|
|
||||||
|
|
||||||
totalShifts
|
|
||||||
averageRating
|
|
||||||
onTimeRate
|
|
||||||
noShowCount
|
|
||||||
cancellationCount
|
|
||||||
reliabilityScore
|
|
||||||
xp
|
|
||||||
badges
|
|
||||||
isRecommended
|
|
||||||
|
|
||||||
bio
|
|
||||||
skills
|
|
||||||
industries
|
|
||||||
preferredLocations
|
|
||||||
maxDistanceMiles
|
|
||||||
languages
|
|
||||||
itemsAttire
|
|
||||||
|
|
||||||
ownerId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
department
|
|
||||||
hubId
|
|
||||||
manager
|
|
||||||
english
|
|
||||||
|
|
||||||
backgroundCheckStatus
|
|
||||||
employmentType
|
|
||||||
initial
|
|
||||||
englishRequired
|
|
||||||
city
|
|
||||||
addres
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterStaff(
|
|
||||||
$ownerId: UUID
|
|
||||||
$fullName: String
|
|
||||||
$level: String
|
|
||||||
$email: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffs(
|
|
||||||
where: {
|
|
||||||
ownerId: { eq: $ownerId }
|
|
||||||
fullName: { eq: $fullName }
|
|
||||||
level: { eq: $level }
|
|
||||||
email: { eq: $email }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
userId
|
|
||||||
fullName
|
|
||||||
level
|
|
||||||
phone
|
|
||||||
email
|
|
||||||
photoUrl
|
|
||||||
averageRating
|
|
||||||
reliabilityScore
|
|
||||||
totalShifts
|
|
||||||
ownerId
|
|
||||||
isRecommended
|
|
||||||
skills
|
|
||||||
industries
|
|
||||||
backgroundCheckStatus
|
|
||||||
employmentType
|
|
||||||
initial
|
|
||||||
englishRequired
|
|
||||||
city
|
|
||||||
addres
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
|
|
||||||
mutation createStaffAvailability(
|
|
||||||
$staffId: UUID!
|
|
||||||
$day: DayOfWeek!
|
|
||||||
$slot: AvailabilitySlot!
|
|
||||||
$status: AvailabilityStatus
|
|
||||||
$notes: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailability_insert(
|
|
||||||
data: {
|
|
||||||
staffId: $staffId
|
|
||||||
day: $day
|
|
||||||
slot: $slot
|
|
||||||
status: $status
|
|
||||||
notes: $notes
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateStaffAvailability(
|
|
||||||
$staffId: UUID!
|
|
||||||
$day: DayOfWeek!
|
|
||||||
$slot: AvailabilitySlot!
|
|
||||||
$status: AvailabilityStatus
|
|
||||||
$notes: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailability_update(
|
|
||||||
key: { staffId: $staffId, day: $day, slot: $slot }
|
|
||||||
data: {
|
|
||||||
status: $status
|
|
||||||
notes: $notes
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteStaffAvailability(
|
|
||||||
$staffId: UUID!
|
|
||||||
$day: DayOfWeek!
|
|
||||||
$slot: AvailabilitySlot!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailability_delete(
|
|
||||||
key: { staffId: $staffId, day: $day, slot: $slot }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
|
|
||||||
query listStaffAvailabilities(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilities(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
day
|
|
||||||
slot
|
|
||||||
status
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
staff { id fullName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffAvailabilitiesByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilities(
|
|
||||||
where: { staffId: { eq: $staffId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
day
|
|
||||||
slot
|
|
||||||
status
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
staff { id fullName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getStaffAvailabilityByKey(
|
|
||||||
$staffId: UUID!
|
|
||||||
$day: DayOfWeek!
|
|
||||||
$slot: AvailabilitySlot!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailability(key: { staffId: $staffId, day: $day, slot: $slot }) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
day
|
|
||||||
slot
|
|
||||||
status
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
staff { id fullName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffAvailabilitiesByDay(
|
|
||||||
$day: DayOfWeek!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilities(
|
|
||||||
where: { day: { eq: $day } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
day
|
|
||||||
slot
|
|
||||||
status
|
|
||||||
notes
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
staff { id fullName }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
|
|
||||||
mutation createStaffAvailabilityStats(
|
|
||||||
$staffId: UUID!
|
|
||||||
$needWorkIndex: Int
|
|
||||||
$utilizationPercentage: Int
|
|
||||||
$predictedAvailabilityScore: Int
|
|
||||||
$scheduledHoursThisPeriod: Int
|
|
||||||
$desiredHoursThisPeriod: Int
|
|
||||||
$lastShiftDate: Timestamp
|
|
||||||
$acceptanceRate: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilityStats_insert(
|
|
||||||
data: {
|
|
||||||
staffId: $staffId
|
|
||||||
needWorkIndex: $needWorkIndex
|
|
||||||
utilizationPercentage: $utilizationPercentage
|
|
||||||
predictedAvailabilityScore: $predictedAvailabilityScore
|
|
||||||
scheduledHoursThisPeriod: $scheduledHoursThisPeriod
|
|
||||||
desiredHoursThisPeriod: $desiredHoursThisPeriod
|
|
||||||
lastShiftDate: $lastShiftDate
|
|
||||||
acceptanceRate: $acceptanceRate
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateStaffAvailabilityStats(
|
|
||||||
$staffId: UUID!
|
|
||||||
$needWorkIndex: Int
|
|
||||||
$utilizationPercentage: Int
|
|
||||||
$predictedAvailabilityScore: Int
|
|
||||||
$scheduledHoursThisPeriod: Int
|
|
||||||
$desiredHoursThisPeriod: Int
|
|
||||||
$lastShiftDate: Timestamp
|
|
||||||
$acceptanceRate: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilityStats_update(
|
|
||||||
key: { staffId: $staffId }
|
|
||||||
data: {
|
|
||||||
needWorkIndex: $needWorkIndex
|
|
||||||
utilizationPercentage: $utilizationPercentage
|
|
||||||
predictedAvailabilityScore: $predictedAvailabilityScore
|
|
||||||
scheduledHoursThisPeriod: $scheduledHoursThisPeriod
|
|
||||||
desiredHoursThisPeriod: $desiredHoursThisPeriod
|
|
||||||
lastShiftDate: $lastShiftDate
|
|
||||||
acceptanceRate: $acceptanceRate
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteStaffAvailabilityStats(
|
|
||||||
$staffId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilityStats_delete(key: { staffId: $staffId })
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
# ==========================================================
|
|
||||||
# StaffAvailabilityStats - QUERIES
|
|
||||||
# ==========================================================
|
|
||||||
# Notes:
|
|
||||||
# - Entity key is composite: key: ["staffId"]
|
|
||||||
# - So the single-record lookup is: staffAvailabilityStats(key: { staffId: ... })
|
|
||||||
# - There is no Query.staffAvailabilityStat(id: ...) unless you defined id as the key.
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listStaffAvailabilityStats(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilityStatss(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
needWorkIndex
|
|
||||||
utilizationPercentage
|
|
||||||
predictedAvailabilityScore
|
|
||||||
scheduledHoursThisPeriod
|
|
||||||
desiredHoursThisPeriod
|
|
||||||
lastShiftDate
|
|
||||||
acceptanceRate
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# GET BY KEY (staffId)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query getStaffAvailabilityStatsByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilityStats(key: { staffId: $staffId }) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
needWorkIndex
|
|
||||||
utilizationPercentage
|
|
||||||
predictedAvailabilityScore
|
|
||||||
scheduledHoursThisPeriod
|
|
||||||
desiredHoursThisPeriod
|
|
||||||
lastShiftDate
|
|
||||||
acceptanceRate
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# FILTER (optional) - useful for dashboards
|
|
||||||
# NOTE: Data Connect filter ops are typically: eq, ne, gt, ge, lt, le, in, isNull
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query filterStaffAvailabilityStats(
|
|
||||||
$needWorkIndexMin: Int
|
|
||||||
$needWorkIndexMax: Int
|
|
||||||
$utilizationMin: Int
|
|
||||||
$utilizationMax: Int
|
|
||||||
$acceptanceRateMin: Int
|
|
||||||
$acceptanceRateMax: Int
|
|
||||||
$lastShiftAfter: Timestamp
|
|
||||||
$lastShiftBefore: Timestamp
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffAvailabilityStatss(
|
|
||||||
where: {
|
|
||||||
needWorkIndex: { ge: $needWorkIndexMin, le: $needWorkIndexMax }
|
|
||||||
utilizationPercentage: { ge: $utilizationMin, le: $utilizationMax }
|
|
||||||
acceptanceRate: { ge: $acceptanceRateMin, le: $acceptanceRateMax }
|
|
||||||
lastShiftDate: { ge: $lastShiftAfter, le: $lastShiftBefore }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
needWorkIndex
|
|
||||||
utilizationPercentage
|
|
||||||
predictedAvailabilityScore
|
|
||||||
scheduledHoursThisPeriod
|
|
||||||
desiredHoursThisPeriod
|
|
||||||
lastShiftDate
|
|
||||||
acceptanceRate
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
# Mutations for StaffCourse
|
|
||||||
|
|
||||||
mutation createStaffCourse(
|
|
||||||
$staffId: UUID!
|
|
||||||
$courseId: UUID!
|
|
||||||
$progressPercent: Int
|
|
||||||
$completed: Boolean
|
|
||||||
$completedAt: Timestamp
|
|
||||||
$startedAt: Timestamp
|
|
||||||
$lastAccessedAt: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffCourse_insert(
|
|
||||||
data: {
|
|
||||||
staffId: $staffId
|
|
||||||
courseId: $courseId
|
|
||||||
progressPercent: $progressPercent
|
|
||||||
completed: $completed
|
|
||||||
completedAt: $completedAt
|
|
||||||
startedAt: $startedAt
|
|
||||||
lastAccessedAt: $lastAccessedAt
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateStaffCourse(
|
|
||||||
$id: UUID!
|
|
||||||
$progressPercent: Int
|
|
||||||
$completed: Boolean
|
|
||||||
$completedAt: Timestamp
|
|
||||||
$startedAt: Timestamp
|
|
||||||
$lastAccessedAt: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffCourse_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
progressPercent: $progressPercent
|
|
||||||
completed: $completed
|
|
||||||
completedAt: $completedAt
|
|
||||||
startedAt: $startedAt
|
|
||||||
lastAccessedAt: $lastAccessedAt
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteStaffCourse($id: UUID!) @auth(level: USER) {
|
|
||||||
staffCourse_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
query getStaffCourseById($id: UUID!) @auth(level: USER) {
|
|
||||||
staffCourse(id: $id) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
courseId
|
|
||||||
progressPercent
|
|
||||||
completed
|
|
||||||
completedAt
|
|
||||||
startedAt
|
|
||||||
lastAccessedAt
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffCoursesByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffCourses(
|
|
||||||
where: { staffId: { eq: $staffId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
courseId
|
|
||||||
progressPercent
|
|
||||||
completed
|
|
||||||
completedAt
|
|
||||||
startedAt
|
|
||||||
lastAccessedAt
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffCoursesByCourseId(
|
|
||||||
$courseId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffCourses(
|
|
||||||
where: { courseId: { eq: $courseId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
courseId
|
|
||||||
progressPercent
|
|
||||||
completed
|
|
||||||
completedAt
|
|
||||||
startedAt
|
|
||||||
lastAccessedAt
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getStaffCourseByStaffAndCourse(
|
|
||||||
$staffId: UUID!
|
|
||||||
$courseId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffCourses(
|
|
||||||
where: {
|
|
||||||
staffId: { eq: $staffId }
|
|
||||||
courseId: { eq: $courseId }
|
|
||||||
}
|
|
||||||
limit: 1
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
courseId
|
|
||||||
progressPercent
|
|
||||||
completed
|
|
||||||
completedAt
|
|
||||||
startedAt
|
|
||||||
lastAccessedAt
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
|
|
||||||
mutation createStaffDocument(
|
|
||||||
$staffId: UUID!
|
|
||||||
$staffName: String!
|
|
||||||
$documentId: UUID!
|
|
||||||
$status: DocumentStatus!
|
|
||||||
$documentUrl: String
|
|
||||||
$expiryDate: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffDocument_insert(
|
|
||||||
data: {
|
|
||||||
staffId: $staffId
|
|
||||||
staffName: $staffName
|
|
||||||
documentId: $documentId
|
|
||||||
status: $status
|
|
||||||
documentUrl: $documentUrl
|
|
||||||
expiryDate: $expiryDate
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateStaffDocument(
|
|
||||||
$staffId: UUID!
|
|
||||||
$documentId: UUID!
|
|
||||||
$status: DocumentStatus
|
|
||||||
$documentUrl: String
|
|
||||||
$expiryDate: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffDocument_update(
|
|
||||||
key: { staffId: $staffId, documentId: $documentId }
|
|
||||||
data: {
|
|
||||||
status: $status
|
|
||||||
documentUrl: $documentUrl
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteStaffDocument(
|
|
||||||
$staffId: UUID!
|
|
||||||
$documentId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffDocument_delete(key: { staffId: $staffId, documentId: $documentId })
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
|
|
||||||
query getStaffDocumentByKey(
|
|
||||||
$staffId: UUID!
|
|
||||||
$documentId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffDocument(key: { staffId: $staffId, documentId: $documentId }) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
staffName
|
|
||||||
documentId
|
|
||||||
status
|
|
||||||
documentUrl
|
|
||||||
expiryDate
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
document {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
documentType
|
|
||||||
description
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffDocumentsByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffDocuments(
|
|
||||||
where: { staffId: { eq: $staffId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
staffName
|
|
||||||
documentId
|
|
||||||
status
|
|
||||||
documentUrl
|
|
||||||
expiryDate
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
document {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
documentType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffDocumentsByDocumentType(
|
|
||||||
$documentType: DocumentType!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffDocuments(
|
|
||||||
where: { document: { documentType: { eq: $documentType } } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
staffName
|
|
||||||
documentId
|
|
||||||
status
|
|
||||||
documentUrl
|
|
||||||
expiryDate
|
|
||||||
document {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
documentType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listStaffDocumentsByStatus(
|
|
||||||
$status: DocumentStatus!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffDocuments(
|
|
||||||
where: { status: { eq: $status } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
staffName
|
|
||||||
documentId
|
|
||||||
status
|
|
||||||
documentUrl
|
|
||||||
expiryDate
|
|
||||||
document {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
documentType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
mutation createStaffRole(
|
|
||||||
$staffId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
$roleType: RoleType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffRole_insert(
|
|
||||||
data: {
|
|
||||||
staffId: $staffId
|
|
||||||
roleId: $roleId
|
|
||||||
roleType: $roleType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteStaffRole(
|
|
||||||
$staffId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffRole_delete(
|
|
||||||
key: { staffId: $staffId, roleId: $roleId }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listStaffRoles(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffRoles(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
roleId
|
|
||||||
createdAt
|
|
||||||
roleType
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
userId
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# GET BY COMPOSITE KEY (staffId + roleId)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query getStaffRoleByKey(
|
|
||||||
$staffId: UUID!
|
|
||||||
$roleId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffRole(key: { staffId: $staffId, roleId: $roleId }) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
roleId
|
|
||||||
createdAt
|
|
||||||
roleType
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
userId
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY STAFF (most common)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listStaffRolesByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffRoles(
|
|
||||||
where: { staffId: { eq: $staffId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
roleId
|
|
||||||
createdAt
|
|
||||||
roleType
|
|
||||||
|
|
||||||
role {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costPerHour
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY ROLE (who has this skill)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listStaffRolesByRoleId(
|
|
||||||
$roleId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffRoles(
|
|
||||||
where: { roleId: { eq: $roleId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
roleId
|
|
||||||
createdAt
|
|
||||||
roleType
|
|
||||||
|
|
||||||
staff {
|
|
||||||
id
|
|
||||||
fullName
|
|
||||||
userId
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# FILTER (optional)
|
|
||||||
# Useful when you want both conditions without using key lookup
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query filterStaffRoles(
|
|
||||||
$staffId: UUID
|
|
||||||
$roleId: UUID
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffRoles(
|
|
||||||
where: {
|
|
||||||
staffId: { eq: $staffId }
|
|
||||||
roleId: { eq: $roleId }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
staffId
|
|
||||||
roleId
|
|
||||||
createdAt
|
|
||||||
roleType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
mutation createTask(
|
|
||||||
$taskName: String!
|
|
||||||
$description: String
|
|
||||||
$priority: TaskPriority!
|
|
||||||
$status: TaskStatus!
|
|
||||||
$dueDate: Timestamp
|
|
||||||
$progress: Int
|
|
||||||
$orderIndex: Int
|
|
||||||
$commentCount: Int
|
|
||||||
$attachmentCount: Int
|
|
||||||
$files: Any
|
|
||||||
$ownerId:UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
task_insert(
|
|
||||||
data: {
|
|
||||||
taskName: $taskName
|
|
||||||
description: $description
|
|
||||||
priority: $priority
|
|
||||||
status: $status
|
|
||||||
dueDate: $dueDate
|
|
||||||
progress: $progress
|
|
||||||
orderIndex: $orderIndex
|
|
||||||
commentCount: $commentCount
|
|
||||||
attachmentCount: $attachmentCount
|
|
||||||
files: $files
|
|
||||||
ownerId:$ownerId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateTask(
|
|
||||||
$id: UUID!
|
|
||||||
$taskName: String
|
|
||||||
$description: String
|
|
||||||
$priority: TaskPriority
|
|
||||||
$status: TaskStatus
|
|
||||||
$dueDate: Timestamp
|
|
||||||
$progress: Int
|
|
||||||
$assignedMembers: Any
|
|
||||||
$orderIndex: Int
|
|
||||||
$commentCount: Int
|
|
||||||
$attachmentCount: Int
|
|
||||||
$files: Any
|
|
||||||
) @auth(level: USER) {
|
|
||||||
task_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
taskName: $taskName
|
|
||||||
description: $description
|
|
||||||
priority: $priority
|
|
||||||
status: $status
|
|
||||||
dueDate: $dueDate
|
|
||||||
progress: $progress
|
|
||||||
orderIndex: $orderIndex
|
|
||||||
commentCount: $commentCount
|
|
||||||
attachmentCount: $attachmentCount
|
|
||||||
files: $files
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteTask($id: UUID!) @auth(level: USER) {
|
|
||||||
task_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
query listTasks @auth(level: USER) {
|
|
||||||
tasks {
|
|
||||||
id
|
|
||||||
taskName
|
|
||||||
description
|
|
||||||
priority
|
|
||||||
status
|
|
||||||
dueDate
|
|
||||||
progress
|
|
||||||
orderIndex
|
|
||||||
commentCount
|
|
||||||
attachmentCount
|
|
||||||
files
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTaskById($id: UUID!) @auth(level: USER) {
|
|
||||||
task(id: $id) {
|
|
||||||
id
|
|
||||||
taskName
|
|
||||||
description
|
|
||||||
priority
|
|
||||||
status
|
|
||||||
dueDate
|
|
||||||
progress
|
|
||||||
orderIndex
|
|
||||||
commentCount
|
|
||||||
attachmentCount
|
|
||||||
files
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTasksByOwnerId($ownerId: UUID!) @auth(level: USER) {
|
|
||||||
tasks(where: { ownerId: { eq: $ownerId } }) {
|
|
||||||
id
|
|
||||||
taskName
|
|
||||||
description
|
|
||||||
priority
|
|
||||||
status
|
|
||||||
dueDate
|
|
||||||
progress
|
|
||||||
orderIndex
|
|
||||||
commentCount
|
|
||||||
attachmentCount
|
|
||||||
files
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterTasks(
|
|
||||||
$status: TaskStatus
|
|
||||||
$priority: TaskPriority
|
|
||||||
) @auth(level: USER) {
|
|
||||||
tasks(
|
|
||||||
where: {
|
|
||||||
status: { eq: $status }
|
|
||||||
priority: { eq: $priority }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
taskName
|
|
||||||
description
|
|
||||||
priority
|
|
||||||
status
|
|
||||||
dueDate
|
|
||||||
progress
|
|
||||||
orderIndex
|
|
||||||
commentCount
|
|
||||||
attachmentCount
|
|
||||||
files
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
mutation createTaskComment(
|
|
||||||
$taskId: UUID!
|
|
||||||
$teamMemberId: UUID!
|
|
||||||
$comment: String!
|
|
||||||
$isSystem: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
taskComment_insert(
|
|
||||||
data: {
|
|
||||||
taskId: $taskId
|
|
||||||
teamMemberId: $teamMemberId
|
|
||||||
comment: $comment
|
|
||||||
isSystem: $isSystem
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateTaskComment(
|
|
||||||
$id: UUID!
|
|
||||||
$comment: String
|
|
||||||
$isSystem: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
taskComment_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
comment: $comment
|
|
||||||
isSystem: $isSystem
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteTaskComment($id: UUID!) @auth(level: USER) {
|
|
||||||
taskComment_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
query listTaskComments @auth(level: USER) {
|
|
||||||
taskComments {
|
|
||||||
id
|
|
||||||
taskId
|
|
||||||
teamMemberId
|
|
||||||
comment
|
|
||||||
isSystem
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
teamMember{
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTaskCommentById($id: UUID!) @auth(level: USER) {
|
|
||||||
taskComment(id: $id) {
|
|
||||||
id
|
|
||||||
taskId
|
|
||||||
teamMemberId
|
|
||||||
comment
|
|
||||||
isSystem
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
teamMember{
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTaskCommentsByTaskId($taskId: UUID!) @auth(level: USER) {
|
|
||||||
taskComments(where: { taskId: { eq: $taskId } }) {
|
|
||||||
id
|
|
||||||
taskId
|
|
||||||
teamMemberId
|
|
||||||
comment
|
|
||||||
isSystem
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
teamMember{
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
mutation createTaxForm(
|
|
||||||
$formType: TaxFormType!
|
|
||||||
$firstName: String!
|
|
||||||
$lastName: String!
|
|
||||||
$mInitial: String
|
|
||||||
$oLastName: String
|
|
||||||
$dob: Timestamp
|
|
||||||
$socialSN: Int!
|
|
||||||
$email: String
|
|
||||||
$phone: String
|
|
||||||
$address: String!
|
|
||||||
$city: String
|
|
||||||
$apt: String
|
|
||||||
$state: String
|
|
||||||
$zipCode: String
|
|
||||||
|
|
||||||
# W-4
|
|
||||||
$marital: MaritalStatus
|
|
||||||
$multipleJob: Boolean
|
|
||||||
$childrens: Int
|
|
||||||
$otherDeps: Int
|
|
||||||
$totalCredits: Float
|
|
||||||
$otherInconme: Float
|
|
||||||
$deductions: Float
|
|
||||||
$extraWithholding: Float
|
|
||||||
|
|
||||||
# I-9
|
|
||||||
$citizen: CitizenshipStatus
|
|
||||||
$uscis: String
|
|
||||||
$passportNumber: String
|
|
||||||
$countryIssue: String
|
|
||||||
$prepartorOrTranslator: Boolean
|
|
||||||
|
|
||||||
# both
|
|
||||||
$signature: String
|
|
||||||
$date: Timestamp
|
|
||||||
|
|
||||||
$status: TaxFormStatus!
|
|
||||||
$staffId: UUID!
|
|
||||||
$createdBy: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
taxForm_insert(
|
|
||||||
data: {
|
|
||||||
formType: $formType
|
|
||||||
firstName: $firstName
|
|
||||||
lastName: $lastName
|
|
||||||
mInitial: $mInitial
|
|
||||||
oLastName: $oLastName
|
|
||||||
dob: $dob
|
|
||||||
socialSN: $socialSN
|
|
||||||
email: $email
|
|
||||||
phone: $phone
|
|
||||||
address: $address
|
|
||||||
city: $city
|
|
||||||
apt: $apt
|
|
||||||
state: $state
|
|
||||||
zipCode: $zipCode
|
|
||||||
|
|
||||||
marital: $marital
|
|
||||||
multipleJob: $multipleJob
|
|
||||||
childrens: $childrens
|
|
||||||
otherDeps: $otherDeps
|
|
||||||
totalCredits: $totalCredits
|
|
||||||
otherInconme: $otherInconme
|
|
||||||
deductions: $deductions
|
|
||||||
extraWithholding: $extraWithholding
|
|
||||||
|
|
||||||
citizen: $citizen
|
|
||||||
uscis: $uscis
|
|
||||||
passportNumber: $passportNumber
|
|
||||||
countryIssue: $countryIssue
|
|
||||||
prepartorOrTranslator: $prepartorOrTranslator
|
|
||||||
|
|
||||||
signature: $signature
|
|
||||||
date: $date
|
|
||||||
|
|
||||||
status: $status
|
|
||||||
staffId: $staffId
|
|
||||||
createdBy: $createdBy
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateTaxForm(
|
|
||||||
$id: UUID!
|
|
||||||
|
|
||||||
$formType: TaxFormType
|
|
||||||
$firstName: String
|
|
||||||
$lastName: String
|
|
||||||
$mInitial: String
|
|
||||||
$oLastName: String
|
|
||||||
$dob: Timestamp
|
|
||||||
$socialSN: Int
|
|
||||||
$email: String
|
|
||||||
$phone: String
|
|
||||||
$address: String
|
|
||||||
$city: String
|
|
||||||
$apt: String
|
|
||||||
$state: String
|
|
||||||
$zipCode: String
|
|
||||||
|
|
||||||
# W-4
|
|
||||||
$marital: MaritalStatus
|
|
||||||
$multipleJob: Boolean
|
|
||||||
$childrens: Int
|
|
||||||
$otherDeps: Int
|
|
||||||
$totalCredits: Float
|
|
||||||
$otherInconme: Float
|
|
||||||
$deductions: Float
|
|
||||||
$extraWithholding: Float
|
|
||||||
|
|
||||||
# I-9
|
|
||||||
$citizen: CitizenshipStatus
|
|
||||||
$uscis: String
|
|
||||||
$passportNumber: String
|
|
||||||
$countryIssue: String
|
|
||||||
$prepartorOrTranslator: Boolean
|
|
||||||
|
|
||||||
# both
|
|
||||||
$signature: String
|
|
||||||
$date: Timestamp
|
|
||||||
|
|
||||||
$status: TaxFormStatus
|
|
||||||
|
|
||||||
) @auth(level: USER) {
|
|
||||||
taxForm_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
formType: $formType
|
|
||||||
firstName: $firstName
|
|
||||||
lastName: $lastName
|
|
||||||
mInitial: $mInitial
|
|
||||||
oLastName: $oLastName
|
|
||||||
dob: $dob
|
|
||||||
socialSN: $socialSN
|
|
||||||
email: $email
|
|
||||||
phone: $phone
|
|
||||||
address: $address
|
|
||||||
city: $city
|
|
||||||
apt: $apt
|
|
||||||
state: $state
|
|
||||||
zipCode: $zipCode
|
|
||||||
|
|
||||||
marital: $marital
|
|
||||||
multipleJob: $multipleJob
|
|
||||||
childrens: $childrens
|
|
||||||
otherDeps: $otherDeps
|
|
||||||
totalCredits: $totalCredits
|
|
||||||
otherInconme: $otherInconme
|
|
||||||
deductions: $deductions
|
|
||||||
extraWithholding: $extraWithholding
|
|
||||||
|
|
||||||
citizen: $citizen
|
|
||||||
uscis: $uscis
|
|
||||||
passportNumber: $passportNumber
|
|
||||||
countryIssue: $countryIssue
|
|
||||||
prepartorOrTranslator: $prepartorOrTranslator
|
|
||||||
|
|
||||||
signature: $signature
|
|
||||||
date: $date
|
|
||||||
|
|
||||||
status: $status
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteTaxForm($id: UUID!) @auth(level: USER) {
|
|
||||||
taxForm_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
|
|
||||||
# ==========================================================
|
|
||||||
# TAX FORM - QUERIES (USE where, NOT filter)
|
|
||||||
# Include ALL fields from the new TaxForm type
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
query listTaxForms($offset: Int, $limit: Int) @auth(level: USER) {
|
|
||||||
taxForms(offset: $offset, limit: $limit, orderBy: { createdAt: DESC }) {
|
|
||||||
id
|
|
||||||
formType
|
|
||||||
firstName
|
|
||||||
lastName
|
|
||||||
mInitial
|
|
||||||
oLastName
|
|
||||||
dob
|
|
||||||
socialSN
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
address
|
|
||||||
city
|
|
||||||
apt
|
|
||||||
state
|
|
||||||
zipCode
|
|
||||||
|
|
||||||
marital
|
|
||||||
multipleJob
|
|
||||||
childrens
|
|
||||||
otherDeps
|
|
||||||
totalCredits
|
|
||||||
otherInconme
|
|
||||||
deductions
|
|
||||||
extraWithholding
|
|
||||||
|
|
||||||
citizen
|
|
||||||
uscis
|
|
||||||
passportNumber
|
|
||||||
countryIssue
|
|
||||||
prepartorOrTranslator
|
|
||||||
|
|
||||||
signature
|
|
||||||
date
|
|
||||||
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTaxFormById($id: UUID!) @auth(level: USER) {
|
|
||||||
taxForm(id: $id) {
|
|
||||||
id
|
|
||||||
formType
|
|
||||||
firstName
|
|
||||||
lastName
|
|
||||||
mInitial
|
|
||||||
oLastName
|
|
||||||
dob
|
|
||||||
socialSN
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
address
|
|
||||||
city
|
|
||||||
apt
|
|
||||||
state
|
|
||||||
zipCode
|
|
||||||
|
|
||||||
marital
|
|
||||||
multipleJob
|
|
||||||
childrens
|
|
||||||
otherDeps
|
|
||||||
totalCredits
|
|
||||||
otherInconme
|
|
||||||
deductions
|
|
||||||
extraWithholding
|
|
||||||
|
|
||||||
citizen
|
|
||||||
uscis
|
|
||||||
passportNumber
|
|
||||||
countryIssue
|
|
||||||
prepartorOrTranslator
|
|
||||||
|
|
||||||
signature
|
|
||||||
date
|
|
||||||
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTaxFormsByStaffId(
|
|
||||||
$staffId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
taxForms(
|
|
||||||
where: { staffId: { eq: $staffId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
formType
|
|
||||||
firstName
|
|
||||||
lastName
|
|
||||||
mInitial
|
|
||||||
oLastName
|
|
||||||
dob
|
|
||||||
socialSN
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
address
|
|
||||||
city
|
|
||||||
apt
|
|
||||||
state
|
|
||||||
zipCode
|
|
||||||
|
|
||||||
marital
|
|
||||||
multipleJob
|
|
||||||
childrens
|
|
||||||
otherDeps
|
|
||||||
totalCredits
|
|
||||||
otherInconme
|
|
||||||
deductions
|
|
||||||
extraWithholding
|
|
||||||
|
|
||||||
citizen
|
|
||||||
uscis
|
|
||||||
passportNumber
|
|
||||||
countryIssue
|
|
||||||
prepartorOrTranslator
|
|
||||||
|
|
||||||
signature
|
|
||||||
date
|
|
||||||
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query listTaxFormsWhere(
|
|
||||||
$formType: TaxFormType
|
|
||||||
$status: TaxFormStatus
|
|
||||||
$staffId: UUID
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
taxForms(
|
|
||||||
where: {
|
|
||||||
formType: { eq: $formType }
|
|
||||||
status: { eq: $status }
|
|
||||||
staffId: { eq: $staffId }
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
formType
|
|
||||||
firstName
|
|
||||||
lastName
|
|
||||||
mInitial
|
|
||||||
oLastName
|
|
||||||
dob
|
|
||||||
socialSN
|
|
||||||
email
|
|
||||||
phone
|
|
||||||
address
|
|
||||||
city
|
|
||||||
apt
|
|
||||||
state
|
|
||||||
zipCode
|
|
||||||
|
|
||||||
marital
|
|
||||||
multipleJob
|
|
||||||
childrens
|
|
||||||
otherDeps
|
|
||||||
totalCredits
|
|
||||||
otherInconme
|
|
||||||
deductions
|
|
||||||
extraWithholding
|
|
||||||
|
|
||||||
citizen
|
|
||||||
uscis
|
|
||||||
passportNumber
|
|
||||||
countryIssue
|
|
||||||
prepartorOrTranslator
|
|
||||||
|
|
||||||
signature
|
|
||||||
date
|
|
||||||
|
|
||||||
status
|
|
||||||
staffId
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
mutation createTeam(
|
|
||||||
$teamName: String!
|
|
||||||
$ownerId: UUID!
|
|
||||||
$ownerName: String!
|
|
||||||
$ownerRole: String!
|
|
||||||
$email: String
|
|
||||||
$companyLogo: String
|
|
||||||
$totalMembers: Int
|
|
||||||
$activeMembers: Int
|
|
||||||
$totalHubs: Int
|
|
||||||
$departments: Any
|
|
||||||
$favoriteStaffCount: Int
|
|
||||||
$blockedStaffCount: Int
|
|
||||||
$favoriteStaff: Any
|
|
||||||
$blockedStaff: Any
|
|
||||||
) @auth(level: USER) {
|
|
||||||
team_insert(
|
|
||||||
data: {
|
|
||||||
teamName: $teamName
|
|
||||||
ownerId: $ownerId
|
|
||||||
ownerName: $ownerName
|
|
||||||
ownerRole: $ownerRole
|
|
||||||
email: $email
|
|
||||||
companyLogo: $companyLogo
|
|
||||||
totalMembers: $totalMembers
|
|
||||||
activeMembers: $activeMembers
|
|
||||||
totalHubs: $totalHubs
|
|
||||||
departments: $departments
|
|
||||||
favoriteStaffCount: $favoriteStaffCount
|
|
||||||
blockedStaffCount: $blockedStaffCount
|
|
||||||
favoriteStaff: $favoriteStaff
|
|
||||||
blockedStaff: $blockedStaff
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateTeam(
|
|
||||||
$id: UUID!
|
|
||||||
$teamName: String
|
|
||||||
$ownerName: String
|
|
||||||
$ownerRole: String
|
|
||||||
$companyLogo: String
|
|
||||||
$totalMembers: Int
|
|
||||||
$activeMembers: Int
|
|
||||||
$totalHubs: Int
|
|
||||||
$departments: Any
|
|
||||||
$favoriteStaffCount: Int
|
|
||||||
$blockedStaffCount: Int
|
|
||||||
$favoriteStaff: Any
|
|
||||||
$blockedStaff: Any
|
|
||||||
) @auth(level: USER) {
|
|
||||||
team_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
teamName: $teamName
|
|
||||||
ownerName: $ownerName
|
|
||||||
ownerRole: $ownerRole
|
|
||||||
companyLogo: $companyLogo
|
|
||||||
totalMembers: $totalMembers
|
|
||||||
activeMembers: $activeMembers
|
|
||||||
totalHubs: $totalHubs
|
|
||||||
departments: $departments
|
|
||||||
favoriteStaffCount: $favoriteStaffCount
|
|
||||||
blockedStaffCount: $blockedStaffCount
|
|
||||||
favoriteStaff: $favoriteStaff
|
|
||||||
blockedStaff: $blockedStaff
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteTeam($id: UUID!) @auth(level: USER) {
|
|
||||||
team_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
query listTeams @auth(level: USER) {
|
|
||||||
teams {
|
|
||||||
id
|
|
||||||
teamName
|
|
||||||
ownerId
|
|
||||||
ownerName
|
|
||||||
ownerRole
|
|
||||||
email
|
|
||||||
companyLogo
|
|
||||||
totalMembers
|
|
||||||
activeMembers
|
|
||||||
totalHubs
|
|
||||||
departments
|
|
||||||
favoriteStaffCount
|
|
||||||
blockedStaffCount
|
|
||||||
favoriteStaff
|
|
||||||
blockedStaff
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamById($id: UUID!) @auth(level: USER) {
|
|
||||||
team(id: $id) {
|
|
||||||
id
|
|
||||||
teamName
|
|
||||||
ownerId
|
|
||||||
ownerName
|
|
||||||
ownerRole
|
|
||||||
email
|
|
||||||
companyLogo
|
|
||||||
totalMembers
|
|
||||||
activeMembers
|
|
||||||
totalHubs
|
|
||||||
departments
|
|
||||||
favoriteStaffCount
|
|
||||||
blockedStaffCount
|
|
||||||
favoriteStaff
|
|
||||||
blockedStaff
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamsByOwnerId($ownerId: UUID!) @auth(level: USER) {
|
|
||||||
teams(where: { ownerId: { eq: $ownerId } }) {
|
|
||||||
id
|
|
||||||
teamName
|
|
||||||
ownerId
|
|
||||||
ownerName
|
|
||||||
ownerRole
|
|
||||||
email
|
|
||||||
companyLogo
|
|
||||||
totalMembers
|
|
||||||
activeMembers
|
|
||||||
totalHubs
|
|
||||||
departments
|
|
||||||
favoriteStaffCount
|
|
||||||
blockedStaffCount
|
|
||||||
favoriteStaff
|
|
||||||
blockedStaff
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
mutation createTeamHub(
|
|
||||||
$teamId: UUID!
|
|
||||||
$hubName: String!
|
|
||||||
$address: String!
|
|
||||||
|
|
||||||
$placeId: String
|
|
||||||
$latitude: Float
|
|
||||||
$longitude: Float
|
|
||||||
|
|
||||||
$city: String
|
|
||||||
$state: String
|
|
||||||
$street: String
|
|
||||||
$country: String
|
|
||||||
$zipCode: String
|
|
||||||
|
|
||||||
$managerName: String
|
|
||||||
$isActive: Boolean
|
|
||||||
$departments: Any
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHub_insert(
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
hubName: $hubName
|
|
||||||
address: $address
|
|
||||||
|
|
||||||
placeId: $placeId
|
|
||||||
latitude: $latitude
|
|
||||||
longitude: $longitude
|
|
||||||
|
|
||||||
city: $city
|
|
||||||
state: $state
|
|
||||||
street: $street
|
|
||||||
country: $country
|
|
||||||
zipCode: $zipCode
|
|
||||||
|
|
||||||
managerName: $managerName
|
|
||||||
isActive: $isActive
|
|
||||||
departments: $departments
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateTeamHub(
|
|
||||||
$id: UUID!
|
|
||||||
|
|
||||||
$teamId: UUID
|
|
||||||
$hubName: String
|
|
||||||
$address: String
|
|
||||||
|
|
||||||
$placeId: String
|
|
||||||
$latitude: Float
|
|
||||||
$longitude: Float
|
|
||||||
|
|
||||||
$city: String
|
|
||||||
$state: String
|
|
||||||
$street: String
|
|
||||||
$country: String
|
|
||||||
$zipCode: String
|
|
||||||
|
|
||||||
$managerName: String
|
|
||||||
$isActive: Boolean
|
|
||||||
$departments: Any
|
|
||||||
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHub_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
hubName: $hubName
|
|
||||||
address: $address
|
|
||||||
|
|
||||||
placeId: $placeId
|
|
||||||
latitude: $latitude
|
|
||||||
longitude: $longitude
|
|
||||||
|
|
||||||
city: $city
|
|
||||||
state: $state
|
|
||||||
street: $street
|
|
||||||
country: $country
|
|
||||||
zipCode: $zipCode
|
|
||||||
|
|
||||||
managerName: $managerName
|
|
||||||
isActive: $isActive
|
|
||||||
departments: $departments
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteTeamHub($id: UUID!) @auth(level: USER) {
|
|
||||||
teamHub_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
|
|
||||||
# ==========================================================
|
|
||||||
# TEAM HUB - QUERIES (USE where, NOT filter)
|
|
||||||
# Include ALL fields in TeamHub
|
|
||||||
# ==========================================================
|
|
||||||
|
|
||||||
query listTeamHubs($offset: Int, $limit: Int) @auth(level: USER) {
|
|
||||||
teamHubs(offset: $offset, limit: $limit, orderBy: { createdAt: DESC }) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
hubName
|
|
||||||
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
zipCode
|
|
||||||
|
|
||||||
managerName
|
|
||||||
isActive
|
|
||||||
departments
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamHubById($id: UUID!) @auth(level: USER) {
|
|
||||||
teamHub(id: $id) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
hubName
|
|
||||||
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
zipCode
|
|
||||||
|
|
||||||
managerName
|
|
||||||
isActive
|
|
||||||
departments
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamHubsByTeamId(
|
|
||||||
$teamId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHubs(
|
|
||||||
where: { teamId: { eq: $teamId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
hubName
|
|
||||||
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
zipCode
|
|
||||||
|
|
||||||
managerName
|
|
||||||
isActive
|
|
||||||
departments
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# LIST TEAM HUBS BY OWNER (Vendor/Business)
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
query listTeamHubsByOwnerId(
|
|
||||||
$ownerId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHubs(
|
|
||||||
where: {
|
|
||||||
team: {
|
|
||||||
ownerId: { eq: $ownerId }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
orderBy: { createdAt: DESC }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
hubName
|
|
||||||
|
|
||||||
address
|
|
||||||
placeId
|
|
||||||
latitude
|
|
||||||
longitude
|
|
||||||
|
|
||||||
city
|
|
||||||
state
|
|
||||||
street
|
|
||||||
country
|
|
||||||
zipCode
|
|
||||||
|
|
||||||
managerName
|
|
||||||
isActive
|
|
||||||
departments
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
|
|
||||||
mutation createTeamHudDepartment(
|
|
||||||
$name: String!
|
|
||||||
$costCenter: String
|
|
||||||
$teamHubId: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHudDepartment_insert(
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
costCenter: $costCenter
|
|
||||||
teamHubId: $teamHubId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateTeamHudDepartment(
|
|
||||||
$id: UUID!
|
|
||||||
|
|
||||||
$name: String
|
|
||||||
$costCenter: String
|
|
||||||
$teamHubId: UUID
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHudDepartment_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
name: $name
|
|
||||||
costCenter: $costCenter
|
|
||||||
teamHubId: $teamHubId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteTeamHudDepartment($id: UUID!) @auth(level: USER) {
|
|
||||||
teamHudDepartment_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST ALL (admin/debug)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listTeamHudDepartments(
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHudDepartments(offset: $offset, limit: $limit) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costCenter
|
|
||||||
|
|
||||||
teamHubId
|
|
||||||
teamHub {
|
|
||||||
id
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# GET BY ID
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query getTeamHudDepartmentById($id: UUID!) @auth(level: USER) {
|
|
||||||
teamHudDepartment(id: $id) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costCenter
|
|
||||||
|
|
||||||
teamHubId
|
|
||||||
teamHub {
|
|
||||||
id
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# LIST BY TEAM HUB ID
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
query listTeamHudDepartmentsByTeamHubId(
|
|
||||||
$teamHubId: UUID!
|
|
||||||
$offset: Int
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHudDepartments(
|
|
||||||
where: { teamHubId: { eq: $teamHubId } }
|
|
||||||
offset: $offset
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
costCenter
|
|
||||||
|
|
||||||
teamHubId
|
|
||||||
teamHub {
|
|
||||||
id
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
createdAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
mutation createTeamMember(
|
|
||||||
$teamId: UUID!
|
|
||||||
$role: TeamMemberRole!
|
|
||||||
$title: String
|
|
||||||
$department: String
|
|
||||||
$teamHubId: UUID
|
|
||||||
$isActive: Boolean
|
|
||||||
$userId: String!
|
|
||||||
$inviteStatus: TeamMemberInviteStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember_insert(
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
role: $role
|
|
||||||
title: $title
|
|
||||||
department: $department
|
|
||||||
teamHubId: $teamHubId
|
|
||||||
isActive: $isActive
|
|
||||||
userId: $userId
|
|
||||||
inviteStatus: $inviteStatus
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateTeamMember(
|
|
||||||
$id: UUID!
|
|
||||||
$role: TeamMemberRole
|
|
||||||
$title: String
|
|
||||||
$department: String
|
|
||||||
$teamHubId: UUID
|
|
||||||
$isActive: Boolean
|
|
||||||
$inviteStatus: TeamMemberInviteStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
role: $role
|
|
||||||
title: $title
|
|
||||||
department: $department
|
|
||||||
teamHubId: $teamHubId
|
|
||||||
isActive: $isActive
|
|
||||||
inviteStatus: $inviteStatus
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateTeamMemberInviteStatus(
|
|
||||||
$id: UUID!
|
|
||||||
$inviteStatus: TeamMemberInviteStatus!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember_update(
|
|
||||||
id: $id
|
|
||||||
data: {
|
|
||||||
inviteStatus: $inviteStatus
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation acceptInviteByCode(
|
|
||||||
$inviteCode: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember_updateMany(
|
|
||||||
where: {
|
|
||||||
inviteCode: { eq: $inviteCode }
|
|
||||||
inviteStatus: { eq: PENDING }
|
|
||||||
}
|
|
||||||
data: {
|
|
||||||
inviteStatus: ACCEPTED
|
|
||||||
isActive: true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation cancelInviteByCode(
|
|
||||||
$inviteCode: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember_updateMany(
|
|
||||||
where: {
|
|
||||||
inviteCode: { eq: $inviteCode }
|
|
||||||
inviteStatus: { eq: PENDING }
|
|
||||||
}
|
|
||||||
data: {
|
|
||||||
inviteStatus: CANCELLED
|
|
||||||
isActive: false
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
mutation deleteTeamMember($id: UUID!) @auth(level: USER) {
|
|
||||||
teamMember_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
query listTeamMembers @auth(level: USER) {
|
|
||||||
teamMembers {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
role
|
|
||||||
title
|
|
||||||
department
|
|
||||||
teamHubId
|
|
||||||
isActive
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub{
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamMemberById($id: UUID!) @auth(level: USER) {
|
|
||||||
teamMember(id: $id) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
role
|
|
||||||
title
|
|
||||||
department
|
|
||||||
teamHubId
|
|
||||||
isActive
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub{
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamMembersByTeamId($teamId: UUID!) @auth(level: USER) {
|
|
||||||
teamMembers(where: { teamId: { eq: $teamId } }) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
role
|
|
||||||
title
|
|
||||||
department
|
|
||||||
teamHubId
|
|
||||||
isActive
|
|
||||||
createdAt
|
|
||||||
|
|
||||||
user {
|
|
||||||
fullName
|
|
||||||
email
|
|
||||||
}
|
|
||||||
|
|
||||||
teamHub{
|
|
||||||
hubName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
mutation CreateUser(
|
|
||||||
$id: String!, # Firebase UID
|
|
||||||
$email: String,
|
|
||||||
$fullName: String,
|
|
||||||
$role: UserBaseRole!,
|
|
||||||
$userRole: String,
|
|
||||||
$photoUrl: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
user_insert(
|
|
||||||
data: {
|
|
||||||
id: $id
|
|
||||||
email: $email
|
|
||||||
fullName: $fullName
|
|
||||||
role: $role
|
|
||||||
userRole: $userRole
|
|
||||||
photoUrl: $photoUrl
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateUser(
|
|
||||||
$id: String!,
|
|
||||||
$email: String,
|
|
||||||
$fullName: String,
|
|
||||||
$role: UserBaseRole,
|
|
||||||
$userRole: String,
|
|
||||||
$photoUrl: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
user_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
email: $email
|
|
||||||
fullName: $fullName
|
|
||||||
role: $role
|
|
||||||
userRole: $userRole
|
|
||||||
photoUrl: $photoUrl
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteUser(
|
|
||||||
$id: String!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
user_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
query listUsers @auth(level: USER) {
|
|
||||||
users {
|
|
||||||
id
|
|
||||||
email
|
|
||||||
fullName
|
|
||||||
role
|
|
||||||
userRole
|
|
||||||
photoUrl
|
|
||||||
createdDate
|
|
||||||
updatedDate
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getUserById(
|
|
||||||
$id: String!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
user(id: $id) {
|
|
||||||
id
|
|
||||||
email
|
|
||||||
fullName
|
|
||||||
role
|
|
||||||
userRole
|
|
||||||
photoUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterUsers(
|
|
||||||
$id: String,
|
|
||||||
$email: String,
|
|
||||||
$role: UserBaseRole,
|
|
||||||
$userRole: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
users(
|
|
||||||
where: {
|
|
||||||
id: { eq: $id }
|
|
||||||
email: { eq: $email }
|
|
||||||
role: { eq: $role }
|
|
||||||
userRole: { eq: $userRole }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
email
|
|
||||||
fullName
|
|
||||||
role
|
|
||||||
userRole
|
|
||||||
photoUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
|
|
||||||
mutation createUserConversation(
|
|
||||||
$conversationId: UUID!
|
|
||||||
$userId: String!
|
|
||||||
$unreadCount: Int
|
|
||||||
$lastReadAt: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
userConversation_insert(
|
|
||||||
data: {
|
|
||||||
conversationId: $conversationId
|
|
||||||
userId: $userId
|
|
||||||
unreadCount: $unreadCount
|
|
||||||
lastReadAt: $lastReadAt
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation updateUserConversation(
|
|
||||||
$conversationId: UUID!
|
|
||||||
$userId: String!
|
|
||||||
$unreadCount: Int
|
|
||||||
$lastReadAt: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
userConversation_update(
|
|
||||||
key: { conversationId: $conversationId, userId: $userId }
|
|
||||||
data: {
|
|
||||||
unreadCount: $unreadCount
|
|
||||||
lastReadAt: $lastReadAt
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# MARK AS READ (sets unreadCount=0 + lastReadAt=now)
|
|
||||||
# Note: request.time is valid in schema defaults; in mutations
|
|
||||||
# you can pass Timestamp from client. If you want "now" server-side,
|
|
||||||
# you'd typically pass null and have logic elsewhere.
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
mutation markConversationAsRead(
|
|
||||||
$conversationId: UUID!
|
|
||||||
$userId: String!
|
|
||||||
$lastReadAt: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
userConversation_update(
|
|
||||||
key: { conversationId: $conversationId, userId: $userId }
|
|
||||||
data: {
|
|
||||||
unreadCount: 0
|
|
||||||
lastReadAt: $lastReadAt
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# INCREMENT UNREAD (common after sending message)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
mutation incrementUnreadForUser(
|
|
||||||
$conversationId: UUID!
|
|
||||||
$userId: String!
|
|
||||||
$unreadCount: Int!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
userConversation_update(
|
|
||||||
key: { conversationId: $conversationId, userId: $userId }
|
|
||||||
data: { unreadCount: $unreadCount }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation deleteUserConversation(
|
|
||||||
$conversationId: UUID!
|
|
||||||
$userId: String!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
userConversation_delete(
|
|
||||||
key: { conversationId: $conversationId, userId: $userId }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user