fix
This commit is contained in:
@@ -3,8 +3,8 @@ export const adminAssignments = [
|
||||
id: 301,
|
||||
title: 'یادداشتبرداری از جلسه اول',
|
||||
description: 'خلاصهای از مباحث جلسه اول را در دو صفحه بنویسید.',
|
||||
courseTemplate: { id: 1, title: 'اصول اخلاق اسلامی' },
|
||||
courseTemplateTitle: 'اصول اخلاق اسلامی',
|
||||
course: { id: 1, title: 'اصول اخلاق اسلامی' },
|
||||
courseTitle: 'اصول اخلاق اسلامی',
|
||||
session: { id: 101, title: 'مقدمهای بر اخلاق اسلامی' },
|
||||
sessionTitle: 'مقدمهای بر اخلاق اسلامی',
|
||||
startDate: '2025-09-26T00:00:00.000Z',
|
||||
@@ -19,8 +19,8 @@ export const adminAssignments = [
|
||||
id: 302,
|
||||
title: 'تحلیل تفسیری سوره حمد',
|
||||
description: 'تحلیل سه آیه از سوره حمد را ارسال نمایید.',
|
||||
courseTemplate: { id: 2, title: 'مفاهیم قرآنی' },
|
||||
courseTemplateTitle: 'مفاهیم قرآنی',
|
||||
course: { id: 2, title: 'مفاهیم قرآنی' },
|
||||
courseTitle: 'مفاهیم قرآنی',
|
||||
session: { id: 102, title: 'تفسیر سوره حمد' },
|
||||
sessionTitle: 'تفسیر سوره حمد',
|
||||
startDate: '2025-10-05T00:00:00.000Z',
|
||||
@@ -55,7 +55,7 @@ export const assignmentSubmissions = new Map([
|
||||
},
|
||||
},
|
||||
termTitle: 'ترم پاییز ۱۴۰۴',
|
||||
courseTemplateTitle: 'اصول اخلاق اسلامی',
|
||||
courseTitle: 'اصول اخلاق اسلامی',
|
||||
sessionTitle: 'مقدمهای بر اخلاق اسلامی',
|
||||
userDescription: 'یادداشتهای جلسه اول به همراه برداشت شخصی ضمیمه است.',
|
||||
attachments: [{ id: 1, title: 'یادداشت-جلسه-اول.pdf', fileUrl: '#', type: 'document' }],
|
||||
@@ -82,7 +82,7 @@ export const assignmentSubmissions = new Map([
|
||||
},
|
||||
},
|
||||
termTitle: 'ترم پاییز ۱۴۰۴',
|
||||
courseTemplateTitle: 'اصول اخلاق اسلامی',
|
||||
courseTitle: 'اصول اخلاق اسلامی',
|
||||
sessionTitle: 'مقدمهای بر اخلاق اسلامی',
|
||||
userDescription: 'خلاصهای از جلسه به همراه پرسش پایان.',
|
||||
attachments: [],
|
||||
|
||||
@@ -1,50 +1,5 @@
|
||||
export const adminCourseTemplates = [
|
||||
{
|
||||
id: 1,
|
||||
title: 'اصول اخلاق اسلامی',
|
||||
description: 'دوره مقدماتی برای آشنایی با اخلاق اسلامی.',
|
||||
image: 'https://picsum.photos/seed/course1/200/200',
|
||||
defaultTeacher: { id: 5, firstName: 'علی', lastName: 'حسنی', fullName: 'علی حسنی' },
|
||||
defaultCapacity: 30,
|
||||
isActiveByDefault: true,
|
||||
prerequisitesCount: 0,
|
||||
prerequisites: [],
|
||||
createdAt: '2025-08-10T08:00:00.000Z',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: 'مفاهیم قرآنی',
|
||||
description: 'بررسی مفاهیم قرآنی به همراه تفسیر مختصر.',
|
||||
image: 'https://picsum.photos/seed/course2/200/200',
|
||||
defaultTeacher: { id: 6, firstName: 'حسین', lastName: 'مرادی', fullName: 'حسین مرادی' },
|
||||
defaultCapacity: 25,
|
||||
isActiveByDefault: true,
|
||||
prerequisitesCount: 1,
|
||||
prerequisites: [{ courseId: 1, course: { id: 1, title: 'اصول اخلاق اسلامی' } }],
|
||||
createdAt: '2025-09-12T08:00:00.000Z',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: 'فقه عبادات',
|
||||
description: 'مرور احکام عملی نماز و روزه.',
|
||||
image: '',
|
||||
defaultTeacher: { id: 7, firstName: 'مهدی', lastName: 'سهرابی', fullName: 'مهدی سهرابی' },
|
||||
defaultCapacity: 20,
|
||||
isActiveByDefault: false,
|
||||
prerequisitesCount: 0,
|
||||
prerequisites: [],
|
||||
createdAt: '2026-01-05T08:00:00.000Z',
|
||||
},
|
||||
]
|
||||
|
||||
// Offered courses carry both the spec keys (term_id/teacher_id/
|
||||
// description/capacity/is_active/cover_url) and the UI-only keys the
|
||||
// current frontend reads (image, template/templateId, term/teacher
|
||||
// nested objects, prerequisitesCount, startDate, endDate). See
|
||||
// docs/backend-api-todo.md.
|
||||
const makeTeacherSnapshot = (overrides) => ({
|
||||
id: overrides.id,
|
||||
// --- spec ---
|
||||
name: overrides.name ?? `${overrides.firstName ?? ''} ${overrides.lastName ?? ''}`.trim(),
|
||||
email: overrides.email ?? '',
|
||||
phone: overrides.phone ?? null,
|
||||
@@ -52,16 +7,70 @@ const makeTeacherSnapshot = (overrides) => ({
|
||||
avatarUrl: overrides.avatarUrl ?? null,
|
||||
avatarDownloadUrl: overrides.avatarDownloadUrl ?? null,
|
||||
createdAt: overrides.createdAt ?? '',
|
||||
// --- ui-only ---
|
||||
firstName: overrides.firstName ?? '',
|
||||
lastName: overrides.lastName ?? '',
|
||||
fullName:
|
||||
overrides.fullName ?? `${overrides.firstName ?? ''} ${overrides.lastName ?? ''}`.trim(),
|
||||
fullName: overrides.fullName ?? `${overrides.firstName ?? ''} ${overrides.lastName ?? ''}`.trim(),
|
||||
})
|
||||
|
||||
export const adminOfferedCourses = [
|
||||
export const adminCourses = [
|
||||
{
|
||||
id: 1,
|
||||
termId: null,
|
||||
teacherId: 5,
|
||||
title: 'اصول اخلاق اسلامی',
|
||||
description: 'دوره مقدماتی برای آشنایی با اخلاق اسلامی.',
|
||||
capacity: 30,
|
||||
isActive: true,
|
||||
coverUrl: 'https://picsum.photos/seed/course1/200/200',
|
||||
image: 'https://picsum.photos/seed/course1/200/200',
|
||||
teacher: makeTeacherSnapshot({ id: 5, firstName: 'علی', lastName: 'حسنی' }),
|
||||
term: null,
|
||||
sessionsCount: 0,
|
||||
prerequisitesCount: 0,
|
||||
prerequisites: [],
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
createdAt: '2025-08-10T08:00:00.000Z',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
termId: null,
|
||||
teacherId: 6,
|
||||
title: 'مفاهیم قرآنی',
|
||||
description: 'بررسی مفاهیم قرآنی به همراه تفسیر مختصر.',
|
||||
capacity: 25,
|
||||
isActive: true,
|
||||
coverUrl: 'https://picsum.photos/seed/course2/200/200',
|
||||
image: 'https://picsum.photos/seed/course2/200/200',
|
||||
teacher: makeTeacherSnapshot({ id: 6, firstName: 'حسین', lastName: 'مرادی' }),
|
||||
term: null,
|
||||
sessionsCount: 0,
|
||||
prerequisitesCount: 1,
|
||||
prerequisites: [{ courseId: 1, course: { id: 1, title: 'اصول اخلاق اسلامی' } }],
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
createdAt: '2025-09-12T08:00:00.000Z',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
termId: null,
|
||||
teacherId: 7,
|
||||
title: 'فقه عبادات',
|
||||
description: 'مرور احکام عملی نماز و روزه.',
|
||||
capacity: 20,
|
||||
isActive: false,
|
||||
coverUrl: '',
|
||||
image: '',
|
||||
teacher: makeTeacherSnapshot({ id: 7, firstName: 'مهدی', lastName: 'سهرابی' }),
|
||||
term: null,
|
||||
sessionsCount: 0,
|
||||
prerequisitesCount: 0,
|
||||
prerequisites: [],
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
createdAt: '2026-01-05T08:00:00.000Z',
|
||||
},
|
||||
{
|
||||
// --- spec ---
|
||||
id: 11,
|
||||
termId: 1,
|
||||
teacherId: 5,
|
||||
@@ -70,20 +79,17 @@ export const adminOfferedCourses = [
|
||||
capacity: 30,
|
||||
isActive: true,
|
||||
coverUrl: 'https://picsum.photos/seed/offered1/200/200',
|
||||
|
||||
// --- ui-only ---
|
||||
image: 'https://picsum.photos/seed/offered1/200/200',
|
||||
template: { id: 1, title: 'اصول اخلاق اسلامی' },
|
||||
templateId: 1,
|
||||
term: { id: 1, title: 'ترم پاییز ۱۴۰۴' },
|
||||
teacher: makeTeacherSnapshot({ id: 5, firstName: 'علی', lastName: 'حسنی' }),
|
||||
term: { id: 1, title: 'ترم پاییز ۱۴۰۴' },
|
||||
sessionsCount: 0,
|
||||
prerequisitesCount: 0,
|
||||
prerequisites: [],
|
||||
startDate: '2025-09-23T00:00:00.000Z',
|
||||
endDate: '2025-11-20T00:00:00.000Z',
|
||||
createdAt: '2025-09-01T08:00:00.000Z',
|
||||
},
|
||||
{
|
||||
// --- spec ---
|
||||
id: 12,
|
||||
termId: 1,
|
||||
teacherId: 6,
|
||||
@@ -92,20 +98,17 @@ export const adminOfferedCourses = [
|
||||
capacity: 25,
|
||||
isActive: true,
|
||||
coverUrl: 'https://picsum.photos/seed/offered2/200/200',
|
||||
|
||||
// --- ui-only ---
|
||||
image: 'https://picsum.photos/seed/offered2/200/200',
|
||||
template: { id: 2, title: 'مفاهیم قرآنی' },
|
||||
templateId: 2,
|
||||
term: { id: 1, title: 'ترم پاییز ۱۴۰۴' },
|
||||
teacher: makeTeacherSnapshot({ id: 6, firstName: 'حسین', lastName: 'مرادی' }),
|
||||
term: { id: 1, title: 'ترم پاییز ۱۴۰۴' },
|
||||
sessionsCount: 0,
|
||||
prerequisitesCount: 1,
|
||||
prerequisites: [{ courseId: 11, course: { id: 11, title: 'اصول اخلاق اسلامی - پاییز' } }],
|
||||
startDate: '2025-10-01T00:00:00.000Z',
|
||||
endDate: '2025-12-15T00:00:00.000Z',
|
||||
createdAt: '2025-09-10T08:00:00.000Z',
|
||||
},
|
||||
{
|
||||
// --- spec ---
|
||||
id: 13,
|
||||
termId: 2,
|
||||
teacherId: 7,
|
||||
@@ -114,14 +117,12 @@ export const adminOfferedCourses = [
|
||||
capacity: 20,
|
||||
isActive: false,
|
||||
coverUrl: '',
|
||||
|
||||
// --- ui-only ---
|
||||
image: '',
|
||||
template: { id: 3, title: 'فقه عبادات' },
|
||||
templateId: 3,
|
||||
term: { id: 2, title: 'ترم زمستان ۱۴۰۴' },
|
||||
teacher: makeTeacherSnapshot({ id: 7, firstName: 'مهدی', lastName: 'سهرابی' }),
|
||||
term: { id: 2, title: 'ترم زمستان ۱۴۰۴' },
|
||||
sessionsCount: 0,
|
||||
prerequisitesCount: 0,
|
||||
prerequisites: [],
|
||||
startDate: '2026-01-22T00:00:00.000Z',
|
||||
endDate: '2026-03-15T00:00:00.000Z',
|
||||
createdAt: '2025-12-10T08:00:00.000Z',
|
||||
|
||||
@@ -1,67 +1,83 @@
|
||||
const sampleQuestions = (seed) => [
|
||||
{
|
||||
id: `${seed}-q1`,
|
||||
title: 'کدام گزینه به مفهوم تقوا نزدیکتر است؟',
|
||||
score: 5,
|
||||
correctAnswerId: `${seed}-q1-a2`,
|
||||
answers: [
|
||||
{ id: `${seed}-q1-a1`, title: 'پرهیز از خطا و دوری از گناه' },
|
||||
{ id: `${seed}-q1-a2`, title: 'خودنگهداری در محضر خداوند' },
|
||||
{ id: `${seed}-q1-a3`, title: 'پرهیز از خوراکیهای مضر' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: `${seed}-q2`,
|
||||
title: 'منبع اصلی احکام شیعه چیست؟',
|
||||
score: 5,
|
||||
correctAnswerId: `${seed}-q2-a1`,
|
||||
answers: [
|
||||
{ id: `${seed}-q2-a1`, title: 'قرآن و سنت اهل بیت(ع)' },
|
||||
{ id: `${seed}-q2-a2`, title: 'فقط قرآن کریم' },
|
||||
{ id: `${seed}-q2-a3`, title: 'اجماع علما' },
|
||||
],
|
||||
},
|
||||
// Shape mirrors backend Postman doc for /exams:
|
||||
// exam: { id, sessionId, title, description, passScore, isActive,
|
||||
// questions: [{ id, questionText, position,
|
||||
// options: [{ id, optionText, isCorrect }] }] }
|
||||
// (Backend hides `is_correct` from non-admin reads; the admin mock shows it.)
|
||||
|
||||
const buildQuestion = (id, questionText, position, options, correctIndex) => ({
|
||||
id,
|
||||
questionText,
|
||||
position,
|
||||
options: options.map((optionText, idx) => ({
|
||||
id: id * 100 + idx + 1,
|
||||
optionText,
|
||||
isCorrect: idx === correctIndex,
|
||||
})),
|
||||
})
|
||||
|
||||
const ethicsQuestions = [
|
||||
buildQuestion(
|
||||
1,
|
||||
'کدام گزینه به مفهوم تقوا نزدیکتر است؟',
|
||||
1,
|
||||
['پرهیز از خطا و دوری از گناه', 'خودنگهداری در محضر خداوند', 'پرهیز از خوراکیهای مضر'],
|
||||
1
|
||||
),
|
||||
buildQuestion(
|
||||
2,
|
||||
'منبع اصلی احکام شیعه چیست؟',
|
||||
2,
|
||||
['قرآن و سنت اهل بیت(ع)', 'فقط قرآن کریم', 'اجماع علما'],
|
||||
0
|
||||
),
|
||||
]
|
||||
|
||||
const quranQuestions = [
|
||||
buildQuestion(3, 'سوره حمد چند آیه دارد؟', 1, ['۵ آیه', '۶ آیه', '۷ آیه', '۸ آیه'], 2),
|
||||
buildQuestion(
|
||||
4,
|
||||
'کدام آیه به نام آیةالکرسی شناخته میشود؟',
|
||||
2,
|
||||
['آیه ۲۵۵ سوره بقره', 'آیه اول سوره فاتحه', 'آیه ۱۸ سوره آل عمران'],
|
||||
0
|
||||
),
|
||||
]
|
||||
|
||||
export const adminExams = [
|
||||
{
|
||||
id: 201,
|
||||
sessionId: 101,
|
||||
title: 'آزمون پایان فصل اول اخلاق',
|
||||
description: 'آزمون چهار گزینهای از مفاهیم درسهای ۱ تا ۳.',
|
||||
courseTemplate: { id: 1, title: 'اصول اخلاق اسلامی' },
|
||||
courseTemplateTitle: 'اصول اخلاق اسلامی',
|
||||
passScore: 12,
|
||||
isActive: true,
|
||||
questions: ethicsQuestions,
|
||||
// ── UI-only fields for ExamItem / ExamDetailsModal (not in backend). ──
|
||||
course: { id: 1, title: 'اصول اخلاق اسلامی' },
|
||||
courseTitle: 'اصول اخلاق اسلامی',
|
||||
session: { id: 101, title: 'مقدمهای بر اخلاق اسلامی' },
|
||||
sessionTitle: 'مقدمهای بر اخلاق اسلامی',
|
||||
durationMinutes: 25,
|
||||
passingScore: 12,
|
||||
questionsCount: 2,
|
||||
randomize: true,
|
||||
endDate: '2026-05-15T00:00:00.000Z',
|
||||
startDate: '2026-05-01T00:00:00.000Z',
|
||||
questionsCount: ethicsQuestions.length,
|
||||
createdAt: '2026-04-20T08:00:00.000Z',
|
||||
questions: sampleQuestions(201),
|
||||
usedInTerms: [{ termId: 1 }],
|
||||
},
|
||||
{
|
||||
id: 202,
|
||||
sessionId: 102,
|
||||
title: 'آزمون مفاهیم قرآنی - میانترم',
|
||||
description: 'آزمون میانترم برای مرور آیات کلیدی.',
|
||||
courseTemplate: { id: 2, title: 'مفاهیم قرآنی' },
|
||||
courseTemplateTitle: 'مفاهیم قرآنی',
|
||||
passScore: 14,
|
||||
isActive: true,
|
||||
questions: quranQuestions,
|
||||
course: { id: 2, title: 'مفاهیم قرآنی' },
|
||||
courseTitle: 'مفاهیم قرآنی',
|
||||
session: { id: 102, title: 'تفسیر سوره حمد' },
|
||||
sessionTitle: 'تفسیر سوره حمد',
|
||||
durationMinutes: 30,
|
||||
passingScore: 14,
|
||||
questionsCount: 2,
|
||||
randomize: false,
|
||||
endDate: '2026-06-10T00:00:00.000Z',
|
||||
startDate: '2026-05-25T00:00:00.000Z',
|
||||
questionsCount: quranQuestions.length,
|
||||
createdAt: '2026-05-10T08:00:00.000Z',
|
||||
questions: sampleQuestions(202),
|
||||
usedInTerms: [{ termId: 1 }],
|
||||
},
|
||||
]
|
||||
|
||||
// FE-mock-only — no backend endpoint for exam participants.
|
||||
export const examParticipants = new Map([
|
||||
[
|
||||
201,
|
||||
@@ -85,10 +101,6 @@ export const examParticipants = new Map([
|
||||
date: '2026-05-05T10:30:00.000Z',
|
||||
score: 17,
|
||||
scoreTone: 'good',
|
||||
questions: sampleQuestions(201).map((q) => ({
|
||||
...q,
|
||||
userAnswerId: q.correctAnswerId,
|
||||
})),
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -111,10 +123,6 @@ export const examParticipants = new Map([
|
||||
date: '2026-05-06T11:00:00.000Z',
|
||||
score: 9,
|
||||
scoreTone: 'bad',
|
||||
questions: sampleQuestions(201).map((q, i) => ({
|
||||
...q,
|
||||
userAnswerId: i === 0 ? q.answers[0].id : q.correctAnswerId,
|
||||
})),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// Maps the FE's 7-value `sessionType` to the spec's 3-value `type`.
|
||||
const SESSION_TYPE_TO_SPEC = {
|
||||
in_person: 'offline',
|
||||
online: 'online',
|
||||
@@ -13,29 +12,26 @@ const makeSession = (overrides) => {
|
||||
const sessionType = overrides.sessionType ?? ''
|
||||
const sessionConfig = overrides.sessionConfig ?? {}
|
||||
const startsAt = overrides.startsAt ?? sessionConfig.startTime ?? null
|
||||
const location = overrides.location ?? sessionConfig.location ?? null
|
||||
const endsAt = overrides.endsAt ?? sessionConfig.endTime ?? null
|
||||
const link = overrides.link ?? sessionConfig.meetingLink ?? null
|
||||
return {
|
||||
// --- spec ---
|
||||
id: overrides.id,
|
||||
courseId: overrides.courseId ?? null,
|
||||
title: overrides.title ?? '',
|
||||
description: overrides.description ?? '',
|
||||
type: overrides.type ?? SESSION_TYPE_TO_SPEC[sessionType] ?? null,
|
||||
startsAt,
|
||||
location,
|
||||
endsAt,
|
||||
link,
|
||||
media: overrides.media ?? [],
|
||||
|
||||
// --- ui-only ---
|
||||
image: overrides.image ?? '',
|
||||
courseTemplate: overrides.courseTemplate ?? null,
|
||||
course: overrides.course ?? null,
|
||||
sessionType,
|
||||
sessionTypeFa: overrides.sessionTypeFa ?? '',
|
||||
contentType: overrides.contentType ?? '',
|
||||
contentMediaId: overrides.contentMediaId ?? null,
|
||||
durationMinutes: overrides.durationMinutes ?? 0,
|
||||
order: overrides.order ?? 1,
|
||||
sessionConfig,
|
||||
materials: overrides.materials ?? [],
|
||||
usedInTerms: overrides.usedInTerms ?? [],
|
||||
createdAt: overrides.createdAt ?? '',
|
||||
}
|
||||
@@ -48,7 +44,7 @@ export const adminSessions = [
|
||||
title: 'مقدمهای بر اخلاق اسلامی',
|
||||
description: 'جلسه نخست؛ تعاریف و چارچوب دوره.',
|
||||
image: 'https://picsum.photos/seed/session1/200/200',
|
||||
courseTemplate: { id: 1, title: 'اصول اخلاق اسلامی' },
|
||||
course: { id: 11, title: 'اصول اخلاق اسلامی - پاییز' },
|
||||
sessionType: 'in_person',
|
||||
sessionTypeFa: 'حضوری',
|
||||
durationMinutes: 90,
|
||||
@@ -65,7 +61,7 @@ export const adminSessions = [
|
||||
courseId: 12,
|
||||
title: 'تفسیر سوره حمد',
|
||||
description: 'تحلیل آیات سوره حمد.',
|
||||
courseTemplate: { id: 2, title: 'مفاهیم قرآنی' },
|
||||
course: { id: 12, title: 'مفاهیم قرآنی - پاییز' },
|
||||
sessionType: 'online',
|
||||
sessionTypeFa: 'آنلاین',
|
||||
durationMinutes: 75,
|
||||
@@ -83,7 +79,7 @@ export const adminSessions = [
|
||||
courseId: 13,
|
||||
title: 'احکام نماز جماعت',
|
||||
description: 'مرور احکام و شرایط نماز جماعت.',
|
||||
courseTemplate: { id: 3, title: 'فقه عبادات' },
|
||||
course: { id: 13, title: 'فقه عبادات - زمستان' },
|
||||
sessionType: 'video',
|
||||
sessionTypeFa: 'ویدئو',
|
||||
durationMinutes: 50,
|
||||
|
||||
@@ -1,92 +1,148 @@
|
||||
// Shape mirrors backend Postman doc for /admin/tickets:
|
||||
// ticket: { id, student_id, assigned_to_user_id, target_role, status, subject,
|
||||
// created_at, student, assignee, messages: [{ id, ticket_id,
|
||||
// sender_id, message, created_at, sender }] }
|
||||
// Field names use camelCase here (snake_case bridge happens at the HTTP layer
|
||||
// when we swap the mock for the real backend).
|
||||
|
||||
const makeUser = (overrides) => ({
|
||||
id: overrides.id,
|
||||
name: overrides.name ?? '',
|
||||
email: overrides.email ?? '',
|
||||
phone: overrides.phone ?? null,
|
||||
roles: overrides.roles ?? ['student'],
|
||||
avatarUrl: overrides.avatarUrl ?? null,
|
||||
avatarDownloadUrl: overrides.avatarDownloadUrl ?? null,
|
||||
createdAt: overrides.createdAt ?? '',
|
||||
})
|
||||
|
||||
const studentJane = makeUser({
|
||||
id: 100,
|
||||
name: 'فاطمه رضایی',
|
||||
email: 'fateme@example.com',
|
||||
phone: '+989121111111',
|
||||
roles: ['student'],
|
||||
avatarUrl: '',
|
||||
createdAt: '2026-02-01T10:00:00.000Z',
|
||||
})
|
||||
|
||||
const studentMaryam = makeUser({
|
||||
id: 102,
|
||||
name: 'مریم احمدی',
|
||||
email: 'maryam@example.com',
|
||||
phone: '+989122222222',
|
||||
roles: ['student'],
|
||||
avatarUrl: '',
|
||||
createdAt: '2026-02-05T10:00:00.000Z',
|
||||
})
|
||||
|
||||
const studentAli = makeUser({
|
||||
id: 103,
|
||||
name: 'علی علوی',
|
||||
email: 'ali@example.com',
|
||||
phone: '+989123333333',
|
||||
roles: ['student'],
|
||||
avatarUrl: '',
|
||||
createdAt: '2026-02-10T10:00:00.000Z',
|
||||
})
|
||||
|
||||
const adminUser = makeUser({
|
||||
id: 1,
|
||||
name: 'مدیر سامانه',
|
||||
email: 'admin@example.com',
|
||||
roles: ['admin'],
|
||||
createdAt: '2026-01-01T00:00:00.000Z',
|
||||
})
|
||||
|
||||
export const adminTickets = [
|
||||
{
|
||||
id: 401,
|
||||
title: 'پیگیری وضعیت ثبتنام',
|
||||
user: {
|
||||
id: 100,
|
||||
firstName: 'فاطمه',
|
||||
lastName: 'رضایی',
|
||||
fullName: 'فاطمه رضایی',
|
||||
avatarUrl: '',
|
||||
},
|
||||
studentId: studentJane.id,
|
||||
assignedToUserId: adminUser.id,
|
||||
targetRole: 'admin',
|
||||
status: 'answered',
|
||||
statusLabel: 'پاسخ داده شده',
|
||||
createdAt: '2026-05-09T20:28:00.000Z',
|
||||
faCreatedAt: '۱۴۰۵/۰۲/۱۹',
|
||||
faCreatedTime: '۱۰:۳۰',
|
||||
subject: 'پیگیری وضعیت ثبتنام',
|
||||
createdAt: '2026-05-09T10:30:00.000Z',
|
||||
student: studentJane,
|
||||
assignee: adminUser,
|
||||
messages: [
|
||||
{
|
||||
id: 1,
|
||||
sender: 'user',
|
||||
text: 'سلام وقت بخیر، در فرایند ثبتنام به مشکل برخوردم.',
|
||||
time: '۱۲:۳۵',
|
||||
ticketId: 401,
|
||||
senderId: studentJane.id,
|
||||
message: 'سلام وقت بخیر، در فرایند ثبتنام به مشکل برخوردم.',
|
||||
createdAt: '2026-05-09T10:35:00.000Z',
|
||||
sender: studentJane,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
sender: 'admin',
|
||||
text: 'سلام و عرض ادب. لطفا کد پیگیری ثبتنام را ارسال کنید.',
|
||||
time: '۱۲:۴۰',
|
||||
ticketId: 401,
|
||||
senderId: adminUser.id,
|
||||
message: 'سلام و عرض ادب. لطفا کد پیگیری ثبتنام را ارسال کنید.',
|
||||
createdAt: '2026-05-09T10:40:00.000Z',
|
||||
sender: adminUser,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
sender: 'user',
|
||||
text: 'کد ثبتنام: ۱۲۳۴۵۶۷۸',
|
||||
time: '۱۲:۴۲',
|
||||
ticketId: 401,
|
||||
senderId: studentJane.id,
|
||||
message: 'کد ثبتنام: ۱۲۳۴۵۶۷۸',
|
||||
createdAt: '2026-05-09T10:42:00.000Z',
|
||||
sender: studentJane,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 402,
|
||||
title: 'سوال درباره جلسه آموزشی',
|
||||
user: {
|
||||
id: 102,
|
||||
firstName: 'مریم',
|
||||
lastName: 'احمدی',
|
||||
fullName: 'مریم احمدی',
|
||||
avatarUrl: '',
|
||||
},
|
||||
status: 'pending',
|
||||
statusLabel: 'در انتظار پاسخ',
|
||||
studentId: studentMaryam.id,
|
||||
assignedToUserId: null,
|
||||
targetRole: 'admin',
|
||||
status: 'open',
|
||||
subject: 'سوال درباره جلسه آموزشی',
|
||||
createdAt: '2026-05-08T09:15:00.000Z',
|
||||
faCreatedAt: '۱۴۰۵/۰۲/۱۸',
|
||||
faCreatedTime: '۱۲:۴۵',
|
||||
student: studentMaryam,
|
||||
assignee: null,
|
||||
messages: [
|
||||
{
|
||||
id: 1,
|
||||
sender: 'user',
|
||||
text: 'سلام، درباره ساعت برگزاری جلسه چهارم سوال داشتم.',
|
||||
time: '۱۲:۴۵',
|
||||
ticketId: 402,
|
||||
senderId: studentMaryam.id,
|
||||
message: 'سلام، درباره ساعت برگزاری جلسه چهارم سوال داشتم.',
|
||||
createdAt: '2026-05-08T09:15:00.000Z',
|
||||
sender: studentMaryam,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 403,
|
||||
title: 'درخواست بستن تیکت',
|
||||
user: {
|
||||
id: 103,
|
||||
firstName: 'علی',
|
||||
lastName: 'علوی',
|
||||
fullName: 'علی علوی',
|
||||
avatarUrl: '',
|
||||
},
|
||||
studentId: studentAli.id,
|
||||
assignedToUserId: adminUser.id,
|
||||
targetRole: 'admin',
|
||||
status: 'closed',
|
||||
statusLabel: 'بسته شده',
|
||||
subject: 'درخواست بستن تیکت',
|
||||
createdAt: '2026-05-07T14:10:00.000Z',
|
||||
faCreatedAt: '۱۴۰۵/۰۲/۱۷',
|
||||
faCreatedTime: '۱۷:۴۰',
|
||||
student: studentAli,
|
||||
assignee: adminUser,
|
||||
messages: [
|
||||
{
|
||||
id: 1,
|
||||
sender: 'user',
|
||||
text: 'مشکل برطرف شد. لطفا تیکت بسته شود.',
|
||||
time: '۱۷:۴۰',
|
||||
ticketId: 403,
|
||||
senderId: studentAli.id,
|
||||
message: 'مشکل برطرف شد. لطفا تیکت بسته شود.',
|
||||
createdAt: '2026-05-07T17:40:00.000Z',
|
||||
sender: studentAli,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
sender: 'admin',
|
||||
text: 'با تشکر از شما. تیکت بسته شد.',
|
||||
time: '۱۷:۴۲',
|
||||
ticketId: 403,
|
||||
senderId: adminUser.id,
|
||||
message: 'با تشکر از شما. تیکت بسته شد.',
|
||||
createdAt: '2026-05-07T17:42:00.000Z',
|
||||
sender: adminUser,
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
// The signed-in admin used as `sender` when a message is posted from the FE.
|
||||
export const currentAdminUser = adminUser
|
||||
|
||||
Reference in New Issue
Block a user