@tomei/rental 0.2.4 → 0.2.5
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/.eslintrc +16 -16
- package/.eslintrc.js +35 -35
- package/.husky/commit-msg +15 -15
- package/.husky/pre-commit +7 -7
- package/.prettierrc +4 -4
- package/Jenkinsfile +57 -57
- package/README.md +8 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/dist/jest.config.d.ts +2 -0
- package/dist/jest.config.js +11 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/migrations/rental-price-table-migration.d.ts +2 -0
- package/dist/migrations/rental-price-table-migration.js +43 -0
- package/dist/migrations/rental-price-table-migration.js.map +1 -0
- package/dist/migrations/rental-table-migrations.d.ts +2 -0
- package/dist/migrations/rental-table-migrations.js +95 -0
- package/dist/migrations/rental-table-migrations.js.map +1 -0
- package/dist/src/components/rental/rental.d.ts +35 -35
- package/dist/src/components/rental/rental.js +208 -208
- package/dist/src/components/rental/rental.js.map +1 -1
- package/dist/src/components/rental/rental.repository.d.ts +8 -8
- package/dist/src/components/rental/rental.repository.js +66 -66
- package/dist/src/components/rental-price/rental-price.d.ts +12 -12
- package/dist/src/components/rental-price/rental-price.js +71 -71
- package/dist/src/components/rental-price/rental-price.repository.d.ts +8 -8
- package/dist/src/components/rental-price/rental-price.repository.js +66 -66
- package/dist/src/database.d.ts +4 -4
- package/dist/src/database.js +19 -19
- package/dist/src/enum/index.d.ts +2 -2
- package/dist/src/enum/index.js +5 -5
- package/dist/src/enum/rental-status.enum.d.ts +6 -6
- package/dist/src/enum/rental-status.enum.js +10 -10
- package/dist/src/index.d.ts +9 -9
- package/dist/src/index.js +30 -30
- package/dist/src/interfaces/index.d.ts +4 -4
- package/dist/src/interfaces/index.js +2 -2
- package/dist/src/interfaces/rental-attr.interface.d.ts +20 -20
- package/dist/src/interfaces/rental-attr.interface.js +2 -2
- package/dist/src/interfaces/rental-find-all-search-attr.interface.d.ts +8 -8
- package/dist/src/interfaces/rental-find-all-search-attr.interface.js +2 -2
- package/dist/src/interfaces/rental-price-attr.interface.d.ts +7 -7
- package/dist/src/interfaces/rental-price-attr.interface.js +2 -2
- package/dist/src/models/index.d.ts +3 -3
- package/dist/src/models/index.js +7 -7
- package/dist/src/models/rental-price.entity.d.ts +8 -8
- package/dist/src/models/rental-price.entity.js +58 -58
- package/dist/src/models/rental.entity.d.ts +23 -23
- package/dist/src/models/rental.entity.js +138 -138
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/jest.config.js +10 -10
- package/migrations/rental-price-table-migration.js +32 -32
- package/migrations/rental-table-migrations.js +84 -84
- package/package.json +71 -71
- package/src/components/rental/rental.repository.ts +51 -51
- package/src/components/rental/rental.ts +285 -285
- package/src/components/rental-price/rental-price.repository.ts +54 -54
- package/src/components/rental-price/rental-price.ts +89 -89
- package/src/database.ts +21 -21
- package/src/enum/index.ts +3 -3
- package/src/enum/rental-status.enum.ts +6 -6
- package/src/index.ts +16 -16
- package/src/interfaces/index.ts +5 -5
- package/src/interfaces/rental-attr.interface.ts +21 -21
- package/src/interfaces/rental-find-all-search-attr.interface.ts +9 -9
- package/src/interfaces/rental-price-attr.interface.ts +7 -7
- package/src/models/index.ts +4 -4
- package/src/models/rental-price.entity.ts +38 -38
- package/src/models/rental.entity.ts +114 -114
- package/tsconfig.build.json +5 -5
- package/tsconfig.json +23 -23
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/.eslintrc
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "@typescript-eslint/parser",
|
|
3
|
-
"parserOptions": {
|
|
4
|
-
"ecmaVersion": "latest",
|
|
5
|
-
"sourceType": "module" // Allows for the use of imports
|
|
6
|
-
},
|
|
7
|
-
"extends": ["plugin:@typescript-eslint/recommended"],
|
|
8
|
-
"env": {
|
|
9
|
-
"node": true // Enable Node.js global variables
|
|
10
|
-
},
|
|
11
|
-
"rules": {
|
|
12
|
-
"no-console": "off",
|
|
13
|
-
"import/prefer-default-export": "off",
|
|
14
|
-
"@typescript-eslint/no-unused-vars": "warn"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"parser": "@typescript-eslint/parser",
|
|
3
|
+
"parserOptions": {
|
|
4
|
+
"ecmaVersion": "latest",
|
|
5
|
+
"sourceType": "module" // Allows for the use of imports
|
|
6
|
+
},
|
|
7
|
+
"extends": ["plugin:@typescript-eslint/recommended"],
|
|
8
|
+
"env": {
|
|
9
|
+
"node": true // Enable Node.js global variables
|
|
10
|
+
},
|
|
11
|
+
"rules": {
|
|
12
|
+
"no-console": "off",
|
|
13
|
+
"import/prefer-default-export": "off",
|
|
14
|
+
"@typescript-eslint/no-unused-vars": "warn"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/.eslintrc.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: "@typescript-eslint/parser",
|
|
3
|
-
plugins: ["@typescript-eslint"],
|
|
4
|
-
|
|
5
|
-
parserOptions: {
|
|
6
|
-
ecmaVersion: "latest", // Allows the use of modern ECMAScript features
|
|
7
|
-
sourceType: "module", // Allows for the use of imports
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
|
11
|
-
env: {
|
|
12
|
-
node: true, // Enable Node.js global variables
|
|
13
|
-
},
|
|
14
|
-
rules: {
|
|
15
|
-
"no-console": "off",
|
|
16
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
17
|
-
"@typescript-eslint/no-var-requires": "off",
|
|
18
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
19
|
-
"import/prefer-default-export": "off",
|
|
20
|
-
"@typescript-eslint/no-unused-vars": "warn",
|
|
21
|
-
"no-useless-catch": "off",
|
|
22
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
23
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
24
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
25
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
26
|
-
"@typescript-eslint/no-namespace": "off",
|
|
27
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
28
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
29
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
|
30
|
-
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
31
|
-
"@typescript-eslint/no-unsafe-return": "off",
|
|
32
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
|
33
|
-
"no-useless-escape": "off",
|
|
34
|
-
},
|
|
35
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: "@typescript-eslint/parser",
|
|
3
|
+
plugins: ["@typescript-eslint"],
|
|
4
|
+
|
|
5
|
+
parserOptions: {
|
|
6
|
+
ecmaVersion: "latest", // Allows the use of modern ECMAScript features
|
|
7
|
+
sourceType: "module", // Allows for the use of imports
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
|
11
|
+
env: {
|
|
12
|
+
node: true, // Enable Node.js global variables
|
|
13
|
+
},
|
|
14
|
+
rules: {
|
|
15
|
+
"no-console": "off",
|
|
16
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
17
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
18
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
19
|
+
"import/prefer-default-export": "off",
|
|
20
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
21
|
+
"no-useless-catch": "off",
|
|
22
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
23
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
24
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
25
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
26
|
+
"@typescript-eslint/no-namespace": "off",
|
|
27
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
28
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
29
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
30
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
31
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
32
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
33
|
+
"no-useless-escape": "off",
|
|
34
|
+
},
|
|
35
|
+
};
|
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,57 +1,57 @@
|
|
|
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
|
-
echo 'Publish..'
|
|
31
|
-
withCredentials([
|
|
32
|
-
usernamePassword(credentialsId: 'npm-auth-token', usernameVariable: 'NPM_USERNAME', passwordVariable: 'AUTH_TOKEN')
|
|
33
|
-
]) {
|
|
34
|
-
sh "npm set //registry.npmjs.org/:_authToken=$AUTH_TOKEN"
|
|
35
|
-
sh "npm publish"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
post {
|
|
42
|
-
success {
|
|
43
|
-
script {
|
|
44
|
-
def gitAuthor = sh(returnStdout: true, script: 'git log -1 --pretty=format:%an').trim()
|
|
45
|
-
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'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
failure {
|
|
50
|
-
script {
|
|
51
|
-
def gitAuthor = sh(returnStdout: true, script: 'git log -1 --pretty=format:%an').trim()
|
|
52
|
-
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'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
}
|
|
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
|
+
echo 'Publish..'
|
|
31
|
+
withCredentials([
|
|
32
|
+
usernamePassword(credentialsId: 'npm-auth-token', usernameVariable: 'NPM_USERNAME', passwordVariable: 'AUTH_TOKEN')
|
|
33
|
+
]) {
|
|
34
|
+
sh "npm set //registry.npmjs.org/:_authToken=$AUTH_TOKEN"
|
|
35
|
+
sh "npm publish"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
post {
|
|
42
|
+
success {
|
|
43
|
+
script {
|
|
44
|
+
def gitAuthor = sh(returnStdout: true, script: 'git log -1 --pretty=format:%an').trim()
|
|
45
|
+
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'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
failure {
|
|
50
|
+
script {
|
|
51
|
+
def gitAuthor = sh(returnStdout: true, script: 'git log -1 --pretty=format:%an').trim()
|
|
52
|
+
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'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
}
|
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './src';
|
|
1
|
+
export * from './src';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +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);
|
|
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
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.js"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,GAAG;IACf,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,UAAU;IAC7B,eAAe,EAAE,MAAM;IACvB,0BAA0B,EAAE;QAC1B,gBAAgB;KACjB;CACF,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
module.exports = {
|
|
12
|
+
up(queryInterface, Sequelize) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
yield queryInterface.createTable('rental_Price', {
|
|
15
|
+
PriceId: {
|
|
16
|
+
type: Sequelize.STRING(30),
|
|
17
|
+
allowNull: false,
|
|
18
|
+
primaryKey: true,
|
|
19
|
+
},
|
|
20
|
+
RetailPrice: {
|
|
21
|
+
type: Sequelize.DECIMAL(10, 2),
|
|
22
|
+
allowNull: false,
|
|
23
|
+
},
|
|
24
|
+
Currency: {
|
|
25
|
+
type: Sequelize.CHAR(3),
|
|
26
|
+
allowNull: false,
|
|
27
|
+
},
|
|
28
|
+
PromoCode: {
|
|
29
|
+
type: Sequelize.STRING(10),
|
|
30
|
+
},
|
|
31
|
+
Remarks: {
|
|
32
|
+
type: Sequelize.STRING(3000),
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
down(queryInterface, Sequelize) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
yield queryInterface.dropTable('rental_Price');
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=rental-price-table-migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rental-price-table-migration.js","sourceRoot":"","sources":["../../migrations/rental-price-table-migration.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;AAGb,MAAM,CAAC,OAAO,GAAG;IACP,EAAE,CAAC,cAAc,EAAE,SAAS;;YAC9B,MAAM,cAAc,CAAC,WAAW,CAAC,cAAc,EAAE;gBAC7C,OAAO,EAAE;oBACL,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;oBAChB,UAAU,EAAE,IAAI;iBACnB;gBACD,WAAW,EAAE;oBACT,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;oBAC9B,SAAS,EAAE,KAAK;iBACnB;gBACD,QAAQ,EAAE;oBACN,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;oBACvB,SAAS,EAAE,KAAK;iBACnB;gBACD,SAAS,EAAE;oBACP,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;iBAC7B;gBACD,OAAO,EAAE;oBACL,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;iBAC/B;aACJ,CAAC,CAAC;QACP,CAAC;KAAA;IAEK,IAAI,CAAC,cAAc,EAAE,SAAS;;YAChC,MAAM,cAAc,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACnD,CAAC;KAAA;CACJ,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
module.exports = {
|
|
12
|
+
up(queryInterface, Sequelize) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
yield queryInterface.createTable('rental_Rental', {
|
|
15
|
+
RentalId: {
|
|
16
|
+
type: Sequelize.STRING(30),
|
|
17
|
+
allowNull: false,
|
|
18
|
+
primaryKey: true,
|
|
19
|
+
},
|
|
20
|
+
CustomerId: {
|
|
21
|
+
type: Sequelize.STRING(30),
|
|
22
|
+
allowNull: false,
|
|
23
|
+
},
|
|
24
|
+
CustomerType: {
|
|
25
|
+
type: Sequelize.STRING(30),
|
|
26
|
+
allowNull: false,
|
|
27
|
+
},
|
|
28
|
+
ItemId: {
|
|
29
|
+
type: Sequelize.STRING(30),
|
|
30
|
+
allowNull: false,
|
|
31
|
+
},
|
|
32
|
+
ItemType: {
|
|
33
|
+
type: Sequelize.STRING(30),
|
|
34
|
+
allowNull: false,
|
|
35
|
+
},
|
|
36
|
+
PriceId: {
|
|
37
|
+
type: Sequelize.STRING(30),
|
|
38
|
+
allowNull: false,
|
|
39
|
+
references: {
|
|
40
|
+
model: 'rental_Price',
|
|
41
|
+
key: 'PriceId',
|
|
42
|
+
},
|
|
43
|
+
onUpdate: 'CASCADE',
|
|
44
|
+
onDelete: 'CASCADE',
|
|
45
|
+
},
|
|
46
|
+
StartDateTime: {
|
|
47
|
+
type: Sequelize.DATE,
|
|
48
|
+
allowNull: false,
|
|
49
|
+
},
|
|
50
|
+
EndDateTime: {
|
|
51
|
+
type: Sequelize.DATE,
|
|
52
|
+
allowNull: false,
|
|
53
|
+
},
|
|
54
|
+
Status: {
|
|
55
|
+
type: Sequelize.STRING(20),
|
|
56
|
+
allowNull: false,
|
|
57
|
+
},
|
|
58
|
+
CancelRemarks: {
|
|
59
|
+
type: Sequelize.STRING(3000),
|
|
60
|
+
},
|
|
61
|
+
TerminateRemarks: {
|
|
62
|
+
type: Sequelize.STRING(3000),
|
|
63
|
+
},
|
|
64
|
+
EscheatmentYN: {
|
|
65
|
+
type: Sequelize.CHAR(1),
|
|
66
|
+
},
|
|
67
|
+
AgreementNo: {
|
|
68
|
+
type: Sequelize.STRING(30),
|
|
69
|
+
},
|
|
70
|
+
CreatedById: {
|
|
71
|
+
type: Sequelize.STRING(30),
|
|
72
|
+
allowNull: false,
|
|
73
|
+
},
|
|
74
|
+
CreatedAt: {
|
|
75
|
+
type: Sequelize.DATE,
|
|
76
|
+
allowNull: false,
|
|
77
|
+
},
|
|
78
|
+
UpdatedById: {
|
|
79
|
+
type: Sequelize.STRING(30),
|
|
80
|
+
allowNull: false,
|
|
81
|
+
},
|
|
82
|
+
UpdatedAt: {
|
|
83
|
+
type: Sequelize.DATE,
|
|
84
|
+
allowNull: false,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
down(queryInterface, Sequelize) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
yield queryInterface.dropTable('rental_Rental');
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=rental-table-migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rental-table-migrations.js","sourceRoot":"","sources":["../../migrations/rental-table-migrations.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;AAGb,MAAM,CAAC,OAAO,GAAG;IACP,EAAE,CAAC,cAAc,EAAE,SAAS;;YAC9B,MAAM,cAAc,CAAC,WAAW,CAAC,eAAe,EAAE;gBAC9C,QAAQ,EAAE;oBACN,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;oBAChB,UAAU,EAAE,IAAI;iBACnB;gBACD,UAAU,EAAE;oBACR,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;iBACnB;gBACD,YAAY,EAAE;oBACV,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;iBACnB;gBACD,MAAM,EAAE;oBACJ,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;iBACnB;gBACD,QAAQ,EAAE;oBACN,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;iBACnB;gBACD,OAAO,EAAE;oBACL,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;oBAChB,UAAU,EAAE;wBACR,KAAK,EAAE,cAAc;wBACrB,GAAG,EAAE,SAAS;qBACjB;oBACD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,SAAS;iBACtB;gBACD,aAAa,EAAE;oBACX,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,SAAS,EAAE,KAAK;iBACnB;gBACD,WAAW,EAAE;oBACT,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,SAAS,EAAE,KAAK;iBACnB;gBACD,MAAM,EAAE;oBACJ,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;iBACnB;gBACD,aAAa,EAAE;oBACX,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;iBAC/B;gBACD,gBAAgB,EAAE;oBACd,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;iBAC/B;gBACD,aAAa,EAAE;oBACX,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;iBAC1B;gBACD,WAAW,EAAE;oBACT,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;iBAC7B;gBACD,WAAW,EAAE;oBACT,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;iBACnB;gBACD,SAAS,EAAE;oBACP,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,SAAS,EAAE,KAAK;iBACnB;gBACD,WAAW,EAAE;oBACT,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,SAAS,EAAE,KAAK;iBACnB;gBACD,SAAS,EAAE;oBACP,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,SAAS,EAAE,KAAK;iBACnB;aACJ,CAAC,CAAC;QACP,CAAC;KAAA;IAEK,IAAI,CAAC,cAAc,EAAE,SAAS;;YAChC,MAAM,cAAc,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QACpD,CAAC;KAAA;CACJ,CAAC"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { RentalStatusEnum } from '../../enum/rental-status.enum';
|
|
2
|
-
import { LoginUser } from '@tomei/sso';
|
|
3
|
-
import { RentalPrice } from '../rental-price/rental-price';
|
|
4
|
-
import { IRentalFindAllSearchAttr } from '../../interfaces/rental-find-all-search-attr.interface';
|
|
5
|
-
export declare class Rental {
|
|
6
|
-
RentalId: string;
|
|
7
|
-
CustomerId: string;
|
|
8
|
-
CustomerType: string;
|
|
9
|
-
ItemId: string;
|
|
10
|
-
ItemType: string;
|
|
11
|
-
PriceId: string;
|
|
12
|
-
StartDateTime: Date;
|
|
13
|
-
EndDateTime: Date;
|
|
14
|
-
CancelRemarks: string;
|
|
15
|
-
TerminateRemarks: string;
|
|
16
|
-
AgreementNo: string;
|
|
17
|
-
private _Status;
|
|
18
|
-
private _EscheatmentYN;
|
|
19
|
-
private _CreatedById;
|
|
20
|
-
private _CreatedAt;
|
|
21
|
-
private _UpdatedById;
|
|
22
|
-
private _UpdatedAt;
|
|
23
|
-
private static _Repo;
|
|
24
|
-
get Status(): RentalStatusEnum;
|
|
25
|
-
get EscheatmentYN(): string;
|
|
26
|
-
get CreatedById(): string;
|
|
27
|
-
get CreatedAt(): Date;
|
|
28
|
-
get UpdatedById(): string;
|
|
29
|
-
get UpdatedAt(): Date;
|
|
30
|
-
private constructor();
|
|
31
|
-
static init(dbTransaction?: any, rentalId?: string): Promise<Rental>;
|
|
32
|
-
create(rentalPrice: RentalPrice, loginUser: LoginUser, dbTransaction?: any): Promise<this>;
|
|
33
|
-
isItemAvailable(itemId: string, itemType: string, startDateTime: Date, endDateTime: Date, dbTransaction?: any): Promise<boolean>;
|
|
34
|
-
static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, row?: number, search?: IRentalFindAllSearchAttr): Promise<any>;
|
|
35
|
-
}
|
|
1
|
+
import { RentalStatusEnum } from '../../enum/rental-status.enum';
|
|
2
|
+
import { LoginUser } from '@tomei/sso';
|
|
3
|
+
import { RentalPrice } from '../rental-price/rental-price';
|
|
4
|
+
import { IRentalFindAllSearchAttr } from '../../interfaces/rental-find-all-search-attr.interface';
|
|
5
|
+
export declare class Rental {
|
|
6
|
+
RentalId: string;
|
|
7
|
+
CustomerId: string;
|
|
8
|
+
CustomerType: string;
|
|
9
|
+
ItemId: string;
|
|
10
|
+
ItemType: string;
|
|
11
|
+
PriceId: string;
|
|
12
|
+
StartDateTime: Date;
|
|
13
|
+
EndDateTime: Date;
|
|
14
|
+
CancelRemarks: string;
|
|
15
|
+
TerminateRemarks: string;
|
|
16
|
+
AgreementNo: string;
|
|
17
|
+
private _Status;
|
|
18
|
+
private _EscheatmentYN;
|
|
19
|
+
private _CreatedById;
|
|
20
|
+
private _CreatedAt;
|
|
21
|
+
private _UpdatedById;
|
|
22
|
+
private _UpdatedAt;
|
|
23
|
+
private static _Repo;
|
|
24
|
+
get Status(): RentalStatusEnum;
|
|
25
|
+
get EscheatmentYN(): string;
|
|
26
|
+
get CreatedById(): string;
|
|
27
|
+
get CreatedAt(): Date;
|
|
28
|
+
get UpdatedById(): string;
|
|
29
|
+
get UpdatedAt(): Date;
|
|
30
|
+
private constructor();
|
|
31
|
+
static init(dbTransaction?: any, rentalId?: string): Promise<Rental>;
|
|
32
|
+
create(rentalPrice: RentalPrice, loginUser: LoginUser, dbTransaction?: any): Promise<this>;
|
|
33
|
+
isItemAvailable(itemId: string, itemType: string, startDateTime: Date, endDateTime: Date, dbTransaction?: any): Promise<boolean>;
|
|
34
|
+
static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, row?: number, search?: IRentalFindAllSearchAttr): Promise<any>;
|
|
35
|
+
}
|