Skip to content

Commit e3061a4

Browse files
committed
added logs in payment
1 parent f74d72d commit e3061a4

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

manifest/ingress-controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
name: vlearning-api-gateway
1818
port:
1919
number: 3000
20-
- path: /payments/webhook
20+
- path: /webhook
2121
pathType: Prefix
2222
backend:
2323
service:

payment-srv/src/application/useCases/enrollStudentInCourseUseCase.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ export const enrollStudentInCourseUseCase = (dependencies: IDependencies) => {
77
execute: async (userId: string, courseId: string) => {
88
try {
99
const response = await enrollStudentInCourse(userId,courseId)
10+
console.log("Enrolling student in course.... usecase", userId, courseId, 'and getting response :',response);
1011
if(response){
1112
await sendEnrollPaidUserProducer(userId,courseId,"course-srv-topic");
1213
await sendEnrollPaidUserProducer(userId,courseId,"chat-srv-topic");
1314
}
15+
console.log(`✅ User ${userId} enrolled in course ${courseId} successfully. enrollStudentInCourse usecase`);
1416
return;
1517
} catch (error) {
1618
console.error("Error enrolling student:", error);

payment-srv/src/infrastructure/databases/mongoDb/repositories/addNewCourse.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const addNewCourse = async (data: PTobe) => {
3131
},
3232
{ overwrite: false } // Ensures no new fields are added
3333
);
34-
console.log(`FUCK :++ Course updated successfully in Payment from Course: ${existingCourse._id}`);
3534
return;
3635
} else {
3736
// Create a new course with the provided data, ensuring `_id` fields are preserved

payment-srv/src/infrastructure/databases/mongoDb/repositories/enrollStudentInCourse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import { CourseModel } from "../models";
33
export const enrollStudentInCourse = async (userId: string, courseId: string): Promise<boolean> => {
44
try {
55
// **FROM PAID COURSES**
6-
6+
console.log("Enrolling student in course.... repo", userId, courseId);
77
const updatedCourse = await CourseModel.findByIdAndUpdate(
88
courseId,
99
{ $addToSet: { students: userId } },
1010
{ new: true }
1111
);
1212

1313
if (!updatedCourse) {
14-
console.error(`Course with ID ${courseId} not found.`);
14+
console.error(`Course with ID ${courseId} not found. in enrollStudentInCourse repo`);
1515
return false;
1616
}
1717

18-
console.log(`✅ User ${userId} enrolled in course ${courseId}`);
18+
console.log(`✅ User ${userId} enrolled in course ${courseId} successfully. enrollStudentInCourse repo`);
1919
return true;
2020
} catch (error) {
2121
console.error("❌ Error enrolling student in course:", error);

0 commit comments

Comments
 (0)