Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c0289b1da | |||
| 67800c20ce | |||
| 9a97e9b0c7 | |||
| 970a1fe034 | |||
| 589814ee8f | |||
| 5278509401 | |||
| 2d72cd688f | |||
| 8e5e20320d | |||
| f5a803d86f | |||
| 67e34bb753 | |||
| fa1a029298 | |||
| fedb3b95da |
@@ -0,0 +1,25 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.git
|
||||||
|
.github
|
||||||
|
.husky
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
coverage
|
||||||
|
*.log
|
||||||
|
dump
|
||||||
|
html
|
||||||
|
none
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
.DS_Store
|
||||||
|
*.md
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
docker-compose*.yml
|
||||||
|
*.test.ts
|
||||||
|
jest.config.js
|
||||||
|
.eslintrc*
|
||||||
|
.prettierrc*
|
||||||
|
commitlint.config.*
|
||||||
|
qodana.yaml
|
||||||
+3
-3
@@ -27,9 +27,9 @@ SMTP_PASSWORD=
|
|||||||
JWT_SECRET=
|
JWT_SECRET=
|
||||||
JWT_EXPIRE_ACCESS=2 #minutes
|
JWT_EXPIRE_ACCESS=2 #minutes
|
||||||
JWT_EXPIRE_REFRESH=2 #days
|
JWT_EXPIRE_REFRESH=2 #days
|
||||||
#S3_BUCKET
|
#S3_BUCKET (Parspack)
|
||||||
BUCKET_NAME=
|
BUCKET_NAME=c183597
|
||||||
BUCKET_URL=
|
BUCKET_URL=https://c183597.parspack.net
|
||||||
BUCKET_ACCESS_KEY=
|
BUCKET_ACCESS_KEY=
|
||||||
BUCKET_SECRET_KEY=
|
BUCKET_SECRET_KEY=
|
||||||
#DEFAULT_ADMIN
|
#DEFAULT_ADMIN
|
||||||
|
|||||||
+34
-27
@@ -1,41 +1,48 @@
|
|||||||
# Stage 1: Build Stage
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM node:22-alpine AS base
|
FROM node:22-alpine AS base
|
||||||
|
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.arvancloud.ir/alpine|g' /etc/apk/repositories \
|
||||||
RUN npm install -g corepack@latest
|
&& npm config set registry https://package-mirror.liara.ir/repository/npm/
|
||||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/
|
||||||
|
RUN npm install -g corepack@latest \
|
||||||
# Install tzdata to support timezone settings
|
&& corepack enable \
|
||||||
RUN apk add --no-cache tzdata
|
&& corepack prepare pnpm@9.13.0 --activate
|
||||||
|
|
||||||
# Set the timezone to Asia/Tehran
|
|
||||||
RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone
|
|
||||||
|
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
WORKDIR /temp-deps
|
WORKDIR /app
|
||||||
COPY package*.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
RUN pnpm install --frozen-lockfile --loglevel info
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
|
pnpm config set store-dir /pnpm/store \
|
||||||
|
&& pnpm install --frozen-lockfile
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
WORKDIR /build
|
WORKDIR /app
|
||||||
COPY . ./
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=deps /temp-deps/node_modules ./node_modules
|
COPY package.json pnpm-lock.yaml tsconfig.json tsconfig.build.json ./
|
||||||
RUN if [ -f package.json ] && grep -q '"build":' package.json; then pnpm run build; fi
|
COPY src ./src
|
||||||
RUN pnpm install --prod --frozen-lockfile --loglevel info
|
RUN pnpm run build && pnpm prune --prod
|
||||||
|
|
||||||
|
FROM node:22-alpine AS runner
|
||||||
|
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.arvancloud.ir/alpine|g' /etc/apk/repositories \
|
||||||
|
&& npm config set registry https://package-mirror.liara.ir/repository/npm/ \
|
||||||
|
&& apk add --no-cache tzdata \
|
||||||
|
&& cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime \
|
||||||
|
&& echo "Asia/Tehran" > /etc/timezone \
|
||||||
|
&& addgroup -S appgroup \
|
||||||
|
&& adduser -S appuser -G appgroup
|
||||||
|
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/
|
||||||
|
|
||||||
FROM base AS runner
|
|
||||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . ./
|
ENV NODE_ENV=production \
|
||||||
COPY --from=builder --chown=appuser:appgroup /build/ ./
|
TZ=Asia/Tehran
|
||||||
|
|
||||||
RUN chown -R appuser:appgroup /app
|
COPY --from=builder --chown=appuser:appgroup /app/node_modules ./node_modules
|
||||||
|
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
|
||||||
|
COPY --chown=appuser:appgroup package.json ./
|
||||||
|
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|
||||||
CMD ["npm", "start"]
|
CMD ["node", "--trace-warnings", "dist/server.js"]
|
||||||
|
|||||||
+2
-2
@@ -34,7 +34,7 @@
|
|||||||
"@nestjs/mapped-types": "^2.0.6",
|
"@nestjs/mapped-types": "^2.0.6",
|
||||||
"ansi-colors": "^4.1.3",
|
"ansi-colors": "^4.1.3",
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.7",
|
||||||
"bcrypt": "^5.1.1",
|
"bcryptjs": "^2.4.3",
|
||||||
"bullmq": "^5.25.6",
|
"bullmq": "^5.25.6",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.14.1",
|
"class-validator": "^0.14.1",
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^19.5.0",
|
"@commitlint/cli": "^19.5.0",
|
||||||
"@commitlint/config-conventional": "^19.5.0",
|
"@commitlint/config-conventional": "^19.5.0",
|
||||||
"@types/bcrypt": "^5.0.2",
|
"@types/bcryptjs": "^2.4.6",
|
||||||
"@types/compression": "^1.7.5",
|
"@types/compression": "^1.7.5",
|
||||||
"@types/cookie-parser": "^1.4.10",
|
"@types/cookie-parser": "^1.4.10",
|
||||||
"@types/cors": "^2.8.17",
|
"@types/cors": "^2.8.17",
|
||||||
|
|||||||
Generated
+14
-227
@@ -23,9 +23,9 @@ importers:
|
|||||||
axios:
|
axios:
|
||||||
specifier: ^1.7.7
|
specifier: ^1.7.7
|
||||||
version: 1.7.7
|
version: 1.7.7
|
||||||
bcrypt:
|
bcryptjs:
|
||||||
specifier: ^5.1.1
|
specifier: ^2.4.3
|
||||||
version: 5.1.1
|
version: 2.4.3
|
||||||
bullmq:
|
bullmq:
|
||||||
specifier: ^5.25.6
|
specifier: ^5.25.6
|
||||||
version: 5.25.6
|
version: 5.25.6
|
||||||
@@ -138,9 +138,9 @@ importers:
|
|||||||
'@commitlint/config-conventional':
|
'@commitlint/config-conventional':
|
||||||
specifier: ^19.5.0
|
specifier: ^19.5.0
|
||||||
version: 19.5.0
|
version: 19.5.0
|
||||||
'@types/bcrypt':
|
'@types/bcryptjs':
|
||||||
specifier: ^5.0.2
|
specifier: ^2.4.6
|
||||||
version: 5.0.2
|
version: 2.4.6
|
||||||
'@types/compression':
|
'@types/compression':
|
||||||
specifier: ^1.7.5
|
specifier: ^1.7.5
|
||||||
version: 1.7.5
|
version: 1.7.5
|
||||||
@@ -708,10 +708,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==}
|
resolution: {integrity: sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
'@mapbox/node-pre-gyp@1.0.11':
|
|
||||||
resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==}
|
|
||||||
hasBin: true
|
|
||||||
|
|
||||||
'@mongodb-js/saslprep@1.1.9':
|
'@mongodb-js/saslprep@1.1.9':
|
||||||
resolution: {integrity: sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==}
|
resolution: {integrity: sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==}
|
||||||
|
|
||||||
@@ -1011,8 +1007,8 @@ packages:
|
|||||||
'@tsconfig/node16@1.0.4':
|
'@tsconfig/node16@1.0.4':
|
||||||
resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
|
resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
|
||||||
|
|
||||||
'@types/bcrypt@5.0.2':
|
'@types/bcryptjs@2.4.6':
|
||||||
resolution: {integrity: sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==}
|
resolution: {integrity: sha512-9xlo6R2qDs5uixm0bcIqCeMCE6HiQsIyel9KQySStiyqNl2tnj2mP3DX1Nf56MD6KMenNNlBBsy3LJ7gUEQPXQ==}
|
||||||
|
|
||||||
'@types/body-parser@1.19.5':
|
'@types/body-parser@1.19.5':
|
||||||
resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==}
|
resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==}
|
||||||
@@ -1182,9 +1178,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==}
|
resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
abbrev@1.1.1:
|
|
||||||
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
|
|
||||||
|
|
||||||
abort-controller@3.0.0:
|
abort-controller@3.0.0:
|
||||||
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
|
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
|
||||||
engines: {node: '>=6.5'}
|
engines: {node: '>=6.5'}
|
||||||
@@ -1207,10 +1200,6 @@ packages:
|
|||||||
engines: {node: '>=0.4.0'}
|
engines: {node: '>=0.4.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
agent-base@6.0.2:
|
|
||||||
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
|
|
||||||
engines: {node: '>= 6.0.0'}
|
|
||||||
|
|
||||||
agentkeepalive@4.6.0:
|
agentkeepalive@4.6.0:
|
||||||
resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==}
|
resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==}
|
||||||
engines: {node: '>= 8.0.0'}
|
engines: {node: '>= 8.0.0'}
|
||||||
@@ -1256,14 +1245,6 @@ packages:
|
|||||||
append-field@1.0.0:
|
append-field@1.0.0:
|
||||||
resolution: {integrity: sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==}
|
resolution: {integrity: sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==}
|
||||||
|
|
||||||
aproba@2.0.0:
|
|
||||||
resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==}
|
|
||||||
|
|
||||||
are-we-there-yet@2.0.0:
|
|
||||||
resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==}
|
|
||||||
engines: {node: '>=10'}
|
|
||||||
deprecated: This package is no longer supported.
|
|
||||||
|
|
||||||
arg@4.1.3:
|
arg@4.1.3:
|
||||||
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
|
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
|
||||||
|
|
||||||
@@ -1327,9 +1308,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==}
|
resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==}
|
||||||
engines: {node: '>= 0.8'}
|
engines: {node: '>= 0.8'}
|
||||||
|
|
||||||
bcrypt@5.1.1:
|
bcryptjs@2.4.3:
|
||||||
resolution: {integrity: sha512-AGBHOG5hPYZ5Xl9KXzU5iKq9516yEmvCKDg3ecP5kX2aB6UqTeXZxk2ELnDgDm6BQSMlLt9rDB4LoSMx0rYwww==}
|
resolution: {integrity: sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==}
|
||||||
engines: {node: '>= 10.0.0'}
|
|
||||||
|
|
||||||
binary-extensions@2.3.0:
|
binary-extensions@2.3.0:
|
||||||
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
|
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
|
||||||
@@ -1413,10 +1393,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
|
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
|
||||||
engines: {node: '>= 8.10.0'}
|
engines: {node: '>= 8.10.0'}
|
||||||
|
|
||||||
chownr@2.0.0:
|
|
||||||
resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
|
|
||||||
engines: {node: '>=10'}
|
|
||||||
|
|
||||||
class-transformer@0.5.1:
|
class-transformer@0.5.1:
|
||||||
resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==}
|
resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==}
|
||||||
|
|
||||||
@@ -1475,10 +1451,6 @@ packages:
|
|||||||
color-string@1.9.1:
|
color-string@1.9.1:
|
||||||
resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==}
|
resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==}
|
||||||
|
|
||||||
color-support@1.1.3:
|
|
||||||
resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==}
|
|
||||||
hasBin: true
|
|
||||||
|
|
||||||
color@3.2.1:
|
color@3.2.1:
|
||||||
resolution: {integrity: sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==}
|
resolution: {integrity: sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==}
|
||||||
|
|
||||||
@@ -1518,9 +1490,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==}
|
resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==}
|
||||||
engines: {'0': node >= 0.8}
|
engines: {'0': node >= 0.8}
|
||||||
|
|
||||||
console-control-strings@1.1.0:
|
|
||||||
resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==}
|
|
||||||
|
|
||||||
content-disposition@0.5.4:
|
content-disposition@0.5.4:
|
||||||
resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
|
resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
|
||||||
engines: {node: '>= 0.6'}
|
engines: {node: '>= 0.6'}
|
||||||
@@ -1667,9 +1636,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
||||||
engines: {node: '>=0.4.0'}
|
engines: {node: '>=0.4.0'}
|
||||||
|
|
||||||
delegates@1.0.0:
|
|
||||||
resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==}
|
|
||||||
|
|
||||||
denque@2.1.0:
|
denque@2.1.0:
|
||||||
resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==}
|
resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==}
|
||||||
engines: {node: '>=0.10'}
|
engines: {node: '>=0.10'}
|
||||||
@@ -2047,10 +2013,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
|
resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
|
||||||
engines: {node: '>= 0.6'}
|
engines: {node: '>= 0.6'}
|
||||||
|
|
||||||
fs-minipass@2.1.0:
|
|
||||||
resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
|
|
||||||
engines: {node: '>= 8'}
|
|
||||||
|
|
||||||
fs.realpath@1.0.0:
|
fs.realpath@1.0.0:
|
||||||
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
|
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
|
||||||
|
|
||||||
@@ -2069,11 +2031,6 @@ packages:
|
|||||||
functions-have-names@1.2.3:
|
functions-have-names@1.2.3:
|
||||||
resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
|
resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
|
||||||
|
|
||||||
gauge@3.0.2:
|
|
||||||
resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==}
|
|
||||||
engines: {node: '>=10'}
|
|
||||||
deprecated: This package is no longer supported.
|
|
||||||
|
|
||||||
get-caller-file@2.0.5:
|
get-caller-file@2.0.5:
|
||||||
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
||||||
engines: {node: 6.* || 8.* || >= 10.*}
|
engines: {node: 6.* || 8.* || >= 10.*}
|
||||||
@@ -2184,9 +2141,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
|
resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
has-unicode@2.0.1:
|
|
||||||
resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==}
|
|
||||||
|
|
||||||
hasown@2.0.2:
|
hasown@2.0.2:
|
||||||
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
|
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@@ -2201,10 +2155,6 @@ packages:
|
|||||||
http-status-codes@2.3.0:
|
http-status-codes@2.3.0:
|
||||||
resolution: {integrity: sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==}
|
resolution: {integrity: sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==}
|
||||||
|
|
||||||
https-proxy-agent@5.0.1:
|
|
||||||
resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
|
|
||||||
engines: {node: '>= 6'}
|
|
||||||
|
|
||||||
human-signals@5.0.0:
|
human-signals@5.0.0:
|
||||||
resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
|
resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
|
||||||
engines: {node: '>=16.17.0'}
|
engines: {node: '>=16.17.0'}
|
||||||
@@ -2586,10 +2536,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==}
|
resolution: {integrity: sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
|
|
||||||
make-dir@3.1.0:
|
|
||||||
resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
|
|
||||||
engines: {node: '>=8'}
|
|
||||||
|
|
||||||
make-error@1.3.6:
|
make-error@1.3.6:
|
||||||
resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
|
resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
|
||||||
|
|
||||||
@@ -2669,31 +2615,14 @@ packages:
|
|||||||
minimist@1.2.8:
|
minimist@1.2.8:
|
||||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||||
|
|
||||||
minipass@3.3.6:
|
|
||||||
resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==}
|
|
||||||
engines: {node: '>=8'}
|
|
||||||
|
|
||||||
minipass@5.0.0:
|
|
||||||
resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==}
|
|
||||||
engines: {node: '>=8'}
|
|
||||||
|
|
||||||
minipass@7.1.2:
|
minipass@7.1.2:
|
||||||
resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
|
resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
|
||||||
engines: {node: '>=16 || 14 >=14.17'}
|
engines: {node: '>=16 || 14 >=14.17'}
|
||||||
|
|
||||||
minizlib@2.1.2:
|
|
||||||
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
|
|
||||||
engines: {node: '>= 8'}
|
|
||||||
|
|
||||||
mkdirp@0.5.6:
|
mkdirp@0.5.6:
|
||||||
resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
|
resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
mkdirp@1.0.4:
|
|
||||||
resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
|
|
||||||
engines: {node: '>=10'}
|
|
||||||
hasBin: true
|
|
||||||
|
|
||||||
moment@2.30.1:
|
moment@2.30.1:
|
||||||
resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}
|
resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}
|
||||||
|
|
||||||
@@ -2806,9 +2735,6 @@ packages:
|
|||||||
node-abort-controller@3.1.1:
|
node-abort-controller@3.1.1:
|
||||||
resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==}
|
resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==}
|
||||||
|
|
||||||
node-addon-api@5.1.0:
|
|
||||||
resolution: {integrity: sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==}
|
|
||||||
|
|
||||||
node-cache@5.1.2:
|
node-cache@5.1.2:
|
||||||
resolution: {integrity: sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==}
|
resolution: {integrity: sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==}
|
||||||
engines: {node: '>= 8.0.0'}
|
engines: {node: '>= 8.0.0'}
|
||||||
@@ -2840,11 +2766,6 @@ packages:
|
|||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
nopt@5.0.0:
|
|
||||||
resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==}
|
|
||||||
engines: {node: '>=6'}
|
|
||||||
hasBin: true
|
|
||||||
|
|
||||||
normalize-path@3.0.0:
|
normalize-path@3.0.0:
|
||||||
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
|
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
@@ -2853,10 +2774,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==}
|
resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==}
|
||||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||||
|
|
||||||
npmlog@5.0.1:
|
|
||||||
resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==}
|
|
||||||
deprecated: This package is no longer supported.
|
|
||||||
|
|
||||||
object-assign@4.1.1:
|
object-assign@4.1.1:
|
||||||
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
|
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
@@ -3197,9 +3114,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==}
|
resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==}
|
||||||
engines: {node: '>= 0.8.0'}
|
engines: {node: '>= 0.8.0'}
|
||||||
|
|
||||||
set-blocking@2.0.0:
|
|
||||||
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
|
|
||||||
|
|
||||||
set-function-length@1.2.2:
|
set-function-length@1.2.2:
|
||||||
resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
|
resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@@ -3389,10 +3303,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==}
|
resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==}
|
||||||
engines: {node: ^14.18.0 || >=16.0.0}
|
engines: {node: ^14.18.0 || >=16.0.0}
|
||||||
|
|
||||||
tar@6.2.1:
|
|
||||||
resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}
|
|
||||||
engines: {node: '>=10'}
|
|
||||||
|
|
||||||
text-extensions@2.4.0:
|
text-extensions@2.4.0:
|
||||||
resolution: {integrity: sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==}
|
resolution: {integrity: sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
@@ -3609,9 +3519,6 @@ packages:
|
|||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
wide-align@1.1.5:
|
|
||||||
resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==}
|
|
||||||
|
|
||||||
winston-transport@4.9.0:
|
winston-transport@4.9.0:
|
||||||
resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==}
|
resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==}
|
||||||
engines: {node: '>= 12.0.0'}
|
engines: {node: '>= 12.0.0'}
|
||||||
@@ -3666,9 +3573,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
|
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
yallist@4.0.0:
|
|
||||||
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
|
|
||||||
|
|
||||||
yaml@2.5.1:
|
yaml@2.5.1:
|
||||||
resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==}
|
resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==}
|
||||||
engines: {node: '>= 14'}
|
engines: {node: '>= 14'}
|
||||||
@@ -4573,21 +4477,6 @@ snapshots:
|
|||||||
|
|
||||||
'@lukeed/csprng@1.1.0': {}
|
'@lukeed/csprng@1.1.0': {}
|
||||||
|
|
||||||
'@mapbox/node-pre-gyp@1.0.11':
|
|
||||||
dependencies:
|
|
||||||
detect-libc: 2.0.3
|
|
||||||
https-proxy-agent: 5.0.1
|
|
||||||
make-dir: 3.1.0
|
|
||||||
node-fetch: 2.7.0
|
|
||||||
nopt: 5.0.0
|
|
||||||
npmlog: 5.0.1
|
|
||||||
rimraf: 3.0.2
|
|
||||||
semver: 7.6.3
|
|
||||||
tar: 6.2.1
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- encoding
|
|
||||||
- supports-color
|
|
||||||
|
|
||||||
'@mongodb-js/saslprep@1.1.9':
|
'@mongodb-js/saslprep@1.1.9':
|
||||||
dependencies:
|
dependencies:
|
||||||
sparse-bitfield: 3.0.3
|
sparse-bitfield: 3.0.3
|
||||||
@@ -4988,9 +4877,7 @@ snapshots:
|
|||||||
|
|
||||||
'@tsconfig/node16@1.0.4': {}
|
'@tsconfig/node16@1.0.4': {}
|
||||||
|
|
||||||
'@types/bcrypt@5.0.2':
|
'@types/bcryptjs@2.4.6': {}
|
||||||
dependencies:
|
|
||||||
'@types/node': 20.17.6
|
|
||||||
|
|
||||||
'@types/body-parser@1.19.5':
|
'@types/body-parser@1.19.5':
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -5222,8 +5109,6 @@ snapshots:
|
|||||||
jsonparse: 1.3.1
|
jsonparse: 1.3.1
|
||||||
through: 2.3.8
|
through: 2.3.8
|
||||||
|
|
||||||
abbrev@1.1.1: {}
|
|
||||||
|
|
||||||
abort-controller@3.0.0:
|
abort-controller@3.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
event-target-shim: 5.0.1
|
event-target-shim: 5.0.1
|
||||||
@@ -5243,12 +5128,6 @@ snapshots:
|
|||||||
|
|
||||||
acorn@8.14.0: {}
|
acorn@8.14.0: {}
|
||||||
|
|
||||||
agent-base@6.0.2:
|
|
||||||
dependencies:
|
|
||||||
debug: 4.3.7(supports-color@5.5.0)
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
|
|
||||||
agentkeepalive@4.6.0:
|
agentkeepalive@4.6.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
humanize-ms: 1.2.1
|
humanize-ms: 1.2.1
|
||||||
@@ -5294,13 +5173,6 @@ snapshots:
|
|||||||
|
|
||||||
append-field@1.0.0: {}
|
append-field@1.0.0: {}
|
||||||
|
|
||||||
aproba@2.0.0: {}
|
|
||||||
|
|
||||||
are-we-there-yet@2.0.0:
|
|
||||||
dependencies:
|
|
||||||
delegates: 1.0.0
|
|
||||||
readable-stream: 3.6.2
|
|
||||||
|
|
||||||
arg@4.1.3: {}
|
arg@4.1.3: {}
|
||||||
|
|
||||||
argparse@2.0.1: {}
|
argparse@2.0.1: {}
|
||||||
@@ -5383,13 +5255,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer: 5.1.2
|
safe-buffer: 5.1.2
|
||||||
|
|
||||||
bcrypt@5.1.1:
|
bcryptjs@2.4.3: {}
|
||||||
dependencies:
|
|
||||||
'@mapbox/node-pre-gyp': 1.0.11
|
|
||||||
node-addon-api: 5.1.0
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- encoding
|
|
||||||
- supports-color
|
|
||||||
|
|
||||||
binary-extensions@2.3.0: {}
|
binary-extensions@2.3.0: {}
|
||||||
|
|
||||||
@@ -5505,8 +5371,6 @@ snapshots:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
chownr@2.0.0: {}
|
|
||||||
|
|
||||||
class-transformer@0.5.1: {}
|
class-transformer@0.5.1: {}
|
||||||
|
|
||||||
class-validator@0.14.1:
|
class-validator@0.14.1:
|
||||||
@@ -5561,8 +5425,6 @@ snapshots:
|
|||||||
color-name: 1.1.4
|
color-name: 1.1.4
|
||||||
simple-swizzle: 0.2.2
|
simple-swizzle: 0.2.2
|
||||||
|
|
||||||
color-support@1.1.3: {}
|
|
||||||
|
|
||||||
color@3.2.1:
|
color@3.2.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
color-convert: 1.9.3
|
color-convert: 1.9.3
|
||||||
@@ -5613,8 +5475,6 @@ snapshots:
|
|||||||
readable-stream: 2.3.8
|
readable-stream: 2.3.8
|
||||||
typedarray: 0.0.6
|
typedarray: 0.0.6
|
||||||
|
|
||||||
console-control-strings@1.1.0: {}
|
|
||||||
|
|
||||||
content-disposition@0.5.4:
|
content-disposition@0.5.4:
|
||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer: 5.2.1
|
safe-buffer: 5.2.1
|
||||||
@@ -5751,15 +5611,14 @@ snapshots:
|
|||||||
|
|
||||||
delayed-stream@1.0.0: {}
|
delayed-stream@1.0.0: {}
|
||||||
|
|
||||||
delegates@1.0.0: {}
|
|
||||||
|
|
||||||
denque@2.1.0: {}
|
denque@2.1.0: {}
|
||||||
|
|
||||||
depd@2.0.0: {}
|
depd@2.0.0: {}
|
||||||
|
|
||||||
destroy@1.2.0: {}
|
destroy@1.2.0: {}
|
||||||
|
|
||||||
detect-libc@2.0.3: {}
|
detect-libc@2.0.3:
|
||||||
|
optional: true
|
||||||
|
|
||||||
diff@4.0.2: {}
|
diff@4.0.2: {}
|
||||||
|
|
||||||
@@ -6262,10 +6121,6 @@ snapshots:
|
|||||||
|
|
||||||
fresh@0.5.2: {}
|
fresh@0.5.2: {}
|
||||||
|
|
||||||
fs-minipass@2.1.0:
|
|
||||||
dependencies:
|
|
||||||
minipass: 3.3.6
|
|
||||||
|
|
||||||
fs.realpath@1.0.0: {}
|
fs.realpath@1.0.0: {}
|
||||||
|
|
||||||
fsevents@2.3.3:
|
fsevents@2.3.3:
|
||||||
@@ -6282,18 +6137,6 @@ snapshots:
|
|||||||
|
|
||||||
functions-have-names@1.2.3: {}
|
functions-have-names@1.2.3: {}
|
||||||
|
|
||||||
gauge@3.0.2:
|
|
||||||
dependencies:
|
|
||||||
aproba: 2.0.0
|
|
||||||
color-support: 1.1.3
|
|
||||||
console-control-strings: 1.1.0
|
|
||||||
has-unicode: 2.0.1
|
|
||||||
object-assign: 4.1.1
|
|
||||||
signal-exit: 3.0.7
|
|
||||||
string-width: 4.2.3
|
|
||||||
strip-ansi: 6.0.1
|
|
||||||
wide-align: 1.1.5
|
|
||||||
|
|
||||||
get-caller-file@2.0.5: {}
|
get-caller-file@2.0.5: {}
|
||||||
|
|
||||||
get-east-asian-width@1.3.0: {}
|
get-east-asian-width@1.3.0: {}
|
||||||
@@ -6418,8 +6261,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
has-symbols: 1.0.3
|
has-symbols: 1.0.3
|
||||||
|
|
||||||
has-unicode@2.0.1: {}
|
|
||||||
|
|
||||||
hasown@2.0.2:
|
hasown@2.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
function-bind: 1.1.2
|
function-bind: 1.1.2
|
||||||
@@ -6436,13 +6277,6 @@ snapshots:
|
|||||||
|
|
||||||
http-status-codes@2.3.0: {}
|
http-status-codes@2.3.0: {}
|
||||||
|
|
||||||
https-proxy-agent@5.0.1:
|
|
||||||
dependencies:
|
|
||||||
agent-base: 6.0.2
|
|
||||||
debug: 4.3.7(supports-color@5.5.0)
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
|
|
||||||
human-signals@5.0.0: {}
|
human-signals@5.0.0: {}
|
||||||
|
|
||||||
humanize-ms@1.2.1:
|
humanize-ms@1.2.1:
|
||||||
@@ -6822,10 +6656,6 @@ snapshots:
|
|||||||
|
|
||||||
luxon@3.5.0: {}
|
luxon@3.5.0: {}
|
||||||
|
|
||||||
make-dir@3.1.0:
|
|
||||||
dependencies:
|
|
||||||
semver: 6.3.1
|
|
||||||
|
|
||||||
make-error@1.3.6: {}
|
make-error@1.3.6: {}
|
||||||
|
|
||||||
math-intrinsics@1.1.0: {}
|
math-intrinsics@1.1.0: {}
|
||||||
@@ -6879,25 +6709,12 @@ snapshots:
|
|||||||
|
|
||||||
minimist@1.2.8: {}
|
minimist@1.2.8: {}
|
||||||
|
|
||||||
minipass@3.3.6:
|
|
||||||
dependencies:
|
|
||||||
yallist: 4.0.0
|
|
||||||
|
|
||||||
minipass@5.0.0: {}
|
|
||||||
|
|
||||||
minipass@7.1.2: {}
|
minipass@7.1.2: {}
|
||||||
|
|
||||||
minizlib@2.1.2:
|
|
||||||
dependencies:
|
|
||||||
minipass: 3.3.6
|
|
||||||
yallist: 4.0.0
|
|
||||||
|
|
||||||
mkdirp@0.5.6:
|
mkdirp@0.5.6:
|
||||||
dependencies:
|
dependencies:
|
||||||
minimist: 1.2.8
|
minimist: 1.2.8
|
||||||
|
|
||||||
mkdirp@1.0.4: {}
|
|
||||||
|
|
||||||
moment@2.30.1: {}
|
moment@2.30.1: {}
|
||||||
|
|
||||||
mongodb-connection-string-url@2.6.0:
|
mongodb-connection-string-url@2.6.0:
|
||||||
@@ -7044,8 +6861,6 @@ snapshots:
|
|||||||
|
|
||||||
node-abort-controller@3.1.1: {}
|
node-abort-controller@3.1.1: {}
|
||||||
|
|
||||||
node-addon-api@5.1.0: {}
|
|
||||||
|
|
||||||
node-cache@5.1.2:
|
node-cache@5.1.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
clone: 2.1.2
|
clone: 2.1.2
|
||||||
@@ -7076,23 +6891,12 @@ snapshots:
|
|||||||
touch: 3.1.1
|
touch: 3.1.1
|
||||||
undefsafe: 2.0.5
|
undefsafe: 2.0.5
|
||||||
|
|
||||||
nopt@5.0.0:
|
|
||||||
dependencies:
|
|
||||||
abbrev: 1.1.1
|
|
||||||
|
|
||||||
normalize-path@3.0.0: {}
|
normalize-path@3.0.0: {}
|
||||||
|
|
||||||
npm-run-path@5.3.0:
|
npm-run-path@5.3.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
path-key: 4.0.0
|
path-key: 4.0.0
|
||||||
|
|
||||||
npmlog@5.0.1:
|
|
||||||
dependencies:
|
|
||||||
are-we-there-yet: 2.0.0
|
|
||||||
console-control-strings: 1.1.0
|
|
||||||
gauge: 3.0.2
|
|
||||||
set-blocking: 2.0.0
|
|
||||||
|
|
||||||
object-assign@4.1.1: {}
|
object-assign@4.1.1: {}
|
||||||
|
|
||||||
object-inspect@1.13.3: {}
|
object-inspect@1.13.3: {}
|
||||||
@@ -7437,8 +7241,6 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
set-blocking@2.0.0: {}
|
|
||||||
|
|
||||||
set-function-length@1.2.2:
|
set-function-length@1.2.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
define-data-property: 1.1.4
|
define-data-property: 1.1.4
|
||||||
@@ -7647,15 +7449,6 @@ snapshots:
|
|||||||
'@pkgr/core': 0.1.1
|
'@pkgr/core': 0.1.1
|
||||||
tslib: 2.8.1
|
tslib: 2.8.1
|
||||||
|
|
||||||
tar@6.2.1:
|
|
||||||
dependencies:
|
|
||||||
chownr: 2.0.0
|
|
||||||
fs-minipass: 2.1.0
|
|
||||||
minipass: 5.0.0
|
|
||||||
minizlib: 2.1.2
|
|
||||||
mkdirp: 1.0.4
|
|
||||||
yallist: 4.0.0
|
|
||||||
|
|
||||||
text-extensions@2.4.0: {}
|
text-extensions@2.4.0: {}
|
||||||
|
|
||||||
text-hex@1.0.0: {}
|
text-hex@1.0.0: {}
|
||||||
@@ -7866,10 +7659,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
isexe: 2.0.0
|
isexe: 2.0.0
|
||||||
|
|
||||||
wide-align@1.1.5:
|
|
||||||
dependencies:
|
|
||||||
string-width: 4.2.3
|
|
||||||
|
|
||||||
winston-transport@4.9.0:
|
winston-transport@4.9.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
logform: 2.7.0
|
logform: 2.7.0
|
||||||
@@ -7926,8 +7715,6 @@ snapshots:
|
|||||||
|
|
||||||
y18n@5.0.8: {}
|
y18n@5.0.8: {}
|
||||||
|
|
||||||
yallist@4.0.0: {}
|
|
||||||
|
|
||||||
yaml@2.5.1: {}
|
yaml@2.5.1: {}
|
||||||
|
|
||||||
yargs-parser@21.1.1: {}
|
yargs-parser@21.1.1: {}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { compare, hash } from "bcrypt";
|
import { compare, hash } from "bcryptjs";
|
||||||
import { inject, injectable } from "inversify";
|
import { inject, injectable } from "inversify";
|
||||||
|
|
||||||
import { LoginPassDTO } from "./DTO/loginPassword.dto";
|
import { LoginPassDTO } from "./DTO/loginPassword.dto";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { hash } from "bcrypt";
|
import { hash } from "bcryptjs";
|
||||||
import { CallbackError, Schema, model } from "mongoose";
|
import { CallbackError, Schema, model } from "mongoose";
|
||||||
|
|
||||||
import { IAdmin } from "./Abstraction/IAdmin";
|
import { IAdmin } from "./Abstraction/IAdmin";
|
||||||
|
|||||||
@@ -19,6 +19,40 @@ class CategoryRepository extends BaseRepository<ICategory> {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super(CategoryModel);
|
super(CategoryModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getDescendantCategoryIds(rootCategoryId: string): Promise<string[]> {
|
||||||
|
const docs = await this.model.aggregate<{ _id: Types.ObjectId; descendants: { _id: Types.ObjectId }[] }>([
|
||||||
|
{
|
||||||
|
$match: {
|
||||||
|
_id: new ObjectId(rootCategoryId),
|
||||||
|
deleted: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$graphLookup: {
|
||||||
|
from: "categories",
|
||||||
|
startWith: "$_id",
|
||||||
|
connectFromField: "_id",
|
||||||
|
connectToField: "parent",
|
||||||
|
as: "descendants",
|
||||||
|
restrictSearchWithMatch: { deleted: false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$project: {
|
||||||
|
_id: 1,
|
||||||
|
descendants: { _id: 1 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (!docs[0]) return [];
|
||||||
|
|
||||||
|
const ids = new Set<string>([docs[0]._id.toString()]);
|
||||||
|
for (const child of docs[0].descendants || []) ids.add(child._id.toString());
|
||||||
|
return Array.from(ids);
|
||||||
|
}
|
||||||
|
|
||||||
async findByTitle(title_en: string, id?: string) {
|
async findByTitle(title_en: string, id?: string) {
|
||||||
const query: Record<string, any> = { title_en, deleted: false };
|
const query: Record<string, any> = { title_en, deleted: false };
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ class PriceDetailDTO {
|
|||||||
@Expose()
|
@Expose()
|
||||||
shipping_cost: number;
|
shipping_cost: number;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
shipping_cost_on_delivery: number;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
process_cost: number;
|
process_cost: number;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export interface ICartPayment {
|
|||||||
|
|
||||||
export interface IPriceDetails {
|
export interface IPriceDetails {
|
||||||
shipping_cost: number;
|
shipping_cost: number;
|
||||||
|
shipping_cost_on_delivery: number;
|
||||||
process_cost: number;
|
process_cost: number;
|
||||||
total_retail_price: number;
|
total_retail_price: number;
|
||||||
total_payable_price: number;
|
total_payable_price: number;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { PaymentStatus } from "../../../common/enums/order.enum";
|
|||||||
const PaymentPriceDetails = new Schema<IPriceDetails>(
|
const PaymentPriceDetails = new Schema<IPriceDetails>(
|
||||||
{
|
{
|
||||||
shipping_cost: { type: Number, required: true },
|
shipping_cost: { type: Number, required: true },
|
||||||
|
shipping_cost_on_delivery: { type: Number, default: 0 },
|
||||||
process_cost: { type: Number, required: true },
|
process_cost: { type: Number, required: true },
|
||||||
total_retail_price: { type: Number, required: true },
|
total_retail_price: { type: Number, required: true },
|
||||||
total_discount: { type: Number, default: 0 },
|
total_discount: { type: Number, default: 0 },
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { OrderService } from "../../order/order.service";
|
|||||||
import { PricingRepository } from "../../pricing/pricing.repository";
|
import { PricingRepository } from "../../pricing/pricing.repository";
|
||||||
import { ProductService } from "../../product/providers/product.service";
|
import { ProductService } from "../../product/providers/product.service";
|
||||||
import { ShopRepo } from "../../shop/shop.repository";
|
import { ShopRepo } from "../../shop/shop.repository";
|
||||||
|
import { ShipmentRepository } from "../../shipment/shipment.repository";
|
||||||
import { IUser } from "../../user/models/Abstraction/IUser";
|
import { IUser } from "../../user/models/Abstraction/IUser";
|
||||||
import { WalletService } from "../../wallet/wallet.service";
|
import { WalletService } from "../../wallet/wallet.service";
|
||||||
import { CartCheckoutDTO } from "../DTO/cartCheckout.dto";
|
import { CartCheckoutDTO } from "../DTO/cartCheckout.dto";
|
||||||
@@ -46,6 +47,7 @@ class PaymentService {
|
|||||||
@inject(IOCTYPES.WalletService) walletService: WalletService;
|
@inject(IOCTYPES.WalletService) walletService: WalletService;
|
||||||
@inject(IOCTYPES.NotificationService) notificationService: NotificationService;
|
@inject(IOCTYPES.NotificationService) notificationService: NotificationService;
|
||||||
@inject(IOCTYPES.ShopRepo) shopRepo: ShopRepo;
|
@inject(IOCTYPES.ShopRepo) shopRepo: ShopRepo;
|
||||||
|
@inject(IOCTYPES.ShipmentRepository) shipmentRepo: ShipmentRepository;
|
||||||
|
|
||||||
//##################################################################
|
//##################################################################
|
||||||
//##################################################################
|
//##################################################################
|
||||||
@@ -98,7 +100,7 @@ class PaymentService {
|
|||||||
|
|
||||||
if (!paymentMethods) throw new BadRequestError(PaymentMessage.PaymentMethodsNotFound);
|
if (!paymentMethods) throw new BadRequestError(PaymentMessage.PaymentMethodsNotFound);
|
||||||
|
|
||||||
const { price } = this.calculateTotalPrice(cart, cartShipmentItems);
|
const { price } = await this.calculateTotalPrice(cart, cartShipmentItems);
|
||||||
return {
|
return {
|
||||||
cart,
|
cart,
|
||||||
cartShipmentItems,
|
cartShipmentItems,
|
||||||
@@ -135,7 +137,7 @@ class PaymentService {
|
|||||||
const paymentMethod = await this.paymentMethodRepo.findById(cartCheckoutDto.payment_method_id);
|
const paymentMethod = await this.paymentMethodRepo.findById(cartCheckoutDto.payment_method_id);
|
||||||
if (!paymentMethod) throw new BadRequestError(PaymentMessage.PaymentMethodNotFound);
|
if (!paymentMethod) throw new BadRequestError(PaymentMessage.PaymentMethodNotFound);
|
||||||
|
|
||||||
const { price, description } = this.calculateTotalPrice(cart, cartShipmentItems);
|
const { price, description } = await this.calculateTotalPrice(cart, cartShipmentItems);
|
||||||
|
|
||||||
// extracted to handle payment creation
|
// extracted to handle payment creation
|
||||||
const { payment, paymentData } = await this.handlePaymentCreation(paymentMethod, price, user, description, session);
|
const { payment, paymentData } = await this.handlePaymentCreation(paymentMethod, price, user, description, session);
|
||||||
@@ -238,26 +240,33 @@ class PaymentService {
|
|||||||
//##################################################################
|
//##################################################################
|
||||||
//##################################################################
|
//##################################################################
|
||||||
// Helper method to calculate the total price of cart items
|
// Helper method to calculate the total price of cart items
|
||||||
private calculateTotalPrice(cart: CartDTO, cartShipItem: ICartShipmentItem[]) {
|
private async calculateTotalPrice(cart: CartDTO, cartShipItem: ICartShipmentItem[]) {
|
||||||
const totalShippingCost = cartShipItem.reduce(
|
const totalShippingCost = cartShipItem.reduce(
|
||||||
(sum, item) => sum + item.shipmentItems.reduce((subSum, shipmentItem) => subSum + shipmentItem.shipmentCost, 0),
|
(sum, item) => sum + item.shipmentItems.reduce((subSum, shipmentItem) => subSum + shipmentItem.shipmentCost, 0),
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
|
|
||||||
// const totalCouponDiscount = cartShipItem.reduce((sum, item) => sum + item.totalCouponDiscount, 0);
|
const shipperIds = [...new Set(cartShipItem.map((item) => item.shipper))];
|
||||||
// const totalShippingCost = cartShipItem.reduce((sum, item) => sum + item.shipmentCost, 0);
|
const shippers = await this.shipmentRepo.model.find({ _id: { $in: shipperIds } }).select("_id payDeliveryFeeOnDelivery").lean();
|
||||||
|
const payOnDeliveryShipperIds = new Set(
|
||||||
|
shippers.filter((shipper) => shipper.payDeliveryFeeOnDelivery).map((shipper) => shipper._id),
|
||||||
|
);
|
||||||
|
|
||||||
|
const onlineShippingCost = cartShipItem.reduce((sum, item) => {
|
||||||
|
const itemShippingCost = item.shipmentItems.reduce((subSum, shipmentItem) => subSum + shipmentItem.shipmentCost, 0);
|
||||||
|
return sum + (payOnDeliveryShipperIds.has(item.shipper) ? 0 : itemShippingCost);
|
||||||
|
}, 0);
|
||||||
|
const shippingCostOnDelivery = totalShippingCost - onlineShippingCost;
|
||||||
|
|
||||||
const price = {
|
const price = {
|
||||||
shipping_cost: totalShippingCost,
|
shipping_cost: onlineShippingCost,
|
||||||
// process_cost: totalShippingCost,
|
shipping_cost_on_delivery: shippingCostOnDelivery,
|
||||||
process_cost: 0,
|
process_cost: 0,
|
||||||
cart_retail_price: cart.retail_price,
|
cart_retail_price: cart.retail_price,
|
||||||
// cart_payable_price: cart.payable_price - cart.coupon_discount,
|
|
||||||
cart_payable_price: cart.payable_price,
|
cart_payable_price: cart.payable_price,
|
||||||
total_discount: cart.total_discount,
|
total_discount: cart.total_discount,
|
||||||
coupon_discount: cart.coupon_discount,
|
coupon_discount: cart.coupon_discount,
|
||||||
// total_payable_price: cart.payable_price + totalShippingCost * 2,
|
total_payable_price: cart.isWholeSale ? cart.retail_price + onlineShippingCost : cart.payable_price + onlineShippingCost,
|
||||||
total_payable_price: cart.isWholeSale ? cart.retail_price + totalShippingCost : cart.payable_price + totalShippingCost,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const items = cart.items;
|
const items = cart.items;
|
||||||
@@ -357,6 +366,7 @@ class PaymentService {
|
|||||||
|
|
||||||
const priceDetails: Partial<IPriceDetails> = {
|
const priceDetails: Partial<IPriceDetails> = {
|
||||||
shipping_cost: price.shipping_cost,
|
shipping_cost: price.shipping_cost,
|
||||||
|
shipping_cost_on_delivery: price.shipping_cost_on_delivery,
|
||||||
process_cost: price.process_cost,
|
process_cost: price.process_cost,
|
||||||
total_retail_price: price.cart_retail_price,
|
total_retail_price: price.cart_retail_price,
|
||||||
total_discount: price.total_discount,
|
total_discount: price.total_discount,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Types } from "mongoose";
|
import { PipelineStage, Types } from "mongoose";
|
||||||
|
|
||||||
import { BaseRepository } from "../../../common/base/repository";
|
import { BaseRepository } from "../../../common/base/repository";
|
||||||
import { ProductMarketStatus, ProductStatus } from "../../../common/enums/product.enum";
|
import { ProductMarketStatus, ProductStatus } from "../../../common/enums/product.enum";
|
||||||
@@ -16,16 +16,22 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
super(ProductModel);
|
super(ProductModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getSellersProducts(shopIds: Types.ObjectId[], queryDto: SellerProductQueryDTO) {
|
async getSellersProducts(shopIds: Types.ObjectId[], queryDto: SellerProductQueryDTO & { categoryIds?: string[] }) {
|
||||||
const { limit, skip } = paginationUtils(queryDto);
|
const { limit, skip } = paginationUtils(queryDto);
|
||||||
|
|
||||||
|
const categoryIds = queryDto.categoryIds?.length
|
||||||
|
? queryDto.categoryIds.map((id) => new Types.ObjectId(id))
|
||||||
|
: queryDto.categoryId
|
||||||
|
? [new Types.ObjectId(queryDto.categoryId)]
|
||||||
|
: null;
|
||||||
|
|
||||||
const products = await this.model.aggregate([
|
const products = await this.model.aggregate([
|
||||||
{
|
{
|
||||||
$match: {
|
$match: {
|
||||||
deleted: false,
|
deleted: false,
|
||||||
shop: { $in: shopIds },
|
shop: { $in: shopIds },
|
||||||
...(queryDto.categoryId && {
|
...(categoryIds && {
|
||||||
category: new Types.ObjectId(queryDto.categoryId),
|
category: { $in: categoryIds },
|
||||||
}),
|
}),
|
||||||
...(queryDto.status && {
|
...(queryDto.status && {
|
||||||
status: queryDto.status as ProductStatus,
|
status: queryDto.status as ProductStatus,
|
||||||
@@ -130,6 +136,11 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
variantId: "$default_variant._id",
|
variantId: "$default_variant._id",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
$sort: {
|
||||||
|
createdAt: -1,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
$facet: {
|
$facet: {
|
||||||
data: [{ $skip: skip }, { $limit: limit }],
|
data: [{ $skip: skip }, { $limit: limit }],
|
||||||
@@ -141,11 +152,6 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
totalCount: { $arrayElemAt: ["$totalCount.count", 0] },
|
totalCount: { $arrayElemAt: ["$totalCount.count", 0] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
$sort: {
|
|
||||||
createdAt: -1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
return {
|
return {
|
||||||
count: (products[0]?.totalCount as number) || 0,
|
count: (products[0]?.totalCount as number) || 0,
|
||||||
@@ -226,6 +232,11 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
popular: { $cond: [{ $gt: [{ $size: "$popularData" }, 0] }, true, false] },
|
popular: { $cond: [{ $gt: [{ $size: "$popularData" }, 0] }, true, false] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
$sort: {
|
||||||
|
createdAt: -1,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
$facet: {
|
$facet: {
|
||||||
data: [{ $skip: skip }, { $limit: limit }],
|
data: [{ $skip: skip }, { $limit: limit }],
|
||||||
@@ -237,11 +248,6 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
totalCount: { $arrayElemAt: ["$totalCount.count", 0] },
|
totalCount: { $arrayElemAt: ["$totalCount.count", 0] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
$sort: {
|
|
||||||
createdAt: -1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
return {
|
return {
|
||||||
count: (products[0]?.totalCount as number) || 0,
|
count: (products[0]?.totalCount as number) || 0,
|
||||||
@@ -249,16 +255,22 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async getSellerProducts(shopId: string, queries: SellerProductQueryDTO) {
|
async getSellerProducts(shopId: string, queries: SellerProductQueryDTO & { categoryIds?: string[] }) {
|
||||||
const { skip, limit } = paginationUtils(queries);
|
const { skip, limit } = paginationUtils(queries);
|
||||||
|
|
||||||
|
const categoryIds = queries.categoryIds?.length
|
||||||
|
? queries.categoryIds.map((id) => new Types.ObjectId(id))
|
||||||
|
: queries.categoryId
|
||||||
|
? [new Types.ObjectId(queries.categoryId)]
|
||||||
|
: null;
|
||||||
|
|
||||||
const products = await this.model.aggregate([
|
const products = await this.model.aggregate([
|
||||||
{
|
{
|
||||||
$match: {
|
$match: {
|
||||||
deleted: false,
|
deleted: false,
|
||||||
shop: new Types.ObjectId(shopId),
|
shop: new Types.ObjectId(shopId),
|
||||||
...(queries.categoryId && {
|
...(categoryIds && {
|
||||||
category: new Types.ObjectId(queries.categoryId),
|
category: { $in: categoryIds },
|
||||||
}),
|
}),
|
||||||
...(queries.status && {
|
...(queries.status && {
|
||||||
status: queries.status as ProductStatus,
|
status: queries.status as ProductStatus,
|
||||||
@@ -361,6 +373,11 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
variantId: "$default_variant._id",
|
variantId: "$default_variant._id",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
$sort: {
|
||||||
|
createdAt: -1,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
$facet: {
|
$facet: {
|
||||||
data: [{ $skip: skip }, { $limit: limit }],
|
data: [{ $skip: skip }, { $limit: limit }],
|
||||||
@@ -380,11 +397,6 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
totalCount: { $arrayElemAt: ["$totalCount.count", 0] },
|
totalCount: { $arrayElemAt: ["$totalCount.count", 0] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
$sort: {
|
|
||||||
createdAt: -1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
return {
|
return {
|
||||||
count: (products?.[0]?.totalCount as number) || 0,
|
count: (products?.[0]?.totalCount as number) || 0,
|
||||||
@@ -1625,6 +1637,7 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const sortStage = { ...sortMatch, _id: 1 };
|
||||||
const pipeline = [
|
const pipeline = [
|
||||||
{
|
{
|
||||||
$match: productMatch,
|
$match: productMatch,
|
||||||
@@ -1762,11 +1775,23 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
preserveNullAndEmptyArrays: true,
|
preserveNullAndEmptyArrays: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
$group: {
|
||||||
|
_id: {
|
||||||
|
productId: "$_id",
|
||||||
|
variantId: "$variants._id",
|
||||||
|
},
|
||||||
|
doc: { $first: "$$ROOT" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$replaceRoot: { newRoot: "$doc" },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
$group: {
|
$group: {
|
||||||
_id: "$_id",
|
_id: "$_id",
|
||||||
count: { $sum: 1 },
|
count: { $sum: 1 },
|
||||||
|
createdAt: { $first: "$createdAt" },
|
||||||
title_fa: { $first: "$title_fa" },
|
title_fa: { $first: "$title_fa" },
|
||||||
title_en: { $first: "$title_en" },
|
title_en: { $first: "$title_en" },
|
||||||
seoTitle: { $first: "$seoTitle" },
|
seoTitle: { $first: "$seoTitle" },
|
||||||
@@ -1819,7 +1844,7 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
$facet: {
|
$facet: {
|
||||||
data: [{ $skip: skip }, { $limit: limit }, { $sort: sortMatch }],
|
data: [{ $sort: sortStage }, { $skip: skip }, { $limit: limit }],
|
||||||
totalCount: [{ $count: "count" }],
|
totalCount: [{ $count: "count" }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1830,7 +1855,7 @@ export class ProductRepository extends BaseRepository<IProduct> {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const docs = await this.model.aggregate(pipeline);
|
const docs = await this.model.aggregate(pipeline as PipelineStage[]);
|
||||||
return {
|
return {
|
||||||
count: (docs[0]?.totalCount as number) || 0,
|
count: (docs[0]?.totalCount as number) || 0,
|
||||||
docs: docs[0]?.data || [],
|
docs: docs[0]?.data || [],
|
||||||
|
|||||||
@@ -53,6 +53,14 @@ const productSchema = new Schema<IProduct>(
|
|||||||
{ timestamps: true, toJSON: { virtuals: true, versionKey: false }, _id: false, id: false },
|
{ timestamps: true, toJSON: { virtuals: true, versionKey: false }, _id: false, id: false },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
productSchema.index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deleted: false } });
|
||||||
|
productSchema.index({ shop: 1, status: 1, createdAt: -1 }, { partialFilterExpression: { deleted: false } });
|
||||||
|
productSchema.index({ category: 1, status: 1, createdAt: -1 }, { partialFilterExpression: { deleted: false } });
|
||||||
|
productSchema.index({ brand: 1, status: 1, createdAt: -1 }, { partialFilterExpression: { deleted: false } });
|
||||||
|
productSchema.index({ category: 1, brand: 1, status: 1 }, { partialFilterExpression: { deleted: false } });
|
||||||
|
productSchema.index({ model: 1 }, { partialFilterExpression: { deleted: false } });
|
||||||
|
productSchema.index({ tags: 1, status: 1 }, { partialFilterExpression: { deleted: false } });
|
||||||
|
|
||||||
productSchema.virtual("url").get(function () {
|
productSchema.virtual("url").get(function () {
|
||||||
return `/product/SHP-${this._id}/${this.title_fa}`;
|
return `/product/SHP-${this._id}/${this.title_fa}`;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ const productVariantSchema = new Schema<IProductVariant>(
|
|||||||
{ timestamps: true, toObject: { virtuals: true, versionKey: false }, toJSON: { virtuals: true, versionKey: false }, id: false },
|
{ timestamps: true, toObject: { virtuals: true, versionKey: false }, toJSON: { virtuals: true, versionKey: false }, id: false },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
productVariantSchema.index({ product: 1, deleted: 1 });
|
||||||
|
productVariantSchema.index({ shop: 1, product: 1, deleted: 1 });
|
||||||
|
productVariantSchema.index({ market_status: 1, deleted: 1 });
|
||||||
|
|
||||||
productVariantSchema.pre("save", function (next) {
|
productVariantSchema.pre("save", function (next) {
|
||||||
if (this.price) {
|
if (this.price) {
|
||||||
if (this.price.retailPrice) {
|
if (this.price.retailPrice) {
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ class ProductService {
|
|||||||
{ title_fa: { $regex: q, $options: "i" } },
|
{ title_fa: { $regex: q, $options: "i" } },
|
||||||
{ model: { $regex: q, $options: "i" } },
|
{ model: { $regex: q, $options: "i" } },
|
||||||
],
|
],
|
||||||
|
deleted: false,
|
||||||
variants: { $elemMatch: { $exists: true } },
|
variants: { $elemMatch: { $exists: true } },
|
||||||
},
|
},
|
||||||
{ _id: 1, title_fa: 1, title_en: 1, imagesUrl: 1, model: 1, description: 1, variants: 1 },
|
{ _id: 1, title_fa: 1, title_en: 1, imagesUrl: 1, model: 1, description: 1, variants: 1 },
|
||||||
@@ -852,7 +853,8 @@ class ProductService {
|
|||||||
async getAdminPanelProducts(ownerRef: OwnerRef, queryDto: SellerProductQueryDTO) {
|
async getAdminPanelProducts(ownerRef: OwnerRef, queryDto: SellerProductQueryDTO) {
|
||||||
const shops = await this.shopeRepo.model.find({ ownerRef }).select("_id");
|
const shops = await this.shopeRepo.model.find({ ownerRef }).select("_id");
|
||||||
const shopIds = shops.map((shop) => shop._id);
|
const shopIds = shops.map((shop) => shop._id);
|
||||||
const { docs, count } = await this.productRepo.getSellersProducts(shopIds, queryDto);
|
const categoryIds = queryDto.categoryId ? await this.categoryRepo.getDescendantCategoryIds(queryDto.categoryId) : undefined;
|
||||||
|
const { docs, count } = await this.productRepo.getSellersProducts(shopIds, { ...queryDto, categoryIds });
|
||||||
const brands = docs.map(({ brand }: any) => BrandDTO.transformBrand(brand));
|
const brands = docs.map(({ brand }: any) => BrandDTO.transformBrand(brand));
|
||||||
const categories = docs.map(({ category }: any) => CategoryTreeDTO.transformCategory(category));
|
const categories = docs.map(({ category }: any) => CategoryTreeDTO.transformCategory(category));
|
||||||
const products = docs.map((doc: IProduct) => SellerPanelProductDTO.transformProduct(doc));
|
const products = docs.map((doc: IProduct) => SellerPanelProductDTO.transformProduct(doc));
|
||||||
@@ -869,7 +871,8 @@ class ProductService {
|
|||||||
const shop = await this.shopeRepo.model.findOne({ owner: ownerId });
|
const shop = await this.shopeRepo.model.findOne({ owner: ownerId });
|
||||||
if (!shop) throw new BadRequestError(ShopMessage.ShopNotFound);
|
if (!shop) throw new BadRequestError(ShopMessage.ShopNotFound);
|
||||||
|
|
||||||
const { docs, count, category } = await this.productRepo.getSellerProducts(shop._id.toString(), queryDto);
|
const categoryIds = queryDto.categoryId ? await this.categoryRepo.getDescendantCategoryIds(queryDto.categoryId) : undefined;
|
||||||
|
const { docs, count, category } = await this.productRepo.getSellerProducts(shop._id.toString(), { ...queryDto, categoryIds });
|
||||||
|
|
||||||
const brands = docs.map(({ brand }: any) => BrandDTO.transformBrand(brand));
|
const brands = docs.map(({ brand }: any) => BrandDTO.transformBrand(brand));
|
||||||
const categories = category.map((cat: any) => CategoryTreeDTO.transformCategory(cat));
|
const categories = category.map((cat: any) => CategoryTreeDTO.transformCategory(cat));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Expose, Type } from "class-transformer";
|
import { Expose, Type } from "class-transformer";
|
||||||
import { ArrayMinSize, IsArray, IsNotEmpty, IsNumber, IsString, ValidateNested } from "class-validator";
|
import { ArrayMinSize, IsArray, IsBoolean, IsNotEmpty, IsNumber, IsOptional, IsString, ValidateNested } from "class-validator";
|
||||||
|
|
||||||
import { ApiProperty } from "../../../common/decorator/swggerDocs";
|
import { ApiProperty } from "../../../common/decorator/swggerDocs";
|
||||||
|
|
||||||
@@ -71,4 +71,14 @@ export class CreateShipProvidersDTO {
|
|||||||
@IsNumber()
|
@IsNumber()
|
||||||
@ApiProperty({ type: "number", description: "Delivery time in days", example: 3 })
|
@ApiProperty({ type: "number", description: "Delivery time in days", example: 3 })
|
||||||
deliveryTime: number;
|
deliveryTime: number;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsOptional()
|
||||||
|
@IsBoolean()
|
||||||
|
@ApiProperty({
|
||||||
|
type: "boolean",
|
||||||
|
description: "If true, delivery fee must be paid at delivery time instead of checkout",
|
||||||
|
example: false,
|
||||||
|
})
|
||||||
|
payDeliveryFeeOnDelivery?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ class ShipperInfoDTO {
|
|||||||
@Expose()
|
@Expose()
|
||||||
totalShippingCost: number;
|
totalShippingCost: number;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
payDeliveryFeeOnDelivery: boolean;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => ShipperItemsDTO)
|
@Type(() => ShipperItemsDTO)
|
||||||
items: ShipperItemsDTO[];
|
items: ShipperItemsDTO[];
|
||||||
@@ -89,4 +92,7 @@ export class ShipmentMethodDTO {
|
|||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
deliveryType: string;
|
deliveryType: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
payDeliveryFeeOnDelivery: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export interface IShipmentProviders {
|
|||||||
costs: IShipmentCost[];
|
costs: IShipmentCost[];
|
||||||
deliveryType: DeliveryType;
|
deliveryType: DeliveryType;
|
||||||
deliveryTime: number;
|
deliveryTime: number;
|
||||||
|
payDeliveryFeeOnDelivery: boolean;
|
||||||
deleted: boolean;
|
deleted: boolean;
|
||||||
}
|
}
|
||||||
export interface IShipmentCost {
|
export interface IShipmentCost {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ const ShipmentSchema = new Schema<IShipmentProviders>(
|
|||||||
costs: [ShipmentCostSchema],
|
costs: [ShipmentCostSchema],
|
||||||
deliveryType: { type: String, enum: DeliveryType, required: true },
|
deliveryType: { type: String, enum: DeliveryType, required: true },
|
||||||
deliveryTime: { type: Number, required: true },
|
deliveryTime: { type: Number, required: true },
|
||||||
|
payDeliveryFeeOnDelivery: { type: Boolean, default: false },
|
||||||
deleted: { type: Boolean, default: false },
|
deleted: { type: Boolean, default: false },
|
||||||
},
|
},
|
||||||
{ timestamps: true, toJSON: { versionKey: false }, _id: false, id: false },
|
{ timestamps: true, toJSON: { versionKey: false }, _id: false, id: false },
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class ShipmentService {
|
|||||||
//###################################################################
|
//###################################################################
|
||||||
//###################################################################
|
//###################################################################
|
||||||
async createShipmentProviderS(createDto: CreateShipProvidersDTO) {
|
async createShipmentProviderS(createDto: CreateShipProvidersDTO) {
|
||||||
const existShipper = await this.shipmentRepo.model.exists({ name: createDto.name });
|
const existShipper = await this.shipmentRepo.model.exists({ name: createDto.name, deleted: false });
|
||||||
if (existShipper) throw new BadRequestError(CommonMessage.DuplicateName);
|
if (existShipper) throw new BadRequestError(CommonMessage.DuplicateName);
|
||||||
|
|
||||||
const deliveryType = this.getDeliveryType(createDto.deliveryTime);
|
const deliveryType = this.getDeliveryType(createDto.deliveryTime);
|
||||||
@@ -48,7 +48,7 @@ class ShipmentService {
|
|||||||
|
|
||||||
//###################################################################
|
//###################################################################
|
||||||
async updateShipmentProvider(shipmentId: number, updateDto: UpdateShipmentProviderDTO) {
|
async updateShipmentProvider(shipmentId: number, updateDto: UpdateShipmentProviderDTO) {
|
||||||
const existShipper = await this.shipmentRepo.model.exists({ name: updateDto.name, _id: { $ne: shipmentId } });
|
const existShipper = await this.shipmentRepo.model.exists({ name: updateDto.name, _id: { $ne: shipmentId }, deleted: false });
|
||||||
if (existShipper) throw new BadRequestError(CommonMessage.DuplicateName);
|
if (existShipper) throw new BadRequestError(CommonMessage.DuplicateName);
|
||||||
|
|
||||||
if (updateDto.deliveryTime) {
|
if (updateDto.deliveryTime) {
|
||||||
@@ -157,6 +157,7 @@ class ShipmentService {
|
|||||||
shipperName: shipmentProvider.name,
|
shipperName: shipmentProvider.name,
|
||||||
shippingDaysRange: this.calculateShippingDays(shipmentProvider.deliveryType, shipmentProvider.deliveryTime),
|
shippingDaysRange: this.calculateShippingDays(shipmentProvider.deliveryType, shipmentProvider.deliveryTime),
|
||||||
totalShippingCost,
|
totalShippingCost,
|
||||||
|
payDeliveryFeeOnDelivery: shipmentProvider.payDeliveryFeeOnDelivery ?? false,
|
||||||
items: shipperItems,
|
items: shipperItems,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -230,15 +231,25 @@ class ShipmentService {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
if (existingCartShipmentItem) {
|
if (existingCartShipmentItem) {
|
||||||
// update the existing CartShipmentItem
|
const totalSellingPrice = shipmentItems.reduce((acc, item) => acc + item.selling_price * item.quantity, 0);
|
||||||
|
const totalRetailPrice = shipmentItems.reduce((acc, item) => acc + item.retail_price * item.quantity, 0);
|
||||||
|
const totalShipmentCost = shipmentItems.reduce((acc, item) => acc + item.shipmentCost, 0);
|
||||||
|
const onlineShipmentCost = selectedShipper.payDeliveryFeeOnDelivery ? 0 : totalShipmentCost;
|
||||||
|
|
||||||
existingCartShipmentItem.shipmentItems = shipmentItems;
|
existingCartShipmentItem.shipmentItems = shipmentItems;
|
||||||
existingCartShipmentItem.shipper = selectedShipper.shipperId;
|
existingCartShipmentItem.shipper = selectedShipper.shipperId;
|
||||||
|
existingCartShipmentItem.totalSellingPrice = totalSellingPrice;
|
||||||
|
existingCartShipmentItem.totalRetailPrice = totalRetailPrice;
|
||||||
|
existingCartShipmentItem.totalShipmentCost = totalShipmentCost;
|
||||||
|
existingCartShipmentItem.totalPaymentPrice = totalSellingPrice + onlineShipmentCost;
|
||||||
|
existingCartShipmentItem.itemsCount = shipmentItems.reduce((acc, item) => acc + item.quantity, 0);
|
||||||
|
|
||||||
await existingCartShipmentItem.save();
|
await existingCartShipmentItem.save();
|
||||||
} else {
|
} else {
|
||||||
const totalSellingPrice = shipmentItems.reduce((acc, item) => acc + item.selling_price * item.quantity, 0);
|
const totalSellingPrice = shipmentItems.reduce((acc, item) => acc + item.selling_price * item.quantity, 0);
|
||||||
const totalRetailPrice = shipmentItems.reduce((acc, item) => acc + item.retail_price * item.quantity, 0);
|
const totalRetailPrice = shipmentItems.reduce((acc, item) => acc + item.retail_price * item.quantity, 0);
|
||||||
const totalShipmentCost = shipmentItems.reduce((acc, item) => acc + item.shipmentCost, 0);
|
const totalShipmentCost = shipmentItems.reduce((acc, item) => acc + item.shipmentCost, 0);
|
||||||
|
const onlineShipmentCost = selectedShipper.payDeliveryFeeOnDelivery ? 0 : totalShipmentCost;
|
||||||
|
|
||||||
// create a new CartShipmentItem
|
// create a new CartShipmentItem
|
||||||
await this.cartShipItemRepo.model.create({
|
await this.cartShipItemRepo.model.create({
|
||||||
@@ -249,7 +260,7 @@ class ShipmentService {
|
|||||||
totalSellingPrice,
|
totalSellingPrice,
|
||||||
totalRetailPrice,
|
totalRetailPrice,
|
||||||
totalShipmentCost,
|
totalShipmentCost,
|
||||||
totalPaymentPrice: totalShipmentCost + totalSellingPrice,
|
totalPaymentPrice: totalSellingPrice + onlineShipmentCost,
|
||||||
itemsCount: shipmentItems.reduce((acc, item) => acc + item.quantity, 0),
|
itemsCount: shipmentItems.reduce((acc, item) => acc + item.quantity, 0),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -261,12 +272,15 @@ class ShipmentService {
|
|||||||
(sum, item) => sum + item.shipmentItems.reduce((subSum, shipmentItem) => subSum + shipmentItem.shipmentCost, 0),
|
(sum, item) => sum + item.shipmentItems.reduce((subSum, shipmentItem) => subSum + shipmentItem.shipmentCost, 0),
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
|
const onlineShippingCost = cartShipmentItems.reduce((sum, item) => sum + (item.totalPaymentPrice - item.totalSellingPrice), 0);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
cartShipmentItems: cartShipmentItems,
|
cartShipmentItems: cartShipmentItems,
|
||||||
shippingCost: totalShippingCost,
|
shippingCost: totalShippingCost,
|
||||||
processCost: totalShippingCost,
|
onlineShippingCost,
|
||||||
payable_price: cart.payable_price + totalShippingCost * 2,
|
shippingCostOnDelivery: totalShippingCost - onlineShippingCost,
|
||||||
|
processCost: onlineShippingCost,
|
||||||
|
payable_price: cart.payable_price + onlineShippingCost,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ class UploadService {
|
|||||||
secretAccessKey: process.env.BUCKET_SECRET_KEY,
|
secretAccessKey: process.env.BUCKET_SECRET_KEY,
|
||||||
},
|
},
|
||||||
endpoint: process.env.BUCKET_URL,
|
endpoint: process.env.BUCKET_URL,
|
||||||
region: "default",
|
region: "us-east-1",
|
||||||
|
forcePathStyle: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
private fileOption = {
|
private fileOption = {
|
||||||
|
|||||||
Reference in New Issue
Block a user