@tomei/rental 0.12.3 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.commitlintrc.json +22 -22
- package/.gitlab-ci.yml +16 -16
- package/.husky/commit-msg +15 -15
- package/.husky/pre-commit +7 -7
- package/.prettierrc +4 -4
- package/Jenkinsfile +51 -51
- package/README.md +8 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/src/components/agreement/agreement.d.ts +17 -0
- package/dist/src/components/agreement/agreement.js +50 -0
- package/dist/src/components/agreement/agreement.js.map +1 -0
- package/dist/src/components/agreement/agreement.repository.d.ts +8 -0
- package/dist/src/components/agreement/agreement.repository.js +67 -0
- package/dist/src/components/agreement/agreement.repository.js.map +1 -0
- package/dist/src/components/booking/booking.d.ts +46 -0
- package/dist/src/components/booking/booking.js +314 -0
- package/dist/src/components/booking/booking.js.map +1 -0
- package/dist/src/components/booking/booking.repository.d.ts +8 -0
- package/dist/src/components/booking/booking.repository.js +67 -0
- package/dist/src/components/booking/booking.repository.js.map +1 -0
- package/dist/src/components/joint-hirer/joint-hirer.d.ts +23 -0
- package/dist/src/components/joint-hirer/joint-hirer.js +106 -0
- package/dist/src/components/joint-hirer/joint-hirer.js.map +1 -0
- package/dist/src/components/joint-hirer/joint-hirer.repository.d.ts +8 -0
- package/dist/src/components/joint-hirer/joint-hirer.repository.js +67 -0
- package/dist/src/components/joint-hirer/joint-hirer.repository.js.map +1 -0
- package/dist/src/components/rental/rental.d.ts +59 -0
- package/dist/src/components/rental/rental.js +619 -0
- package/dist/src/components/rental/rental.js.map +1 -0
- package/dist/src/components/rental/rental.repository.d.ts +8 -0
- package/dist/src/components/rental/rental.repository.js +67 -0
- package/dist/src/components/rental/rental.repository.js.map +1 -0
- package/dist/src/components/rental-price/rental-price.d.ts +18 -0
- package/dist/src/components/rental-price/rental-price.js +79 -0
- package/dist/src/components/rental-price/rental-price.js.map +1 -0
- package/dist/src/components/rental-price/rental-price.repository.d.ts +8 -0
- package/dist/src/components/rental-price/rental-price.repository.js +67 -0
- package/dist/src/components/rental-price/rental-price.repository.js.map +1 -0
- package/dist/src/database.d.ts +4 -0
- package/dist/src/database.js +25 -0
- package/dist/src/database.js.map +1 -0
- package/dist/src/enum/account-type.enum.d.ts +4 -0
- package/dist/src/enum/account-type.enum.js +9 -0
- package/dist/src/enum/account-type.enum.js.map +1 -0
- package/dist/src/enum/aggrement-status.enum.d.ts +5 -0
- package/dist/src/enum/aggrement-status.enum.js +10 -0
- package/dist/src/enum/aggrement-status.enum.js.map +1 -0
- package/dist/src/enum/booking.enum.d.ts +5 -0
- package/dist/src/enum/booking.enum.js +10 -0
- package/dist/src/enum/booking.enum.js.map +1 -0
- package/dist/src/enum/index.d.ts +5 -0
- package/dist/src/enum/index.js +12 -0
- package/dist/src/enum/index.js.map +1 -0
- package/dist/src/enum/rental-status.enum.d.ts +9 -0
- package/dist/src/enum/rental-status.enum.js +14 -0
- package/dist/src/enum/rental-status.enum.js.map +1 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.js +43 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces/agreement-attr.interface.d.ts +7 -0
- package/dist/src/interfaces/agreement-attr.interface.js +3 -0
- package/dist/src/interfaces/agreement-attr.interface.js.map +1 -0
- package/dist/src/interfaces/booking-attr.interface.d.ts +18 -0
- package/dist/src/interfaces/booking-attr.interface.js +3 -0
- package/dist/src/interfaces/booking-attr.interface.js.map +1 -0
- package/dist/src/interfaces/booking-find-all-search-attr.interface.d.ts +12 -0
- package/dist/src/interfaces/booking-find-all-search-attr.interface.js +3 -0
- package/dist/src/interfaces/booking-find-all-search-attr.interface.js.map +1 -0
- package/dist/src/interfaces/index.d.ts +7 -0
- package/dist/src/interfaces/index.js +3 -0
- package/dist/src/interfaces/index.js.map +1 -0
- package/dist/src/interfaces/joint-hirer-attr.interface.d.ts +10 -0
- package/dist/src/interfaces/joint-hirer-attr.interface.js +3 -0
- package/dist/src/interfaces/joint-hirer-attr.interface.js.map +1 -0
- package/dist/src/interfaces/rental-attr.interface.d.ts +24 -0
- package/dist/src/interfaces/rental-attr.interface.js +3 -0
- package/dist/src/interfaces/rental-attr.interface.js.map +1 -0
- package/dist/src/interfaces/rental-find-all-search-attr.interface.d.ts +10 -0
- package/dist/src/interfaces/rental-find-all-search-attr.interface.js +3 -0
- package/dist/src/interfaces/rental-find-all-search-attr.interface.js.map +1 -0
- package/dist/src/interfaces/rental-price-attr.interface.d.ts +7 -0
- package/dist/src/interfaces/rental-price-attr.interface.js +3 -0
- package/dist/src/interfaces/rental-price-attr.interface.js.map +1 -0
- package/dist/src/models/agreement.entity.d.ts +10 -0
- package/dist/src/models/agreement.entity.js +60 -0
- package/dist/src/models/agreement.entity.js.map +1 -0
- package/dist/src/models/booking.entity.d.ts +21 -0
- package/dist/src/models/booking.entity.js +128 -0
- package/dist/src/models/booking.entity.js.map +1 -0
- package/dist/src/models/index.d.ts +6 -0
- package/dist/src/models/index.js +14 -0
- package/dist/src/models/index.js.map +1 -0
- package/dist/src/models/joint-hirer.entity.d.ts +13 -0
- package/dist/src/models/joint-hirer.entity.js +79 -0
- package/dist/src/models/joint-hirer.entity.js.map +1 -0
- package/dist/src/models/rental-price.entity.d.ts +8 -0
- package/dist/src/models/rental-price.entity.js +59 -0
- package/dist/src/models/rental-price.entity.js.map +1 -0
- package/dist/src/models/rental.entity.d.ts +29 -0
- package/dist/src/models/rental.entity.js +160 -0
- package/dist/src/models/rental.entity.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/eslint.config.mjs +58 -37
- package/jest.config.js +10 -10
- package/migrations/booking-table-migration.js +79 -79
- package/migrations/joint-hirer-table-migration.js +52 -52
- package/migrations/rental-aggrement-table-migration.js +30 -30
- package/migrations/rental-price-table-migration.js +32 -32
- package/migrations/rental-table-migrations.js +96 -96
- package/package.json +75 -78
- package/sonar-project.properties +12 -12
- package/src/components/agreement/agreement.repository.ts +54 -54
- package/src/components/agreement/agreement.ts +49 -49
- package/src/components/booking/booking.repository.ts +51 -51
- package/src/components/booking/booking.ts +492 -492
- package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
- package/src/components/joint-hirer/joint-hirer.ts +137 -137
- package/src/components/rental/rental.repository.ts +51 -51
- package/src/components/rental/rental.ts +963 -963
- package/src/components/rental-price/rental-price.repository.ts +54 -54
- package/src/components/rental-price/rental-price.ts +100 -100
- package/src/database.ts +27 -27
- package/src/enum/account-type.enum.ts +4 -4
- package/src/enum/booking.enum.ts +5 -5
- package/src/enum/index.ts +11 -11
- package/src/enum/rental-status.enum.ts +39 -39
- package/src/index.ts +28 -28
- package/src/interfaces/agreement-attr.interface.ts +7 -7
- package/src/interfaces/booking-attr.interface.ts +19 -19
- package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
- package/src/interfaces/index.ts +15 -15
- package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
- package/src/interfaces/rental-attr.interface.ts +25 -25
- package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
- package/src/interfaces/rental-price-attr.interface.ts +7 -7
- package/src/models/agreement.entity.ts +39 -39
- package/src/models/booking.entity.ts +105 -105
- package/src/models/index.ts +13 -13
- package/src/models/joint-hirer.entity.ts +63 -63
- package/src/models/rental-price.entity.ts +38 -38
- package/src/models/rental.entity.ts +133 -133
- package/tsconfig.build.json +5 -5
- package/tsconfig.json +24 -23
- package/.eslintrc +0 -16
- package/.eslintrc.js +0 -35
- package/tomei-rental-0.9.4.tgz +0 -0
package/.commitlintrc.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"@commitlint/config-conventional"
|
|
4
|
-
],
|
|
5
|
-
"rules": {
|
|
6
|
-
"header-max-length": [ 2, "always", 120 ],
|
|
7
|
-
"type-enum": [
|
|
8
|
-
2,
|
|
9
|
-
"always",
|
|
10
|
-
[
|
|
11
|
-
"breaking",
|
|
12
|
-
"feat",
|
|
13
|
-
"fix",
|
|
14
|
-
"refactor",
|
|
15
|
-
"config",
|
|
16
|
-
"test",
|
|
17
|
-
"docs",
|
|
18
|
-
"chore"
|
|
19
|
-
]
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"@commitlint/config-conventional"
|
|
4
|
+
],
|
|
5
|
+
"rules": {
|
|
6
|
+
"header-max-length": [ 2, "always", 120 ],
|
|
7
|
+
"type-enum": [
|
|
8
|
+
2,
|
|
9
|
+
"always",
|
|
10
|
+
[
|
|
11
|
+
"breaking",
|
|
12
|
+
"feat",
|
|
13
|
+
"fix",
|
|
14
|
+
"refactor",
|
|
15
|
+
"config",
|
|
16
|
+
"test",
|
|
17
|
+
"docs",
|
|
18
|
+
"chore"
|
|
19
|
+
]
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
package/.gitlab-ci.yml
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
variables:
|
|
2
|
-
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
|
|
3
|
-
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
|
|
4
|
-
sonarcloud-check:
|
|
5
|
-
image:
|
|
6
|
-
name: sonarsource/sonar-scanner-cli:latest
|
|
7
|
-
entrypoint: [""]
|
|
8
|
-
cache:
|
|
9
|
-
key: "${CI_JOB_NAME}"
|
|
10
|
-
paths:
|
|
11
|
-
- .sonar/cache
|
|
12
|
-
script:
|
|
13
|
-
- sonar-scanner
|
|
14
|
-
only:
|
|
15
|
-
- merge_requests
|
|
16
|
-
- main
|
|
1
|
+
variables:
|
|
2
|
+
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
|
|
3
|
+
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
|
|
4
|
+
sonarcloud-check:
|
|
5
|
+
image:
|
|
6
|
+
name: sonarsource/sonar-scanner-cli:latest
|
|
7
|
+
entrypoint: [""]
|
|
8
|
+
cache:
|
|
9
|
+
key: "${CI_JOB_NAME}"
|
|
10
|
+
paths:
|
|
11
|
+
- .sonar/cache
|
|
12
|
+
script:
|
|
13
|
+
- sonar-scanner
|
|
14
|
+
only:
|
|
15
|
+
- merge_requests
|
|
16
|
+
- main
|
package/.husky/commit-msg
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
-
|
|
4
|
-
npx commitlint --edit $1
|
|
5
|
-
message="$(cat $1)"
|
|
6
|
-
echo "$message"
|
|
7
|
-
a=($(echo "$message" | tr ':' '\n'))
|
|
8
|
-
echo "${a[0]}"
|
|
9
|
-
if [ "${a[0]}" = "feat" ];
|
|
10
|
-
then
|
|
11
|
-
npm version --commit-hooks false --no-git-tag-version minor
|
|
12
|
-
else
|
|
13
|
-
npm version --commit-hooks false --no-git-tag-version patch
|
|
14
|
-
fi
|
|
15
|
-
git add .
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
+
|
|
4
|
+
npx commitlint --edit $1
|
|
5
|
+
message="$(cat $1)"
|
|
6
|
+
echo "$message"
|
|
7
|
+
a=($(echo "$message" | tr ':' '\n'))
|
|
8
|
+
echo "${a[0]}"
|
|
9
|
+
if [ "${a[0]}" = "feat" ];
|
|
10
|
+
then
|
|
11
|
+
npm version --commit-hooks false --no-git-tag-version minor
|
|
12
|
+
else
|
|
13
|
+
npm version --commit-hooks false --no-git-tag-version patch
|
|
14
|
+
fi
|
|
15
|
+
git add .
|
|
16
16
|
git commit -m "$message" --no-verify
|
package/.husky/pre-commit
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
-
|
|
4
|
-
npm run lint
|
|
5
|
-
npm run format
|
|
6
|
-
npm run build
|
|
7
|
-
git add .
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
+
|
|
4
|
+
npm run lint
|
|
5
|
+
npm run format
|
|
6
|
+
npm run build
|
|
7
|
+
git add .
|
package/.prettierrc
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"singleQuote": true,
|
|
3
|
-
"trailingComma": "all",
|
|
4
|
-
"endOfLine": "auto"
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"trailingComma": "all",
|
|
4
|
+
"endOfLine": "auto"
|
|
5
5
|
}
|
package/Jenkinsfile
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
pipeline {
|
|
2
|
-
agent {
|
|
3
|
-
kubernetes {
|
|
4
|
-
label 'jenkins-agent'
|
|
5
|
-
namespace 'devops-tools'
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
tools {nodejs "node18"}
|
|
9
|
-
stages {
|
|
10
|
-
stage('Install') {
|
|
11
|
-
steps {
|
|
12
|
-
echo 'Install Dependencies..'
|
|
13
|
-
sh 'npm install'
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
stage('Test') {
|
|
17
|
-
steps {
|
|
18
|
-
echo 'Testing..'
|
|
19
|
-
// sh 'npm run test'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
stage('Build') {
|
|
23
|
-
steps {
|
|
24
|
-
echo 'Building..'
|
|
25
|
-
sh 'npm run build'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
stage('Publish') {
|
|
29
|
-
steps {
|
|
30
|
-
sh "npm publish"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
post {
|
|
36
|
-
success {
|
|
37
|
-
script {
|
|
38
|
-
def gitAuthor = sh(returnStdout: true, script: 'git log -1 --pretty=format:%an').trim()
|
|
39
|
-
discordSend description: "Git Commit: ${env.GIT_COMMIT}\nGit Branch: ${env.GIT_BRANCH}\nGit URL: ${env.GIT_URL}\nGit Author: ${gitAuthor}", footer: '', image: '', link: env.BUILD_URL, result: 'SUCCESS', scmWebUrl: '', thumbnail: '', title: "${env.JOB_NAME} Build #${env.BUILD_NUMBER} Success", webhookURL: 'https://discord.com/api/webhooks/1166358157166125076/AquDPsQ6L5piq_TfiSfLGOujmVqgHhxfK8yVEfJZrWfhgT6g-j5gJ3xhuXGFZUjRhhlo'
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
failure {
|
|
44
|
-
script {
|
|
45
|
-
def gitAuthor = sh(returnStdout: true, script: 'git log -1 --pretty=format:%an').trim()
|
|
46
|
-
discordSend description: "Git Commit: ${env.GIT_COMMIT}\nGit Branch: ${env.GIT_BRANCH}\nGit URL: ${env.GIT_URL}\nGit Author: ${gitAuthor}", footer: '', image: '', link: env.BUILD_URL, result: 'FAILURE', scmWebUrl: '', thumbnail: '', title: "${env.JOB_NAME} Build #${env.BUILD_NUMBER} Failed", webhookURL: 'https://discord.com/api/webhooks/1166358157166125076/AquDPsQ6L5piq_TfiSfLGOujmVqgHhxfK8yVEfJZrWfhgT6g-j5gJ3xhuXGFZUjRhhlo'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}
|
|
1
|
+
pipeline {
|
|
2
|
+
agent {
|
|
3
|
+
kubernetes {
|
|
4
|
+
label 'jenkins-agent'
|
|
5
|
+
namespace 'devops-tools'
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
tools {nodejs "node18"}
|
|
9
|
+
stages {
|
|
10
|
+
stage('Install') {
|
|
11
|
+
steps {
|
|
12
|
+
echo 'Install Dependencies..'
|
|
13
|
+
sh 'npm install'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
stage('Test') {
|
|
17
|
+
steps {
|
|
18
|
+
echo 'Testing..'
|
|
19
|
+
// sh 'npm run test'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
stage('Build') {
|
|
23
|
+
steps {
|
|
24
|
+
echo 'Building..'
|
|
25
|
+
sh 'npm run build'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
stage('Publish') {
|
|
29
|
+
steps {
|
|
30
|
+
sh "npm publish"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
post {
|
|
36
|
+
success {
|
|
37
|
+
script {
|
|
38
|
+
def gitAuthor = sh(returnStdout: true, script: 'git log -1 --pretty=format:%an').trim()
|
|
39
|
+
discordSend description: "Git Commit: ${env.GIT_COMMIT}\nGit Branch: ${env.GIT_BRANCH}\nGit URL: ${env.GIT_URL}\nGit Author: ${gitAuthor}", footer: '', image: '', link: env.BUILD_URL, result: 'SUCCESS', scmWebUrl: '', thumbnail: '', title: "${env.JOB_NAME} Build #${env.BUILD_NUMBER} Success", webhookURL: 'https://discord.com/api/webhooks/1166358157166125076/AquDPsQ6L5piq_TfiSfLGOujmVqgHhxfK8yVEfJZrWfhgT6g-j5gJ3xhuXGFZUjRhhlo'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
failure {
|
|
44
|
+
script {
|
|
45
|
+
def gitAuthor = sh(returnStdout: true, script: 'git log -1 --pretty=format:%an').trim()
|
|
46
|
+
discordSend description: "Git Commit: ${env.GIT_COMMIT}\nGit Branch: ${env.GIT_BRANCH}\nGit URL: ${env.GIT_URL}\nGit Author: ${gitAuthor}", footer: '', image: '', link: env.BUILD_URL, result: 'FAILURE', scmWebUrl: '', thumbnail: '', title: "${env.JOB_NAME} Build #${env.BUILD_NUMBER} Failed", webhookURL: 'https://discord.com/api/webhooks/1166358157166125076/AquDPsQ6L5piq_TfiSfLGOujmVqgHhxfK8yVEfJZrWfhgT6g-j5gJ3xhuXGFZUjRhhlo'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
}
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## Package Template
|
|
2
|
-
|
|
3
|
-
### How to use
|
|
4
|
-
- run `npm i`
|
|
5
|
-
- create a `components` folder in the root of your project
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
## Package Template
|
|
2
|
+
|
|
3
|
+
### How to use
|
|
4
|
+
- run `npm i`
|
|
5
|
+
- create a `components` folder in the root of your project
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ObjectBase } from '@tomei/general';
|
|
2
|
+
import { IAgreementAttr } from '../../interfaces/agreement-attr.interface';
|
|
3
|
+
import { AggrementStatusEnum } from '../../enum/aggrement-status.enum';
|
|
4
|
+
export declare class Agreement extends ObjectBase {
|
|
5
|
+
ObjectId: string;
|
|
6
|
+
ObjectName: string;
|
|
7
|
+
ObjectType: string;
|
|
8
|
+
TableName: string;
|
|
9
|
+
Status: AggrementStatusEnum;
|
|
10
|
+
DateSigned: Date;
|
|
11
|
+
MediaId: string;
|
|
12
|
+
private static _Repo;
|
|
13
|
+
get AgreementNo(): string;
|
|
14
|
+
set AgreementNo(value: string);
|
|
15
|
+
protected constructor(agreementAttr?: IAgreementAttr);
|
|
16
|
+
static init(agreementNo?: string, dbTransaction?: any): Promise<Agreement>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Agreement = void 0;
|
|
13
|
+
const general_1 = require("@tomei/general");
|
|
14
|
+
const agreement_repository_1 = require("./agreement.repository");
|
|
15
|
+
class Agreement extends general_1.ObjectBase {
|
|
16
|
+
get AgreementNo() {
|
|
17
|
+
return this.ObjectId;
|
|
18
|
+
}
|
|
19
|
+
set AgreementNo(value) {
|
|
20
|
+
this.ObjectId = value;
|
|
21
|
+
}
|
|
22
|
+
constructor(agreementAttr) {
|
|
23
|
+
super();
|
|
24
|
+
this.ObjectType = 'Agreement';
|
|
25
|
+
this.TableName = 'rental_Agreement';
|
|
26
|
+
if (agreementAttr) {
|
|
27
|
+
this.ObjectId = agreementAttr.AgreementNo;
|
|
28
|
+
this.Status = agreementAttr.Status;
|
|
29
|
+
this.DateSigned = agreementAttr.DateSigned;
|
|
30
|
+
this.MediaId = agreementAttr.MediaId;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
static init(agreementNo, dbTransaction) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
try {
|
|
36
|
+
if (agreementNo) {
|
|
37
|
+
const agreement = yield this._Repo.findByPk(agreementNo, dbTransaction);
|
|
38
|
+
return new Agreement(agreement === null || agreement === void 0 ? void 0 : agreement.get({ plain: true }));
|
|
39
|
+
}
|
|
40
|
+
return new Agreement();
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.Agreement = Agreement;
|
|
49
|
+
Agreement._Repo = new agreement_repository_1.AgreementRepository();
|
|
50
|
+
//# sourceMappingURL=agreement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agreement.js","sourceRoot":"","sources":["../../../../src/components/agreement/agreement.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA4C;AAE5C,iEAA6D;AAG7D,MAAa,SAAU,SAAQ,oBAAU;IAWvC,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,WAAW,CAAC,KAAa;QAC3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,YAAsB,aAA8B;QAClD,KAAK,EAAE,CAAC;QAjBV,eAAU,GAAW,WAAW,CAAC;QACjC,cAAS,GAAG,kBAAkB,CAAC;QAiB7B,IAAI,aAAa,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,WAAW,CAAC;YAC1C,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;YACnC,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;YAC3C,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;QACvC,CAAC;IACH,CAAC;IAEM,MAAM,CAAO,IAAI,CACtB,WAAoB,EACpB,aAAmB;;YAEnB,IAAI,CAAC;gBACH,IAAI,WAAW,EAAE,CAAC;oBAChB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;oBACxE,OAAO,IAAI,SAAS,CAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBACxD,CAAC;gBACD,OAAO,IAAI,SAAS,EAAE,CAAC;YACzB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;;AA1CH,8BA2CC;AAlCgB,eAAK,GAAG,IAAI,0CAAmB,EAAE,AAA5B,CAA6B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
+
import { AgreementModel } from '../../models/agreement.entity';
|
|
3
|
+
export declare class AgreementRepository extends RepositoryBase<AgreementModel> implements IRepositoryBase<AgreementModel> {
|
|
4
|
+
constructor();
|
|
5
|
+
findByPk(id: string, transaction?: any): Promise<AgreementModel | null>;
|
|
6
|
+
delete(AgreementNo: string, dbTransaction?: any): Promise<void>;
|
|
7
|
+
findAndCountAll(options?: any): Promise<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgreementRepository = void 0;
|
|
13
|
+
const general_1 = require("@tomei/general");
|
|
14
|
+
const agreement_entity_1 = require("../../models/agreement.entity");
|
|
15
|
+
class AgreementRepository extends general_1.RepositoryBase {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(agreement_entity_1.AgreementModel);
|
|
18
|
+
}
|
|
19
|
+
findByPk(id, transaction) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
try {
|
|
22
|
+
const result = yield agreement_entity_1.AgreementModel.findByPk(id, {
|
|
23
|
+
transaction: transaction,
|
|
24
|
+
});
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw new Error(`An Error occured when fetching : ${error.message}`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
delete(AgreementNo, dbTransaction) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
const options = {
|
|
36
|
+
where: {
|
|
37
|
+
AgreementNo,
|
|
38
|
+
},
|
|
39
|
+
transaction: dbTransaction,
|
|
40
|
+
};
|
|
41
|
+
yield agreement_entity_1.AgreementModel.destroy(options);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
throw new Error(`An Error occured when delete : ${error.message}`);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
findAndCountAll(options) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
try {
|
|
51
|
+
let Agreements;
|
|
52
|
+
if (options) {
|
|
53
|
+
Agreements = yield agreement_entity_1.AgreementModel.findAndCountAll(options);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
Agreements = yield agreement_entity_1.AgreementModel.findAndCountAll();
|
|
57
|
+
}
|
|
58
|
+
return Agreements;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw new Error(`An Error occured when retriving : ${error.message}`);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.AgreementRepository = AgreementRepository;
|
|
67
|
+
//# sourceMappingURL=agreement.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agreement.repository.js","sourceRoot":"","sources":["../../../../src/components/agreement/agreement.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,oEAA+D;AAE/D,MAAa,mBACX,SAAQ,wBAA8B;IAGtC;QACE,KAAK,CAAC,iCAAc,CAAC,CAAC;IACxB,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,iCAAc,CAAC,QAAQ,CAAC,EAAE,EAAE;oBAC/C,WAAW,EAAE,WAAW;iBACzB,CAAC,CAAC;gBAEH,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;KAAA;IAEK,MAAM,CAAC,WAAmB,EAAE,aAAmB;;YACnD,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,WAAW;qBACZ;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,iCAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACxC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;KAAA;IAEK,eAAe,CAAC,OAAa;;YACjC,IAAI,CAAC;gBACH,IAAI,UAAe,CAAC;gBACpB,IAAI,OAAO,EAAE,CAAC;oBACZ,UAAU,GAAG,MAAM,iCAAc,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBAC7D,CAAC;qBAAM,CAAC;oBACN,UAAU,GAAG,MAAM,iCAAc,CAAC,eAAe,EAAE,CAAC;gBACtD,CAAC;gBACD,OAAO,UAAU,CAAC;YACpB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;KAAA;CACF;AAlDD,kDAkDC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ObjectBase } from '@tomei/general';
|
|
2
|
+
import { BookingStatusEnum } from '../../enum/booking.enum';
|
|
3
|
+
import { IBookingAttr } from '../../interfaces/booking-attr.interface';
|
|
4
|
+
import { BookingRepository } from './booking.repository';
|
|
5
|
+
import { LoginUser } from '@tomei/sso';
|
|
6
|
+
import { RentalPrice } from '../rental-price/rental-price';
|
|
7
|
+
import { WhereOptions } from 'sequelize';
|
|
8
|
+
import { IBookingFindAllSearchAttr } from '../../interfaces/booking-find-all-search-attr.interface';
|
|
9
|
+
export declare class Booking extends ObjectBase {
|
|
10
|
+
ObjectId: string;
|
|
11
|
+
ObjectName: string;
|
|
12
|
+
ObjectType: string;
|
|
13
|
+
TableName: string;
|
|
14
|
+
CustomerId: string;
|
|
15
|
+
CustomerType: string;
|
|
16
|
+
ItemId: string;
|
|
17
|
+
ItemType: string;
|
|
18
|
+
PriceId: string;
|
|
19
|
+
protected _ScheduledStartDateTime: Date;
|
|
20
|
+
protected _ScheduledEndDateTime: Date;
|
|
21
|
+
BookingFee: number;
|
|
22
|
+
Status: BookingStatusEnum;
|
|
23
|
+
CancelRemarks: string;
|
|
24
|
+
protected _CreatedById: string;
|
|
25
|
+
protected _CreatedAt: Date;
|
|
26
|
+
protected _UpdatedById: string;
|
|
27
|
+
protected _UpdatedAt: Date;
|
|
28
|
+
protected static _Repo: BookingRepository;
|
|
29
|
+
get BookingNo(): string;
|
|
30
|
+
set BookingNo(value: string);
|
|
31
|
+
get CreatedById(): string;
|
|
32
|
+
get CreatedAt(): Date;
|
|
33
|
+
get UpdatedById(): string;
|
|
34
|
+
get UpdatedAt(): Date;
|
|
35
|
+
get ScheduledStartDateTime(): Date;
|
|
36
|
+
get ScheduledEndDateTime(): Date;
|
|
37
|
+
setScheduledStartDateTime(datetime: Date): Promise<void>;
|
|
38
|
+
setScheduledEndDateTime(datetime: Date): Promise<void>;
|
|
39
|
+
protected constructor(bookingAttr?: IBookingAttr);
|
|
40
|
+
static init(dbTransaction?: any, bookingNo?: string): Promise<Booking>;
|
|
41
|
+
create(dbTransaction: any, loginUser: LoginUser, rentalPrice: RentalPrice): Promise<this>;
|
|
42
|
+
static isBookingItemAvailable(dbTransaction: any, itemId: string, itemType: string, startDateTime: Date, endDateTime: Date): Promise<boolean>;
|
|
43
|
+
static findAll(dbTransaction: any, page?: number, row?: number, search?: IBookingFindAllSearchAttr): Promise<any>;
|
|
44
|
+
static findOne(loginUser: LoginUser, dbTransaction: any, searchOptions: WhereOptions): Promise<Booking>;
|
|
45
|
+
static updateLeadToCustomer(loginUser: LoginUser, dbTransaction: any, LeadId: string, CustomerId: string): Promise<void>;
|
|
46
|
+
}
|