Compare commits
33 Commits
bc5b73e080
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6ecefb8d9 | ||
|
|
be029ee054 | ||
|
|
df35b8991d | ||
|
|
4349fa39b4 | ||
|
|
7ed3367ed8 | ||
|
|
90c192c881 | ||
|
|
e9943dae76 | ||
|
|
4e77578abf | ||
|
|
72c213eaea | ||
|
|
c26abee957 | ||
|
|
fe30561a40 | ||
|
|
056b9f6c80 | ||
|
|
e86b356baf | ||
|
|
57edf5b4a8 | ||
|
|
453d02612c | ||
|
|
93b1fb9610 | ||
|
|
fb31f0813a | ||
|
|
c53c00e13c | ||
|
|
122ddae575 | ||
|
|
2e2f37ab86 | ||
|
|
cacc04a217 | ||
|
|
f740c11685 | ||
|
|
fa098f4a1b | ||
|
|
a043d64229 | ||
|
|
9d6e5bb7a3 | ||
|
|
aec1fd5ad1 | ||
|
|
02442a162a | ||
|
|
364be9976a | ||
|
|
e1ae0a36d7 | ||
|
|
71a8e267dc | ||
|
|
2934e099b1 | ||
|
|
dad9f4fce1 | ||
|
|
9c1c2f6356 |
9
.run/all_start_dev.run.xml
Normal file
9
.run/all_start_dev.run.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="all:start:dev" type="CompoundRunConfigurationType">
|
||||
<toRun name="dev:gui" type="ShConfigurationType" />
|
||||
<toRun name="dev:lib" type="ShConfigurationType" />
|
||||
<toRun name="dev:server" type="ShConfigurationType" />
|
||||
<toRun name="docker-env-dev" type="ShConfigurationType" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
17
.run/dev_gui.run.xml
Normal file
17
.run/dev_gui.run.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="dev:gui" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="cd admin && npm run start" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="/usr/bin/zsh" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
17
.run/dev_lib.run.xml
Normal file
17
.run/dev_lib.run.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="dev:lib" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="cd admin && ng build @rschneider/ng-daisyui --watch " />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="/usr/bin/zsh" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
17
.run/dev_server.run.xml
Normal file
17
.run/dev_server.run.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="dev:server" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="cd server && npm run start:dev" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="/usr/bin/zsh" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
17
.run/docker-env-dev.run.xml
Normal file
17
.run/docker-env-dev.run.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="docker-env-dev" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="cd environment/dev && docker compose up -d" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="/usr/bin/zsh" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
66
.vscode/launch.json
vendored
Normal file
66
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"program": "${file}"
|
||||
},
|
||||
{
|
||||
"name": "NPM Start Admin",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}/admin",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": [
|
||||
"run",
|
||||
"start"
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
},
|
||||
{
|
||||
"name": "NPM Start LIB",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}/admin",
|
||||
"runtimeExecutable": "ng",
|
||||
"runtimeArgs": [
|
||||
"build",
|
||||
"@rschneider/ng-daisyui",
|
||||
"--watch"
|
||||
],
|
||||
"console": "integratedTerminal"
|
||||
},
|
||||
{
|
||||
"name": "NPM Start REST",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}/server",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": [
|
||||
"run",
|
||||
"start:dev"
|
||||
],
|
||||
"preLaunchTask": "Docker Up (Environment)",
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Full Stack: Docker + App + GUI",
|
||||
"configurations": [
|
||||
"NPM Start LIB",
|
||||
"NPM Start Admin",
|
||||
"NPM Start REST"
|
||||
],
|
||||
"stopAll": true
|
||||
}
|
||||
]
|
||||
}
|
||||
19
.vscode/settings.json
vendored
Normal file
19
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"editor.fontFamily": "'FiraCode Nerd Font Mono',Menlo, Monaco, 'Courier New', monospace",
|
||||
"terminal.integrated.fontFamily": "'FiraCode Nerd Font Mono'",
|
||||
"markdown.preview.fontFamily": "'FiraCode Nerd Font Mono',-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif",
|
||||
"sqltools.connections": [
|
||||
{
|
||||
"ssh": "Disabled",
|
||||
"previewLimit": 50,
|
||||
"server": "localhost",
|
||||
"port": 4301,
|
||||
"driver": "PostgreSQL",
|
||||
"name": "dvbooking-dev",
|
||||
"group": "dvbooking",
|
||||
"database": "dvbooking",
|
||||
"username": "postgres",
|
||||
"password": "test"
|
||||
}
|
||||
]
|
||||
}
|
||||
18
.vscode/tasks.json
vendored
Normal file
18
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Docker Up (Environment)",
|
||||
"type": "shell",
|
||||
"command": "docker compose up -d",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/environment/dev"
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "new"
|
||||
},
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
5
admin/generate.openapi.client.sh
Normal file
5
admin/generate.openapi.client.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "workdir ${pwd}"
|
||||
wget -O ./openapi/api.json localhost:3000/api-json
|
||||
npx ng-openapi -i ./openapi/api.json -o ./src/api
|
||||
1
admin/openapi/api.json
Normal file
1
admin/openapi/api.json
Normal file
File diff suppressed because one or more lines are too long
422
admin/package-lock.json
generated
422
admin/package-lock.json
generated
@@ -40,6 +40,7 @@
|
||||
"karma-coverage": "~2.2.0",
|
||||
"karma-jasmine": "~5.1.0",
|
||||
"karma-jasmine-html-reporter": "~2.1.0",
|
||||
"ng-openapi": "^0.2.10",
|
||||
"ng-packagr": "^20.3.0",
|
||||
"typescript": "~5.9.2"
|
||||
}
|
||||
@@ -923,6 +924,30 @@
|
||||
"node": ">=0.1.90"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
|
||||
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "0.3.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": {
|
||||
"version": "0.3.9",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
|
||||
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/resolve-uri": "^3.0.3",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.10"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz",
|
||||
@@ -2499,6 +2524,44 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodelib/fs.scandir": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
||||
"integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "2.0.5",
|
||||
"run-parallel": "^1.1.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodelib/fs.stat": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
|
||||
"integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodelib/fs.walk": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
|
||||
"integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.scandir": "2.1.5",
|
||||
"fastq": "^1.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@npmcli/agent": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz",
|
||||
@@ -3879,6 +3942,62 @@
|
||||
"tailwindcss": "4.1.17"
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-morph/common": {
|
||||
"version": "0.27.0",
|
||||
"resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.27.0.tgz",
|
||||
"integrity": "sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-glob": "^3.3.3",
|
||||
"minimatch": "^10.0.1",
|
||||
"path-browserify": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-morph/common/node_modules/minimatch": {
|
||||
"version": "10.1.1",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
|
||||
"integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/brace-expansion": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@tsconfig/node10": {
|
||||
"version": "1.0.12",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz",
|
||||
"integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tsconfig/node12": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
|
||||
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tsconfig/node14": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
|
||||
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tsconfig/node16": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
|
||||
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tufjs/canonical-json": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz",
|
||||
@@ -3963,6 +4082,13 @@
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/swagger-schema-official": {
|
||||
"version": "2.0.25",
|
||||
"resolved": "https://registry.npmjs.org/@types/swagger-schema-official/-/swagger-schema-official-2.0.25.tgz",
|
||||
"integrity": "sha512-T92Xav+Gf/Ik1uPW581nA+JftmjWPgskw/WBf4TJzxRG/SJ+DfNnNE+WuZ4mrXuzflQMqMkm1LSYjzYW7MB1Cg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@vitejs/plugin-basic-ssl": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-2.1.0.tgz",
|
||||
@@ -4007,6 +4133,32 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.15.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
|
||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-walk": {
|
||||
"version": "8.3.4",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz",
|
||||
"integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"acorn": "^8.11.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "7.1.4",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
|
||||
@@ -4157,6 +4309,20 @@
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
||||
"dev": true,
|
||||
"license": "Python-2.0"
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
@@ -4635,6 +4801,13 @@
|
||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/code-block-writer": {
|
||||
"version": "13.0.3",
|
||||
"resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
|
||||
"integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
@@ -4848,6 +5021,13 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
@@ -4994,6 +5174,16 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/dom-serialize": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz",
|
||||
@@ -5545,6 +5735,23 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
|
||||
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "^2.0.2",
|
||||
"@nodelib/fs.walk": "^1.2.3",
|
||||
"glob-parent": "^5.1.2",
|
||||
"merge2": "^1.3.0",
|
||||
"micromatch": "^4.0.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-json-stable-stringify": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
|
||||
@@ -5569,6 +5776,16 @@
|
||||
],
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/fastq": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
|
||||
"integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"reusify": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/fdir": {
|
||||
"version": "6.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
|
||||
@@ -6508,6 +6725,19 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
||||
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"js-yaml": "bin/js-yaml.js"
|
||||
}
|
||||
},
|
||||
"node_modules/jsesc": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
|
||||
@@ -7613,6 +7843,13 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/make-fetch-happen": {
|
||||
"version": "14.0.3",
|
||||
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz",
|
||||
@@ -7669,13 +7906,22 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/merge2": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
|
||||
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"braces": "^3.0.3",
|
||||
"picomatch": "^2.3.1"
|
||||
@@ -7690,7 +7936,6 @@
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
},
|
||||
@@ -8057,6 +8302,44 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ng-openapi": {
|
||||
"version": "0.2.10",
|
||||
"resolved": "https://registry.npmjs.org/ng-openapi/-/ng-openapi-0.2.10.tgz",
|
||||
"integrity": "sha512-QddaPUVh69Tb6pfBx/2odT3rA6/gBUYpUD0sLr4QaTkvazUGEzytqGcbX3hRkU9eaHuKjbq2yU7c+UOdbWYLjA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/swagger-schema-official": "^2.0.25",
|
||||
"commander": "^14.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"ts-morph": "^26.0.0",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"bin": {
|
||||
"ng-openapi": "cli.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0",
|
||||
"npm": ">=8.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "buymeacoffee",
|
||||
"url": "https://buymeacoffee.com/ngopenapi"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": ">=15",
|
||||
"@angular/core": ">=15"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@angular/common": {
|
||||
"optional": false
|
||||
},
|
||||
"@angular/core": {
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/ng-packagr": {
|
||||
"version": "20.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ng-packagr/-/ng-packagr-20.3.2.tgz",
|
||||
@@ -8718,6 +9001,13 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-browserify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
|
||||
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
@@ -8973,6 +9263,27 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/queue-microtask": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
||||
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
@@ -9095,6 +9406,17 @@
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/reusify": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
|
||||
"integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"iojs": ">=1.0.0",
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rfdc": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz",
|
||||
@@ -9201,6 +9523,30 @@
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/run-parallel": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
||||
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"queue-microtask": "^1.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/rxjs": {
|
||||
"version": "7.8.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
|
||||
@@ -10114,6 +10460,61 @@
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-morph": {
|
||||
"version": "26.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-26.0.0.tgz",
|
||||
"integrity": "sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ts-morph/common": "~0.27.0",
|
||||
"code-block-writer": "^13.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-node": {
|
||||
"version": "10.9.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
|
||||
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-support": "^0.8.0",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
"@tsconfig/node16": "^1.0.2",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn-walk": "^8.1.1",
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"v8-compile-cache-lib": "^3.0.1",
|
||||
"yn": "3.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"ts-node": "dist/bin.js",
|
||||
"ts-node-cwd": "dist/bin-cwd.js",
|
||||
"ts-node-esm": "dist/bin-esm.js",
|
||||
"ts-node-script": "dist/bin-script.js",
|
||||
"ts-node-transpile-only": "dist/bin-transpile.js",
|
||||
"ts-script": "dist/bin-script-deprecated.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@swc/core": ">=1.2.50",
|
||||
"@swc/wasm": ">=1.2.50",
|
||||
"@types/node": "*",
|
||||
"typescript": ">=2.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@swc/core": {
|
||||
"optional": true
|
||||
},
|
||||
"@swc/wasm": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
@@ -10305,6 +10706,13 @@
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/v8-compile-cache-lib": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
|
||||
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/validate-npm-package-license": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||
@@ -10726,6 +11134,16 @@
|
||||
"node": "^20.19.0 || ^22.12.0 || >=23"
|
||||
}
|
||||
},
|
||||
"node_modules/yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/yoctocolors-cjs": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"start": "ng serve --proxy-config proxy.conf.json",
|
||||
"build": "ng build",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"generate.openapi.client": "bash ./generate.openapi.client.sh",
|
||||
"test": "ng test"
|
||||
},
|
||||
"prettier": {
|
||||
@@ -54,6 +55,7 @@
|
||||
"karma-coverage": "~2.2.0",
|
||||
"karma-jasmine": "~5.1.0",
|
||||
"karma-jasmine-html-reporter": "~2.1.0",
|
||||
"ng-openapi": "^0.2.10",
|
||||
"ng-packagr": "^20.3.0",
|
||||
"typescript": "~5.9.2"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<div class="join">
|
||||
@if (pageCount() > 1) {
|
||||
<button class="join-item btn" (click)="paginate(1)"><</button>
|
||||
}
|
||||
@for (page of pages(); track page){
|
||||
<button class="join-item btn"
|
||||
[class.btn-active]="activePage() === page"
|
||||
(click)="paginate(page)"
|
||||
>{{page}}</button>
|
||||
}
|
||||
@if (pageCount() > 1) {
|
||||
<button class="join-item btn" (click)="paginate(pageCount())">></button>
|
||||
}
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Pagination } from './pagination';
|
||||
|
||||
describe('Pagination', () => {
|
||||
let component: Pagination;
|
||||
let fixture: ComponentFixture<Pagination>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [Pagination]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(Pagination);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Component, computed, input, output } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'rs-daisy-pagination',
|
||||
imports: [],
|
||||
templateUrl: './pagination.html',
|
||||
styleUrl: './pagination.css',
|
||||
})
|
||||
export class Pagination {
|
||||
pageCount = input<number>(0);
|
||||
activePage = input<number>(0);
|
||||
pages = computed( () => {
|
||||
console.info("pag.pagecount", this.pageCount())
|
||||
return [...Array(this.pageCount() ?? 1)].map((_,i) => i+1)
|
||||
})
|
||||
|
||||
onPaginate = output<number>();
|
||||
|
||||
|
||||
paginate(page: number){
|
||||
this.onPaginate.emit(page);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ export * from './lib/components/button/button';
|
||||
export * from './lib/components/footer/footer';
|
||||
export * from './lib/components/breadcrumbs/breadcrumbs';
|
||||
export * from './lib/components/modal/modal';
|
||||
export * from './lib/components/pagination/pagination';
|
||||
export * from './lib/components/card/card-with-centered-content-and-paddings/card-with-centered-content-and-paddings';
|
||||
export * from './lib/daisy.types';
|
||||
export * from './lib/layout/';
|
||||
|
||||
16
admin/src/api/index.ts
Normal file
16
admin/src/api/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Entrypoint for the client
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
export * from "./models";
|
||||
export * from "./tokens";
|
||||
export * from "./providers";
|
||||
export * from "./services";
|
||||
export * from "./utils/file-download";
|
||||
export * from "./utils/http-params-builder";
|
||||
export * from "./utils/date-transformer";
|
||||
127
admin/src/api/models/index.ts
Normal file
127
admin/src/api/models/index.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated TypeScript interfaces from Swagger specification
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpContext, HttpHeaders } from "@angular/common/http";
|
||||
export interface CreateUserDto {
|
||||
username: string;
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface UpdateUserDto {
|
||||
username: string;
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface LoginRequestDto {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface CreateEventTypeDto {
|
||||
}
|
||||
|
||||
export interface UpdateEventTypeDto {
|
||||
}
|
||||
|
||||
export interface CreateProductDto {
|
||||
}
|
||||
|
||||
export interface UpdateProductDto {
|
||||
}
|
||||
|
||||
export interface CreateEventDto {
|
||||
}
|
||||
|
||||
export interface UpdateEventDto {
|
||||
}
|
||||
|
||||
export interface CreateUserGroupDto {
|
||||
}
|
||||
|
||||
export interface UpdateUserGroupDto {
|
||||
}
|
||||
|
||||
export interface CreateUserRoleDto {
|
||||
}
|
||||
|
||||
export interface UpdateUserRoleDto {
|
||||
}
|
||||
|
||||
export interface CreateRecurrenceRuleDto {
|
||||
}
|
||||
|
||||
export interface UpdateRecurrenceRuleDto {
|
||||
}
|
||||
|
||||
export interface CreateEventExceptionDto {
|
||||
}
|
||||
|
||||
export interface UpdateEventExceptionDto {
|
||||
}
|
||||
|
||||
export interface CreateExceptionDto {
|
||||
}
|
||||
|
||||
export interface CalendarCreateBookingDto {
|
||||
occurrenceStartTime: Date;
|
||||
userId: number;
|
||||
reservedSeatsCount: number;
|
||||
notes: string;
|
||||
}
|
||||
|
||||
export interface CancelBookingDto {
|
||||
canceledReason: string;
|
||||
}
|
||||
|
||||
export interface UserResponseDto {
|
||||
id: number;
|
||||
username: string;
|
||||
}
|
||||
|
||||
export interface BookingResponseDto {
|
||||
id: number;
|
||||
eventId: number;
|
||||
occurrenceStartTime: Date;
|
||||
notes?: string;
|
||||
reservedSeatsCount: number;
|
||||
canceledAt: string | null;
|
||||
createdAt: string | null;
|
||||
user: UserResponseDto;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export interface PaginationResponseMetaDto {
|
||||
totalItems: number;
|
||||
itemCount: number;
|
||||
itemsPerPage: number;
|
||||
totalPages: number;
|
||||
currentPage: number;
|
||||
}
|
||||
|
||||
export interface CalenderControllerGetBookingResponse {
|
||||
data: Array<BookingResponseDto>;
|
||||
meta: PaginationResponseMetaDto;
|
||||
}
|
||||
|
||||
export interface CreateBookingDto {
|
||||
}
|
||||
|
||||
export interface UpdateBookingDto {
|
||||
}
|
||||
|
||||
/** Request Options for Angular HttpClient requests */
|
||||
export interface RequestOptions<TResponseType extends 'arraybuffer' | 'blob' | 'json' | 'text'> {
|
||||
headers?: HttpHeaders;
|
||||
reportProgress?: boolean;
|
||||
responseType?: TResponseType;
|
||||
withCredentials?: boolean;
|
||||
context?: HttpContext;
|
||||
}
|
||||
93
admin/src/api/providers.ts
Normal file
93
admin/src/api/providers.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated provider functions for easy setup
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { EnvironmentProviders, Provider, makeEnvironmentProviders } from "@angular/core";
|
||||
import { HTTP_INTERCEPTORS, HttpInterceptor } from "@angular/common/http";
|
||||
import { BASE_PATH_DEFAULT, HTTP_INTERCEPTORS_DEFAULT } from "./tokens";
|
||||
import { DefaultBaseInterceptor } from "./utils/base-interceptor";
|
||||
import { DateInterceptor } from "./utils/date-transformer";
|
||||
|
||||
/** Configuration options for default client */
|
||||
export interface DefaultConfig {
|
||||
/** Base API URL */
|
||||
basePath: string;
|
||||
/** Enable automatic date transformation (default: true) */
|
||||
enableDateTransform?: boolean;
|
||||
/** Array of HTTP interceptor classes to apply to this client */
|
||||
interceptors?: (new (...args: HttpInterceptor[]) => HttpInterceptor)[];
|
||||
}
|
||||
|
||||
/** Provides configuration for default client */
|
||||
/** */
|
||||
/** @example */
|
||||
/** ```typescript */
|
||||
/** // In your app.config.ts */
|
||||
/** import { provideDefaultClient } from './api/providers'; */
|
||||
/** */
|
||||
/** export const appConfig: ApplicationConfig = { */
|
||||
/** providers: [ */
|
||||
/** provideDefaultClient({ */
|
||||
/** basePath: 'https://api.example.com', */
|
||||
/** interceptors: [AuthInterceptor, LoggingInterceptor] // Classes, not instances */
|
||||
/** }), */
|
||||
/** // other providers... */
|
||||
/** ] */
|
||||
/** }; */
|
||||
/** ``` */
|
||||
export function provideDefaultClient(config: DefaultConfig): EnvironmentProviders {
|
||||
|
||||
const providers: Provider[] = [
|
||||
// Base path token for this client
|
||||
{
|
||||
provide: BASE_PATH_DEFAULT,
|
||||
useValue: config.basePath
|
||||
},
|
||||
// Base interceptor that handles client-specific interceptors
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: DefaultBaseInterceptor,
|
||||
multi: true
|
||||
}
|
||||
];
|
||||
|
||||
// Add client-specific interceptor instances
|
||||
if (config.interceptors && config.interceptors.length > 0) {
|
||||
const interceptorInstances = config.interceptors.map(InterceptorClass => new InterceptorClass());
|
||||
|
||||
// Add date interceptor if enabled (default: true)
|
||||
if (config.enableDateTransform !== false) {
|
||||
interceptorInstances.unshift(new DateInterceptor());
|
||||
}
|
||||
|
||||
providers.push({
|
||||
provide: HTTP_INTERCEPTORS_DEFAULT,
|
||||
useValue: interceptorInstances
|
||||
});
|
||||
} else if (config.enableDateTransform !== false) {
|
||||
// Only date interceptor enabled
|
||||
providers.push({
|
||||
provide: HTTP_INTERCEPTORS_DEFAULT,
|
||||
useValue: [new DateInterceptor()]
|
||||
});
|
||||
} else {
|
||||
// No interceptors
|
||||
providers.push({
|
||||
provide: HTTP_INTERCEPTORS_DEFAULT,
|
||||
useValue: []
|
||||
});
|
||||
}
|
||||
|
||||
return makeEnvironmentProviders(providers);
|
||||
}
|
||||
|
||||
/** @deprecated Use provideDefaultClient instead for better clarity */
|
||||
/** Provides configuration for the default client */
|
||||
export function provideNgOpenapi(config: DefaultConfig): EnvironmentProviders {
|
||||
return provideDefaultClient(config);
|
||||
}
|
||||
43
admin/src/api/services/app.service.ts
Normal file
43
admin/src/api/services/app.service.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for App controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class AppService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
appControllerGetHello(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
appControllerGetHello(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
appControllerGetHello(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
appControllerGetHello(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
}
|
||||
75
admin/src/api/services/auth.service.ts
Normal file
75
admin/src/api/services/auth.service.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for Auth controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { LoginRequestDto, RequestOptions } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class AuthService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
authControllerLogin(loginRequestDto: LoginRequestDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
authControllerLogin(loginRequestDto: LoginRequestDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
authControllerLogin(loginRequestDto: LoginRequestDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
authControllerLogin(loginRequestDto: LoginRequestDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/auth/login`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, loginRequestDto, requestOptions);
|
||||
}
|
||||
|
||||
authControllerLogout(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
authControllerLogout(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
authControllerLogout(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
authControllerLogout(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/auth/logout`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, null, requestOptions);
|
||||
}
|
||||
|
||||
authControllerRefresh(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
authControllerRefresh(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
authControllerRefresh(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
authControllerRefresh(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/auth/refresh`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, null, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/bookings.service.ts
Normal file
135
admin/src/api/services/bookings.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for Bookings controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateBookingDto, UpdateBookingDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class BookingsService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
bookingsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
bookingsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
bookingsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
bookingsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/bookings`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/bookings`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createBookingDto, requestOptions);
|
||||
}
|
||||
|
||||
bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/bookings/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
bookingsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
bookingsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
bookingsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
bookingsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/bookings/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/bookings/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateBookingDto, requestOptions);
|
||||
}
|
||||
|
||||
bookingsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
bookingsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
bookingsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
bookingsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/bookings/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
189
admin/src/api/services/calendar.service.ts
Normal file
189
admin/src/api/services/calendar.service.ts
Normal file
@@ -0,0 +1,189 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for Calendar controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateEventDto, CreateExceptionDto, CalendarCreateBookingDto, CancelBookingDto, CalenderControllerGetBookingResponse } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class CalendarService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
calendarControllerGetCalendarEvents(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
calendarControllerGetCalendarEvents(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
calendarControllerGetCalendarEvents(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
calendarControllerGetCalendarEvents(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/events`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createEventDto, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerGetEventById(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
calendarControllerGetEventById(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
calendarControllerGetEventById(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
calendarControllerGetEventById(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/events/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/events/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, createEventDto, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerDeleteEvent(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
calendarControllerDeleteEvent(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
calendarControllerDeleteEvent(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
calendarControllerDeleteEvent(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/events/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/events/${id}/exceptions`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createExceptionDto, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/events/${id}/bookings`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, calendarCreateBookingDto, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<CalenderControllerGetBookingResponse>;
|
||||
calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<CalenderControllerGetBookingResponse>>;
|
||||
calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<CalenderControllerGetBookingResponse>>;
|
||||
calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/bookings/${bookingId}/cancel`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, cancelBookingDto, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'body', options?: RequestOptions<'json'>): Observable<CalenderControllerGetBookingResponse>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<CalenderControllerGetBookingResponse>>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<CalenderControllerGetBookingResponse>>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/bookings/${eventId}`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
if (sortBy != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, sortBy, 'sortBy');
|
||||
}
|
||||
if (order != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, order, 'order');
|
||||
}
|
||||
if (startTime != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, startTime, 'startTime');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/eventExceptions.service.ts
Normal file
135
admin/src/api/services/eventExceptions.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for EventExceptions controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateEventExceptionDto, UpdateEventExceptionDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class EventExceptionsService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
eventExceptionsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventExceptionsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventExceptionsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventExceptionsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-exceptions`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventExceptionsControllerCreate(createEventExceptionDto: CreateEventExceptionDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventExceptionsControllerCreate(createEventExceptionDto: CreateEventExceptionDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventExceptionsControllerCreate(createEventExceptionDto: CreateEventExceptionDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventExceptionsControllerCreate(createEventExceptionDto: CreateEventExceptionDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-exceptions`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createEventExceptionDto, requestOptions);
|
||||
}
|
||||
|
||||
eventExceptionsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventExceptionsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventExceptionsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventExceptionsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-exceptions/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventExceptionsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventExceptionsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventExceptionsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventExceptionsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-exceptions/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventExceptionsControllerUpdate(id: number, updateEventExceptionDto: UpdateEventExceptionDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventExceptionsControllerUpdate(id: number, updateEventExceptionDto: UpdateEventExceptionDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventExceptionsControllerUpdate(id: number, updateEventExceptionDto: UpdateEventExceptionDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventExceptionsControllerUpdate(id: number, updateEventExceptionDto: UpdateEventExceptionDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-exceptions/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateEventExceptionDto, requestOptions);
|
||||
}
|
||||
|
||||
eventExceptionsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventExceptionsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventExceptionsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventExceptionsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-exceptions/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/eventTypes.service.ts
Normal file
135
admin/src/api/services/eventTypes.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for EventTypes controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateEventTypeDto, UpdateEventTypeDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class EventTypesService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
eventTypesControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventTypesControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventTypesControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventTypesControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-type`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventTypesControllerCreate(createEventTypeDto: CreateEventTypeDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventTypesControllerCreate(createEventTypeDto: CreateEventTypeDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventTypesControllerCreate(createEventTypeDto: CreateEventTypeDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventTypesControllerCreate(createEventTypeDto: CreateEventTypeDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-type`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createEventTypeDto, requestOptions);
|
||||
}
|
||||
|
||||
eventTypesControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventTypesControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventTypesControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventTypesControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-type/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventTypesControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventTypesControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventTypesControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventTypesControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-type/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventTypesControllerUpdate(id: number, updateEventTypeDto: UpdateEventTypeDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventTypesControllerUpdate(id: number, updateEventTypeDto: UpdateEventTypeDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventTypesControllerUpdate(id: number, updateEventTypeDto: UpdateEventTypeDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventTypesControllerUpdate(id: number, updateEventTypeDto: UpdateEventTypeDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-type/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateEventTypeDto, requestOptions);
|
||||
}
|
||||
|
||||
eventTypesControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventTypesControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventTypesControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventTypesControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/event-type/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/events.service.ts
Normal file
135
admin/src/api/services/events.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for Events controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateEventDto, UpdateEventDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class EventsService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
eventsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/events`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventsControllerCreate(createEventDto: CreateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventsControllerCreate(createEventDto: CreateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventsControllerCreate(createEventDto: CreateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventsControllerCreate(createEventDto: CreateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/events`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createEventDto, requestOptions);
|
||||
}
|
||||
|
||||
eventsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/events/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/events/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
eventsControllerUpdate(id: number, updateEventDto: UpdateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventsControllerUpdate(id: number, updateEventDto: UpdateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventsControllerUpdate(id: number, updateEventDto: UpdateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventsControllerUpdate(id: number, updateEventDto: UpdateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/events/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateEventDto, requestOptions);
|
||||
}
|
||||
|
||||
eventsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
eventsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
eventsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
eventsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/events/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
22
admin/src/api/services/index.ts
Normal file
22
admin/src/api/services/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated service exports
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
export { AppService } from "./app.service";
|
||||
export { AuthService } from "./auth.service";
|
||||
export { BookingsService } from "./bookings.service";
|
||||
export { CalendarService } from "./calendar.service";
|
||||
export { EventExceptionsService } from "./eventExceptions.service";
|
||||
export { EventTypesService } from "./eventTypes.service";
|
||||
export { EventsService } from "./events.service";
|
||||
export { PingService } from "./ping.service";
|
||||
export { ProductsService } from "./products.service";
|
||||
export { RecurrenceRulesService } from "./recurrenceRules.service";
|
||||
export { UserService } from "./user.service";
|
||||
export { UserGroupsService } from "./userGroups.service";
|
||||
export { UserRolesService } from "./userRoles.service";
|
||||
59
admin/src/api/services/ping.service.ts
Normal file
59
admin/src/api/services/ping.service.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for Ping controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class PingService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
pingControllerPing(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
pingControllerPing(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
pingControllerPing(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
pingControllerPing(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/ping`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
pingControllerPingAuth(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
pingControllerPingAuth(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
pingControllerPingAuth(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
pingControllerPingAuth(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/ping/auth`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/products.service.ts
Normal file
135
admin/src/api/services/products.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for Products controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateProductDto, UpdateProductDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class ProductsService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
productsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
productsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
productsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
productsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/products`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
productsControllerCreate(createProductDto: CreateProductDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
productsControllerCreate(createProductDto: CreateProductDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
productsControllerCreate(createProductDto: CreateProductDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
productsControllerCreate(createProductDto: CreateProductDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/products`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createProductDto, requestOptions);
|
||||
}
|
||||
|
||||
productsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
productsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
productsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
productsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/products/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
productsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
productsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
productsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
productsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/products/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
productsControllerUpdate(id: number, updateProductDto: UpdateProductDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
productsControllerUpdate(id: number, updateProductDto: UpdateProductDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
productsControllerUpdate(id: number, updateProductDto: UpdateProductDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
productsControllerUpdate(id: number, updateProductDto: UpdateProductDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/products/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateProductDto, requestOptions);
|
||||
}
|
||||
|
||||
productsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
productsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
productsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
productsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/products/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/recurrenceRules.service.ts
Normal file
135
admin/src/api/services/recurrenceRules.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for RecurrenceRules controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateRecurrenceRuleDto, UpdateRecurrenceRuleDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class RecurrenceRulesService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
recurrenceRulesControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
recurrenceRulesControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
recurrenceRulesControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
recurrenceRulesControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/recurrence-rules`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
recurrenceRulesControllerCreate(createRecurrenceRuleDto: CreateRecurrenceRuleDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
recurrenceRulesControllerCreate(createRecurrenceRuleDto: CreateRecurrenceRuleDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
recurrenceRulesControllerCreate(createRecurrenceRuleDto: CreateRecurrenceRuleDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
recurrenceRulesControllerCreate(createRecurrenceRuleDto: CreateRecurrenceRuleDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/recurrence-rules`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createRecurrenceRuleDto, requestOptions);
|
||||
}
|
||||
|
||||
recurrenceRulesControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
recurrenceRulesControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
recurrenceRulesControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
recurrenceRulesControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/recurrence-rules/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
recurrenceRulesControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
recurrenceRulesControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
recurrenceRulesControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
recurrenceRulesControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/recurrence-rules/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
recurrenceRulesControllerUpdate(id: number, updateRecurrenceRuleDto: UpdateRecurrenceRuleDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
recurrenceRulesControllerUpdate(id: number, updateRecurrenceRuleDto: UpdateRecurrenceRuleDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
recurrenceRulesControllerUpdate(id: number, updateRecurrenceRuleDto: UpdateRecurrenceRuleDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
recurrenceRulesControllerUpdate(id: number, updateRecurrenceRuleDto: UpdateRecurrenceRuleDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/recurrence-rules/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateRecurrenceRuleDto, requestOptions);
|
||||
}
|
||||
|
||||
recurrenceRulesControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
recurrenceRulesControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
recurrenceRulesControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
recurrenceRulesControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/recurrence-rules/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/user.service.ts
Normal file
135
admin/src/api/services/user.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for User controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateUserDto, UpdateUserDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class UserService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
userControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userControllerCreate(createUserDto: CreateUserDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userControllerCreate(createUserDto: CreateUserDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userControllerCreate(createUserDto: CreateUserDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userControllerCreate(createUserDto: CreateUserDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createUserDto, requestOptions);
|
||||
}
|
||||
|
||||
userControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userControllerFindOne(id: string, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userControllerFindOne(id: string, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userControllerFindOne(id: string, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userControllerFindOne(id: string, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateUserDto, requestOptions);
|
||||
}
|
||||
|
||||
userControllerRemove(id: string, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userControllerRemove(id: string, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userControllerRemove(id: string, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userControllerRemove(id: string, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/userGroups.service.ts
Normal file
135
admin/src/api/services/userGroups.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for UserGroups controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateUserGroupDto, UpdateUserGroupDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class UserGroupsService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
userGroupsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userGroupsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userGroupsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userGroupsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-group`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userGroupsControllerCreate(createUserGroupDto: CreateUserGroupDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userGroupsControllerCreate(createUserGroupDto: CreateUserGroupDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userGroupsControllerCreate(createUserGroupDto: CreateUserGroupDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userGroupsControllerCreate(createUserGroupDto: CreateUserGroupDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-group`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createUserGroupDto, requestOptions);
|
||||
}
|
||||
|
||||
userGroupsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userGroupsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userGroupsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userGroupsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-group/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userGroupsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userGroupsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userGroupsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userGroupsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-group/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userGroupsControllerUpdate(id: number, updateUserGroupDto: UpdateUserGroupDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userGroupsControllerUpdate(id: number, updateUserGroupDto: UpdateUserGroupDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userGroupsControllerUpdate(id: number, updateUserGroupDto: UpdateUserGroupDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userGroupsControllerUpdate(id: number, updateUserGroupDto: UpdateUserGroupDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-group/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateUserGroupDto, requestOptions);
|
||||
}
|
||||
|
||||
userGroupsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userGroupsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userGroupsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userGroupsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-group/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
135
admin/src/api/services/userRoles.service.ts
Normal file
135
admin/src/api/services/userRoles.service.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Angular service for UserRoles controller
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateUserRoleDto, UpdateUserRoleDto } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class UserRolesService {
|
||||
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||
const context = existingContext || new HttpContext();
|
||||
return context.set(this.clientContextToken, 'default');
|
||||
}
|
||||
|
||||
userRolesControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userRolesControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userRolesControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userRolesControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-role`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userRolesControllerCreate(createUserRoleDto: CreateUserRoleDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userRolesControllerCreate(createUserRoleDto: CreateUserRoleDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userRolesControllerCreate(createUserRoleDto: CreateUserRoleDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userRolesControllerCreate(createUserRoleDto: CreateUserRoleDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-role`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.post(url, createUserRoleDto, requestOptions);
|
||||
}
|
||||
|
||||
userRolesControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userRolesControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userRolesControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userRolesControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-role/search`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (q != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||
}
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userRolesControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userRolesControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userRolesControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userRolesControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-role/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.get(url, requestOptions);
|
||||
}
|
||||
|
||||
userRolesControllerUpdate(id: number, updateUserRoleDto: UpdateUserRoleDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userRolesControllerUpdate(id: number, updateUserRoleDto: UpdateUserRoleDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userRolesControllerUpdate(id: number, updateUserRoleDto: UpdateUserRoleDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userRolesControllerUpdate(id: number, updateUserRoleDto: UpdateUserRoleDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-role/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.patch(url, updateUserRoleDto, requestOptions);
|
||||
}
|
||||
|
||||
userRolesControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
userRolesControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
userRolesControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
userRolesControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/user-role/${id}`;
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
};
|
||||
|
||||
return this.httpClient.delete(url, requestOptions);
|
||||
}
|
||||
}
|
||||
29
admin/src/api/tokens/index.ts
Normal file
29
admin/src/api/tokens/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { InjectionToken } from "@angular/core";
|
||||
import { HttpInterceptor, HttpContextToken } from "@angular/common/http";
|
||||
|
||||
/**
|
||||
* Injection token for the default client base API path
|
||||
*/
|
||||
export const BASE_PATH_DEFAULT = new InjectionToken<string>('BASE_PATH_DEFAULT', {
|
||||
providedIn: 'root',
|
||||
factory: () => '/api', // Default fallback
|
||||
});
|
||||
/**
|
||||
* Injection token for the default client HTTP interceptor instances
|
||||
*/
|
||||
export const HTTP_INTERCEPTORS_DEFAULT = new InjectionToken<HttpInterceptor[]>('HTTP_INTERCEPTORS_DEFAULT', {
|
||||
providedIn: 'root',
|
||||
factory: () => [], // Default empty array
|
||||
});
|
||||
/**
|
||||
* HttpContext token to identify requests belonging to the default client
|
||||
*/
|
||||
export const CLIENT_CONTEXT_TOKEN_DEFAULT = new HttpContextToken<string>(() => 'default');
|
||||
/**
|
||||
* @deprecated Use BASE_PATH_DEFAULT instead
|
||||
*/
|
||||
export const BASE_PATH = BASE_PATH_DEFAULT;
|
||||
/**
|
||||
* @deprecated Use CLIENT_CONTEXT_TOKEN_DEFAULT instead
|
||||
*/
|
||||
export const CLIENT_CONTEXT_TOKEN = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
40
admin/src/api/utils/base-interceptor.ts
Normal file
40
admin/src/api/utils/base-interceptor.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/* @ts-nocheck */
|
||||
/* eslint-disable */
|
||||
/* @noformat */
|
||||
/* @formatter:off */
|
||||
/**
|
||||
* Generated by ng-openapi
|
||||
* Generated Base Interceptor for client default
|
||||
* Do not edit this file manually
|
||||
*/
|
||||
import { HttpContextToken, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { CLIENT_CONTEXT_TOKEN_DEFAULT, HTTP_INTERCEPTORS_DEFAULT } from "../tokens";
|
||||
|
||||
@Injectable()
|
||||
export class DefaultBaseInterceptor implements HttpInterceptor {
|
||||
private readonly httpInterceptors: HttpInterceptor[] = inject(HTTP_INTERCEPTORS_DEFAULT);
|
||||
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
|
||||
// Check if this request belongs to this client using HttpContext
|
||||
if (!req.context.has(this.clientContextToken)) {
|
||||
// This request doesn't belong to this client, pass it through
|
||||
return next.handle(req);
|
||||
}
|
||||
|
||||
// Apply client-specific interceptors in reverse order
|
||||
let handler = next;
|
||||
|
||||
handler = this.httpInterceptors.reduceRight(
|
||||
(next, interceptor) => ({
|
||||
handle: (request: HttpRequest<any>) => interceptor.intercept(request, next)
|
||||
}),
|
||||
handler
|
||||
);
|
||||
|
||||
return handler.handle(req);
|
||||
}
|
||||
}
|
||||
50
admin/src/api/utils/date-transformer.ts
Normal file
50
admin/src/api/utils/date-transformer.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from "@angular/common/http";
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Observable, map } from "rxjs";
|
||||
|
||||
export const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/;
|
||||
|
||||
export function transformDates(obj: any): any {
|
||||
|
||||
if (obj === null || obj === undefined || typeof obj !== 'object') {
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (obj instanceof Date) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.map(item => transformDates(item));
|
||||
}
|
||||
|
||||
if (typeof obj === 'object') {
|
||||
const transformed: any = {};
|
||||
for (const key of Object.keys(obj)) {
|
||||
const value = obj[key];
|
||||
if (typeof value === 'string' && ISO_DATE_REGEX.test(value)) {
|
||||
transformed[key] = new Date(value);
|
||||
} else {
|
||||
transformed[key] = transformDates(value);
|
||||
}
|
||||
}
|
||||
return transformed;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class DateInterceptor implements HttpInterceptor {
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
|
||||
return next.handle(req).pipe(
|
||||
map(event => {
|
||||
if (event instanceof HttpResponse && event.body) {
|
||||
return event.clone({ body: transformDates(event.body) });
|
||||
}
|
||||
return event;
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
61
admin/src/api/utils/file-download.ts
Normal file
61
admin/src/api/utils/file-download.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import { Observable, tap } from "rxjs";
|
||||
|
||||
export function downloadFile(blob: Blob, filename: string, mimeType?: string): void {
|
||||
|
||||
// Create a temporary URL for the blob
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
|
||||
// Create a temporary anchor element and trigger download
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = filename;
|
||||
|
||||
// Append to body, click, and remove
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
|
||||
// Clean up the URL
|
||||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
export function downloadFileOperator<T extends Blob>(filename: string | ((blob: T) => string), mimeType?: string): (source: Observable<T>) => Observable<T> {
|
||||
|
||||
return (source: Observable<T>) => {
|
||||
return source.pipe(
|
||||
tap((blob: T) => {
|
||||
const actualFilename = typeof filename === 'function' ? filename(blob) : filename;
|
||||
downloadFile(blob, actualFilename, mimeType);
|
||||
})
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export function extractFilenameFromContentDisposition(contentDisposition: string | null, fallbackFilename: string = "download"): string {
|
||||
|
||||
if (!contentDisposition) {
|
||||
return fallbackFilename;
|
||||
}
|
||||
|
||||
// Try to extract filename from Content-Disposition header
|
||||
// Supports both "filename=" and "filename*=" formats
|
||||
const filenameMatch = contentDisposition.match(/filename\*?=['"]?([^'"\n;]+)['"]?/i);
|
||||
|
||||
if (filenameMatch && filenameMatch[1]) {
|
||||
// Decode if it's RFC 5987 encoded (filename*=UTF-8''...)
|
||||
const filename = filenameMatch[1];
|
||||
if (filename.includes("''")) {
|
||||
const parts = filename.split("''");
|
||||
if (parts.length === 2) {
|
||||
try {
|
||||
return decodeURIComponent(parts[1]);
|
||||
} catch {
|
||||
return parts[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
return fallbackFilename;
|
||||
}
|
||||
65
admin/src/api/utils/http-params-builder.ts
Normal file
65
admin/src/api/utils/http-params-builder.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import { HttpParams } from "@angular/common/http";
|
||||
|
||||
export class HttpParamsBuilder {
|
||||
/** Adds a value to HttpParams. Delegates to recursive handler for objects/arrays. */
|
||||
public static addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
|
||||
const isDate = value instanceof Date;
|
||||
const isArray = Array.isArray(value);
|
||||
const isObject = typeof value === "object" && !isDate && !isArray;
|
||||
|
||||
if (isObject) {
|
||||
return this.addToHttpParamsRecursive(httpParams, value);
|
||||
}
|
||||
|
||||
return this.addToHttpParamsRecursive(httpParams, value, key);
|
||||
}
|
||||
|
||||
private static addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
|
||||
if (value == null) {
|
||||
return httpParams;
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
return this.handleArray(httpParams, value, key);
|
||||
}
|
||||
|
||||
if (value instanceof Date) {
|
||||
return this.handleDate(httpParams, value, key);
|
||||
}
|
||||
|
||||
if (typeof value === "object") {
|
||||
return this.handleObject(httpParams, value, key);
|
||||
}
|
||||
|
||||
return this.handlePrimitive(httpParams, value, key);
|
||||
}
|
||||
|
||||
private static handleArray(httpParams: HttpParams, arr: unknown[], key?: string): HttpParams {
|
||||
arr.forEach((element) => {
|
||||
httpParams = this.addToHttpParamsRecursive(httpParams, element, key);
|
||||
});
|
||||
return httpParams;
|
||||
}
|
||||
|
||||
private static handleDate(httpParams: HttpParams, date: Date, key?: string): HttpParams {
|
||||
if (!key) {
|
||||
throw new Error("key may not be null if value is Date");
|
||||
}
|
||||
return httpParams.append(key, date.toISOString().substring(0, 10));
|
||||
}
|
||||
|
||||
private static handleObject(httpParams: HttpParams, obj: Record<string, any>, key?: string): HttpParams {
|
||||
Object.keys(obj).forEach((prop) => {
|
||||
const nestedKey = key ? `${key}.${prop}` : prop;
|
||||
httpParams = this.addToHttpParamsRecursive(httpParams, obj[prop], nestedKey);
|
||||
});
|
||||
return httpParams;
|
||||
}
|
||||
|
||||
private static handlePrimitive(httpParams: HttpParams, value: string | number | boolean, key?: string): HttpParams {
|
||||
if (!key) {
|
||||
throw new Error("key may not be null if value is primitive");
|
||||
}
|
||||
return httpParams.append(key, value);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import { routes } from './app.routes';
|
||||
import { JwtInterceptor } from './auth/jwt.interceptor';
|
||||
import { AuthService } from './auth/auth.service';
|
||||
import { AuthGuard } from './auth/auth.guard';
|
||||
import { provideNgOpenapi } from '../api';
|
||||
import { environment } from '../environments/environment';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
@@ -16,6 +18,9 @@ export const appConfig: ApplicationConfig = {
|
||||
provideZonelessChangeDetection(),
|
||||
provideRouter(routes),
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideNgOpenapi({
|
||||
basePath: environment.apiBaseUrl
|
||||
}),
|
||||
AuthService,
|
||||
AuthGuard,
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },
|
||||
|
||||
@@ -3,11 +3,12 @@ import { Router, RouterOutlet } from '@angular/router';
|
||||
import { AuthService } from './auth/auth.service';
|
||||
import { AdminLayoutRs1 } from '../../projects/rschneider/ng-daisyui/src/lib/layout';
|
||||
import { Menu, MenuItem } from './components/menu/menu';
|
||||
import { SingleEventDashboardCard } from './features/calendar/components/calendar-view/single-event-dashboard-card/single-event-dashboard-card';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
|
||||
imports: [RouterOutlet, AdminLayoutRs1, Menu],
|
||||
imports: [RouterOutlet, AdminLayoutRs1, Menu, SingleEventDashboardCard], // Import it here
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.css',
|
||||
})
|
||||
@@ -74,8 +75,6 @@ export class App {
|
||||
}
|
||||
|
||||
logout(): void {
|
||||
// With the interceptor fixed, this is now the correct and robust way.
|
||||
// The error from a failed server logout will propagate here.
|
||||
this.authService.serverSideLogout().subscribe({
|
||||
next: () => {
|
||||
console.log('Server-side logout successful.');
|
||||
|
||||
27
admin/src/app/components/detail-view/detail-view.html
Normal file
27
admin/src/app/components/detail-view/detail-view.html
Normal file
@@ -0,0 +1,27 @@
|
||||
@if (config().data){
|
||||
<div class="overflow-x-auto" [ngClass]="config().styleClass">
|
||||
<table class="table w-full table-zebra">
|
||||
<tbody>
|
||||
@for (row of config().rows; track row.attribute) {
|
||||
<tr [ngClass]="row.getDetailClass ? row.getDetailClass(config().data) : ''">
|
||||
<th [ngClass]="row.getTitleStyleClass ? row.getTitleStyleClass(config().data) : ''">
|
||||
@if (row.titleComponent) {
|
||||
<ng-container *ngComponentOutlet="row.titleComponent; inputs: row.titleComponentInputs ? row.titleComponentInputs(config().data) : {}"></ng-container>
|
||||
} @else {
|
||||
{{ getTitle(row, config().data) }}
|
||||
}
|
||||
</th>
|
||||
<td [ngClass]="row.getValueStyleClass ? row.getValueStyleClass(config().data) : ''">
|
||||
@if (row.component) {
|
||||
<ng-container *ngComponentOutlet="row.component; inputs: row.componentInputs ? row.componentInputs(config().data) : {}"></ng-container>
|
||||
} @else {
|
||||
{{ getFormattedValue(row, config().data) }}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
}
|
||||
23
admin/src/app/components/detail-view/detail-view.spec.ts
Normal file
23
admin/src/app/components/detail-view/detail-view.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DetailView } from './detail-view';
|
||||
|
||||
describe('DetailView', () => {
|
||||
let component: DetailView;
|
||||
let fixture: ComponentFixture<DetailView>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [DetailView]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(DetailView);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
76
admin/src/app/components/detail-view/detail-view.ts
Normal file
76
admin/src/app/components/detail-view/detail-view.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import { Component, input, Type } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
export interface CellComponent<T> {
|
||||
component?: Type<any>;
|
||||
componentInputs?: (obj: T) => { [key: string]: any };
|
||||
}
|
||||
|
||||
export interface DetailViewRow<T> extends CellComponent<T> {
|
||||
attribute: keyof T;
|
||||
getValue?: (obj: T) => any;
|
||||
format?: 'date' | 'datetime' | 'number' | 'raw' | ((value: any) => string);
|
||||
getTitle?: string | ((obj: T) => string);
|
||||
getDetailClass?: (obj: T) => string;
|
||||
getTitleStyleClass?: (obj: T) => string;
|
||||
getValueStyleClass?: (obj: T) => string;
|
||||
titleComponent?: Type<any>;
|
||||
titleComponentInputs?: (obj: T) => { [key: string]: any };
|
||||
}
|
||||
|
||||
export interface DetailViewConfig<T> {
|
||||
data: T;
|
||||
rows: DetailViewRow<T>[];
|
||||
styleClass?: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-detail-view',
|
||||
imports: [CommonModule],
|
||||
templateUrl: './detail-view.html',
|
||||
styleUrl: './detail-view.css',
|
||||
})
|
||||
export class DetailView<T> {
|
||||
config = input.required<DetailViewConfig<T>>();
|
||||
|
||||
getFormattedValue(row: DetailViewRow<T>, data: T): string {
|
||||
let value : any;
|
||||
try {
|
||||
value = row.getValue ? row.getValue(data) : data[row.attribute];
|
||||
}catch (e) {
|
||||
value = '';
|
||||
|
||||
}
|
||||
|
||||
if (row.component) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (typeof row.format === 'function') {
|
||||
return row.format(value);
|
||||
}
|
||||
|
||||
switch (row.format) {
|
||||
case 'date':
|
||||
return new Date(value).toLocaleDateString();
|
||||
case 'datetime':
|
||||
return new Date(value).toLocaleString();
|
||||
case 'number':
|
||||
return Number(value).toString();
|
||||
case 'raw':
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
getTitle(row: DetailViewRow<T>, data: T): string {
|
||||
if (row.titleComponent) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (typeof row.getTitle === 'function') {
|
||||
return row.getTitle(data);
|
||||
}
|
||||
return row.getTitle || String(row.attribute);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<form [formGroup]="filterForm" class="p-4 bg-base-200 rounded-lg shadow">
|
||||
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 items-end">
|
||||
<div class="form-control"><label class="label"><span class="label-text">SearchTerm</span></label>
|
||||
<input type="text" formControlName="term" class="input input-bordered w-full" placeholder="Search term" /></div>
|
||||
<div class="form-control"><label class="label"><span class="label-text">Keresés</span></label>
|
||||
<input type="text" formControlName="term" class="input input-bordered w-full" placeholder="Keresés" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
0
admin/src/app/components/heading/heading.css
Normal file
0
admin/src/app/components/heading/heading.css
Normal file
10
admin/src/app/components/heading/heading.html
Normal file
10
admin/src/app/components/heading/heading.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- We use a generic container but tell the browser it is a heading -->
|
||||
<div
|
||||
role="heading"
|
||||
[attr.aria-level]="level()"
|
||||
class="text-3xl font-bold"
|
||||
[class]="'h' + level()"
|
||||
|
||||
>
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
14
admin/src/app/components/heading/heading.ts
Normal file
14
admin/src/app/components/heading/heading.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
|
||||
export type HeadingLevel = 1|2|3|4|5|6;
|
||||
|
||||
@Component({
|
||||
selector: 'app-heading',
|
||||
imports: [],
|
||||
templateUrl: './heading.html',
|
||||
styleUrl: './heading.css',
|
||||
})
|
||||
export class Heading {
|
||||
|
||||
level = input.required<HeadingLevel>()
|
||||
}
|
||||
0
admin/src/app/components/list-view/list-view.css
Normal file
0
admin/src/app/components/list-view/list-view.css
Normal file
1
admin/src/app/components/list-view/list-view.html
Normal file
1
admin/src/app/components/list-view/list-view.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>list-view works!</p>
|
||||
11
admin/src/app/components/list-view/list-view.ts
Normal file
11
admin/src/app/components/list-view/list-view.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-view',
|
||||
imports: [],
|
||||
templateUrl: './list-view.html',
|
||||
styleUrl: './list-view.css',
|
||||
})
|
||||
export class ListView {
|
||||
|
||||
}
|
||||
@@ -1,16 +1,26 @@
|
||||
<div>
|
||||
<h1>Naptár</h1>
|
||||
<div>
|
||||
<input type="text" name="startHour" id="starthour" #startHour>
|
||||
<a class="btn" (click)="addEvent($event)">add</a>
|
||||
</div>
|
||||
<full-calendar #calendar [options]="calendarOptions"></full-calendar>
|
||||
</div>
|
||||
|
||||
<rs-daisy-modal [isOpen]="isOpen()" (closeClick)="closeDialog()" >
|
||||
@if (isOpen()){
|
||||
<app-create-event-form (ready)="closeDialog()" [date]="selectedDate()" [id]="selectedEventId()"></app-create-event-form>
|
||||
}
|
||||
|
||||
@if (workflow() == 'event_create') {
|
||||
<rs-daisy-modal [isOpen]="true" (closeClick)="closeDialog()" [modalBoxStyleClass]="'max-w-none w-2xl'">
|
||||
<app-create-event-form (ready)="closeDialog()" [date]="selectedDate()" [id]="undefined"></app-create-event-form>
|
||||
</rs-daisy-modal>
|
||||
}
|
||||
|
||||
@if (workflow() == 'event_dashboard' && selectedEvent()) {
|
||||
<rs-daisy-modal [isOpen]="true" (closeClick)="closeDialog()" [modalBoxStyleClass]="'max-w-none w-2xl'">
|
||||
<app-single-event-dashboard [event]="selectedEvent()" (action)="setWorkFlow($event)"></app-single-event-dashboard>
|
||||
</rs-daisy-modal>
|
||||
}
|
||||
|
||||
@for (dialogDefinition of dialogs; track dialogDefinition) {
|
||||
|
||||
@if (dialogDefinition.isRendered()) {
|
||||
<rs-daisy-modal [isOpen]="true" (closeClick)="openDashboard()" [modalBoxStyleClass]="'max-w-none w-2xl'">
|
||||
<ng-container
|
||||
*ngComponentOutlet="dialogDefinition.component; inputs: dialogDefinition.componentInputs ? dialogDefinition.componentInputs() : {}; "></ng-container>
|
||||
</rs-daisy-modal>
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,11 @@
|
||||
import { AfterViewInit, Component, effect, ElementRef, inject, OnInit, signal, ViewChild } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
ElementRef,
|
||||
inject,
|
||||
signal,
|
||||
Type,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { FullCalendarComponent, FullCalendarModule } from '@fullcalendar/angular';
|
||||
import { CalendarOptions, EventInput } from '@fullcalendar/core';
|
||||
|
||||
@@ -9,157 +16,273 @@ import interactionPlugin from '@fullcalendar/interaction';
|
||||
import { Modal } from '@rschneider/ng-daisyui';
|
||||
import { CreateEventForm } from '../create-event-form/create-event-form';
|
||||
import { CalendarService } from '../../services/calendar.service';
|
||||
import { addDays, subDays } from 'date-fns';
|
||||
import { EventsInRangeDTO } from '../../models/events-in-range-dto.model';
|
||||
import { CalendarEventDto } from '../../models/events-in-range-dto.model';
|
||||
import { map } from 'rxjs';
|
||||
import { SingleEventDashboard } from './single-event-dashboard/single-event-dashboard';
|
||||
import { CommonModule, NgComponentOutlet } from '@angular/common';
|
||||
import {
|
||||
SingleEventDashboardEventDelete,
|
||||
} from './single-event-dashboard-event-delete/single-event-dashboard-event-delete';
|
||||
import {
|
||||
SingleEventDashboardEventActivation,
|
||||
} from './single-event-dashboard-event-activation/single-event-dashboard-event-activation.component';
|
||||
import { SingleEventDashboardEventEdit } from './single-event-dashboard-event-edit/single-event-dashboard-event-edit';
|
||||
import { EventBusService } from '../../../../services/event-bus.service';
|
||||
import { EventType } from '../../../../../types';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { SingleEventBookingCreate } from './single-event-booking-create/single-event-booking-create';
|
||||
import { SingleEventBookingList } from './single-event-booking-list/single-event-booking-list';
|
||||
|
||||
|
||||
export type WORKFLOW_TYPE = 'NO_DIALOG'
|
||||
| 'event_delete'
|
||||
| 'event_cancel'
|
||||
| 'event_dashboard'
|
||||
| 'event_create'
|
||||
| 'event_activate'
|
||||
| 'event_edit'
|
||||
| 'booking_create'
|
||||
| 'booking_list'
|
||||
| 'booking_cancel'
|
||||
;
|
||||
|
||||
@Component({
|
||||
selector: 'app-calendar-view',
|
||||
imports: [FullCalendarModule, Modal, CreateEventForm],
|
||||
imports: [FullCalendarModule, CommonModule, Modal, NgComponentOutlet, CreateEventForm, SingleEventDashboard],
|
||||
templateUrl: './calendar-view.html',
|
||||
styleUrl: './calendar-view.css',
|
||||
})
|
||||
export class CalendarView implements OnInit, AfterViewInit {
|
||||
export class CalendarView {
|
||||
|
||||
@ViewChild('startHour') startHour!: ElementRef;
|
||||
@ViewChild('calendar') calendarComponent: FullCalendarComponent | undefined;
|
||||
|
||||
private eventBus = inject(EventBusService);
|
||||
|
||||
calendarService = inject(CalendarService);
|
||||
|
||||
workflow = signal<string>('');
|
||||
isOpen = signal<boolean>(false);
|
||||
selectedDate = signal<Date|undefined>(undefined);
|
||||
selectedEventId = signal<number|undefined>(undefined)
|
||||
|
||||
events = signal<EventsInRangeDTO[]>([]);
|
||||
workflow = signal<WORKFLOW_TYPE>('NO_DIALOG');
|
||||
selectedDate = signal<Date | undefined>(undefined);
|
||||
selectedEvent = signal<CalendarEventDto | undefined>(undefined);
|
||||
|
||||
calendarOptions: CalendarOptions;
|
||||
dialogs: DialogConfig[] = [];
|
||||
|
||||
constructor() {
|
||||
const start = new Date();
|
||||
start.setHours(10, 0, 0);
|
||||
const end = new Date();
|
||||
end.setHours(11, 0, 0);
|
||||
|
||||
this.eventBus.on(EventType.CALENDAR_VIEW_EVENT_SAVED)
|
||||
.pipe(takeUntilDestroyed())
|
||||
.subscribe({
|
||||
next: (_) => {
|
||||
this.closeDialog();
|
||||
this.calendarComponent?.getApi().refetchEvents();
|
||||
}
|
||||
});
|
||||
|
||||
this.eventBus.on(EventType.CALENDAR_VIEW_CLOSE_DIALOG_AND_RELOAD)
|
||||
.pipe(takeUntilDestroyed())
|
||||
.subscribe({
|
||||
next: (_) => {
|
||||
this.closeDialog();
|
||||
this.calendarComponent?.getApi().refetchEvents();
|
||||
}
|
||||
})
|
||||
|
||||
this.eventBus.on(EventType.CALENDAR_VIEW_EVENT_DASHBOARD)
|
||||
.pipe(takeUntilDestroyed())
|
||||
.subscribe({
|
||||
next: (_) => {
|
||||
this.openDashboard();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
this.calendarOptions = {
|
||||
plugins: [dayGridPlugin, timeGridPlugin, listPlugin, interactionPlugin],
|
||||
initialView: 'dayGridMonth',
|
||||
weekends: true,
|
||||
firstDay: 1,
|
||||
headerToolbar: {
|
||||
left: 'prev,next,today',
|
||||
center: 'title',
|
||||
// right: 'dayGridMonth,dayGridWeek,dayGridDay' // user can switch between the two
|
||||
right: 'dayGridMonth,dayGridWeek,dayGridDay,timeGridWeek,timeGridDay,listWeek',
|
||||
|
||||
},
|
||||
events: this.fetchEvents.bind(this), // Bind the context
|
||||
|
||||
eventClick: function(info) {
|
||||
console.info('Event info: ', info);
|
||||
|
||||
// change the border color just for fun
|
||||
info.el.style.borderColor = 'red';
|
||||
eventClick: (info) => {
|
||||
this.selectedEvent.set(info.event.extendedProps['event']);
|
||||
this.workflow.set('event_dashboard');
|
||||
this.selectedDate.set(undefined);
|
||||
},
|
||||
|
||||
dateClick: (info) => {
|
||||
console.info('setting day ',info);
|
||||
this.workflow.set('day');
|
||||
this.workflow.set('event_create');
|
||||
this.selectedDate.set(info.date);
|
||||
this.selectedEventId.set(undefined);
|
||||
console.info("date click with", this.selectedDate())
|
||||
this.isOpen.set(true);
|
||||
// console.info('Date click on: ' , info);
|
||||
// const calendarApi = info.view.calendar;
|
||||
// const start = new Date(info.date.getTime())
|
||||
// start.setHours(2,0,0)
|
||||
// const end = new Date(info.date.getTime())
|
||||
// end.setHours(3,0,0)
|
||||
// calendarApi.addEvent({
|
||||
// title: 'New Event',
|
||||
// start,
|
||||
// end,
|
||||
// });
|
||||
this.selectedEvent.set(undefined);
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
effect(() => {
|
||||
// this.calendarOptions.events = this.events
|
||||
this.dialogs = [
|
||||
{
|
||||
component: SingleEventDashboardEventDelete,
|
||||
isRendered: () => this.workflow() == 'event_delete',
|
||||
closeClick: () => this.closeDialog(),
|
||||
modalBoxStyleClass: 'max-w-none w-2xl',
|
||||
componentInputs: () => {
|
||||
return {
|
||||
'event': this.selectedEvent(),
|
||||
};
|
||||
},
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
{
|
||||
component: SingleEventDashboardEventActivation,
|
||||
isRendered: () => this.workflow() == 'event_cancel',
|
||||
closeClick: () => this.closeDialog(),
|
||||
modalBoxStyleClass: 'max-w-none w-2xl',
|
||||
componentInputs: () => {
|
||||
return {
|
||||
'mode': 'cancel',
|
||||
'event': this.selectedEvent(),
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
component: SingleEventDashboardEventActivation,
|
||||
isRendered: () => this.workflow() == 'event_activate',
|
||||
closeClick: () => this.closeDialog(),
|
||||
modalBoxStyleClass: 'max-w-none w-2xl',
|
||||
componentInputs: () => {
|
||||
return {
|
||||
'mode': 'activate',
|
||||
'event': this.selectedEvent(),
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
component: SingleEventDashboardEventEdit,
|
||||
isRendered: () => this.workflow() == 'event_edit',
|
||||
closeClick: () => this.closeDialog(),
|
||||
modalBoxStyleClass: 'max-w-none w-2xl',
|
||||
componentInputs: () => {
|
||||
return {
|
||||
'event': this.selectedEvent(),
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
component: SingleEventBookingCreate,
|
||||
isRendered: () => this.workflow() == 'booking_create',
|
||||
closeClick: () => this.closeDialog(),
|
||||
modalBoxStyleClass: 'max-w-none w-2xl',
|
||||
componentInputs: () => {
|
||||
return {
|
||||
'event': this.selectedEvent(),
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
component: SingleEventBookingList,
|
||||
isRendered: () => this.workflow() == 'booking_list',
|
||||
closeClick: () => this.closeDialog(),
|
||||
modalBoxStyleClass: 'max-w-none w-2xl',
|
||||
componentInputs: () => {
|
||||
return {
|
||||
'event': this.selectedEvent(),
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
component: SingleEventBookingList,
|
||||
isRendered: () => this.workflow() == 'booking_cancel',
|
||||
closeClick: () => this.closeDialog(),
|
||||
modalBoxStyleClass: 'max-w-none w-2xl',
|
||||
componentInputs: () => {
|
||||
return {
|
||||
'event': this.selectedEvent(),
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
fetchEvents(fetchInfo: any, successCallback: (events: EventInput[]) => void, failureCallback: (error: any) => void): void {
|
||||
|
||||
console.info('fetching events', fetchInfo);
|
||||
const start = fetchInfo.start;
|
||||
const end = fetchInfo.end;
|
||||
// if ( fetchInfo ){
|
||||
// console.info("fetchinfo", fetchInfo);
|
||||
// successCallback([]);
|
||||
// return;
|
||||
// }
|
||||
this.calendarService.getEventsInRange({
|
||||
startTime: start,
|
||||
endTime: end,
|
||||
})
|
||||
.pipe(
|
||||
map(value => {
|
||||
console.info("vent got" , value );
|
||||
const events: EventInput[] = value.map( (model) => {
|
||||
const events: EventInput[] = value.map((model) => {
|
||||
const calendarEvent: EventInput = {
|
||||
start: new Date(model.startTime),
|
||||
// end: model.end_time,
|
||||
title: model.title
|
||||
title: model.title,
|
||||
extendedProps: {
|
||||
event: model,
|
||||
},
|
||||
editable: !model.isCancelled,
|
||||
// 2. Add a class for styling
|
||||
classNames: model.isCancelled ? ['disabled-event'] : [],
|
||||
// Optional: Force a gray color here if not using CSS
|
||||
backgroundColor: '#d3d3d3',
|
||||
borderColor: '#d3d3d3'
|
||||
};
|
||||
if ( model.eventType){
|
||||
if (model.eventType) {
|
||||
calendarEvent.borderColor = model.eventType.color;
|
||||
}
|
||||
// calendarEvent.backgroundColor = "#00ff00"
|
||||
return calendarEvent;
|
||||
})
|
||||
});
|
||||
return events;
|
||||
}),
|
||||
)
|
||||
.subscribe({
|
||||
next: (events) => {
|
||||
console.info("calendar events", events);
|
||||
successCallback(events);
|
||||
}
|
||||
,
|
||||
error: (error) => {
|
||||
console.error('Error fetching events', error);
|
||||
failureCallback(error);
|
||||
},
|
||||
next: (events) => {
|
||||
console.info('calendar events', events);
|
||||
successCallback(events);
|
||||
}
|
||||
,
|
||||
error: (error) => {
|
||||
console.error('Error fetching events', error);
|
||||
failureCallback(error);
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
}
|
||||
|
||||
protected addEvent($event: PointerEvent) {
|
||||
let hourStr = this.startHour.nativeElement.value;
|
||||
const hour = parseInt(hourStr, 10);
|
||||
const date = new Date();
|
||||
const start = new Date(date.getTime());
|
||||
start.setHours(hour, 0, 0);
|
||||
const end = new Date(date.getTime());
|
||||
// end.setHours(3,0,0)
|
||||
|
||||
this.calendarComponent?.getApi().addEvent({
|
||||
title: 'Event at ' + hour,
|
||||
start,
|
||||
});
|
||||
}
|
||||
|
||||
closeDialog() {
|
||||
this.isOpen.set(false);
|
||||
this.workflow.set('NO_DIALOG');
|
||||
}
|
||||
openDashboard() {
|
||||
this.workflow.set('event_dashboard');
|
||||
}
|
||||
/**
|
||||
* Set dashboard workflow
|
||||
* @param workflowType
|
||||
*/
|
||||
setWorkFlow(workflowType: WORKFLOW_TYPE) {
|
||||
console.info('set workflow to', workflowType);
|
||||
this.workflow.set(workflowType);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface DialogConfig {
|
||||
component: Type<any>;
|
||||
componentInputs?: () => { [key: string]: any };
|
||||
closeClick: () => void,
|
||||
modalBoxStyleClass: string
|
||||
isRendered: () => boolean;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<p>single-event-booking-cancel works!</p>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Component, inject, input } from '@angular/core';
|
||||
import { EventBusService } from '../../../../../services/event-bus.service';
|
||||
import { CalendarEventDto } from '../../../models/events-in-range-dto.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-booking-cancel',
|
||||
imports: [],
|
||||
templateUrl: './single-event-booking-cancel.html',
|
||||
styleUrl: './single-event-booking-cancel.css',
|
||||
})
|
||||
export class SingleEventBookingCancel {
|
||||
eventBus = inject(EventBusService);
|
||||
event = input<CalendarEventDto>();
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<!-- Generated by the CLI -->
|
||||
<div class="">
|
||||
<h2 class="card-title text-3xl">
|
||||
Foglalás
|
||||
</h2>
|
||||
<app-single-event-dashboard-event-details-view [event]="event()"></app-single-event-dashboard-event-details-view>
|
||||
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="space-y-4 mt-4">
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Helyek száma</span></label>
|
||||
<input [class.input-error]="slotCount?.invalid && slotCount?.touched" type="number" formControlName="slotCount"
|
||||
class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Megjegyzés</span></label>
|
||||
<input [class.input-error]="note?.invalid && note?.touched" type="text" formControlName="note"
|
||||
class="input input-bordered w-full" /></div>
|
||||
|
||||
<div class="card-actions justify-end mt-6">
|
||||
<a class="btn btn-ghost" (click)="doClose()">Mégse</a>
|
||||
<button type="submit" class="btn btn-primary" [disabled]="form.invalid">
|
||||
{{ 'Foglalás' }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,65 @@
|
||||
import { Component, inject, input } from '@angular/core';
|
||||
import { CalendarEventDto } from '../../../models/events-in-range-dto.model';
|
||||
import { EventBusService } from '../../../../../services/event-bus.service';
|
||||
import { CalendarService, CalendarCreateBookingDto } from '../../../../../../api';
|
||||
import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { EventType } from '../../../../../../types';
|
||||
import {
|
||||
SingleEventDashboardEventDetailsView
|
||||
} from '../single-event-dashboard-event-details-view/single-event-dashboard-event-details-view';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-booking-create',
|
||||
imports: [
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
SingleEventDashboardEventDetailsView
|
||||
],
|
||||
templateUrl: './single-event-booking-create.html',
|
||||
styleUrl: './single-event-booking-create.css',
|
||||
})
|
||||
export class SingleEventBookingCreate {
|
||||
calendarService = inject(CalendarService);
|
||||
eventBus = inject(EventBusService);
|
||||
fb = inject(FormBuilder);
|
||||
event = input.required<CalendarEventDto>();
|
||||
|
||||
form: FormGroup;
|
||||
constructor() {
|
||||
this.form = this.fb.group({
|
||||
slotCount: [1, Validators.required],
|
||||
note: [null],
|
||||
});
|
||||
}
|
||||
|
||||
protected onSubmit() {
|
||||
const formValue = this.form.value;
|
||||
console.log(formValue);
|
||||
return this.calendarService.calendarControllerCreateBooking(this.event().id!,{
|
||||
notes: formValue.notes,
|
||||
reservedSeatsCount: formValue.slotCount,
|
||||
occurrenceStartTime: new Date(this.event()?.startTime!)
|
||||
}as CalendarCreateBookingDto)
|
||||
.subscribe(
|
||||
{
|
||||
next: _ => {
|
||||
this.eventBus.emit(EventType.CALENDAR_VIEW_EVENT_SAVED,'');
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
get slotCount() {
|
||||
return this.form.get('slotCount');
|
||||
}
|
||||
|
||||
get note() {
|
||||
return this.form.get('note');
|
||||
}
|
||||
|
||||
|
||||
protected doClose() {
|
||||
this.eventBus.emit(EventType.CALENDAR_VIEW_DIALOG_CLOSED,'');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<app-heading [level]="1">
|
||||
Foglalások
|
||||
</app-heading>
|
||||
@if (bookings.isLoading()) {
|
||||
<div>loading...</div>
|
||||
} @else {
|
||||
@if (bookings.value()?.data?.length) {
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<!-- head -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Foglalás dátuma</th>
|
||||
<th>Foglalt helyek száma</th>
|
||||
<th>Státusz</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (booking of bookings.value()?.data; track booking) {
|
||||
<tr>
|
||||
<td>{{formatDateTime(booking.createdAt)}}</td>
|
||||
<td>{{booking.reservedSeatsCount}}</td>
|
||||
<td>
|
||||
@switch (booking.status){
|
||||
@case ('active'){
|
||||
<span [outerHTML]="SvgIcons.heroCheckCircle | safeHtml"></span>
|
||||
}
|
||||
@case ('customer_cancelled'){
|
||||
<span [outerHTML]="SvgIcons.heroMinusCircle | safeHtml"></span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (booking.status == 'active') {
|
||||
<rs-daisy-button [variant]="'error'" (clickEvent)="cancelBooking(booking)">
|
||||
Lemondás
|
||||
</rs-daisy-button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if(bookings.value()?.meta?.totalPages! > 1){
|
||||
<rs-daisy-pagination [pageCount]="pageCount()" [activePage]="activePage()"
|
||||
(onPaginate)="paginate($event)"></rs-daisy-pagination>
|
||||
}
|
||||
} @else {
|
||||
Nem találtunk foglalást erre az eseményre
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
import { Component, computed, inject, input, signal } from '@angular/core';
|
||||
import { EventBusService } from '../../../../../services/event-bus.service';
|
||||
import { CalendarEventDto } from '../../../models/events-in-range-dto.model';
|
||||
import { BookingResponseDto, CalendarService } from '../../../../../../api';
|
||||
import { rxResource } from '@angular/core/rxjs-interop';
|
||||
import { delay, of, throwError } from 'rxjs';
|
||||
import { Button, Pagination } from '@rschneider/ng-daisyui';
|
||||
import { Heading } from '../../../../../components/heading/heading';
|
||||
import { format } from 'date-fns';
|
||||
import { EventType } from '../../../../../../types';
|
||||
import { SvgIcons } from '../../../../../svg-icons';
|
||||
import { SafeHtmlPipe } from "../../../../../pipes/safe-html-pipe";
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-booking-list',
|
||||
imports: [
|
||||
Pagination,
|
||||
Heading,
|
||||
Button,
|
||||
SafeHtmlPipe
|
||||
],
|
||||
templateUrl: './single-event-booking-list.html',
|
||||
styleUrl: './single-event-booking-list.css',
|
||||
})
|
||||
export class SingleEventBookingList {
|
||||
|
||||
calendarService = inject(CalendarService);
|
||||
eventBus = inject(EventBusService);
|
||||
event = input<CalendarEventDto>();
|
||||
|
||||
activePage = signal<number>(1);
|
||||
// bookings = toSignal(of(['a','b']));
|
||||
pageSize = input<number>(10);
|
||||
pageCount = computed(() => {
|
||||
// return this.bookings.value()?.pageCount || 1;
|
||||
return 1;
|
||||
});
|
||||
|
||||
bookings = rxResource(
|
||||
{
|
||||
params: () => ({
|
||||
page: this.activePage(),
|
||||
}),
|
||||
stream: ({ params }) => {
|
||||
|
||||
if (!this.event()) {
|
||||
return throwError(() => new Error('no event'));
|
||||
}
|
||||
const event = this.event()!;
|
||||
return this.calendarService.calendarControllerGetBookings(
|
||||
event.id,
|
||||
new Date(event.startTime).toISOString(),
|
||||
params.page,
|
||||
this.pageSize(),
|
||||
);
|
||||
},
|
||||
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
protected paginate($event: number) {
|
||||
console.info('paginated to ', $event);
|
||||
this.activePage.set($event);
|
||||
|
||||
}
|
||||
|
||||
public cancelBooking(booking: BookingResponseDto) {
|
||||
this.calendarService.calendarControllerCancelBooking(
|
||||
booking.id,
|
||||
{
|
||||
canceledReason: 'customer_cancelled',
|
||||
},
|
||||
).subscribe({
|
||||
next: () => {
|
||||
// this.eventBus.emit(EventType.CALENDAR_VIEW_BOOKING_CANCELLED, '');
|
||||
this.bookings.reload();
|
||||
},
|
||||
error: () => {
|
||||
// todo: handle error
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
formatDateTime(dateStr?: string | Date | null) {
|
||||
if (!dateStr) {
|
||||
return '';
|
||||
}
|
||||
return format(new Date(dateStr), 'yyyy-MM-dd HH:mm');
|
||||
}
|
||||
|
||||
protected readonly format = format;
|
||||
|
||||
protected readonly SvgIcons = SvgIcons;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<div class="card bg-base-100 hover:bg-base-300 shadow-sm h-full" [class]="">
|
||||
<div class="card-body items-center ">
|
||||
<h2 class="card-title text-center">{{ title() }}</h2>
|
||||
<p class="text-center">{{ description() }}</p>
|
||||
<div class="card-actions justify-end">
|
||||
<button class="btn btn-primary" (click)="onClick();">
|
||||
<!-- Using the new @if control flow -->
|
||||
@if (svgIcon()) {
|
||||
<span [innerHTML]="svgIcon() | safeHtml"></span>
|
||||
}
|
||||
{{ buttonTitle() }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SingleEventDashboardCard } from './single-event-dashboard-card';
|
||||
|
||||
describe('SingleEventDashboardCard', () => {
|
||||
let component: SingleEventDashboardCard;
|
||||
let fixture: ComponentFixture<SingleEventDashboardCard>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [SingleEventDashboardCard]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(SingleEventDashboardCard);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
import { Component, computed, HostBinding, input, output } from '@angular/core';
|
||||
import { SafeHtmlPipe } from '../../../../../pipes/safe-html-pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-dashboard-card',
|
||||
standalone: true,
|
||||
imports: [
|
||||
SafeHtmlPipe,
|
||||
], // CommonModule is no longer needed
|
||||
templateUrl: './single-event-dashboard-card.html',
|
||||
styleUrl: './single-event-dashboard-card.css',
|
||||
})
|
||||
export class SingleEventDashboardCard {
|
||||
title = input<string>();
|
||||
description = input<string>();
|
||||
buttonTitle = input<string>();
|
||||
svgIcon = input<string>();
|
||||
onAction = output<void>();
|
||||
|
||||
|
||||
// 1. Define the Input Signal to receive class names as a string or array
|
||||
// Example: 'grow-2 align-center'
|
||||
public styleClass = input<string | null>(null);
|
||||
|
||||
// 2. Create a computed signal that filters out any null/undefined and returns the class string
|
||||
private hostClasses = computed(() => {
|
||||
// We append a base class that should always be present (e.g., 'flex-item')
|
||||
const classes = ['flex-item'];
|
||||
|
||||
const custom = this.styleClass();
|
||||
if (custom) {
|
||||
// Split the input string and add the class names
|
||||
classes.push(...custom.trim().split(/\s+/));
|
||||
}
|
||||
|
||||
// Return a single space-separated string
|
||||
return classes.join(' ');
|
||||
});
|
||||
|
||||
// 3. Use @HostBinding to bind the computed string to the host element's 'class' attribute
|
||||
@HostBinding('class')
|
||||
get classAttribute(): string {
|
||||
return this.hostClasses();
|
||||
}
|
||||
|
||||
protected onClick() {
|
||||
this.onAction.emit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<h2 class="text-2xl">
|
||||
@if (mode() == 'cancel') {
|
||||
Esemény lemondása
|
||||
} @else {
|
||||
Esemény aktiválása
|
||||
}
|
||||
</h2>
|
||||
<app-single-event-dashboard-event-details-view [event]="event()"></app-single-event-dashboard-event-details-view>
|
||||
<div class="flex gap-2 mt-3">
|
||||
|
||||
@if (mode() == 'cancel') {
|
||||
<rs-daisy-button variant="error" (click)="cancelEventOccurrence()">
|
||||
<span [outerHTML]="SvgIcons.heroTrash | safeHtml"></span>
|
||||
Lemondás
|
||||
</rs-daisy-button>
|
||||
}
|
||||
@if (mode() == 'activate') {
|
||||
<rs-daisy-button variant="error" (click)="activateEventOccurrence()">
|
||||
<span [outerHTML]="SvgIcons.heroTrash | safeHtml"></span>
|
||||
Aktiválás
|
||||
</rs-daisy-button>
|
||||
}
|
||||
<rs-daisy-button variant="primary" (click)="closeDialog()">
|
||||
<span [outerHTML]="SvgIcons.heroXcircle | safeHtml"></span>
|
||||
Mégsem
|
||||
</rs-daisy-button>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SingleEventDashboardEventActivation } from './single-event-dashboard-event-activation.component';
|
||||
|
||||
describe('SingleEventDashboardEventCancel', () => {
|
||||
let component: SingleEventDashboardEventActivation;
|
||||
let fixture: ComponentFixture<SingleEventDashboardEventActivation>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [SingleEventDashboardEventActivation]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(SingleEventDashboardEventActivation);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,88 @@
|
||||
import { Component, inject, input } from '@angular/core';
|
||||
import { CalendarEventDto } from '../../../models/events-in-range-dto.model';
|
||||
import {
|
||||
SingleEventDashboardEventDetailsView,
|
||||
} from '../single-event-dashboard-event-details-view/single-event-dashboard-event-details-view';
|
||||
import { Button } from '@rschneider/ng-daisyui';
|
||||
import { SvgIcons } from '../../../../../svg-icons';
|
||||
import { SafeHtmlPipe } from '../../../../../pipes/safe-html-pipe';
|
||||
import { CalendarService } from '../../../services/calendar.service';
|
||||
import { CreateExceptionDto } from '../../../models/event-exception.model';
|
||||
import { EventBusService } from '../../../../../services/event-bus.service';
|
||||
import { EventType } from '../../../../../../types';
|
||||
|
||||
export type ACTIVATION_TYPE = 'cancel' | 'activate';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-dashboard-event-cancel',
|
||||
imports: [
|
||||
SingleEventDashboardEventDetailsView,
|
||||
Button,
|
||||
SafeHtmlPipe,
|
||||
],
|
||||
templateUrl: './single-event-dashboard-event-activation.component.html',
|
||||
styleUrl: './single-event-dashboard-event-activation.component.css',
|
||||
})
|
||||
export class SingleEventDashboardEventActivation {
|
||||
|
||||
eventBus = inject(EventBusService);
|
||||
mode = input<ACTIVATION_TYPE>('cancel');
|
||||
calendarService = inject(CalendarService);
|
||||
event = input<CalendarEventDto>();
|
||||
protected readonly SvgIcons = SvgIcons;
|
||||
|
||||
|
||||
protected setEventOccurrenceActivation(activated: boolean) {
|
||||
|
||||
const event = this.event();
|
||||
console.info('setEventOccurrenceActivation', event);
|
||||
const eventId = event?.id!;
|
||||
const originalStartTime = event?.originalStartTime!;
|
||||
let payload: CreateExceptionDto | undefined;
|
||||
|
||||
// Correctly find the exception that matches this specific occurrence
|
||||
const eventException = event?.exceptions?.find(ex =>
|
||||
new Date(ex.originalStartTime).getTime() === new Date(originalStartTime).getTime()
|
||||
);
|
||||
|
||||
if (eventException) {
|
||||
payload = {
|
||||
...eventException,
|
||||
originalStartTime: new Date(eventException.originalStartTime),
|
||||
newStartTime: eventException.newStartTime ? new Date(eventException.newStartTime) : undefined,
|
||||
newEndTime: eventException.newEndTime ? new Date(eventException.newEndTime) : undefined,
|
||||
isCancelled: !activated,
|
||||
};
|
||||
} else {
|
||||
payload = {
|
||||
originalStartTime: new Date(originalStartTime),
|
||||
isCancelled: !activated,
|
||||
};
|
||||
}
|
||||
|
||||
this.calendarService.applyException(eventId, payload).subscribe(
|
||||
{
|
||||
next: () => {
|
||||
this.eventBus.emit(EventType.CALENDAR_VIEW_EVENT_SAVED, 'Event saved')
|
||||
},
|
||||
error: err => {
|
||||
console.error(err);
|
||||
alert('Failed to change event');
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
protected cancelEventOccurrence() {
|
||||
this.setEventOccurrenceActivation(false);
|
||||
}
|
||||
|
||||
protected activateEventOccurrence() {
|
||||
this.setEventOccurrenceActivation(true);
|
||||
}
|
||||
|
||||
protected closeDialog() {
|
||||
this.eventBus.emit(EventType.CALENDAR_VIEW_EVENT_DASHBOARD, 'Event saved')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<h2 class="text-2xl">Törlés</h2>
|
||||
<p>Esemény és az egész széria törlése</p>
|
||||
<app-single-event-dashboard-event-details-view [event]="event()">
|
||||
</app-single-event-dashboard-event-details-view>
|
||||
|
||||
<div class="flex gap-2 mt-3">
|
||||
<rs-daisy-button variant="error" (click)="deleteEventTemplate()">
|
||||
<span [outerHTML]="SvgIcons.heroTrash | safeHtml"></span>
|
||||
Törlés
|
||||
</rs-daisy-button>
|
||||
<rs-daisy-button variant="primary" (click)="closeDialog()">
|
||||
<span [outerHTML]="SvgIcons.heroXcircle | safeHtml"></span>
|
||||
Mégsem
|
||||
</rs-daisy-button>
|
||||
</div>
|
||||
@@ -0,0 +1,41 @@
|
||||
import { Component, inject, input } from '@angular/core';
|
||||
import { CalendarEventDto } from '../../../models/events-in-range-dto.model';
|
||||
import { SvgIcons } from '../../../../../svg-icons';
|
||||
import { SafeHtmlPipe } from '../../../../../pipes/safe-html-pipe';
|
||||
import { Button } from '@rschneider/ng-daisyui';
|
||||
import { CalendarService } from '../../../services/calendar.service';
|
||||
import { EventBusService } from '../../../../../services/event-bus.service';
|
||||
import {
|
||||
SingleEventDashboardEventDetailsView
|
||||
} from '../single-event-dashboard-event-details-view/single-event-dashboard-event-details-view';
|
||||
import { EventType } from '../../../../../../types';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-dashboard-event-delete',
|
||||
imports: [
|
||||
SafeHtmlPipe,
|
||||
Button,
|
||||
SingleEventDashboardEventDetailsView,
|
||||
],
|
||||
templateUrl: './single-event-dashboard-event-delete.html',
|
||||
styleUrl: './single-event-dashboard-event-delete.css',
|
||||
})
|
||||
export class SingleEventDashboardEventDelete {
|
||||
|
||||
eventBus = inject(EventBusService);
|
||||
calendarService = inject(CalendarService);
|
||||
event = input<CalendarEventDto>();
|
||||
|
||||
protected readonly SvgIcons = SvgIcons;
|
||||
|
||||
closeDialog() {
|
||||
// Call the function passed from the parent
|
||||
this.eventBus.emit(EventType.CALENDAR_VIEW_DIALOG_CLOSED, '')
|
||||
}
|
||||
|
||||
|
||||
protected deleteEventTemplate() {
|
||||
this.calendarService.delete(this.event()!.id).subscribe(() => this.eventBus.emit(EventType.CALENDAR_VIEW_EVENT_SAVED, 'Event saved'))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
@if (config) {
|
||||
<app-detail-view
|
||||
[config]="config"
|
||||
></app-detail-view>
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { Component, effect, input } from '@angular/core';
|
||||
import { CalendarEventDto } from '../../../models/events-in-range-dto.model';
|
||||
import { DetailView, DetailViewConfig } from '../../../../../components/detail-view/detail-view';
|
||||
import { SafeHtmlPipe } from '../../../../../pipes/safe-html-pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-dashboard-event-details-view',
|
||||
imports: [
|
||||
DetailView,
|
||||
SafeHtmlPipe,
|
||||
],
|
||||
templateUrl: './single-event-dashboard-event-details-view.html',
|
||||
styleUrl: './single-event-dashboard-event-details-view.css',
|
||||
})
|
||||
export class SingleEventDashboardEventDetailsView {
|
||||
|
||||
event = input<CalendarEventDto>();
|
||||
config: DetailViewConfig<CalendarEventDto> | undefined;
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
|
||||
this.config = {
|
||||
data: this.event()!,
|
||||
|
||||
rows: [{
|
||||
attribute: 'id',
|
||||
getTitle: 'Esemény azonosító',
|
||||
},
|
||||
{
|
||||
attribute: 'title',
|
||||
getTitle: 'Esemény neve',
|
||||
},
|
||||
{
|
||||
attribute: 'startTime',
|
||||
getTitle: 'Kezdési időpont',
|
||||
format: 'datetime',
|
||||
},
|
||||
{
|
||||
attribute: 'eventType',
|
||||
getTitle: 'Esemény típusa',
|
||||
getValue: obj => obj.eventType.name,
|
||||
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<app-create-event-form
|
||||
(ready)="triggerAction($event)"
|
||||
[date]="selectedDate()"
|
||||
[id]="event()?.id">
|
||||
</app-create-event-form>
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Component, inject, input, signal } from '@angular/core';
|
||||
import { CalendarEventDto } from '../../../models/events-in-range-dto.model';
|
||||
import { CreateEventForm, ReadyType } from '../../create-event-form/create-event-form';
|
||||
import { EventBusService } from '../../../../../services/event-bus.service';
|
||||
import { EventType } from '../../../../../../types';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-dashboard-event-edit',
|
||||
imports: [
|
||||
CreateEventForm,
|
||||
],
|
||||
templateUrl: './single-event-dashboard-event-edit.html',
|
||||
styleUrl: './single-event-dashboard-event-edit.css',
|
||||
})
|
||||
export class SingleEventDashboardEventEdit {
|
||||
|
||||
eventBus = inject(EventBusService);
|
||||
selectedDate = signal<Date | undefined>(undefined);
|
||||
event = input<CalendarEventDto>();
|
||||
|
||||
/**
|
||||
* proxy to ready event from form to parent
|
||||
*/
|
||||
protected triggerAction(action: ReadyType) {
|
||||
if (action == 'save-event-success') {
|
||||
this.eventBus.emit(EventType.CALENDAR_VIEW_EVENT_SAVED, '');
|
||||
} else if (action == 'save-event-failed') {
|
||||
this.eventBus.emit(EventType.CALENDAR_VIEW_DIALOG_CLOSED, '');
|
||||
} else {
|
||||
this.eventBus.emit(EventType.CALENDAR_VIEW_EVENT_DASHBOARD, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
@if (event()?.isRecurring) {
|
||||
<h2 class="text-xl">Esemény sorozat</h2>
|
||||
}
|
||||
@if (!event()?.isRecurring) {
|
||||
<h2 class="text-xl">Esemény </h2>
|
||||
}
|
||||
<app-single-event-dashboard-event-details-view [event]="event()">
|
||||
</app-single-event-dashboard-event-details-view>
|
||||
|
||||
<div class="flex mt-3 gap-2 flex-wrap content-stretch ">
|
||||
@for (card of cards(); let i = $index; track i) {
|
||||
|
||||
<app-single-event-dashboard-card
|
||||
[title]="card.title"
|
||||
[svgIcon]="card.svgIcon"
|
||||
[description]="card.description"
|
||||
[buttonTitle]="card.buttonTitle"
|
||||
[styleClass]="'flex-1'"
|
||||
(onAction)="onCardAction(card.workflow)"
|
||||
|
||||
></app-single-event-dashboard-card>
|
||||
}
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,105 @@
|
||||
import { Component, effect, input, output, signal } from '@angular/core';
|
||||
import { CalendarEventDto } from '../../../models/events-in-range-dto.model';
|
||||
import { DetailView, DetailViewConfig } from '../../../../../components/detail-view/detail-view';
|
||||
import { SvgIcons } from '../../../../../svg-icons';
|
||||
import { SingleEventDashboardCard } from '../single-event-dashboard-card/single-event-dashboard-card';
|
||||
import { WORKFLOW_TYPE } from '../calendar-view';
|
||||
import {
|
||||
SingleEventDashboardEventDetailsView
|
||||
} from '../single-event-dashboard-event-details-view/single-event-dashboard-event-details-view';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-event-dashboard',
|
||||
imports: [
|
||||
DetailView,
|
||||
SingleEventDashboardCard,
|
||||
SingleEventDashboardEventDetailsView,
|
||||
],
|
||||
templateUrl: './single-event-dashboard.html',
|
||||
styleUrl: './single-event-dashboard.css',
|
||||
})
|
||||
export class SingleEventDashboard {
|
||||
|
||||
event = input<CalendarEventDto>();
|
||||
action = output<WORKFLOW_TYPE>();
|
||||
cards = signal<CardConfig[]>([]);
|
||||
|
||||
|
||||
constructor() {
|
||||
|
||||
effect(() => {
|
||||
this.cards.set([
|
||||
{
|
||||
buttonTitle: 'Szerkesztés',
|
||||
title: 'Szerkesztés',
|
||||
svgIcon: SvgIcons.heorPencilSquare,
|
||||
description: 'Az esemény módosítása',
|
||||
workflow: 'event_edit',
|
||||
},
|
||||
|
||||
this.event()?.isCancelled ?
|
||||
|
||||
{
|
||||
buttonTitle: 'Aktiválás',
|
||||
title: 'Előfordulás aktiválása',
|
||||
svgIcon: SvgIcons.heroPlay,
|
||||
description: 'Az esemény ezen előfordulásának aktiválása',
|
||||
workflow: 'event_activate',
|
||||
} :
|
||||
{
|
||||
buttonTitle: 'Lemondás',
|
||||
title: 'Előfordulás lemondása',
|
||||
svgIcon: SvgIcons.heroXcircle,
|
||||
description: 'Az esemény ezen előfordulásának lemondása',
|
||||
workflow: 'event_cancel',
|
||||
},
|
||||
{
|
||||
buttonTitle: 'Törlés',
|
||||
title: 'Esemény törlése',
|
||||
svgIcon: SvgIcons.heroTrash,
|
||||
description: 'Az esemény törlése',
|
||||
workflow: 'event_delete',
|
||||
},
|
||||
{
|
||||
buttonTitle: 'Megnézem',
|
||||
title: 'Foglalások',
|
||||
svgIcon: SvgIcons.heroUserGroup,
|
||||
description: 'Foglalások megtekintése',
|
||||
workflow: 'booking_list',
|
||||
},
|
||||
{
|
||||
buttonTitle: 'Bejelentkezés',
|
||||
title: 'Időpont foglalás',
|
||||
svgIcon: SvgIcons.heroUserPlus,
|
||||
description: 'Időpont foglalása eseményre',
|
||||
workflow: 'booking_create',
|
||||
},
|
||||
{
|
||||
buttonTitle: 'Lemondás',
|
||||
title: 'Lemondás',
|
||||
svgIcon: SvgIcons.heroUserMinus,
|
||||
description: 'Az időpont lemondása',
|
||||
workflow: 'booking_cancel',
|
||||
},
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
onCardAction(action: WORKFLOW_TYPE) {
|
||||
if (action) {
|
||||
this.action.emit(action);
|
||||
}
|
||||
console.info("card action", action);
|
||||
}
|
||||
|
||||
|
||||
protected readonly SvgIcons = SvgIcons;
|
||||
}
|
||||
|
||||
export interface CardConfig {
|
||||
title?: string;
|
||||
description?: string;
|
||||
buttonTitle?: string;
|
||||
svgIcon?: string;
|
||||
workflow: WORKFLOW_TYPE;
|
||||
}
|
||||
@@ -1,68 +1,108 @@
|
||||
<!-- Generated by the CLI -->
|
||||
<div class="p-4 md:p-8">
|
||||
<div class="card bg-base-100 shadow-xl max-w-2xl mx-auto">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title text-3xl">
|
||||
Esemény {{ isEditMode ? 'szerkesztése' : 'létrehozása' }}
|
||||
</h2>
|
||||
<div class="">
|
||||
<h2 class="card-title text-3xl">
|
||||
Esemény {{ isEditMode ? 'szerkesztése' : 'létrehozása' }}
|
||||
</h2>
|
||||
|
||||
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="space-y-4 mt-4">
|
||||
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="space-y-4 mt-4">
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Megnevezés</span></label>
|
||||
<input [class.input-error]="title?.invalid && title?.touched" type="text" formControlName="title" class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Esemény típus</span></label>
|
||||
<select class="select w-full"
|
||||
formControlName="eventTypeId"
|
||||
[class.input-error]="eventType?.invalid && eventType?.touched"
|
||||
>
|
||||
<option disabled selected>Pick a color</option>
|
||||
@for (eventType of eventTypes(); track eventType.id) {
|
||||
<option [value]="eventType.id">{{ eventType.name }}</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Leírás</span></label>
|
||||
<input [class.input-error]="description?.invalid && description?.touched" type="text" formControlName="description" class="input input-bordered w-full" /></div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Kezdő időpont</span></label>
|
||||
<input [class.input-error]="startTime?.invalid && startTime?.touched" type="datetime-local" formControlName="startTime" class="input input-bordered w-full" /></div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Befejezési időpont</span></label>
|
||||
<input [class.input-error]="endTime?.invalid && endTime?.touched" type="datetime-local" formControlName="endTime" class="input input-bordered w-full" /></div>
|
||||
|
||||
<div class="form-control"><label class="label cursor-pointer justify-start gap-4">
|
||||
<span class="label-text">Ismétlődő</span>
|
||||
<input type="checkbox" formControlName="is_recurring" class="checkbox" />
|
||||
</label></div>
|
||||
|
||||
@if (isRecurring?.value) {
|
||||
<h3>Ismétlődés</h3>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Gyakoriság</span></label>
|
||||
<select class="select w-full"
|
||||
formGroupName="recurringRule"
|
||||
formControlName="frequency"
|
||||
[class.input-error]="frequency?.invalid && eventType?.touched"
|
||||
>
|
||||
<option disabled selected>Válassz gyakoriságot</option>
|
||||
@for (frequencyOption of frequencyOptions; track frequencyOption) {
|
||||
<option [value]="frequencyOption.frequency">{{ frequencyOption.label }}</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
<div class="card-actions justify-end mt-6">
|
||||
<a routerLink="/events" class="btn btn-ghost" (click)="doReady()">Mégse</a>
|
||||
<button type="submit" class="btn btn-primary" [disabled]="form.invalid">
|
||||
{{ isEditMode ? 'Mentés' : 'Létrezhozás' }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="form-control"><label class="label"><span class="label-text">Megnevezés</span></label>
|
||||
<input [class.input-error]="title?.invalid && title?.touched" type="text" formControlName="title"
|
||||
class="input input-bordered w-full" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Esemény típus</span></label>
|
||||
<select class="select w-full" formControlName="eventTypeId"
|
||||
[class.input-error]="eventType?.invalid && eventType?.touched">
|
||||
<option disabled selected>Pick a color</option>
|
||||
@for (eventType of eventTypes(); track eventType.id) {
|
||||
<option [value]="eventType.id">{{ eventType.name }}</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Leírás</span></label>
|
||||
<input [class.input-error]="description?.invalid && description?.touched" type="text"
|
||||
formControlName="description" class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Kezdő időpont</span></label>
|
||||
<input [class.input-error]="startTime?.invalid && startTime?.touched" type="datetime-local"
|
||||
formControlName="startTime" class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Befejezési időpont</span></label>
|
||||
<input [class.input-error]="endTime?.invalid && endTime?.touched" type="datetime-local" formControlName="endTime"
|
||||
class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label cursor-pointer justify-start gap-4">
|
||||
<span class="label-text">Ismétlődő</span>
|
||||
<input type="checkbox" formControlName="isRecurring" class="checkbox" />
|
||||
</label></div>
|
||||
|
||||
@if (isRecurring?.value === true) {
|
||||
<div formGroupName="recurrenceRule" class="space-y-4 p-4 border border-base-300 rounded-lg">
|
||||
<h3 class="text-lg font-semibold">Ismétlődés</h3>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Gyakoriság</span></label>
|
||||
<select class="select w-full" formControlName="frequency"
|
||||
[class.select-error]="frequency?.invalid && frequency?.touched">
|
||||
<option disabled selected>Válassz gyakoriságot</option>
|
||||
@for (frequencyOption of frequencyOptions; track frequencyOption) {
|
||||
<option [value]="frequencyOption.frequency">{{ frequencyOption.label }}</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Intervallum</span></label>
|
||||
<input type="number" formControlName="interval" class="input input-bordered w-full"
|
||||
[class.input-error]="interval?.invalid && interval?.touched" />
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Napok</span></label>
|
||||
<div class="flex flex-wrap gap-4">
|
||||
@for (day of weekDayOptions; track day.value) {
|
||||
<label class="label cursor-pointer justify-start gap-2">
|
||||
<input type="checkbox" [value]="day.value" [checked]="isDayChecked(day.value)"
|
||||
(change)="onByDayChange($event)" class="checkbox" />
|
||||
<span class="label-text">{{ day.label }}</span>
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Hónap napja</span></label>
|
||||
<input type="text" formControlName="byMonthDay" class="input input-bordered w-full" />
|
||||
<div class="label">
|
||||
<span class="label-text-alt">Vesszővel elválasztott lista (pl. 1,15,31)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Hónap</span></label>
|
||||
<input type="text" formControlName="byMonth" class="input input-bordered w-full" />
|
||||
<div class="label">
|
||||
<span class="label-text-alt">Vesszővel elválasztott lista (pl. 1,2,3)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text">Ismétlődés vége</span></label>
|
||||
<input type="date" formControlName="endDate" class="input input-bordered w-full" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card-actions justify-end mt-6">
|
||||
<button type="submit" class="btn btn-primary" [disabled]="form.invalid">
|
||||
{{ isEditMode ? 'Mentés' : 'Létrezhozás' }}
|
||||
</button>
|
||||
<a class="btn btn-primary" (click)="doReady()">Mégse</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, input, OnInit, output, signal } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { EventService } from '../../../events/services/event.service';
|
||||
import { mergeMap, switchMap, tap } from 'rxjs/operators';
|
||||
import { Observable, of } from 'rxjs';
|
||||
@@ -9,18 +9,19 @@ import { EventType } from '../../../event-type/models/event-type.model';
|
||||
import { EventTypeService } from '../../../event-type/services/event-type.service';
|
||||
import { CalendarService } from '../../services/calendar.service';
|
||||
import { EventFormDTO } from '../../models/event-form-dto.model';
|
||||
import { format } from 'date-fns';
|
||||
|
||||
export type Frequency = 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
||||
export type FrequencyOption = {
|
||||
frequency: Frequency,
|
||||
label: string;
|
||||
}
|
||||
|
||||
export type ReadyType = 'close' | 'save-event-success' | 'save-event-failed';
|
||||
|
||||
@Component({
|
||||
selector: 'app-create-event-form',
|
||||
imports: [
|
||||
ReactiveFormsModule
|
||||
ReactiveFormsModule,
|
||||
],
|
||||
templateUrl: './create-event-form.html',
|
||||
styleUrl: './create-event-form.css',
|
||||
@@ -28,31 +29,39 @@ export type FrequencyOption = {
|
||||
export class CreateEventForm implements OnInit {
|
||||
form: FormGroup;
|
||||
isEditMode = false;
|
||||
ready = output<void>();
|
||||
id= input<number | undefined>() ;
|
||||
date = input<Date|undefined>();
|
||||
ready = output<ReadyType>();
|
||||
id = input<number | undefined>();
|
||||
date = input<Date | undefined>();
|
||||
eventTypes = signal<EventType[]>([]);
|
||||
|
||||
eventTypes = signal<EventType[]>([])
|
||||
|
||||
private numericFields = ["event_type_id"];
|
||||
private numericFields: (keyof EventFormDTO)[] = ['event_type_id'];
|
||||
|
||||
frequencyOptions: FrequencyOption[] = [
|
||||
{
|
||||
frequency: 'DAILY',
|
||||
label: 'Napi'
|
||||
label: 'Napi',
|
||||
},
|
||||
{
|
||||
frequency: 'WEEKLY',
|
||||
label: 'Heti'
|
||||
label: 'Heti',
|
||||
}, {
|
||||
frequency: 'MONTHLY',
|
||||
label: 'Havi'
|
||||
},{
|
||||
label: 'Havi',
|
||||
}, {
|
||||
frequency: 'YEARLY',
|
||||
label: 'Éves'
|
||||
}
|
||||
]
|
||||
label: 'Éves',
|
||||
},
|
||||
];
|
||||
|
||||
weekDayOptions = [
|
||||
{ value: 'MO', label: 'Hétfő' },
|
||||
{ value: 'TU', label: 'Kedd' },
|
||||
{ value: 'WE', label: 'Szerda' },
|
||||
{ value: 'TH', label: 'Csütörtök' },
|
||||
{ value: 'FR', label: 'Péntek' },
|
||||
{ value: 'SA', label: 'Szombat' },
|
||||
{ value: 'SU', label: 'Vasárnap' },
|
||||
];
|
||||
|
||||
constructor(
|
||||
private fb: FormBuilder,
|
||||
@@ -60,132 +69,249 @@ export class CreateEventForm implements OnInit {
|
||||
private router: Router,
|
||||
private eventService: EventService,
|
||||
private calendarService: CalendarService,
|
||||
private eventTypeService: EventTypeService
|
||||
private eventTypeService: EventTypeService,
|
||||
) {
|
||||
this.form = this.fb.group({
|
||||
eventTypeId: [null,Validators.required],
|
||||
title: [null,Validators.required],
|
||||
eventTypeId: [null, Validators.required],
|
||||
title: [null, Validators.required],
|
||||
description: [null],
|
||||
startTime: [null,Validators.required],
|
||||
endTime: [null,Validators.required],
|
||||
is_recurring: [null],
|
||||
recurringRule: this.fb.group({
|
||||
frequency: [null] ,//'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
||||
interval: [null] ,//number
|
||||
startTime: [null, Validators.required],
|
||||
endTime: [null, Validators.required],
|
||||
isRecurring: [false],
|
||||
recurrenceRule: this.fb.group({
|
||||
frequency: ['DAILY'],//'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
||||
interval: [1],//number
|
||||
endDate: [null], // Date
|
||||
count: [null], // number
|
||||
byDay: [null], // string
|
||||
byMonthDay: [null], // number
|
||||
byMonth: [null], // number
|
||||
byMonthDay: [null], // string
|
||||
byMonth: [null], // string
|
||||
|
||||
})
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.isRecurring?.valueChanges.subscribe(isRecurring => {
|
||||
const recurringRule = this.form.get('recurrenceRule');
|
||||
const frequency = recurringRule?.get('frequency');
|
||||
const interval = recurringRule?.get('interval');
|
||||
|
||||
if (isRecurring) {
|
||||
if (this.frequency?.value === null || this.frequency?.value === undefined ){
|
||||
this.form.patchValue(
|
||||
{
|
||||
recurrenceRule: {
|
||||
frequency: 'DAILY',
|
||||
interval: 1,
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
frequency?.setValidators([Validators.required]);
|
||||
interval?.setValidators([Validators.required, Validators.min(1)]);
|
||||
} else {
|
||||
recurringRule?.reset();
|
||||
frequency?.clearValidators();
|
||||
interval?.clearValidators();
|
||||
}
|
||||
frequency?.updateValueAndValidity();
|
||||
interval?.updateValueAndValidity();
|
||||
});
|
||||
|
||||
of(this.id()).pipe(
|
||||
tap(id => {
|
||||
if (id) {
|
||||
console.info("edit mode", 'edit')
|
||||
this.isEditMode = true;
|
||||
}else{
|
||||
|
||||
const start = this.date() || new Date();
|
||||
const end = this.date() || new Date();
|
||||
|
||||
console.info("staring form with date", start,end);
|
||||
start.setMinutes(0,0);
|
||||
end.setHours(start.getHours()+1,0,0);
|
||||
start.setMinutes(start.getMinutes() - start.getTimezoneOffset());
|
||||
const startString = start.toISOString().slice(0,16);
|
||||
|
||||
end.setMinutes(end.getMinutes() - end.getTimezoneOffset());
|
||||
const endTime = end.toISOString().slice(0,16);
|
||||
|
||||
console.info("Date start",start.toLocaleString("hu-HU", {timeStyle: 'short', dateStyle: 'short'}));
|
||||
this.form.patchValue({
|
||||
// start_time: new Date().getTime().toString(),
|
||||
startTime: startString,
|
||||
endTime: endTime
|
||||
})
|
||||
}
|
||||
}),
|
||||
mergeMap(() => {
|
||||
return this.eventTypeService.find({});
|
||||
}
|
||||
return this.eventTypeService.find({});
|
||||
},
|
||||
),
|
||||
tap(eventTypes => {
|
||||
this.eventTypes.set(eventTypes.data);
|
||||
}),
|
||||
switchMap(() => {
|
||||
if (this.isEditMode && this.id()) {
|
||||
console.info('edit mode', 'edit', this.id());
|
||||
return this.eventService.findOne(this.id()!);
|
||||
}
|
||||
return of(null);
|
||||
}),
|
||||
).subscribe(event => {
|
||||
console.info("subscribe form done")
|
||||
if (event) {
|
||||
this.form.patchValue(event);
|
||||
const startTime = this.formatIsoStringForInput(event.startTime);
|
||||
const endTime = this.formatIsoStringForInput(event.endTime);
|
||||
this.form.patchValue(
|
||||
{
|
||||
title: event.title,
|
||||
description: event.description,
|
||||
startTime,
|
||||
endTime,
|
||||
eventTypeId: event?.eventType?.id,
|
||||
isRecurring: event.isRecurring ,
|
||||
recurrenceRule: {
|
||||
frequency: event.recurrenceRule?.frequency,
|
||||
interval: event.recurrenceRule?.interval,
|
||||
endDate: event.recurrenceRule?.endDate,
|
||||
count: event.recurrenceRule?.count,
|
||||
byDay: event.recurrenceRule?.byDay,
|
||||
byMonthDay: event.recurrenceRule?.byMonthDay,
|
||||
byMonth: event.recurrenceRule?.byMonth,
|
||||
|
||||
},
|
||||
},
|
||||
);
|
||||
} else {
|
||||
|
||||
const start = this.createDate(this.date());
|
||||
const end = this.createDate(this.date(), start.getHours() + 1);
|
||||
|
||||
const startTime = this.formatDateForInput(start);
|
||||
const endTime = this.formatDateForInput(end);
|
||||
|
||||
this.form.patchValue({
|
||||
startTime,
|
||||
endTime,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createDate(date?: Date, hours?: number) {
|
||||
const start = date ? new Date(date?.getTime()) : new Date();
|
||||
if (hours != undefined) {
|
||||
start.setHours(start.getHours() + hours, 0, 0);
|
||||
} else {
|
||||
start.setMinutes(0, 0);
|
||||
}
|
||||
return start;
|
||||
}
|
||||
|
||||
formatDateForInput(dateObject: Date) {
|
||||
return format(dateObject, 'yyyy-MM-dd\'T\'HH:mm');
|
||||
}
|
||||
|
||||
formatIsoStringForInput(dateString: string) {
|
||||
const date = new Date(dateString);
|
||||
return this.formatDateForInput(date);
|
||||
}
|
||||
|
||||
onByDayChange(event: any) {
|
||||
const target = event.target as HTMLInputElement;
|
||||
const day = target.value;
|
||||
const isChecked = target.checked;
|
||||
|
||||
let currentByDay: string[] = this.byDay?.value ? this.byDay.value.split(',') : [];
|
||||
|
||||
if (isChecked) {
|
||||
currentByDay.push(day);
|
||||
} else {
|
||||
currentByDay = currentByDay.filter(d => d !== day);
|
||||
}
|
||||
|
||||
this.byDay?.setValue(currentByDay.join(','));
|
||||
}
|
||||
|
||||
isDayChecked(day: string): boolean {
|
||||
return this.byDay?.value ? this.byDay.value.split(',').includes(day) : false;
|
||||
}
|
||||
|
||||
onSubmit(): void {
|
||||
if (this.form.invalid) {
|
||||
this.form.markAllAsTouched();
|
||||
return;
|
||||
}
|
||||
|
||||
const payload: EventFormDTO|any = { ...this.form.value };
|
||||
const payload: EventFormDTO = { ...this.form.value };
|
||||
|
||||
if (!payload.isRecurring) {
|
||||
delete payload.recurrenceRule;
|
||||
}
|
||||
|
||||
for (const field of this.numericFields) {
|
||||
if (payload[field] != null && payload[field] !== '') {
|
||||
payload[field] = parseFloat(payload[field]);
|
||||
if (typeof payload[field] !== 'number') {
|
||||
payload[field] = parseFloat(payload[field] as string) as never;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let action$: Observable<Event>;
|
||||
let action$: Observable<Event | undefined>;
|
||||
|
||||
if (this.isEditMode && this.id()) {
|
||||
console.info("rong branch")
|
||||
// action$ = this.calendarService.update(this.id()!, payload);
|
||||
action$ = of(payload);
|
||||
action$ = this.calendarService.update(this.id()!, payload);
|
||||
// action$ = of(undefined);
|
||||
} else {
|
||||
action$ = this.calendarService.create(payload);
|
||||
}
|
||||
|
||||
action$.subscribe({
|
||||
next: () => this.router.navigate(['/events']),
|
||||
error: (err) => console.error('Failed to save event', err)
|
||||
next: () => {
|
||||
this.ready.emit('save-event-success');
|
||||
},
|
||||
error: (err) =>{
|
||||
console.error('Failed to save event', err);
|
||||
this.ready.emit('save-event-failed');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
get eventType(){
|
||||
get eventType() {
|
||||
return this.form.get('eventTypeId');
|
||||
}
|
||||
|
||||
get title(){
|
||||
get title() {
|
||||
return this.form.get('title');
|
||||
}
|
||||
get description(){
|
||||
|
||||
get description() {
|
||||
return this.form.get('description');
|
||||
}
|
||||
get startTime(){
|
||||
|
||||
get startTime() {
|
||||
return this.form.get('startTime');
|
||||
}
|
||||
get endTime(){
|
||||
|
||||
get endTime() {
|
||||
return this.form.get('endTime');
|
||||
}
|
||||
|
||||
get isRecurring(){
|
||||
return this.form.get('is_recurring');
|
||||
get isRecurring() {
|
||||
return this.form.get('isRecurring');
|
||||
}
|
||||
|
||||
get frequency(){
|
||||
return this.form.get('recurringRule')?.get('frequency');
|
||||
get recurringRule() {
|
||||
return this.form.get('recurrenceRule');
|
||||
}
|
||||
doReady(){
|
||||
this.ready.emit();
|
||||
|
||||
get frequency() {
|
||||
return this.form.get('recurrenceRule')?.get('frequency');
|
||||
}
|
||||
|
||||
get interval() {
|
||||
return this.form.get('recurrenceRule')?.get('interval');
|
||||
}
|
||||
|
||||
get endDate() {
|
||||
return this.form.get('recurrenceRule')?.get('endDate');
|
||||
}
|
||||
|
||||
get byDay() {
|
||||
return this.form.get('recurrenceRule')?.get('byDay');
|
||||
}
|
||||
|
||||
get byMonthDay() {
|
||||
return this.form.get('recurrenceRule')?.get('byMonthDay');
|
||||
}
|
||||
|
||||
get byMonth() {
|
||||
return this.form.get('recurrenceRule')?.get('byMonth');
|
||||
}
|
||||
|
||||
doReady() {
|
||||
this.ready.emit('close');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface CreateExceptionDto {
|
||||
originalStartTime: Date; // The start time of the instance to modify/cancel
|
||||
isCancelled?: boolean;
|
||||
newStartTime?: Date;
|
||||
newEndTime?: Date;
|
||||
title?: string;
|
||||
description?: string;
|
||||
}
|
||||
@@ -1,5 +1,19 @@
|
||||
// dvbooking-cli/src/templates/angular/model.ts.tpl
|
||||
|
||||
|
||||
export interface RecurrenceRuleDto {
|
||||
frequency: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
||||
|
||||
interval: number;
|
||||
|
||||
byDay?: string; // e.g., 'MO,TU,WE,TH,FR'
|
||||
|
||||
endDate?: Date;
|
||||
|
||||
count?: number;
|
||||
}
|
||||
|
||||
|
||||
// Generated by the CLI
|
||||
export interface EventFormDTO {
|
||||
id?: number;
|
||||
@@ -8,5 +22,8 @@ export interface EventFormDTO {
|
||||
description?: string;
|
||||
start_time?: Date;
|
||||
end_time?: Date;
|
||||
is_recurring: boolean;
|
||||
isRecurring: boolean;
|
||||
recurrenceRule?: RecurrenceRuleDto;
|
||||
}
|
||||
|
||||
export interface UpdateEventFormDTO extends Partial<EventFormDTO>{}
|
||||
|
||||
@@ -16,14 +16,31 @@ export type BookingWithUserDto = {
|
||||
id: number;
|
||||
};
|
||||
|
||||
export interface EventExceptionDto {
|
||||
id: number,
|
||||
description: string;
|
||||
eventId: number;
|
||||
isCancelled: boolean;
|
||||
newEndTime: string;
|
||||
newStartTime: string;
|
||||
originalStartTime: string;
|
||||
title: string;
|
||||
|
||||
}
|
||||
|
||||
// The final shape of a calendar event occurrence
|
||||
export type CalendarEventDto = {
|
||||
id: number;
|
||||
title: string;
|
||||
startTime: string,
|
||||
originalStartTime: string,
|
||||
endTime: string,
|
||||
description: string,
|
||||
isModified?: boolean;
|
||||
eventBookings: BookingWithUserDto[];
|
||||
isCancelled: boolean;
|
||||
|
||||
isRecurring: boolean;
|
||||
eventType: EventType
|
||||
exceptions: EventExceptionDto[]
|
||||
};
|
||||
|
||||
@@ -2,9 +2,10 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ConfigurationService } from '../../../services/configuration.service';
|
||||
import { EventFormDTO } from '../models/event-form-dto.model';
|
||||
import { EventFormDTO, UpdateEventFormDTO } from '../models/event-form-dto.model';
|
||||
import { Event } from '../../events/models/event.model';
|
||||
import { CalendarEventDto, EventsInRangeDTO } from '../models/events-in-range-dto.model';
|
||||
import { CreateExceptionDto } from '../models/event-exception.model';
|
||||
|
||||
|
||||
@Injectable({
|
||||
@@ -36,4 +37,14 @@ export class CalendarService {
|
||||
return this.http.post<Event>(this.apiUrl+'/events', data);
|
||||
}
|
||||
|
||||
public update(id: number,data: UpdateEventFormDTO): Observable<Event> {
|
||||
return this.http.patch<Event>(this.apiUrl+'/events/'+id, data);
|
||||
}
|
||||
|
||||
public applyException(eventId: number, eventException: CreateExceptionDto){
|
||||
return this.http.post(this.apiUrl+`/events/${eventId}/exceptions`, eventException);
|
||||
}
|
||||
public delete(eventId: number){
|
||||
return this.http.delete(this.apiUrl+`/events/${eventId}` );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,28 +5,35 @@
|
||||
<div class="card bg-base-100 shadow-xl max-w-2xl mx-auto">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title text-3xl">
|
||||
{{ isEditMode ? 'Edit' : 'Create' }} EventType
|
||||
{{ isEditMode ? 'Frissítés' : 'Létrehozás' }} Esemény típus
|
||||
</h2>
|
||||
|
||||
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="space-y-4 mt-4">
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Esemény típus neve</span></label>
|
||||
<input type="text" formControlName="name" class="input input-bordered w-full" /></div>
|
||||
<div class="form-control"><label class="label"><span class="label-text">Esemény típus neve</span></label>
|
||||
<input type="text" formControlName="name" class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Leírás</span></label>
|
||||
<input type="text" formControlName="description" class="input input-bordered w-full" /></div>
|
||||
<div class="form-control"><label class="label"><span class="label-text">Leírás</span></label>
|
||||
<input type="text" formControlName="description" class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Szín</span></label>
|
||||
<input type="color" formControlName="color" class="input input-bordered w-full" colorspace="display-p3"
|
||||
alpha /></div>
|
||||
<div class="form-control"><label class="label"><span class="label-text">Szín</span></label>
|
||||
<input type="color" formControlName="color" class="input input-bordered w-full" colorspace="display-p3"
|
||||
alpha />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Maximális slot szám</span></label>
|
||||
<input type="number" formControlName="max_slot_count" class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="card-actions justify-end mt-6">
|
||||
<a routerLink="/event-type" class="btn btn-ghost">Cancel</a>
|
||||
<a routerLink="/event-type" class="btn btn-ghost">Vissza</a>
|
||||
<button type="submit" class="btn btn-primary" [disabled]="form.invalid">
|
||||
{{ isEditMode ? 'Update' : 'Create' }}
|
||||
{{ isEditMode ? 'Frissítés' : 'Létrehozás' }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -33,7 +33,7 @@ export class EventTypeFormComponent implements OnInit {
|
||||
isEditMode = false;
|
||||
id: number | null = null;
|
||||
|
||||
private numericFields = [];
|
||||
private numericFields = ['max_slot_count'];
|
||||
|
||||
constructor(
|
||||
private fb: FormBuilder,
|
||||
@@ -43,9 +43,10 @@ export class EventTypeFormComponent implements OnInit {
|
||||
private cdr: ChangeDetectorRef
|
||||
) {
|
||||
this.form = this.fb.group({
|
||||
name: [null],
|
||||
description: [null],
|
||||
color: [null]
|
||||
name: [null],
|
||||
description: [null],
|
||||
color: [null],
|
||||
max_slot_count: [null]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -89,22 +90,22 @@ export class EventTypeFormComponent implements OnInit {
|
||||
|
||||
const payload = { ...this.form.value };
|
||||
|
||||
for (const field of this.numericFields) {
|
||||
if (payload[field] != null && payload[field] !== '') {
|
||||
payload[field] = parseFloat(payload[field]);
|
||||
}
|
||||
}
|
||||
for (const field of this.numericFields) {
|
||||
if (payload[field] != null && payload[field] !== '') {
|
||||
payload[field] = parseFloat(payload[field]);
|
||||
}
|
||||
}
|
||||
|
||||
let action$: Observable<EventType>;
|
||||
|
||||
if (this.isEditMode && this.id) {
|
||||
if (this.isEditMode && this.id) {
|
||||
action$ = this.eventTypeService.update(this.id, payload);
|
||||
} else {
|
||||
action$ = this.eventTypeService.create(payload);
|
||||
}
|
||||
|
||||
action$.subscribe({
|
||||
next: () => this.router.navigate(['/event-type']),
|
||||
next: () => this.router.navigate(['/event-type/table']),
|
||||
error: (err) => console.error('Failed to save event-type', err)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,19 +13,21 @@
|
||||
<table class="table w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>name</th>
|
||||
<th>description</th>
|
||||
<th>color</th>
|
||||
<th class="text-right">Actions</th>
|
||||
<th>Azonosító</th>
|
||||
<th>Név</th>
|
||||
<th>Leírás</th>
|
||||
<th>Szín</th>
|
||||
<th>Férőhelyek</th>
|
||||
<th class="text-right">Műveletek</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of response.data" class="hover">
|
||||
<td>{{ item.id }}</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.description }}</td>
|
||||
<td>{{ item.color }}</td>
|
||||
<td>{{ item.id }}</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.description }}</td>
|
||||
<td>{{ item.color }}</td>
|
||||
<td>{{ item.max_slot_count }}</td>
|
||||
<td class="text-right space-x-2">
|
||||
<a [routerLink]="['/event-type', item.id]" class="btn btn-sm btn-ghost">Részletek</a>
|
||||
<a [routerLink]="['/event-type', item.id, 'edit']" class="btn btn-sm btn-ghost">Módosítás</a>
|
||||
@@ -33,7 +35,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr *ngIf="response.data.length === 0">
|
||||
<td colspan="5" class="text-center">No event-type found.</td>
|
||||
<td colspan="6" class="text-center">Nem található eseménytípusok.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -42,14 +44,10 @@
|
||||
<!-- Pagination Controls -->
|
||||
<div *ngIf="response.meta.totalPages > 1" class="flex justify-center mt-4">
|
||||
<div class="join">
|
||||
<button
|
||||
class="join-item btn"
|
||||
(click)="changePage(response.meta.currentPage - 1)"
|
||||
<button class="join-item btn" (click)="changePage(response.meta.currentPage - 1)"
|
||||
[disabled]="response.meta.currentPage === 1">«</button>
|
||||
<button class="join-item btn">Page {{ response.meta.currentPage }} of {{ response.meta.totalPages }}</button>
|
||||
<button
|
||||
class="join-item btn"
|
||||
(click)="changePage(response.meta.currentPage + 1)"
|
||||
<button class="join-item btn">Oldal {{ response.meta.currentPage }} of {{ response.meta.totalPages }}</button>
|
||||
<button class="join-item btn" (click)="changePage(response.meta.currentPage + 1)"
|
||||
[disabled]="response.meta.currentPage === response.meta.totalPages">»</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,4 +58,4 @@
|
||||
<span class="loading loading-spinner loading-lg"></span>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,7 +60,7 @@ export class EventTypeTableComponent implements OnInit {
|
||||
columns: [
|
||||
{
|
||||
attribute: 'name',
|
||||
headerCell: true,
|
||||
headerCell: { value: 'Név' },
|
||||
valueCell: {
|
||||
styleClass: ctx => 'w-[1%]',
|
||||
value: item => item?.name,
|
||||
@@ -68,14 +68,14 @@ export class EventTypeTableComponent implements OnInit {
|
||||
},
|
||||
{
|
||||
attribute: 'description',
|
||||
headerCell: true,
|
||||
headerCell: { value: 'Leírás' },
|
||||
valueCell: {
|
||||
value: item => item?.description,
|
||||
},
|
||||
},
|
||||
{
|
||||
attribute: 'color',
|
||||
headerCell: true,
|
||||
headerCell: { value: 'Szín' },
|
||||
valueCell: {
|
||||
styleClass: ctx => 'w-[1%]',
|
||||
value: item => item?.color,
|
||||
@@ -85,9 +85,16 @@ export class EventTypeTableComponent implements OnInit {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
attribute: 'max_slot_count',
|
||||
headerCell: { value: 'Férőhelyek' },
|
||||
valueCell: {
|
||||
value: item => item?.max_slot_count,
|
||||
},
|
||||
},
|
||||
{
|
||||
attribute: 'actions',
|
||||
headerCell: { value: 'Actions' },
|
||||
headerCell: { value: 'Műveletek' },
|
||||
valueCell: {
|
||||
styleClass: ctx => 'w-[1%]',
|
||||
component: GenericActionColumn,
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface EventType {
|
||||
name: string;
|
||||
description: string;
|
||||
color: string;
|
||||
max_slot_count?: number;
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>event_type_id</th>
|
||||
<td>{{ event.event_type_id }}</td>
|
||||
<td>{{ event.eventType.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>title</th>
|
||||
@@ -28,11 +28,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>start_time</th>
|
||||
<td>{{ event.start_time }}</td>
|
||||
<td>{{ event.startTime }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>end_time</th>
|
||||
<td>{{ event.end_time }}</td>
|
||||
<td>{{ event.endTime }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>timezone</th>
|
||||
@@ -40,7 +40,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>is_recurring</th>
|
||||
<td>{{ event.is_recurring }}</td>
|
||||
<td>{{ event.isRecurring }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>created_at</th>
|
||||
@@ -67,4 +67,4 @@
|
||||
<span class="loading loading-spinner loading-lg"></span>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
<tbody>
|
||||
<tr *ngFor="let item of response.data" class="hover">
|
||||
<td>{{ item.id }}</td>
|
||||
<td>{{ item.event_type_id }}</td>
|
||||
<td>{{ item.eventType.id }}</td>
|
||||
<td>{{ item.title }}</td>
|
||||
<td>{{ item.description }}</td>
|
||||
<td>{{ item.start_time }}</td>
|
||||
<td>{{ item.end_time }}</td>
|
||||
<td>{{ item.startTime }}</td>
|
||||
<td>{{ item.endTime }}</td>
|
||||
<td>{{ item.timezone }}</td>
|
||||
<td>{{ item.is_recurring }}</td>
|
||||
<td>{{ item.isRecurring }}</td>
|
||||
<td>{{ item.created_at }}</td>
|
||||
<td>{{ item.updated_at }}</td>
|
||||
<td class="text-right space-x-2">
|
||||
@@ -73,4 +73,4 @@
|
||||
<span class="loading loading-spinner loading-lg"></span>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,35 @@
|
||||
// dvbooking-cli/src/templates/angular/model.ts.tpl
|
||||
|
||||
// Generated by the CLI
|
||||
|
||||
export interface Event {
|
||||
id: number;
|
||||
event_type_id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
start_time: Date;
|
||||
end_time: Date;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
timezone: string;
|
||||
is_recurring: boolean;
|
||||
created_at: Date;
|
||||
updated_at: Date;
|
||||
isRecurring: boolean;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
eventType: EventType;
|
||||
recurrenceRule: RecurrenceRule
|
||||
}
|
||||
export interface EventType{
|
||||
id: number;
|
||||
description:string;
|
||||
name: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
|
||||
export interface RecurrenceRule{
|
||||
|
||||
frequency?: string,
|
||||
interval?: number,
|
||||
endDate?: string,
|
||||
count?: number,
|
||||
byDay?: string,
|
||||
byMonthDay?: string,
|
||||
byMonth?: string,
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@ export class EventService {
|
||||
* Find a single record by its ID.
|
||||
*/
|
||||
public findOne(id: number): Observable<Event> {
|
||||
return this.http.get<Event>(`${this.apiUrl}/${id}`);
|
||||
return this.http.get<Event>(`${this.apiUrl}/${id}`
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,4 +83,4 @@ export class EventService {
|
||||
public remove(id: number): Observable<any> {
|
||||
return this.http.delete(`${this.apiUrl}/${id}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
admin/src/app/services/event-bus.service.ts
Normal file
29
admin/src/app/services/event-bus.service.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Subject, Observable } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { AppEvent, EventMap } from '../../types';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root' // Makes this a singleton available everywhere
|
||||
})
|
||||
export class EventBusService {
|
||||
private subject$ = new Subject<AppEvent>();
|
||||
|
||||
/**
|
||||
* Publish an event to the bus
|
||||
*/
|
||||
emit<K extends keyof EventMap>(type: K, payload: EventMap[K]): void {
|
||||
this.subject$.next({ type, payload });
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to specific event types
|
||||
* Returns an Observable of the payload
|
||||
*/
|
||||
on<K extends keyof EventMap>(type: K): Observable<EventMap[K]> {
|
||||
return this.subject$.pipe(
|
||||
filter(e => e.type === type),
|
||||
map(e => e.payload)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,49 @@ export class SvgIcons {
|
||||
</svg>
|
||||
`;
|
||||
|
||||
public static heorPencilSquare = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" />
|
||||
</svg>
|
||||
`;
|
||||
|
||||
public static heroXcircle = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
||||
</svg>
|
||||
`;
|
||||
|
||||
public static heroUserPlus = `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z" />
|
||||
</svg>
|
||||
`
|
||||
public static heroUserMinus = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M22 10.5h-6m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM4 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 10.374 21c-2.331 0-4.512-.645-6.374-1.766Z" />
|
||||
</svg>
|
||||
|
||||
`
|
||||
|
||||
public static heroUserGroup = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />
|
||||
</svg>
|
||||
`
|
||||
public static heroPlay = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z" />
|
||||
</svg>
|
||||
`;
|
||||
|
||||
public static heroMinusCircle = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
||||
</svg>
|
||||
`;
|
||||
|
||||
public static heroBadgeCircle = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296Z" />
|
||||
</svg>
|
||||
`;
|
||||
|
||||
public static heroCheckCircle = `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
||||
</svg>
|
||||
`;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user