feat: doc template (#10)

* feat: doc-template

* fix: empty not converted to dash

* feat: also return province, district and sub district

* refactor: move some relation to outer

* feat: add more function

* chore: deps

* feat: add more relation

* feat: count employee by gender

* feat: count all employee

* feat: add more function

* feat: get employment office

* fix: error

---------

Co-authored-by: Methapon2001 <61303214+Methapon2001@users.noreply.github.com>
This commit is contained in:
Methapon Metanipat 2025-01-22 11:27:47 +07:00 committed by GitHub
parent 67651eb213
commit 4e3c51d84b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 456 additions and 13 deletions

113
pnpm-lock.yaml generated
View file

@ -32,6 +32,9 @@ importers:
cron:
specifier: ^3.3.1
version: 3.3.1
docx-templates:
specifier: ^4.13.0
version: 4.13.0
dotenv:
specifier: ^16.4.7
version: 16.4.7
@ -56,6 +59,12 @@ importers:
promise.any:
specifier: ^2.0.6
version: 2.0.6
thai-baht-text:
specifier: ^2.0.5
version: 2.0.5
to-words:
specifier: ^4.2.0
version: 4.2.0
tsoa:
specifier: ^6.6.0
version: 6.6.0
@ -86,7 +95,7 @@ importers:
version: 6.2.1
prisma-kysely:
specifier: ^1.8.0
version: 1.8.0
version: 1.8.0(encoding@0.1.13)
ts-node:
specifier: ^10.9.2
version: 10.9.2(@types/node@20.17.10)(typescript@5.7.2)
@ -902,6 +911,10 @@ packages:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
docx-templates@4.13.0:
resolution: {integrity: sha512-tTmR3WhROYctuyVReQ+PfCU3zprmC45/VuSVzn8EjovzpRkXYUdXiDatB9M8pasj0V+wuuOyY8bcSHvlQ2GNag==}
engines: {node: '>=6'}
dotenv@16.0.3:
resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==}
engines: {node: '>=12'}
@ -944,6 +957,9 @@ packages:
resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==}
engines: {node: '>= 0.8'}
encoding@0.1.13:
resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==}
end-of-stream@1.4.4:
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
@ -1267,6 +1283,10 @@ packages:
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
engines: {node: '>=0.10.0'}
iconv-lite@0.6.3:
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}
ieee754@1.2.1:
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
@ -1281,6 +1301,9 @@ packages:
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
engines: {node: '>= 4'}
immediate@3.0.6:
resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}
import-in-the-middle@1.4.2:
resolution: {integrity: sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==}
@ -1502,6 +1525,9 @@ packages:
jsonfile@6.1.0:
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
jszip@3.10.1:
resolution: {integrity: sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==}
kleur@3.0.3:
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
engines: {node: '>=6'}
@ -1521,6 +1547,9 @@ packages:
resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==}
engines: {node: '>= 0.6.3'}
lie@3.3.0:
resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==}
lilconfig@2.1.0:
resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
engines: {node: '>=10'}
@ -1884,6 +1913,9 @@ packages:
package-json-from-dist@1.0.1:
resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}
pako@1.0.11:
resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}
parse-json@5.2.0:
resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
engines: {node: '>=8'}
@ -2112,6 +2144,9 @@ packages:
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
sax@1.3.0:
resolution: {integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==}
sax@1.4.1:
resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==}
@ -2147,6 +2182,9 @@ packages:
resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==}
engines: {node: '>= 0.4'}
setimmediate@1.0.5:
resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}
setprototypeof@1.2.0:
resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
@ -2343,6 +2381,9 @@ packages:
text-hex@1.0.0:
resolution: {integrity: sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==}
thai-baht-text@2.0.5:
resolution: {integrity: sha512-xTb1marcZhO7PFm2mBPKDJgtMg3crT8uCNHZIbPaV+B/R9LNWS1wBPg4DULtSgZSllsdmEObPzefxOeKAb6X+Q==}
through2@4.0.2:
resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==}
@ -2357,6 +2398,10 @@ packages:
to-source-code@1.0.2:
resolution: {integrity: sha512-YzWtjmNIf3E75eZYa7m1SCyl0vgOGoTzdpH3svfa8SUm5rqTgl9hnDolrAGOghCF9P2gsITXQoMrlujOoz+RPw==}
to-words@4.2.0:
resolution: {integrity: sha512-KY2WEyu1ZVQ9h44Ac3w/E3i59ne873opFQZ8PXU3L7PWzsl8IjgQvSyogCqhCz+FFRCYEFJ1ERAeSB1Mu5sNjw==}
engines: {node: '>=12.0.0'}
toidentifier@1.0.1:
resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==}
engines: {node: '>=0.6'}
@ -2963,7 +3008,7 @@ snapshots:
'@prisma/fetch-engine': 6.2.1
'@prisma/get-platform': 6.2.1
'@prisma/fetch-engine@5.3.1':
'@prisma/fetch-engine@5.3.1(encoding@0.1.13)':
dependencies:
'@prisma/debug': 5.3.1
'@prisma/get-platform': 5.3.1
@ -2974,7 +3019,7 @@ snapshots:
http-proxy-agent: 7.0.0
https-proxy-agent: 7.0.2
kleur: 4.1.5
node-fetch: 2.7.0
node-fetch: 2.7.0(encoding@0.1.13)
p-filter: 2.1.0
p-map: 4.0.0
p-retry: 4.6.2
@ -3020,19 +3065,19 @@ snapshots:
dependencies:
'@prisma/debug': 6.2.1
'@prisma/internals@5.3.1':
'@prisma/internals@5.3.1(encoding@0.1.13)':
dependencies:
'@antfu/ni': 0.21.8
'@opentelemetry/api': 1.4.1
'@prisma/debug': 5.3.1
'@prisma/engines': 5.3.1
'@prisma/fetch-engine': 5.3.1
'@prisma/fetch-engine': 5.3.1(encoding@0.1.13)
'@prisma/generator-helper': 5.3.1
'@prisma/get-platform': 5.3.1
'@prisma/prisma-schema-wasm': 5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59
archiver: 5.3.2
arg: 5.0.2
checkpoint-client: 1.1.27
checkpoint-client: 1.1.27(encoding@0.1.13)
cli-truncate: 2.1.0
dotenv: 16.0.3
escape-string-regexp: 4.0.0
@ -3048,7 +3093,7 @@ snapshots:
is-wsl: 2.2.0
kleur: 4.1.5
new-github-issue-url: 0.2.1
node-fetch: 2.7.0
node-fetch: 2.7.0(encoding@0.1.13)
npm-packlist: 5.1.3
open: 7.4.2
p-map: 4.0.0
@ -3508,13 +3553,13 @@ snapshots:
ansi-styles: 4.3.0
supports-color: 7.2.0
checkpoint-client@1.1.27:
checkpoint-client@1.1.27(encoding@0.1.13):
dependencies:
ci-info: 3.8.0
env-paths: 2.2.1
make-dir: 4.0.0
ms: 2.1.3
node-fetch: 2.6.12
node-fetch: 2.6.12(encoding@0.1.13)
uuid: 9.0.0
transitivePeerDependencies:
- encoding
@ -3730,6 +3775,11 @@ snapshots:
dependencies:
path-type: 4.0.0
docx-templates@4.13.0:
dependencies:
jszip: 3.10.1
sax: 1.3.0
dotenv@16.0.3: {}
dotenv@16.4.7: {}
@ -3802,6 +3852,11 @@ snapshots:
encodeurl@2.0.0: {}
encoding@0.1.13:
dependencies:
iconv-lite: 0.6.3
optional: true
end-of-stream@1.4.4:
dependencies:
once: 1.4.0
@ -4263,6 +4318,11 @@ snapshots:
dependencies:
safer-buffer: 2.1.2
iconv-lite@0.6.3:
dependencies:
safer-buffer: 2.1.2
optional: true
ieee754@1.2.1: {}
ignore-by-default@1.0.1: {}
@ -4273,6 +4333,8 @@ snapshots:
ignore@5.3.2: {}
immediate@3.0.6: {}
import-in-the-middle@1.4.2:
dependencies:
acorn: 8.14.0
@ -4480,6 +4542,13 @@ snapshots:
optionalDependencies:
graceful-fs: 4.2.11
jszip@3.10.1:
dependencies:
lie: 3.3.0
pako: 1.0.11
readable-stream: 2.3.8
setimmediate: 1.0.5
kleur@3.0.3: {}
kleur@4.1.5: {}
@ -4492,6 +4561,10 @@ snapshots:
dependencies:
readable-stream: 2.3.8
lie@3.3.0:
dependencies:
immediate: 3.0.6
lilconfig@2.1.0: {}
lines-and-columns@1.2.4: {}
@ -4691,13 +4764,17 @@ snapshots:
next-line@1.1.0:
optional: true
node-fetch@2.6.12:
node-fetch@2.6.12(encoding@0.1.13):
dependencies:
whatwg-url: 5.0.0
optionalDependencies:
encoding: 0.1.13
node-fetch@2.7.0:
node-fetch@2.7.0(encoding@0.1.13):
dependencies:
whatwg-url: 5.0.0
optionalDependencies:
encoding: 0.1.13
nodemon@3.1.9:
dependencies:
@ -4838,6 +4915,8 @@ snapshots:
package-json-from-dist@1.0.1: {}
pako@1.0.11: {}
parse-json@5.2.0:
dependencies:
'@babel/code-frame': 7.26.2
@ -4894,11 +4973,11 @@ snapshots:
dependencies:
'@prisma/client': 6.2.1(prisma@6.2.1)
prisma-kysely@1.8.0:
prisma-kysely@1.8.0(encoding@0.1.13):
dependencies:
'@mrleebo/prisma-ast': 0.7.0
'@prisma/generator-helper': 5.3.1
'@prisma/internals': 5.3.1
'@prisma/internals': 5.3.1(encoding@0.1.13)
typescript: 5.7.2
zod: 3.24.1
transitivePeerDependencies:
@ -5097,6 +5176,8 @@ snapshots:
safer-buffer@2.1.2: {}
sax@1.3.0: {}
sax@1.4.1: {}
secure-json-parse@2.7.0: {}
@ -5150,6 +5231,8 @@ snapshots:
functions-have-names: 1.2.3
has-property-descriptors: 1.0.2
setimmediate@1.0.5: {}
setprototypeof@1.2.0: {}
shallow-clone-shim@2.0.0:
@ -5372,6 +5455,8 @@ snapshots:
text-hex@1.0.0: {}
thai-baht-text@2.0.5: {}
through2@4.0.2:
dependencies:
readable-stream: 3.6.2
@ -5389,6 +5474,8 @@ snapshots:
is-nil: 1.0.1
optional: true
to-words@4.2.0: {}
toidentifier@1.0.1: {}
touch@3.1.1: {}