Deploy via committed dist: local Nest build, server runs with .env
Build on the developer machine without Docker, commit dist/, and run on the server with Dockerfile.dist plus compose env_file. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
import { CashPaymentStatus } from '@prisma/client';
|
||||
import { CashPaymentsService } from './cash-payments.service';
|
||||
import type { AuthPrincipal } from '../common/decorators/current-user.decorator';
|
||||
import { SubmitCashReceiptDto, UpdateCashPaymentStatusDto } from './dto/cash-payment.dto';
|
||||
export declare class CashPaymentsController {
|
||||
private readonly cashPaymentsService;
|
||||
constructor(cashPaymentsService: CashPaymentsService);
|
||||
submitReceipt(user: AuthPrincipal, orderId: string, dto: SubmitCashReceiptDto): Promise<{
|
||||
id: string;
|
||||
orderId: string;
|
||||
orderNumber: string;
|
||||
customerName: string;
|
||||
amount: number;
|
||||
paidAmount: number | null;
|
||||
transferDate: string | null;
|
||||
transferTime: string | undefined;
|
||||
trackingNumber: string;
|
||||
trackingCode: string;
|
||||
destinationAccountId: string | undefined;
|
||||
receiptImage: string | undefined;
|
||||
notes: string | undefined;
|
||||
expiresAt: string;
|
||||
status: import("@prisma/client").$Enums.CashPaymentStatus;
|
||||
submittedAt: string | undefined;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}>;
|
||||
findAll(status?: CashPaymentStatus): Promise<{
|
||||
id: string;
|
||||
orderId: string;
|
||||
orderNumber: string;
|
||||
customerName: string;
|
||||
amount: number;
|
||||
paidAmount: number | null;
|
||||
transferDate: string | null;
|
||||
transferTime: string | undefined;
|
||||
trackingNumber: string;
|
||||
trackingCode: string;
|
||||
destinationAccountId: string | undefined;
|
||||
receiptImage: string | undefined;
|
||||
notes: string | undefined;
|
||||
expiresAt: string;
|
||||
status: import("@prisma/client").$Enums.CashPaymentStatus;
|
||||
submittedAt: string | undefined;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}[]>;
|
||||
updateStatus(user: AuthPrincipal, id: string, dto: UpdateCashPaymentStatusDto): Promise<{
|
||||
id: string;
|
||||
orderId: string;
|
||||
orderNumber: string;
|
||||
customerName: string;
|
||||
amount: number;
|
||||
paidAmount: number | null;
|
||||
transferDate: string | null;
|
||||
transferTime: string | undefined;
|
||||
trackingNumber: string;
|
||||
trackingCode: string;
|
||||
destinationAccountId: string | undefined;
|
||||
receiptImage: string | undefined;
|
||||
notes: string | undefined;
|
||||
expiresAt: string;
|
||||
status: import("@prisma/client").$Enums.CashPaymentStatus;
|
||||
submittedAt: string | undefined;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}>;
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CashPaymentsController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const client_1 = require("@prisma/client");
|
||||
const cash_payments_service_1 = require("./cash-payments.service");
|
||||
const auth_decorators_1 = require("../common/decorators/auth.decorators");
|
||||
const current_user_decorator_1 = require("../common/decorators/current-user.decorator");
|
||||
const cash_payment_dto_1 = require("./dto/cash-payment.dto");
|
||||
let CashPaymentsController = class CashPaymentsController {
|
||||
cashPaymentsService;
|
||||
constructor(cashPaymentsService) {
|
||||
this.cashPaymentsService = cashPaymentsService;
|
||||
}
|
||||
submitReceipt(user, orderId, dto) {
|
||||
return this.cashPaymentsService.submitReceipt(user.id, orderId, dto);
|
||||
}
|
||||
findAll(status) {
|
||||
return this.cashPaymentsService.findAll(status);
|
||||
}
|
||||
updateStatus(user, id, dto) {
|
||||
return this.cashPaymentsService.updateStatus(id, user.id, dto);
|
||||
}
|
||||
};
|
||||
exports.CashPaymentsController = CashPaymentsController;
|
||||
__decorate([
|
||||
(0, auth_decorators_1.AuthType)('customer'),
|
||||
(0, common_1.Post)('orders/:orderId/cash-receipt'),
|
||||
__param(0, (0, current_user_decorator_1.CurrentUser)()),
|
||||
__param(1, (0, common_1.Param)('orderId')),
|
||||
__param(2, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, String, cash_payment_dto_1.SubmitCashReceiptDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], CashPaymentsController.prototype, "submitReceipt", null);
|
||||
__decorate([
|
||||
(0, auth_decorators_1.AuthType)('admin'),
|
||||
(0, common_1.Get)('admin/cash-payments'),
|
||||
__param(0, (0, common_1.Query)('status')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], CashPaymentsController.prototype, "findAll", null);
|
||||
__decorate([
|
||||
(0, auth_decorators_1.AuthType)('admin'),
|
||||
(0, common_1.Patch)('admin/cash-payments/:id/status'),
|
||||
__param(0, (0, current_user_decorator_1.CurrentUser)()),
|
||||
__param(1, (0, common_1.Param)('id')),
|
||||
__param(2, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, String, cash_payment_dto_1.UpdateCashPaymentStatusDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], CashPaymentsController.prototype, "updateStatus", null);
|
||||
exports.CashPaymentsController = CashPaymentsController = __decorate([
|
||||
(0, common_1.Controller)(),
|
||||
__metadata("design:paramtypes", [cash_payments_service_1.CashPaymentsService])
|
||||
], CashPaymentsController);
|
||||
//# sourceMappingURL=cash-payments.controller.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cash-payments.controller.js","sourceRoot":"","sources":["../../src/cash-payments/cash-payments.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,2CAAmD;AACnD,mEAA8D;AAC9D,0EAAgE;AAChE,wFAA0E;AAE1E,6DAGgC;AAGzB,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACJ;IAA7B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAIzE,aAAa,CACI,IAAmB,EAChB,OAAe,EACzB,GAAyB;QAEjC,OAAO,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;IAID,OAAO,CAAkB,MAA0B;QACjD,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAID,YAAY,CACK,IAAmB,EACrB,EAAU,EACf,GAA+B;QAEvC,OAAO,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACjE,CAAC;CACF,CAAA;AA5BY,wDAAsB;AAKjC;IAFC,IAAA,0BAAQ,EAAC,UAAU,CAAC;IACpB,IAAA,aAAI,EAAC,8BAA8B,CAAC;IAElC,WAAA,IAAA,oCAAW,GAAE,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,SAAS,CAAC,CAAA;IAChB,WAAA,IAAA,aAAI,GAAE,CAAA;;qDAAM,uCAAoB;;2DAGlC;AAID;IAFC,IAAA,0BAAQ,EAAC,OAAO,CAAC;IACjB,IAAA,YAAG,EAAC,qBAAqB,CAAC;IAClB,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;qDAEvB;AAID;IAFC,IAAA,0BAAQ,EAAC,OAAO,CAAC;IACjB,IAAA,cAAK,EAAC,gCAAgC,CAAC;IAErC,WAAA,IAAA,oCAAW,GAAE,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;qDAAM,6CAA0B;;0DAGxC;iCA3BU,sBAAsB;IADlC,IAAA,mBAAU,GAAE;qCAEuC,2CAAmB;GAD1D,sBAAsB,CA4BlC"}
|
||||
@@ -0,0 +1,2 @@
|
||||
export declare class CashPaymentsModule {
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CashPaymentsModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const cash_payments_controller_1 = require("./cash-payments.controller");
|
||||
const cash_payments_service_1 = require("./cash-payments.service");
|
||||
let CashPaymentsModule = class CashPaymentsModule {
|
||||
};
|
||||
exports.CashPaymentsModule = CashPaymentsModule;
|
||||
exports.CashPaymentsModule = CashPaymentsModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
controllers: [cash_payments_controller_1.CashPaymentsController],
|
||||
providers: [cash_payments_service_1.CashPaymentsService],
|
||||
exports: [cash_payments_service_1.CashPaymentsService],
|
||||
})
|
||||
], CashPaymentsModule);
|
||||
//# sourceMappingURL=cash-payments.module.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cash-payments.module.js","sourceRoot":"","sources":["../../src/cash-payments/cash-payments.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yEAAoE;AACpE,mEAA8D;AAOvD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAL9B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,iDAAsB,CAAC;QACrC,SAAS,EAAE,CAAC,2CAAmB,CAAC;QAChC,OAAO,EAAE,CAAC,2CAAmB,CAAC;KAC/B,CAAC;GACW,kBAAkB,CAAG"}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
import { CashPaymentStatus } from '@prisma/client';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
import { SubmitCashReceiptDto, UpdateCashPaymentStatusDto } from './dto/cash-payment.dto';
|
||||
export declare class CashPaymentsService {
|
||||
private readonly prisma;
|
||||
constructor(prisma: PrismaService);
|
||||
submitReceipt(userId: string, orderId: string, dto: SubmitCashReceiptDto): Promise<{
|
||||
id: string;
|
||||
orderId: string;
|
||||
orderNumber: string;
|
||||
customerName: string;
|
||||
amount: number;
|
||||
paidAmount: number | null;
|
||||
transferDate: string | null;
|
||||
transferTime: string | undefined;
|
||||
trackingNumber: string;
|
||||
trackingCode: string;
|
||||
destinationAccountId: string | undefined;
|
||||
receiptImage: string | undefined;
|
||||
notes: string | undefined;
|
||||
expiresAt: string;
|
||||
status: import("@prisma/client").$Enums.CashPaymentStatus;
|
||||
submittedAt: string | undefined;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}>;
|
||||
findAll(status?: CashPaymentStatus): Promise<{
|
||||
id: string;
|
||||
orderId: string;
|
||||
orderNumber: string;
|
||||
customerName: string;
|
||||
amount: number;
|
||||
paidAmount: number | null;
|
||||
transferDate: string | null;
|
||||
transferTime: string | undefined;
|
||||
trackingNumber: string;
|
||||
trackingCode: string;
|
||||
destinationAccountId: string | undefined;
|
||||
receiptImage: string | undefined;
|
||||
notes: string | undefined;
|
||||
expiresAt: string;
|
||||
status: import("@prisma/client").$Enums.CashPaymentStatus;
|
||||
submittedAt: string | undefined;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}[]>;
|
||||
updateStatus(id: string, adminId: string, dto: UpdateCashPaymentStatusDto): Promise<{
|
||||
id: string;
|
||||
orderId: string;
|
||||
orderNumber: string;
|
||||
customerName: string;
|
||||
amount: number;
|
||||
paidAmount: number | null;
|
||||
transferDate: string | null;
|
||||
transferTime: string | undefined;
|
||||
trackingNumber: string;
|
||||
trackingCode: string;
|
||||
destinationAccountId: string | undefined;
|
||||
receiptImage: string | undefined;
|
||||
notes: string | undefined;
|
||||
expiresAt: string;
|
||||
status: import("@prisma/client").$Enums.CashPaymentStatus;
|
||||
submittedAt: string | undefined;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}>;
|
||||
private mapReceipt;
|
||||
}
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CashPaymentsService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const client_1 = require("@prisma/client");
|
||||
const prisma_service_1 = require("../prisma/prisma.service");
|
||||
const name_1 = require("../common/utils/name");
|
||||
let CashPaymentsService = class CashPaymentsService {
|
||||
prisma;
|
||||
constructor(prisma) {
|
||||
this.prisma = prisma;
|
||||
}
|
||||
async submitReceipt(userId, orderId, dto) {
|
||||
const order = await this.prisma.order.findUnique({
|
||||
where: { id: orderId },
|
||||
include: { cashReceipt: true },
|
||||
});
|
||||
if (!order)
|
||||
throw new common_1.NotFoundException('سفارش یافت نشد');
|
||||
if (order.userId !== userId) {
|
||||
throw new common_1.ForbiddenException('دسترسی به این سفارش مجاز نیست');
|
||||
}
|
||||
if (order.settlementType !== client_1.SettlementType.cash) {
|
||||
throw new common_1.BadRequestException('این سفارش تسویه نقدی نیست');
|
||||
}
|
||||
if (order.cashInvoiceExpiresAt &&
|
||||
order.cashInvoiceExpiresAt.getTime() < Date.now()) {
|
||||
throw new common_1.BadRequestException('مهلت پرداخت فاکتور نقدی به پایان رسیده است');
|
||||
}
|
||||
const account = await this.prisma.bankAccount.findFirst({
|
||||
where: {
|
||||
id: dto.destinationAccountId,
|
||||
companyId: order.companyId,
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
if (!account) {
|
||||
throw new common_1.BadRequestException('حساب مقصد نامعتبر است');
|
||||
}
|
||||
const receipt = await this.prisma.$transaction(async (tx) => {
|
||||
const data = {
|
||||
amount: dto.amount,
|
||||
paidAmount: dto.paidAmount ?? dto.amount,
|
||||
transferDate: new Date(dto.transferDate),
|
||||
transferTime: dto.transferTime.trim(),
|
||||
trackingNumber: dto.trackingNumber.trim(),
|
||||
destinationAccountId: dto.destinationAccountId,
|
||||
receiptImage: dto.receiptImage || null,
|
||||
notes: dto.notes?.trim() || null,
|
||||
expiresAt: order.cashInvoiceExpiresAt,
|
||||
status: client_1.CashPaymentStatus.pending_review,
|
||||
submittedAt: new Date(),
|
||||
};
|
||||
const saved = order.cashReceipt
|
||||
? await tx.cashPaymentReceipt.update({
|
||||
where: { orderId },
|
||||
data,
|
||||
})
|
||||
: await tx.cashPaymentReceipt.create({
|
||||
data: { orderId, ...data },
|
||||
});
|
||||
await tx.order.update({
|
||||
where: { id: orderId },
|
||||
data: { status: client_1.OrderStatus.awaiting_cash_confirmation },
|
||||
});
|
||||
await tx.orderStatusHistory.create({
|
||||
data: {
|
||||
orderId,
|
||||
fromStatus: order.status,
|
||||
toStatus: client_1.OrderStatus.awaiting_cash_confirmation,
|
||||
changedBy: 'customer',
|
||||
note: 'رسید پرداخت نقدی ارسال شد',
|
||||
},
|
||||
});
|
||||
return saved;
|
||||
});
|
||||
return this.mapReceipt(receipt, order.orderNumber, '');
|
||||
}
|
||||
async findAll(status) {
|
||||
const receipts = await this.prisma.cashPaymentReceipt.findMany({
|
||||
where: status ? { status } : undefined,
|
||||
orderBy: { createdAt: 'desc' },
|
||||
include: {
|
||||
order: {
|
||||
include: { user: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
return receipts.map((r) => this.mapReceipt(r, r.order.orderNumber, (0, name_1.joinFullName)(r.order.user.firstName, r.order.user.lastName)));
|
||||
}
|
||||
async updateStatus(id, adminId, dto) {
|
||||
const receipt = await this.prisma.cashPaymentReceipt.findUnique({
|
||||
where: { id },
|
||||
include: { order: { include: { user: true } } },
|
||||
});
|
||||
if (!receipt)
|
||||
throw new common_1.NotFoundException('رسید نقدی یافت نشد');
|
||||
const updated = await this.prisma.$transaction(async (tx) => {
|
||||
const result = await tx.cashPaymentReceipt.update({
|
||||
where: { id },
|
||||
data: {
|
||||
status: dto.status,
|
||||
notes: dto.note
|
||||
? [receipt.notes, dto.note].filter(Boolean).join('\n')
|
||||
: receipt.notes,
|
||||
},
|
||||
include: { order: { include: { user: true } } },
|
||||
});
|
||||
let nextStatus = null;
|
||||
if (dto.status === client_1.CashPaymentStatus.approved) {
|
||||
nextStatus = client_1.OrderStatus.cash_confirmed;
|
||||
}
|
||||
else if (dto.status === client_1.CashPaymentStatus.rejected) {
|
||||
nextStatus = client_1.OrderStatus.needs_correction;
|
||||
}
|
||||
else if (dto.status === client_1.CashPaymentStatus.expired) {
|
||||
nextStatus = client_1.OrderStatus.expired;
|
||||
}
|
||||
if (nextStatus && nextStatus !== receipt.order.status) {
|
||||
await tx.order.update({
|
||||
where: { id: receipt.orderId },
|
||||
data: { status: nextStatus },
|
||||
});
|
||||
await tx.orderStatusHistory.create({
|
||||
data: {
|
||||
orderId: receipt.orderId,
|
||||
fromStatus: receipt.order.status,
|
||||
toStatus: nextStatus,
|
||||
changedBy: `admin:${adminId}`,
|
||||
note: dto.note || `وضعیت پرداخت نقدی: ${dto.status}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
return result;
|
||||
});
|
||||
return this.mapReceipt(updated, updated.order.orderNumber, (0, name_1.joinFullName)(updated.order.user.firstName, updated.order.user.lastName));
|
||||
}
|
||||
mapReceipt(r, orderNumber, customerName) {
|
||||
return {
|
||||
id: r.id,
|
||||
orderId: r.orderId,
|
||||
orderNumber,
|
||||
customerName,
|
||||
amount: r.amount,
|
||||
paidAmount: r.paidAmount,
|
||||
transferDate: r.transferDate?.toISOString() ?? null,
|
||||
transferTime: r.transferTime ?? undefined,
|
||||
trackingNumber: r.trackingNumber ?? '',
|
||||
trackingCode: r.trackingNumber ?? '',
|
||||
destinationAccountId: r.destinationAccountId ?? undefined,
|
||||
receiptImage: r.receiptImage ?? undefined,
|
||||
notes: r.notes ?? undefined,
|
||||
expiresAt: r.expiresAt?.toISOString() ?? '',
|
||||
status: r.status,
|
||||
submittedAt: r.submittedAt?.toISOString(),
|
||||
createdAt: r.createdAt.toISOString(),
|
||||
updatedAt: r.updatedAt.toISOString(),
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.CashPaymentsService = CashPaymentsService;
|
||||
exports.CashPaymentsService = CashPaymentsService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
|
||||
], CashPaymentsService);
|
||||
//# sourceMappingURL=cash-payments.service.js.map
|
||||
File diff suppressed because one or more lines are too long
+15
@@ -0,0 +1,15 @@
|
||||
import { CashPaymentStatus } from '@prisma/client';
|
||||
export declare class SubmitCashReceiptDto {
|
||||
amount: number;
|
||||
paidAmount?: number;
|
||||
transferDate: string;
|
||||
transferTime: string;
|
||||
trackingNumber: string;
|
||||
destinationAccountId: string;
|
||||
receiptImage?: string;
|
||||
notes?: string;
|
||||
}
|
||||
export declare class UpdateCashPaymentStatusDto {
|
||||
status: CashPaymentStatus;
|
||||
note?: string;
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UpdateCashPaymentStatusDto = exports.SubmitCashReceiptDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const class_transformer_1 = require("class-transformer");
|
||||
const client_1 = require("@prisma/client");
|
||||
class SubmitCashReceiptDto {
|
||||
amount;
|
||||
paidAmount;
|
||||
transferDate;
|
||||
transferTime;
|
||||
trackingNumber;
|
||||
destinationAccountId;
|
||||
receiptImage;
|
||||
notes;
|
||||
}
|
||||
exports.SubmitCashReceiptDto = SubmitCashReceiptDto;
|
||||
__decorate([
|
||||
(0, class_transformer_1.Type)(() => Number),
|
||||
(0, class_validator_1.IsNumber)(),
|
||||
(0, class_validator_1.Min)(1),
|
||||
__metadata("design:type", Number)
|
||||
], SubmitCashReceiptDto.prototype, "amount", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_transformer_1.Type)(() => Number),
|
||||
(0, class_validator_1.IsNumber)(),
|
||||
(0, class_validator_1.Min)(0),
|
||||
__metadata("design:type", Number)
|
||||
], SubmitCashReceiptDto.prototype, "paidAmount", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsDateString)(),
|
||||
__metadata("design:type", String)
|
||||
], SubmitCashReceiptDto.prototype, "transferDate", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
(0, class_validator_1.MinLength)(1),
|
||||
__metadata("design:type", String)
|
||||
], SubmitCashReceiptDto.prototype, "transferTime", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
(0, class_validator_1.MinLength)(1),
|
||||
__metadata("design:type", String)
|
||||
], SubmitCashReceiptDto.prototype, "trackingNumber", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], SubmitCashReceiptDto.prototype, "destinationAccountId", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], SubmitCashReceiptDto.prototype, "receiptImage", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], SubmitCashReceiptDto.prototype, "notes", void 0);
|
||||
class UpdateCashPaymentStatusDto {
|
||||
status;
|
||||
note;
|
||||
}
|
||||
exports.UpdateCashPaymentStatusDto = UpdateCashPaymentStatusDto;
|
||||
__decorate([
|
||||
(0, class_validator_1.IsEnum)(client_1.CashPaymentStatus),
|
||||
__metadata("design:type", String)
|
||||
], UpdateCashPaymentStatusDto.prototype, "status", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], UpdateCashPaymentStatusDto.prototype, "note", void 0);
|
||||
//# sourceMappingURL=cash-payment.dto.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cash-payment.dto.js","sourceRoot":"","sources":["../../../src/cash-payments/dto/cash-payment.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AACzB,yDAAyC;AACzC,2CAAmD;AAEnD,MAAa,oBAAoB;IAI/B,MAAM,CAAU;IAMhB,UAAU,CAAU;IAGpB,YAAY,CAAU;IAItB,YAAY,CAAU;IAItB,cAAc,CAAU;IAGxB,oBAAoB,CAAU;IAI9B,YAAY,CAAU;IAItB,KAAK,CAAU;CAChB;AAjCD,oDAiCC;AA7BC;IAHC,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;;oDACS;AAMhB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;;wDACa;AAGpB;IADC,IAAA,8BAAY,GAAE;;0DACO;AAItB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;0DACS;AAItB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;4DACW;AAGxB;IADC,IAAA,0BAAQ,GAAE;;kEACmB;AAI9B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACW;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACI;AAGjB,MAAa,0BAA0B;IAErC,MAAM,CAAqB;IAI3B,IAAI,CAAU;CACf;AAPD,gEAOC;AALC;IADC,IAAA,wBAAM,EAAC,0BAAiB,CAAC;;0DACC;AAI3B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wDACG"}
|
||||
Reference in New Issue
Block a user