@@ -259,6 +294,10 @@ const form = reactive({
professor: null,
capacity: 20,
tuitionFee: 0,
+ hasDiscount: false,
+ discount: 0,
+ freeSpots: null,
+ showOnFrontend: true,
startDate: '',
endDate: '',
days: [],
@@ -269,6 +308,12 @@ const form = reactive({
});
const weekdays = WEEKDAYS;
+const finalTuitionFee = computed(() => {
+ const tuition = Number(form.tuitionFee) || 0;
+ if (!form.hasDiscount) return tuition;
+ return Math.max(0, tuition - (Number(form.discount) || 0));
+});
+
const removeDialogMessage = computed(() => {
const name = studentToRemove.value?.name;
return name
@@ -346,6 +391,10 @@ const fetchData = async () => {
professor: data.professor?._id || data.professor || null,
capacity: data.capacity || 20,
tuitionFee: data.tuitionFee || 0,
+ hasDiscount: Boolean(data.hasDiscount),
+ discount: data.discount || 0,
+ freeSpots: data.freeSpots ?? null,
+ showOnFrontend: data.showOnFrontend !== false,
startDate: toJalaliDisplay(data.startDate),
endDate: toJalaliDisplay(data.endDate),
days: Array.isArray(data.days) ? data.days.map(Number).filter((day) => day >= 0 && day <= 6) : [],
@@ -385,6 +434,10 @@ const handleSubmit = async () => {
professor: form.professor || undefined,
capacity: form.capacity,
tuitionFee: form.tuitionFee,
+ hasDiscount: form.hasDiscount,
+ discount: form.hasDiscount ? form.discount : 0,
+ freeSpots: form.freeSpots,
+ showOnFrontend: form.showOnFrontend,
startDate: toGregorianIso(form.startDate),
endDate: toGregorianIso(form.endDate),
days: form.days || [],
diff --git a/src/views/courses/CourseListView.vue b/src/views/courses/CourseListView.vue
index a2717e2..8c8e7ea 100644
--- a/src/views/courses/CourseListView.vue
+++ b/src/views/courses/CourseListView.vue
@@ -45,13 +45,6 @@
-
-
-
- -
-
-
-
diff --git a/src/views/notifications/NotificationListView.vue b/src/views/notifications/NotificationListView.vue
index f8bf3e1..7046158 100644
--- a/src/views/notifications/NotificationListView.vue
+++ b/src/views/notifications/NotificationListView.vue
@@ -22,29 +22,62 @@
-
+
-
+
-
- {{ data.subject || data.content || '-' }}
+ {{ data.subject || '—' }}
+
+
+
+
+
+
+ {{ truncateText(getBodyText(data), 120) }}
-
+
-
+ {{ data.relatedEvent || '—' }}
-
+
- {{ toPersianDigits(data.retryCount || 0) }}
+
+
+
+
+
+
+ {{ toPersianDigits(data.retryCount || 0) }} / {{ toPersianDigits(data.maxRetries ?? 3) }}
+
+
+
+
+
+ {{ data.sentAt ? formatJalali(data.sentAt, 'jYYYY/jMM/jDD HH:mm') : '—' }}
+
+
+
+
+
+ {{ data.createdAt ? formatJalali(data.createdAt, 'jYYYY/jMM/jDD HH:mm') : '—' }}
+
+
+
+
+
+
+ {{ truncateText(data.lastError, 80) }}
+
+ —
@@ -52,7 +85,7 @@