@tomei/rental 0.12.4 → 0.13.0
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/src/components/agreement/agreement.d.ts +6 -1
- package/dist/src/components/agreement/agreement.js +39 -0
- package/dist/src/components/agreement/agreement.js.map +1 -1
- package/dist/src/components/hirer-signature/hirer-signature.d.ts +27 -0
- package/dist/src/components/hirer-signature/hirer-signature.js +112 -0
- package/dist/src/components/hirer-signature/hirer-signature.js.map +1 -0
- package/dist/src/components/hirer-signature/hirer-signature.repository.d.ts +8 -0
- package/dist/src/components/hirer-signature/hirer-signature.repository.js +67 -0
- package/dist/src/components/hirer-signature/hirer-signature.repository.js.map +1 -0
- package/dist/src/components/rental/rental.d.ts +3 -1
- package/dist/src/components/rental/rental.js +84 -16
- package/dist/src/components/rental/rental.js.map +1 -1
- package/dist/src/database.js +2 -0
- package/dist/src/database.js.map +1 -1
- package/dist/src/enum/hirer-signature-status.enum.d.ts +4 -0
- package/dist/src/enum/hirer-signature-status.enum.js +9 -0
- package/dist/src/enum/hirer-signature-status.enum.js.map +1 -0
- package/dist/src/enum/hirer-type.enum.d.ts +4 -0
- package/dist/src/enum/hirer-type.enum.js +9 -0
- package/dist/src/enum/hirer-type.enum.js.map +1 -0
- package/dist/src/enum/index.d.ts +3 -1
- package/dist/src/enum/index.js +5 -1
- package/dist/src/enum/index.js.map +1 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +5 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces/hirer-signature-attr.interface.d.ts +14 -0
- package/dist/src/interfaces/hirer-signature-attr.interface.js +3 -0
- package/dist/src/interfaces/hirer-signature-attr.interface.js.map +1 -0
- package/dist/src/interfaces/index.d.ts +3 -1
- package/dist/src/interfaces/response-hirer-signature-attr.interface.d.ts +15 -0
- package/dist/src/interfaces/response-hirer-signature-attr.interface.js +3 -0
- package/dist/src/interfaces/response-hirer-signature-attr.interface.js.map +1 -0
- package/dist/src/models/agreement.entity.d.ts +2 -0
- package/dist/src/models/agreement.entity.js +5 -0
- package/dist/src/models/agreement.entity.js.map +1 -1
- package/dist/src/models/hirer-signature.entity.d.ts +16 -0
- package/dist/src/models/hirer-signature.entity.js +100 -0
- package/dist/src/models/hirer-signature.entity.js.map +1 -0
- package/dist/src/models/index.d.ts +2 -1
- package/dist/src/models/index.js +3 -1
- package/dist/src/models/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.mjs +58 -58
- package/jest.config.js +10 -10
- package/migrations/booking-table-migration.js +79 -79
- package/migrations/hirer-signature-table-migration.js +64 -0
- 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 -75
- package/sonar-project.properties +12 -12
- package/src/components/agreement/agreement.repository.ts +54 -54
- package/src/components/agreement/agreement.ts +117 -49
- package/src/components/booking/booking.repository.ts +51 -51
- package/src/components/booking/booking.ts +492 -492
- package/src/components/hirer-signature/hirer-signature.repository.ts +54 -0
- package/src/components/hirer-signature/hirer-signature.ts +140 -0
- 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 +1073 -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 +29 -27
- package/src/enum/account-type.enum.ts +4 -4
- package/src/enum/booking.enum.ts +5 -5
- package/src/enum/hirer-signature-status.enum.ts +4 -0
- package/src/enum/hirer-type.enum.ts +4 -0
- package/src/enum/index.ts +15 -11
- package/src/enum/rental-status.enum.ts +39 -39
- package/src/index.ts +32 -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/hirer-signature-attr.interface.ts +15 -0
- package/src/interfaces/index.ts +19 -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/interfaces/response-hirer-signature-attr.interface.ts +16 -0
- package/src/models/agreement.entity.ts +43 -39
- package/src/models/booking.entity.ts +105 -105
- package/src/models/hirer-signature.entity.ts +81 -0
- package/src/models/index.ts +15 -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 -24
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
|
+
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ObjectBase } from '@tomei/general';
|
|
2
|
-
import { IAgreementAttr } from '../../interfaces/agreement-attr.interface';
|
|
3
2
|
import { AggrementStatusEnum } from '../../enum/aggrement-status.enum';
|
|
3
|
+
import { IAgreementAttr } from '../../interfaces/agreement-attr.interface';
|
|
4
|
+
import { LoginUser } from '@tomei/sso';
|
|
5
|
+
import { HirerSignatureRepository } from '../hirer-signature/hirer-signature.repository';
|
|
6
|
+
import { IResponseHirerSignature } from '../../interfaces/response-hirer-signature-attr.interface';
|
|
4
7
|
export declare class Agreement extends ObjectBase {
|
|
5
8
|
ObjectId: string;
|
|
6
9
|
ObjectName: string;
|
|
@@ -10,8 +13,10 @@ export declare class Agreement extends ObjectBase {
|
|
|
10
13
|
DateSigned: Date;
|
|
11
14
|
MediaId: string;
|
|
12
15
|
private static _Repo;
|
|
16
|
+
protected static _HirerSignatureRepo: HirerSignatureRepository;
|
|
13
17
|
get AgreementNo(): string;
|
|
14
18
|
set AgreementNo(value: string);
|
|
15
19
|
protected constructor(agreementAttr?: IAgreementAttr);
|
|
16
20
|
static init(agreementNo?: string, dbTransaction?: any): Promise<Agreement>;
|
|
21
|
+
static getSignatureList(loginUser: LoginUser, agreementNo: string, dbTransaction: any): Promise<IResponseHirerSignature[]>;
|
|
17
22
|
}
|
|
@@ -12,6 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Agreement = void 0;
|
|
13
13
|
const general_1 = require("@tomei/general");
|
|
14
14
|
const agreement_repository_1 = require("./agreement.repository");
|
|
15
|
+
const config_1 = require("@tomei/config");
|
|
16
|
+
const hirer_signature_repository_1 = require("../hirer-signature/hirer-signature.repository");
|
|
17
|
+
const rentalDb = require("../../database");
|
|
18
|
+
const sequelize_1 = require("sequelize");
|
|
15
19
|
class Agreement extends general_1.ObjectBase {
|
|
16
20
|
get AgreementNo() {
|
|
17
21
|
return this.ObjectId;
|
|
@@ -44,7 +48,42 @@ class Agreement extends general_1.ObjectBase {
|
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
50
|
}
|
|
51
|
+
static getSignatureList(loginUser, agreementNo, dbTransaction) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
try {
|
|
54
|
+
const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
|
|
55
|
+
const isPrivileged = loginUser.checkPrivileges(systemCode, 'AGREEMENT_SIGNATURE_LIST');
|
|
56
|
+
if (!isPrivileged) {
|
|
57
|
+
throw new general_1.ClassError('Agreement', 'AgreementErrMsg01', "You do not have 'AGREEMENT_SIGNATURE_LIST' privilege.");
|
|
58
|
+
}
|
|
59
|
+
if (!agreementNo) {
|
|
60
|
+
throw new general_1.ClassError('AgreementNo', 'AgreementNoErrMsg01', 'AgreementNo is missing');
|
|
61
|
+
}
|
|
62
|
+
const query = `
|
|
63
|
+
SELECT
|
|
64
|
+
hs.*,
|
|
65
|
+
c.FullName
|
|
66
|
+
FROM
|
|
67
|
+
rental_HirerSignature hs
|
|
68
|
+
LEFT JOIN
|
|
69
|
+
sdb_Customer c ON hs.CustomerId = c.CustomerId
|
|
70
|
+
WHERE
|
|
71
|
+
hs.AgreementNo = '${agreementNo}'
|
|
72
|
+
`;
|
|
73
|
+
const db = rentalDb.getConnection();
|
|
74
|
+
const signatures = yield db.query(query, {
|
|
75
|
+
type: sequelize_1.QueryTypes.SELECT,
|
|
76
|
+
transaction: dbTransaction,
|
|
77
|
+
});
|
|
78
|
+
return signatures;
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
47
85
|
}
|
|
48
86
|
exports.Agreement = Agreement;
|
|
49
87
|
Agreement._Repo = new agreement_repository_1.AgreementRepository();
|
|
88
|
+
Agreement._HirerSignatureRepo = new hirer_signature_repository_1.HirerSignatureRepository();
|
|
50
89
|
//# sourceMappingURL=agreement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreement.js","sourceRoot":"","sources":["../../../../src/components/agreement/agreement.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"agreement.js","sourceRoot":"","sources":["../../../../src/components/agreement/agreement.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwD;AAGxD,iEAA6D;AAC7D,0CAAkD;AAElD,8FAAyF;AACzF,2CAA2C;AAC3C,yCAAuC;AAGvC,MAAa,SAAU,SAAQ,oBAAU;IAYvC,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;QAlBV,eAAU,GAAW,WAAW,CAAC;QACjC,cAAS,GAAG,kBAAkB,CAAC;QAkB7B,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,C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@
|
|
|
1
|
+
import { ObjectBase } from '@tomei/general';
|
|
2
|
+
import { HirerSignatureRepository } from './hirer-signature.repository';
|
|
3
|
+
import { IHirerSignatureAttr } from '../../interfaces/hirer-signature-attr.interface';
|
|
4
|
+
import { LoginUser } from '@tomei/sso';
|
|
5
|
+
import { HirerSignatureStatusEnum } from '../../enum/hirer-signature-status.enum';
|
|
6
|
+
export declare class HirerSignature extends ObjectBase {
|
|
7
|
+
ObjectId: string;
|
|
8
|
+
ObjectName: string;
|
|
9
|
+
ObjectType: string;
|
|
10
|
+
TableName: string;
|
|
11
|
+
AgreementNo: string;
|
|
12
|
+
HirerType: string;
|
|
13
|
+
CustomerId: string;
|
|
14
|
+
CustomerType: string;
|
|
15
|
+
SignatureStatus: HirerSignatureStatusEnum;
|
|
16
|
+
SignedAt: Date;
|
|
17
|
+
CreatedById: string;
|
|
18
|
+
CreatedAt: Date;
|
|
19
|
+
UpdatedById: string;
|
|
20
|
+
UpdatedAt: Date;
|
|
21
|
+
get HirerSignatureId(): string;
|
|
22
|
+
set HirerSignatureId(value: string);
|
|
23
|
+
protected static _Repository: HirerSignatureRepository;
|
|
24
|
+
protected constructor(hirerSignatureAttr?: IHirerSignatureAttr);
|
|
25
|
+
static init(HirerSignatureId?: string, dbTransaction?: any): Promise<HirerSignature>;
|
|
26
|
+
create(loginUser: LoginUser, dbTransaction?: any): Promise<this>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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.HirerSignature = void 0;
|
|
13
|
+
const general_1 = require("@tomei/general");
|
|
14
|
+
const hirer_signature_repository_1 = require("./hirer-signature.repository");
|
|
15
|
+
const config_1 = require("@tomei/config");
|
|
16
|
+
const activity_history_1 = require("@tomei/activity-history");
|
|
17
|
+
class HirerSignature extends general_1.ObjectBase {
|
|
18
|
+
get HirerSignatureId() {
|
|
19
|
+
return this.ObjectId;
|
|
20
|
+
}
|
|
21
|
+
set HirerSignatureId(value) {
|
|
22
|
+
this.ObjectId = value;
|
|
23
|
+
}
|
|
24
|
+
constructor(hirerSignatureAttr) {
|
|
25
|
+
super();
|
|
26
|
+
this.ObjectType = 'HirerSignature';
|
|
27
|
+
this.TableName = 'rental_HirerSignature';
|
|
28
|
+
if (hirerSignatureAttr) {
|
|
29
|
+
this.HirerSignatureId = hirerSignatureAttr.HirerSignatureId;
|
|
30
|
+
this.AgreementNo = hirerSignatureAttr.AgreementNo;
|
|
31
|
+
this.HirerType = hirerSignatureAttr.HirerType;
|
|
32
|
+
this.CustomerId = hirerSignatureAttr.CustomerId;
|
|
33
|
+
this.CustomerType = hirerSignatureAttr.CustomerType;
|
|
34
|
+
this.SignatureStatus = hirerSignatureAttr.SignatureStatus;
|
|
35
|
+
this.SignedAt = hirerSignatureAttr.SignedAt;
|
|
36
|
+
this.CreatedById = hirerSignatureAttr.CreatedById;
|
|
37
|
+
this.CreatedAt = hirerSignatureAttr.CreatedAt;
|
|
38
|
+
this.UpdatedById = hirerSignatureAttr.UpdatedById;
|
|
39
|
+
this.UpdatedAt = hirerSignatureAttr.UpdatedAt;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static init(HirerSignatureId, dbTransaction) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
try {
|
|
45
|
+
if (HirerSignatureId) {
|
|
46
|
+
const hs = yield HirerSignature._Repository.findByPk(HirerSignatureId, dbTransaction);
|
|
47
|
+
if (hs) {
|
|
48
|
+
return new HirerSignature(hs.get({ plain: true }));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
throw new general_1.ClassError('HirerSignature', 'HirerSignatureErrMsg01', 'HirerSignature not found');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return new HirerSignature();
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
create(loginUser, dbTransaction) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
try {
|
|
64
|
+
const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
|
|
65
|
+
const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'HirerSignature - Create');
|
|
66
|
+
if (!isPrivileged) {
|
|
67
|
+
throw new general_1.ClassError('HirerSignature', 'HirerSignatureErrMsg00', "You do not have 'HirerSignature - Create' privilege.");
|
|
68
|
+
}
|
|
69
|
+
if (!this.AgreementNo || !this.CustomerId || !this.CustomerType) {
|
|
70
|
+
throw new general_1.ClassError('HirerSignature', 'HirerSignatureErrMsg03', 'AgreementNo, CustomerId and CustomerType are required.');
|
|
71
|
+
}
|
|
72
|
+
this.ObjectId = this.createId();
|
|
73
|
+
this.CreatedById = loginUser.ObjectId;
|
|
74
|
+
this.CreatedAt = new Date();
|
|
75
|
+
this.UpdatedById = loginUser.ObjectId;
|
|
76
|
+
this.UpdatedAt = new Date();
|
|
77
|
+
const entityValueAfter = {
|
|
78
|
+
HirerSignatureId: this.HirerSignatureId,
|
|
79
|
+
AgreementNo: this.AgreementNo,
|
|
80
|
+
HirerType: this.HirerType,
|
|
81
|
+
CustomerId: this.CustomerId,
|
|
82
|
+
CustomerType: this.CustomerType,
|
|
83
|
+
SignatureStatus: this.SignatureStatus,
|
|
84
|
+
SignedAt: this.SignedAt,
|
|
85
|
+
CreatedById: this.CreatedById,
|
|
86
|
+
CreatedAt: this.CreatedAt,
|
|
87
|
+
UpdatedById: this.UpdatedById,
|
|
88
|
+
UpdatedAt: this.UpdatedAt,
|
|
89
|
+
};
|
|
90
|
+
yield HirerSignature._Repository.create(entityValueAfter, {
|
|
91
|
+
transaction: dbTransaction,
|
|
92
|
+
});
|
|
93
|
+
const activity = new activity_history_1.Activity();
|
|
94
|
+
activity.ObjectId = this.createId();
|
|
95
|
+
activity.Action = activity_history_1.ActionEnum.CREATE;
|
|
96
|
+
activity.Description = 'Add Joint Hirer Signature';
|
|
97
|
+
activity.EntityId = this.ObjectId;
|
|
98
|
+
activity.EntityType = this.ObjectType;
|
|
99
|
+
activity.EntityValueBefore = JSON.stringify({});
|
|
100
|
+
activity.EntityValueAfter = JSON.stringify(entityValueAfter);
|
|
101
|
+
yield activity.create(loginUser.ObjectId, dbTransaction);
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.HirerSignature = HirerSignature;
|
|
111
|
+
HirerSignature._Repository = new hirer_signature_repository_1.HirerSignatureRepository();
|
|
112
|
+
//# sourceMappingURL=hirer-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hirer-signature.js","sourceRoot":"","sources":["../../../../src/components/hirer-signature/hirer-signature.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwD;AACxD,6EAAwE;AAExE,0CAAkD;AAElD,8DAA+D;AAG/D,MAAa,cAAe,SAAQ,oBAAU;IAgB5C,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,gBAAgB,CAAC,KAAa;QAChC,IAAI,CAAC,QAAQ,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/general';
|
|
2
|
+
import { HirerSignatureModel } from '../../models/hirer-signature.entity';
|
|
3
|
+
export declare class HirerSignatureRepository extends RepositoryBase<HirerSignatureModel> implements IRepositoryBase<HirerSignatureModel> {
|
|
4
|
+
constructor();
|
|
5
|
+
findByPk(id: string, transaction?: any): Promise<HirerSignatureModel | null>;
|
|
6
|
+
delete(hirerId: 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.HirerSignatureRepository = void 0;
|
|
13
|
+
const general_1 = require("@tomei/general");
|
|
14
|
+
const hirer_signature_entity_1 = require("../../models/hirer-signature.entity");
|
|
15
|
+
class HirerSignatureRepository extends general_1.RepositoryBase {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(hirer_signature_entity_1.HirerSignatureModel);
|
|
18
|
+
}
|
|
19
|
+
findByPk(id, transaction) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
try {
|
|
22
|
+
const result = yield hirer_signature_entity_1.HirerSignatureModel.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(hirerId, dbTransaction) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
const options = {
|
|
36
|
+
where: {
|
|
37
|
+
HirerId: hirerId,
|
|
38
|
+
},
|
|
39
|
+
transaction: dbTransaction,
|
|
40
|
+
};
|
|
41
|
+
yield hirer_signature_entity_1.HirerSignatureModel.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 jointHirers;
|
|
52
|
+
if (options) {
|
|
53
|
+
jointHirers = yield hirer_signature_entity_1.HirerSignatureModel.findAndCountAll(options);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
jointHirers = yield hirer_signature_entity_1.HirerSignatureModel.findAndCountAll();
|
|
57
|
+
}
|
|
58
|
+
return jointHirers;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw new Error(`An Error occured when retriving : ${error.message}`);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.HirerSignatureRepository = HirerSignatureRepository;
|
|
67
|
+
//# sourceMappingURL=hirer-signature.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hirer-signature.repository.js","sourceRoot":"","sources":["../../../../src/components/hirer-signature/hirer-signature.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,gFAA0E;AAE1E,MAAa,wBACX,SAAQ,wBAAmC;IAG3C;QACE,KAAK,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,7 @@ import { RentalAccountTypeEnum } from '../../enum/account-type.enum';
|
|
|
9
9
|
import { JointHirer } from '../joint-hirer/joint-hirer';
|
|
10
10
|
import { AgreementRepository } from '../agreement/agreement.repository';
|
|
11
11
|
import { JointHirerRepository } from '../joint-hirer/joint-hirer.repository';
|
|
12
|
+
import { HirerSignatureRepository } from '../hirer-signature/hirer-signature.repository';
|
|
12
13
|
export declare class Rental extends ObjectBase {
|
|
13
14
|
ObjectId: string;
|
|
14
15
|
ObjectName: string;
|
|
@@ -35,6 +36,7 @@ export declare class Rental extends ObjectBase {
|
|
|
35
36
|
protected static _Repo: RentalRepository;
|
|
36
37
|
protected static _AgreementRepo: AgreementRepository;
|
|
37
38
|
protected static _JointHirerRepo: JointHirerRepository;
|
|
39
|
+
protected static _HirerSignatureRepo: HirerSignatureRepository;
|
|
38
40
|
get RentalId(): string;
|
|
39
41
|
set RentalId(value: string);
|
|
40
42
|
get Status(): RentalStatusEnum;
|
|
@@ -54,6 +56,6 @@ export declare class Rental extends ObjectBase {
|
|
|
54
56
|
periodEndProcess(loginUser: LoginUser, dbTransaction: any, stockInventory: any): Promise<this>;
|
|
55
57
|
getCustomerActiveRentals(loginUser: LoginUser, dbTransaction: any, CustomerId: string): Promise<IRentalAttr[]>;
|
|
56
58
|
getCustomerIds(loginUser: LoginUser, dbTransaction: any): Promise<string[]>;
|
|
57
|
-
signAgreement(loginUser: LoginUser, dbTransaction: any): Promise<void>;
|
|
59
|
+
signAgreement(loginUser: LoginUser, CustomerId: string, dbTransaction: any): Promise<void>;
|
|
58
60
|
generateAgreement(loginUser: LoginUser, dbTransaction: any, MediaId: string): Promise<void>;
|
|
59
61
|
}
|