12 Commits

Author SHA1 Message Date
morteza 0e8e0cba2e update mirrors
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-14 15:12:19 +03:30
morteza 3a84740d9a Merge branch 'rafi/taskmanager'
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-14 15:08:15 +03:30
morteza cb77a55281 update docker
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-12 15:20:49 +03:30
morteza 11445f0a07 Merge branch 'rafi/taskmanager'
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-12 14:53:27 +03:30
morteza c2a861041f Merge branch 'rafi/taskmanager'
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-11 12:44:17 +03:30
morteza 50d9fb2274 Merge branch 'rafi/taskmanager'
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-11 09:43:51 +03:30
morteza 2768611a7c change mirror
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-08 15:59:21 +03:30
morteza b1a02d6b0d mirror
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-08 15:54:41 +03:30
morteza 8b901e4d02 mirror
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-08 15:45:32 +03:30
morteza 43b4f05894 mirror
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-08 15:42:10 +03:30
morteza 7bef7d414a Merge branch 'rafi/taskmanager'
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-08 11:49:27 +03:30
morteza 30dba5ae37 add charge dmenu wallet
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-07-04 15:16:51 +03:30
3 changed files with 57 additions and 9 deletions
+11 -7
View File
@@ -2,10 +2,14 @@
FROM node:22-alpine AS base FROM node:22-alpine AS base
ENV TZ=Asia/Tehran ENV TZ=Asia/Tehran
# Use the public npm registry to avoid paid/unstable mirror outages.
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm
# Runflare build hosts cannot reach registry.npmjs.org; use their npm mirror. # Change Alpine repo
# RUN npm install -g pnpm@9.15.9 --registry=https://mirror-npm.runflare.com RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories
RUN npm install -g pnpm@9.15.9
# Install pnpm globally (uses NPM_CONFIG_REGISTRY mirror above).
RUN npm install -g pnpm@9.15.9 --registry=https://package-mirror.liara.ir/repository/npm
# Stage 2: Install all dependencies (including dev) # Stage 2: Install all dependencies (including dev)
FROM base AS deps FROM base AS deps
@@ -15,9 +19,9 @@ COPY package.json pnpm-lock.yaml ./
# @nestjs/cli and typescript are required for the build step. # @nestjs/cli and typescript are required for the build step.
ENV NODE_ENV=development ENV NODE_ENV=development
# RUN pnpm install --frozen-lockfile --loglevel info \ # RUN pnpm install --frozen-lockfile --loglevel info \
# --registry=https://mirror-npm.runflare.com # --registry=https://package-mirror.liara.ir/repository/npm
RUN pnpm install --frozen-lockfile --loglevel info RUN pnpm install --frozen-lockfile --loglevel info --registry=https://package-mirror.liara.ir/repository/npm
# Stage 3: Build # Stage 3: Build
@@ -32,8 +36,8 @@ FROM base AS prod-deps
WORKDIR /temp-deps WORKDIR /temp-deps
COPY package.json pnpm-lock.yaml ./ COPY package.json pnpm-lock.yaml ./
# RUN pnpm install --prod --frozen-lockfile --loglevel info \ # RUN pnpm install --prod --frozen-lockfile --loglevel info \
# --registry=https://mirror-npm.runflare.com # --registry=https://package-mirror.liara.ir/repository/npm
RUN pnpm install --prod --frozen-lockfile --loglevel info RUN pnpm install --prod --frozen-lockfile --loglevel info --registry=https://package-mirror.liara.ir/repository/npm
# Stage 5: Runner # Stage 5: Runner
@@ -444,6 +444,46 @@ export class RestaurantService {
} }
} }
async finishChargeRequest(invoiceId: string) {
this.logger.log(`Finishing charge request for invoice ${invoiceId}`);
try {
const url = `${this.config.baseUrl}/super-admin/restaurants/charge-request/finish`;
const { data } = await firstValueFrom(
this.httpService
.post(url, { invoiceId }, {
headers: this.getHeaders(),
})
.pipe(
catchError((err: AxiosError) => {
this.logger.error(
`Failed to finish charge request for invoice ${invoiceId}: ${err.message}`,
err.stack,
);
return throwError(() => err);
}),
),
);
this.logger.log(`Successfully finished charge request for invoice ${invoiceId}`);
return data;
} catch (error: unknown) {
if (error instanceof AxiosError && error.response) {
this.logger.error(
`External API error finishing charge request for invoice ${invoiceId} (status ${error.response.status}):`,
error.response.data,
);
const errorResponse = {
...error.response.data,
message: error.response.data.error?.message || error.message,
};
throw new HttpException(errorResponse, error.response.status);
}
this.logger.error(
`Error finishing charge request for invoice ${invoiceId}: ${error instanceof Error ? error.message : "Unknown error"}`,
);
throw error;
}
}
async directLogin(userSubscriptionId: string, userId: string) { async directLogin(userSubscriptionId: string, userId: string) {
try { try {
// 1. Get userSubscription by id // 1. Get userSubscription by id
@@ -948,9 +948,13 @@ export class InvoicesService {
await this.addNotifyForWalletDeduction(invoice, user, userWallet, WalletMessage.SUPPORT_PLAN_WALLET_TRANSFER); await this.addNotifyForWalletDeduction(invoice, user, userWallet, WalletMessage.SUPPORT_PLAN_WALLET_TRANSFER);
// //
} else if (invoice.isExternal) { } else if (invoice.isExternal) {
if (invoice.items[0]?.name == 'purchase_design') { if (invoice.items[0]?.name == 'dmenu_wallet_charge') {
this.restaurantService.finishChargeRequest(invoice.id);
} else if (invoice.items[0]?.name == 'purchase_plan') {
this.dpageService.finishPurchaseDesign(invoice.externalBusinessId!, invoice.id) this.dpageService.finishPurchaseDesign(invoice.externalBusinessId!, invoice.id)
} else if (invoice.items[0]?.name == 'purchase_new_catalogue') { }
else if (invoice.items[0]?.name == 'purchase_new_catalogue') {
// call dpage api // call dpage api
const businessId = invoice.externalBusinessId const businessId = invoice.externalBusinessId
if (!businessId) { if (!businessId) {