@tomei/rental 0.17.9-test.2 → 0.18.0-staging.1
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 +23 -23
- package/.gitlab-ci.yml +16 -234
- package/.husky/commit-msg +10 -4
- package/.husky/pre-commit +7 -12
- package/.prettierrc +4 -4
- package/CHANGELOG.md +8 -8
- package/Jenkinsfile +51 -51
- package/README.md +8 -8
- package/dist/src/components/agreement/agreement.d.ts +0 -1
- package/dist/src/components/agreement/agreement.js +9 -13
- package/dist/src/components/agreement/agreement.js.map +1 -1
- package/dist/src/components/rental/rental.d.ts +0 -1
- package/dist/src/components/rental/rental.js +15 -29
- package/dist/src/components/rental/rental.js.map +1 -1
- package/dist/src/components/rental-price/rental-price.js +6 -1
- package/dist/src/components/rental-price/rental-price.js.map +1 -1
- package/dist/src/enum/aggrement-status.enum.d.ts +1 -2
- package/dist/src/enum/aggrement-status.enum.js +0 -1
- package/dist/src/enum/aggrement-status.enum.js.map +1 -1
- package/dist/src/models/joint-hirer.entity.d.ts +1 -0
- package/dist/src/models/joint-hirer.entity.js +8 -0
- package/dist/src/models/joint-hirer.entity.js.map +1 -1
- package/dist/src/models/rental.entity.d.ts +1 -0
- package/dist/src/models/rental.entity.js +8 -0
- package/dist/src/models/rental.entity.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.mjs +58 -58
- package/jest.config.js +10 -15
- package/migrations/20250529092130-add-status-to-joint-hirer.js +19 -19
- package/migrations/20260512140500-add-version-to-rental-and-joint-hirer.js +21 -0
- package/migrations/agreement-signature-table-migration.js +76 -76
- package/migrations/booking-table-migration.js +79 -79
- package/migrations/hirer-change-request-new-hirer-migration.js +72 -72
- package/migrations/hirer-change-request-remove-hirer-migration.js +39 -39
- package/migrations/hirer-change-request-signature-migration.js +65 -65
- package/migrations/joint-hirer-table-migration.js +52 -52
- package/migrations/rental-aggreement-history-migration.js +41 -41
- package/migrations/rental-aggrement-table-migration.js +30 -30
- package/migrations/rental-hirer-change-request-migrations.js +64 -64
- package/migrations/rental-price-table-migration.js +32 -32
- package/migrations/rental-table-migrations.js +96 -96
- package/package.json +80 -80
- package/sonar-project.properties +12 -12
- package/src/ClassMappings/ItemClassMap.ts +7 -7
- package/src/ClassMappings/index.ts +3 -3
- package/src/components/agreement/agreement.repository.ts +54 -54
- package/src/components/agreement/agreement.ts +187 -191
- package/src/components/agreement-history/agreement-history.repository.ts +54 -54
- package/src/components/agreement-history/agreement-history.ts +57 -57
- package/src/components/agreement-signature/agreement-signature.repository.ts +55 -55
- package/src/components/agreement-signature/agreement-signature.ts +155 -155
- package/src/components/booking/booking.repository.ts +51 -51
- package/src/components/booking/booking.ts +492 -492
- package/src/components/hirer-change-request-new-hirer/hirer-change-request-new-hirer.repository.ts +64 -64
- package/src/components/hirer-change-request-new-hirer/hirer-change-request-new-hirer.ts +153 -153
- package/src/components/hirer-change-request-remove-hirer/hirer-change-request-remove-hirer.repository.ts +65 -65
- package/src/components/hirer-change-request-remove-hirer/hirer-change-request-remove-hirer.ts +134 -134
- package/src/components/hirer-change-request-signature/hirer-change-request-signature.repository.ts +65 -65
- package/src/components/hirer-change-request-signature/hirer-change-request-signature.ts +272 -272
- package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
- package/src/components/joint-hirer/joint-hirer.ts +252 -252
- package/src/components/rental/rental.repository.ts +51 -51
- package/src/components/rental/rental.ts +1467 -1498
- package/src/components/rental-hirer-change-request/rental-hirer-change-request.repository.ts +64 -64
- package/src/components/rental-hirer-change-request/rental-hirer-change-request.ts +907 -907
- package/src/components/rental-price/rental-price.repository.ts +54 -54
- package/src/components/rental-price/rental-price.ts +101 -100
- package/src/database.ts +39 -39
- package/src/enum/account-type.enum.ts +4 -4
- package/src/enum/aggrement-status.enum.ts +0 -1
- package/src/enum/agreement-signature-status.enum.ts +4 -4
- package/src/enum/agreement-signature-verification-method.enum.ts +4 -4
- package/src/enum/booking.enum.ts +5 -5
- package/src/enum/hirer-type.enum.ts +4 -4
- package/src/enum/index.ts +23 -23
- package/src/enum/rental-hirer-change-request-hirer-role.ts +4 -4
- package/src/enum/rental-hirer-change-request-status.ts +7 -7
- package/src/enum/rental-hirer-change-request-type.ts +4 -4
- package/src/enum/rental-status.enum.ts +39 -39
- package/src/index.ts +54 -54
- package/src/interfaces/agreemeent-signature-attr.interface.ts +19 -19
- package/src/interfaces/agreement-attr.interface.ts +7 -7
- package/src/interfaces/agreement-history-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-change-request-new-hirer-attr.interface.ts +15 -15
- package/src/interfaces/hirer-change-request-remove-hirer-attr.interface.ts +5 -5
- package/src/interfaces/hirer-change-request-signature-attr.interface.ts +15 -15
- package/src/interfaces/index.ts +29 -29
- package/src/interfaces/joint-hirer-attr.interface.ts +11 -11
- 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-hirer-change-request.attr.interface.ts +17 -17
- package/src/interfaces/rental-hirer-change-request.update.interface.ts +4 -4
- package/src/interfaces/rental-price-attr.interface.ts +7 -7
- package/src/interfaces/response-hirer-signature-attr.interface.ts +15 -15
- package/src/models/agreement-history.entity.ts +51 -51
- package/src/models/agreement-signature.entity.ts +105 -105
- package/src/models/agreement.entity.ts +47 -47
- package/src/models/booking.entity.ts +105 -105
- package/src/models/hirer-change-request-new-hirer.entity.ts +102 -102
- package/src/models/hirer-change-request-remove-hirer.entity.ts +47 -47
- package/src/models/hirer-change-request-signature.entity.ts +86 -86
- package/src/models/index.ts +25 -25
- package/src/models/joint-hirer.entity.ts +77 -70
- package/src/models/rental-price.entity.ts +38 -38
- package/src/models/rental.entity.ts +140 -133
- package/tsconfig.build.json +5 -5
- package/tsconfig.json +24 -24
- package/dist/src/components/agreement/agreement.spec.d.ts +0 -1
- package/dist/src/components/agreement/agreement.spec.js +0 -177
- package/dist/src/components/agreement/agreement.spec.js.map +0 -1
- package/dist/src/components/booking/booking.spec.d.ts +0 -1
- package/dist/src/components/booking/booking.spec.js +0 -261
- package/dist/src/components/booking/booking.spec.js.map +0 -1
- package/dist/src/components/joint-hirer/joint-hirer.spec.d.ts +0 -1
- package/dist/src/components/joint-hirer/joint-hirer.spec.js +0 -206
- package/dist/src/components/joint-hirer/joint-hirer.spec.js.map +0 -1
- package/dist/src/components/rental/rental.spec.d.ts +0 -1
- package/dist/src/components/rental/rental.spec.js +0 -625
- package/dist/src/components/rental/rental.spec.js.map +0 -1
- package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.spec.d.ts +0 -1
- package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.spec.js +0 -500
- package/dist/src/components/rental-hirer-change-request/rental-hirer-change-request.spec.js.map +0 -1
- package/dist/src/components/rental-price/rental-price.spec.d.ts +0 -1
- package/dist/src/components/rental-price/rental-price.spec.js +0 -108
- package/dist/src/components/rental-price/rental-price.spec.js.map +0 -1
- package/src/components/agreement/agreement.spec.ts +0 -229
- package/src/components/booking/booking.spec.ts +0 -360
- package/src/components/joint-hirer/joint-hirer.spec.ts +0 -240
- package/src/components/rental/rental.spec.ts +0 -899
- package/src/components/rental-hirer-change-request/rental-hirer-change-request.spec.ts +0 -666
- package/src/components/rental-price/rental-price.spec.ts +0 -121
package/.commitlintrc.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
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
|
-
"release"
|
|
20
|
-
]
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
}
|
|
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
|
+
"release"
|
|
20
|
+
]
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
package/.gitlab-ci.yml
CHANGED
|
@@ -1,234 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# npm side setup required (npmjs.com):
|
|
18
|
-
# 1. package.json → publishConfig.provenance: true
|
|
19
|
-
# 2. npmjs.com → package Settings → Publishing Access
|
|
20
|
-
# → Enable OIDC publishing for GitLab project:
|
|
21
|
-
# all-tomei-projects/tomei-package/General/<package-name>
|
|
22
|
-
# ============================================================
|
|
23
|
-
default:
|
|
24
|
-
image: node:20-alpine
|
|
25
|
-
|
|
26
|
-
stages:
|
|
27
|
-
- validate
|
|
28
|
-
- build
|
|
29
|
-
- publish
|
|
30
|
-
- notify
|
|
31
|
-
|
|
32
|
-
# ────────────────────────────────────────────────────────────
|
|
33
|
-
# STAGE: validate
|
|
34
|
-
# Runs lint and unit tests before publish
|
|
35
|
-
# Skipped on prod tags — code already validated on test + staging
|
|
36
|
-
# ────────────────────────────────────────────────────────────
|
|
37
|
-
lint:
|
|
38
|
-
stage: validate
|
|
39
|
-
cache:
|
|
40
|
-
key: node-$CI_COMMIT_REF_SLUG
|
|
41
|
-
paths: [node_modules/]
|
|
42
|
-
script:
|
|
43
|
-
- npm ci
|
|
44
|
-
- npm run lint
|
|
45
|
-
rules:
|
|
46
|
-
- if: '$CI_COMMIT_TAG =~ /^test-v/'
|
|
47
|
-
- if: '$CI_COMMIT_TAG =~ /^staging-v/'
|
|
48
|
-
|
|
49
|
-
unit-test:
|
|
50
|
-
stage: validate
|
|
51
|
-
cache:
|
|
52
|
-
key: node-$CI_COMMIT_REF_SLUG
|
|
53
|
-
paths: [node_modules/]
|
|
54
|
-
script:
|
|
55
|
-
- npm ci
|
|
56
|
-
- npm test
|
|
57
|
-
coverage: '/Lines\s*:\s*(\d+\.?\d*)%/'
|
|
58
|
-
artifacts:
|
|
59
|
-
reports:
|
|
60
|
-
coverage_report:
|
|
61
|
-
coverage_format: cobertura
|
|
62
|
-
path: coverage/cobertura-coverage.xml
|
|
63
|
-
expire_in: 7 days
|
|
64
|
-
rules:
|
|
65
|
-
- if: '$CI_COMMIT_TAG =~ /^test-v/'
|
|
66
|
-
- if: '$CI_COMMIT_TAG =~ /^staging-v/'
|
|
67
|
-
|
|
68
|
-
# ────────────────────────────────────────────────────────────
|
|
69
|
-
# STAGE: build
|
|
70
|
-
# Compiles the package (tsc / rollup / whatever your build uses)
|
|
71
|
-
# Artifacts passed to publish jobs
|
|
72
|
-
# Runs on all tag patterns
|
|
73
|
-
# ────────────────────────────────────────────────────────────
|
|
74
|
-
build:
|
|
75
|
-
stage: build
|
|
76
|
-
cache:
|
|
77
|
-
key: node-$CI_COMMIT_REF_SLUG
|
|
78
|
-
paths: [node_modules/]
|
|
79
|
-
script:
|
|
80
|
-
- npm ci
|
|
81
|
-
- npm run build
|
|
82
|
-
artifacts:
|
|
83
|
-
paths:
|
|
84
|
-
- dist/
|
|
85
|
-
expire_in: 1 hour
|
|
86
|
-
rules:
|
|
87
|
-
- if: '$CI_COMMIT_TAG =~ /^test-v/'
|
|
88
|
-
- if: '$CI_COMMIT_TAG =~ /^staging-v/'
|
|
89
|
-
- if: '$CI_COMMIT_TAG =~ /^prod-v/'
|
|
90
|
-
|
|
91
|
-
# ────────────────────────────────────────────────────────────
|
|
92
|
-
# STAGE: publish — test RC
|
|
93
|
-
# Triggered by: test-vX.Y.Z-rc.N tag
|
|
94
|
-
# Publishes with dist-tag "test"
|
|
95
|
-
# Consumers must opt in: npm install @tomei/pkg@test
|
|
96
|
-
# Version stamped: test-v1.24.0-rc.1 → 1.24.0-rc.1
|
|
97
|
-
# ────────────────────────────────────────────────────────────
|
|
98
|
-
publish-test:
|
|
99
|
-
stage: publish
|
|
100
|
-
needs: [build]
|
|
101
|
-
rules:
|
|
102
|
-
- if: '$CI_COMMIT_TAG =~ /^test-v/'
|
|
103
|
-
script:
|
|
104
|
-
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
|
105
|
-
- |
|
|
106
|
-
RC_VERSION=$(echo "$CI_COMMIT_TAG" | sed 's/^test-v\([0-9.]*\)-rc\.\([0-9]*\)$/\1-test.\2/')
|
|
107
|
-
echo "Publishing version $RC_VERSION with dist-tag: test"
|
|
108
|
-
npm version "$RC_VERSION" --no-git-tag-version --ignore-scripts --force
|
|
109
|
-
npm publish --tag test --access public
|
|
110
|
-
echo "Published: @$(node -p "require('./package.json').name")@$RC_VERSION [test]"
|
|
111
|
-
|
|
112
|
-
# ────────────────────────────────────────────────────────────
|
|
113
|
-
# STAGE: publish — staging RC
|
|
114
|
-
# Triggered by: staging-vX.Y.Z-rc.N tag
|
|
115
|
-
# Publishes with dist-tag "staging"
|
|
116
|
-
# Consumers must opt in: npm install @tomei/pkg@staging
|
|
117
|
-
# Version stamped: staging-v1.24.0-rc.1 → 1.24.0-rc.1
|
|
118
|
-
# ────────────────────────────────────────────────────────────
|
|
119
|
-
publish-staging:
|
|
120
|
-
stage: publish
|
|
121
|
-
needs: [build]
|
|
122
|
-
rules:
|
|
123
|
-
- if: '$CI_COMMIT_TAG =~ /^staging-v/'
|
|
124
|
-
script:
|
|
125
|
-
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
|
126
|
-
- |
|
|
127
|
-
RC_VERSION=$(echo "$CI_COMMIT_TAG" | sed 's/^staging-v\([0-9.]*\)-rc\.\([0-9]*\)$/\1-staging.\2/')
|
|
128
|
-
echo "Publishing version $RC_VERSION with dist-tag: staging"
|
|
129
|
-
npm version "$RC_VERSION" --no-git-tag-version --ignore-scripts --force
|
|
130
|
-
npm publish --tag staging --access public
|
|
131
|
-
echo "Published: @$(node -p "require('./package.json').name")@$RC_VERSION [staging]"
|
|
132
|
-
|
|
133
|
-
# ────────────────────────────────────────────────────────────
|
|
134
|
-
# STAGE: publish — production
|
|
135
|
-
# Triggered by: prod-vX.Y.Z or prod-vX.Y.Z-hotfix.N tag (from main only)
|
|
136
|
-
# Publishes with dist-tag "latest" — becomes the default install version
|
|
137
|
-
# Manual gate — human must click Play in GitLab pipeline UI
|
|
138
|
-
# Version stamped: prod-v2.2.0 → 2.2.0 | prod-v2.2.0-hotfix.1 → 2.2.0-hotfix.1
|
|
139
|
-
# ────────────────────────────────────────────────────────────
|
|
140
|
-
publish-prod:
|
|
141
|
-
stage: publish
|
|
142
|
-
needs: [build]
|
|
143
|
-
rules:
|
|
144
|
-
- if: '$CI_COMMIT_TAG =~ /^prod-v/'
|
|
145
|
-
when: manual
|
|
146
|
-
allow_failure: false
|
|
147
|
-
script:
|
|
148
|
-
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
|
149
|
-
- |
|
|
150
|
-
PROD_VERSION=$(echo "$CI_COMMIT_TAG" | sed 's/^prod-v//')
|
|
151
|
-
echo "Publishing version $PROD_VERSION with dist-tag: latest"
|
|
152
|
-
npm version "$PROD_VERSION" --no-git-tag-version --ignore-scripts --force
|
|
153
|
-
npm publish --tag latest --access public
|
|
154
|
-
echo "Published: @$(node -p "require('./package.json').name")@$PROD_VERSION [latest]"
|
|
155
|
-
echo "Pipeline: $CI_PIPELINE_URL"
|
|
156
|
-
|
|
157
|
-
# ────────────────────────────────────────────────────────────
|
|
158
|
-
# STAGE: notify — success
|
|
159
|
-
# ────────────────────────────────────────────────────────────
|
|
160
|
-
notify-success:
|
|
161
|
-
stage: notify
|
|
162
|
-
image: curlimages/curl:latest
|
|
163
|
-
needs:
|
|
164
|
-
- job: publish-test
|
|
165
|
-
optional: true
|
|
166
|
-
- job: publish-staging
|
|
167
|
-
optional: true
|
|
168
|
-
- job: publish-prod
|
|
169
|
-
optional: true
|
|
170
|
-
rules:
|
|
171
|
-
- if: '$CI_COMMIT_TAG =~ /^test-v/'
|
|
172
|
-
when: on_success
|
|
173
|
-
- if: '$CI_COMMIT_TAG =~ /^staging-v/'
|
|
174
|
-
when: on_success
|
|
175
|
-
- if: '$CI_COMMIT_TAG =~ /^prod-v/'
|
|
176
|
-
when: on_success
|
|
177
|
-
script:
|
|
178
|
-
- |
|
|
179
|
-
if echo "$CI_COMMIT_TAG" | grep -q "^test-v"; then
|
|
180
|
-
DIST_TAG="test"
|
|
181
|
-
COLOR=3066993
|
|
182
|
-
elif echo "$CI_COMMIT_TAG" | grep -q "^staging-v"; then
|
|
183
|
-
DIST_TAG="staging"
|
|
184
|
-
COLOR=16776960
|
|
185
|
-
elif echo "$CI_COMMIT_TAG" | grep -q "^prod-v"; then
|
|
186
|
-
DIST_TAG="latest"
|
|
187
|
-
COLOR=3066993
|
|
188
|
-
fi
|
|
189
|
-
|
|
190
|
-
curl -s -X POST "$DISCORD_WEBHOOK" \
|
|
191
|
-
-H "Content-Type: application/json" \
|
|
192
|
-
-d '{
|
|
193
|
-
"embeds": [{
|
|
194
|
-
"title": "Package published successfully",
|
|
195
|
-
"color": '"$COLOR"',
|
|
196
|
-
"fields": [
|
|
197
|
-
{"name": "Package", "value": "'"$CI_PROJECT_NAME"'", "inline": true},
|
|
198
|
-
{"name": "Tag", "value": "'"$CI_COMMIT_TAG"'", "inline": true},
|
|
199
|
-
{"name": "Dist-tag", "value": "'"$DIST_TAG"'", "inline": true},
|
|
200
|
-
{"name": "Published by", "value": "'"$GITLAB_USER_NAME"'", "inline": true},
|
|
201
|
-
{"name": "Pipeline", "value": "'"$CI_PIPELINE_URL"'", "inline": false}
|
|
202
|
-
]
|
|
203
|
-
}]
|
|
204
|
-
}'
|
|
205
|
-
|
|
206
|
-
# ────────────────────────────────────────────────────────────
|
|
207
|
-
# STAGE: notify — failure
|
|
208
|
-
# ────────────────────────────────────────────────────────────
|
|
209
|
-
notify-failure:
|
|
210
|
-
stage: notify
|
|
211
|
-
image: curlimages/curl:latest
|
|
212
|
-
rules:
|
|
213
|
-
- if: '$CI_COMMIT_TAG =~ /^test-v/'
|
|
214
|
-
when: on_failure
|
|
215
|
-
- if: '$CI_COMMIT_TAG =~ /^staging-v/'
|
|
216
|
-
when: on_failure
|
|
217
|
-
- if: '$CI_COMMIT_TAG =~ /^prod-v/'
|
|
218
|
-
when: on_failure
|
|
219
|
-
script:
|
|
220
|
-
- |
|
|
221
|
-
curl -s -X POST "$DISCORD_WEBHOOK" \
|
|
222
|
-
-H "Content-Type: application/json" \
|
|
223
|
-
-d '{
|
|
224
|
-
"embeds": [{
|
|
225
|
-
"title": "Package publish FAILED",
|
|
226
|
-
"color": 15158332,
|
|
227
|
-
"fields": [
|
|
228
|
-
{"name": "Package", "value": "'"$CI_PROJECT_NAME"'", "inline": true},
|
|
229
|
-
{"name": "Tag", "value": "'"$CI_COMMIT_TAG"'", "inline": true},
|
|
230
|
-
{"name": "Failed by", "value": "'"$GITLAB_USER_NAME"'", "inline": true},
|
|
231
|
-
{"name": "Pipeline", "value": "'"$CI_PIPELINE_URL"'", "inline": false}
|
|
232
|
-
]
|
|
233
|
-
}]
|
|
234
|
-
}'
|
|
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,4 +1,10 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
-
|
|
4
|
-
npx commitlint --edit $1
|
|
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
|
+
git add .
|
|
10
|
+
git commit -m "$message" --no-verify
|
package/.husky/pre-commit
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
npm run
|
|
7
|
-
|
|
8
|
-
npm run build
|
|
9
|
-
|
|
10
|
-
if [ -n "$STAGED" ]; then
|
|
11
|
-
echo "$STAGED" | xargs git add
|
|
12
|
-
fi
|
|
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/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# :package: Release Notes – `v0.17.8`
|
|
2
|
-
**Release Date:** 02nd March 2026
|
|
3
|
-
**Version:** `v0.17.8`
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## :bug: Bug Fixes
|
|
8
|
-
- **Rental Cancellation – Active and Suspended Status Removed**
|
|
1
|
+
# :package: Release Notes – `v0.17.8`
|
|
2
|
+
**Release Date:** 02nd March 2026
|
|
3
|
+
**Version:** `v0.17.8`
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## :bug: Bug Fixes
|
|
8
|
+
- **Rental Cancellation – Active and Suspended Status Removed**
|
|
9
9
|
Removed rental status validation during the rental cancellation process, allowing rentals with Active and Suspended status to be cancelled without restriction.
|
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
|
+
|
|
@@ -23,6 +23,5 @@ export declare class Agreement extends ObjectBase {
|
|
|
23
23
|
static init(agreementNo?: string, dbTransaction?: any): Promise<Agreement>;
|
|
24
24
|
static getSignatureList(loginUser: LoginUser, agreementNo: string, dbTransaction: any): Promise<IResponseAgreementSignature[]>;
|
|
25
25
|
getAllActivities(loginUser: LoginUser, dbTransaction?: any): Promise<IAgreementHistoryAttr[]>;
|
|
26
|
-
expire(): void;
|
|
27
26
|
createActivity(activityCompleted: string, MediaId: string, dbTransaction: any, loginUser: LoginUser): Promise<IAgreementHistoryAttr>;
|
|
28
27
|
}
|
|
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Agreement = void 0;
|
|
13
13
|
const general_1 = require("@tomei/general");
|
|
14
|
-
const aggrement_status_enum_1 = require("../../enum/aggrement-status.enum");
|
|
15
14
|
const agreement_repository_1 = require("./agreement.repository");
|
|
16
15
|
const config_1 = require("@tomei/config");
|
|
17
16
|
const agreement_signature_repository_1 = require("../agreement-signature/agreement-signature.repository");
|
|
@@ -62,15 +61,15 @@ class Agreement extends general_1.ObjectBase {
|
|
|
62
61
|
if (!agreementNo) {
|
|
63
62
|
throw new general_1.ClassError('AgreementNo', 'AgreementNoErrMsg01', 'AgreementNo is missing');
|
|
64
63
|
}
|
|
65
|
-
const query = `
|
|
66
|
-
SELECT
|
|
67
|
-
hs.*
|
|
68
|
-
FROM
|
|
69
|
-
rental_AgreementSignature hs
|
|
70
|
-
WHERE
|
|
71
|
-
hs.AgreementNo = '${agreementNo}'
|
|
72
|
-
ORDER BY
|
|
73
|
-
hs.CreatedAt ASC
|
|
64
|
+
const query = `
|
|
65
|
+
SELECT
|
|
66
|
+
hs.*
|
|
67
|
+
FROM
|
|
68
|
+
rental_AgreementSignature hs
|
|
69
|
+
WHERE
|
|
70
|
+
hs.AgreementNo = '${agreementNo}'
|
|
71
|
+
ORDER BY
|
|
72
|
+
hs.CreatedAt ASC
|
|
74
73
|
`;
|
|
75
74
|
const db = rentalDb.getConnection();
|
|
76
75
|
const signatures = yield db.query(query, {
|
|
@@ -104,9 +103,6 @@ class Agreement extends general_1.ObjectBase {
|
|
|
104
103
|
}
|
|
105
104
|
});
|
|
106
105
|
}
|
|
107
|
-
expire() {
|
|
108
|
-
this.Status = aggrement_status_enum_1.AggrementStatusEnum.EXPIRED;
|
|
109
|
-
}
|
|
110
106
|
createActivity(activityCompleted, MediaId, dbTransaction, loginUser) {
|
|
111
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
112
108
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreement.js","sourceRoot":"","sources":["../../../../src/components/agreement/agreement.ts"],"names":[],"mappings":";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AAS,CAAC,EAAE,CAAC,CAAC;gBACvD,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBACpE,MAAM,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBAEhE,OAAO,QAAQ,CAAC;YAClB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;;AA3KH,8BA4KC;AAnKgB,eAAK,GAAG,IAAI,0CAAmB,EAAE,AAA5B,CAA6B;AAChC,iCAAuB,GAAG,IAAI,6DAA4B,EAAE,AAArC,CAAsC;AAC7D,+BAAqB,GAAG,IAAI,yDAA0B,EAAE,AAAnC,CAAoC"}
|
|
@@ -69,6 +69,5 @@ export declare class Rental extends ObjectBase {
|
|
|
69
69
|
getInvoices(loginUser: LoginUser, dbTransaction: any, accountingSystem?: IAccountSystem): Promise<Document[]>;
|
|
70
70
|
getItem(dbTransaction: any): Promise<any>;
|
|
71
71
|
cancel(loginUser: LoginUser, dbTransaction: any, remarks: string): Promise<Rental>;
|
|
72
|
-
terminate(remarks: string): Rental;
|
|
73
72
|
update(loginUser: LoginUser, dbTransaction: any, updates: Partial<IRentalAttr>): Promise<Rental>;
|
|
74
73
|
}
|
|
@@ -451,21 +451,21 @@ class Rental extends general_1.ObjectBase {
|
|
|
451
451
|
if (!isPrivileged) {
|
|
452
452
|
throw new general_1.ClassError('Rental', 'RentalErrMsg01', "You do not have 'Rental - View' privilege.");
|
|
453
453
|
}
|
|
454
|
-
const query = `
|
|
455
|
-
SELECT
|
|
456
|
-
r.*
|
|
457
|
-
FROM
|
|
458
|
-
rental_Rental r
|
|
459
|
-
LEFT JOIN
|
|
460
|
-
rental_JointHirer jh ON r.RentalId = jh.RentalId
|
|
461
|
-
WHERE
|
|
462
|
-
r.Status = 'Active'
|
|
463
|
-
AND (
|
|
464
|
-
r.CustomerId = '${CustomerId}'
|
|
465
|
-
OR jh.CustomerId = '${CustomerId}'
|
|
466
|
-
)
|
|
467
|
-
GROUP BY
|
|
468
|
-
r.RentalId
|
|
454
|
+
const query = `
|
|
455
|
+
SELECT
|
|
456
|
+
r.*
|
|
457
|
+
FROM
|
|
458
|
+
rental_Rental r
|
|
459
|
+
LEFT JOIN
|
|
460
|
+
rental_JointHirer jh ON r.RentalId = jh.RentalId
|
|
461
|
+
WHERE
|
|
462
|
+
r.Status = 'Active'
|
|
463
|
+
AND (
|
|
464
|
+
r.CustomerId = '${CustomerId}'
|
|
465
|
+
OR jh.CustomerId = '${CustomerId}'
|
|
466
|
+
)
|
|
467
|
+
GROUP BY
|
|
468
|
+
r.RentalId
|
|
469
469
|
`;
|
|
470
470
|
const db = rentalDb.getConnection();
|
|
471
471
|
const result = yield db.query(query, {
|
|
@@ -877,20 +877,6 @@ class Rental extends general_1.ObjectBase {
|
|
|
877
877
|
}
|
|
878
878
|
});
|
|
879
879
|
}
|
|
880
|
-
terminate(remarks) {
|
|
881
|
-
if (!this.ObjectId) {
|
|
882
|
-
throw new general_1.ClassError('Rental', 'RentalErrMsg01', 'Rental not found. Rental Id is empty.');
|
|
883
|
-
}
|
|
884
|
-
if (this.Status === rental_status_enum_1.RentalStatusEnum.TERMINATED) {
|
|
885
|
-
throw new general_1.ClassError('Rental', 'RentalErrMsg01', 'Rental is already terminated.');
|
|
886
|
-
}
|
|
887
|
-
if (!remarks) {
|
|
888
|
-
throw new general_1.ClassError('Rental', 'RentalErrMsg01', 'Termination remarks is required.');
|
|
889
|
-
}
|
|
890
|
-
this._Status = rental_status_enum_1.RentalStatusEnum.TERMINATED;
|
|
891
|
-
this.TerminateRemarks = remarks;
|
|
892
|
-
return this;
|
|
893
|
-
}
|
|
894
880
|
update(loginUser, dbTransaction, updates) {
|
|
895
881
|
return __awaiter(this, void 0, void 0, function* () {
|
|
896
882
|
try {
|