update:add ci cd files ==> do not edit those file

This commit is contained in:
mahyargdz
2024-10-10 16:58:55 +03:30
parent dc6c7c63ea
commit ed5e2023f4
179 changed files with 15757 additions and 2277 deletions
+25
View File
@@ -0,0 +1,25 @@
import Models from "../models";
import Payment from "../models/payment.model";
export class PaymentDataAccess {
async createPayment(userId: string, amount: number, paymentNumber: string,reason:string):Promise<Payment> {
const payment = Models.Payment.create({ userId, amount, paymentNumber,reason });
return payment;
}
async getPayment(paymentId: string): Promise<Payment | null> {
const payment = await Models.Payment.findById(paymentId);
return payment;
}
async getPaymentsByUserId(userId: string): Promise<Payment[]> {
const payments = await Models.Payment.find({ userId });
return payments;
}
async getPayments(): Promise<Payment[]> {
const payments = await Models.Payment.find();
return payments;
}
}