feat: add TourProgressController and related entities for user tour progress tracking

- Implemented TourProgressController to handle API endpoints for tracking guided tours seen by users.
- Created UserTourProgress entity to store the highest version of tours seen by each user.
- Developed UserTourProgressRepository for database interactions related to user tour progress.
- Introduced TourProgressService to manage business logic for marking tours as seen and retrieving seen maps.
- Added comprehensive tests for API endpoints and entity behavior to ensure functionality and data integrity.
This commit is contained in:
hamed
2026-08-10 09:34:14 +03:30
parent 7716b40f6a
commit 20c8eaaad9
27 changed files with 16088 additions and 477 deletions
+8 -2
View File
@@ -2,6 +2,7 @@ import React from 'react';
import { Link } from 'react-router';
import { ChevronLeftIcon } from '@heroicons/react/24/outline';
import BackButton from './BackButton';
import TourButton from './TourButton';
interface Crumb {
label: string;
@@ -18,9 +19,11 @@ interface Props {
* مقدار، مقصدِ fallback است وقتی تاریخچه‌ای برای برگشتن نیست.
*/
backTo?: string;
/** شناسهٔ تور راهنمای این صفحه؛ اگر در registry ثبت نشده باشد دکمه‌ای نمی‌آید. */
tourId?: string;
}
export default function PageHeader({ title, breadcrumbs, action, description, backTo }: Props) {
export default function PageHeader({ title, breadcrumbs, action, description, backTo, tourId }: Props) {
return (
<div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 16, marginBottom: 24 }}>
<div style={{ minWidth: 0 }}>
@@ -48,7 +51,10 @@ export default function PageHeader({ title, breadcrumbs, action, description, ba
))}
</nav>
)}
<h1 className="section-title">{title}</h1>
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
<h1 className="section-title">{title}</h1>
<TourButton tourId={tourId} />
</div>
{description && (
<p style={{ fontSize: 13, color: 'var(--text-3)', marginTop: 4 }}>{description}</p>
)}