Add comprehensive project documentation for ClinicPro in CLAUDE.md and README.md

- Introduced CLAUDE.md for internal guidance on project structure, commands, and architecture.
- Created README.md with detailed project overview, technology stack, directory structure, setup instructions, API endpoints, authentication flow, and external services.
This commit is contained in:
hamed
2026-06-10 11:12:15 +03:30
parent c7ae591e49
commit e9075e8c92
18 changed files with 3533 additions and 142 deletions
+255
View File
@@ -12,6 +12,7 @@ use App\Doctor\Repository\DoctorRepository;
use App\Shared\Constant\ErrorCodes;
use App\Shared\Controller\BaseController;
use App\Shared\Service\FileValidatorService;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Attribute\Route;
@@ -19,6 +20,7 @@ use Symfony\Component\Security\Http\Attribute\CurrentUser;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Uid\Uuid;
#[OA\Tag(name: 'Clinics')]
class ClinicController extends BaseController
{
public function __construct(
@@ -30,6 +32,47 @@ class ClinicController extends BaseController
private readonly string $projectDir,
) {}
#[OA\Post(
path: '/api/v1/clinic',
summary: 'Create a new clinic',
security: [['bearerAuth' => []]],
requestBody: new OA\RequestBody(
required: true,
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'name', type: 'string'),
new OA\Property(property: 'info', type: 'string', nullable: true),
new OA\Property(property: 'address', type: 'string', nullable: true),
new OA\Property(property: 'telephone', type: 'string', nullable: true),
new OA\Property(property: 'working_days', type: 'array', items: new OA\Items(type: 'string'), nullable: true),
new OA\Property(property: '24_7', type: 'boolean', nullable: true),
new OA\Property(property: 'latitude', type: 'number', format: 'float', nullable: true),
new OA\Property(property: 'longitude', type: 'number', format: 'float', nullable: true),
new OA\Property(property: 'state', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'city', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'image_clinic', type: 'array', items: new OA\Items(type: 'string'), nullable: true),
new OA\Property(property: 'clinic_logo', type: 'array', items: new OA\Items(type: 'string'), nullable: true),
new OA\Property(property: 'doctors', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'specialties', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'doctor_services', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'insurance', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
]
)
),
responses: [
new OA\Response(
response: 201,
description: 'Clinic created',
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'success', type: 'boolean', example: true),
new OA\Property(property: 'data', type: 'object'),
]
)
),
new OA\Response(response: 401, description: 'Unauthorized'),
]
)]
#[Route('/api/v1/clinic', methods: ['POST'])]
#[IsGranted('IS_AUTHENTICATED_FULLY')]
public function create(Request $request, #[CurrentUser] User $user): JsonResponse
@@ -50,6 +93,31 @@ class ClinicController extends BaseController
return $this->success(['data' => $clinic->toDetailArray()], 201);
}
#[OA\Get(
path: '/api/v1/clinic/{uuid}',
summary: 'Get clinic details by UUID',
parameters: [
new OA\Parameter(
name: 'uuid',
in: 'path',
required: true,
schema: new OA\Schema(type: 'string', format: 'uuid')
),
],
responses: [
new OA\Response(
response: 200,
description: 'Clinic details',
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'success', type: 'boolean', example: true),
new OA\Property(property: 'data', type: 'object'),
]
)
),
new OA\Response(response: 404, description: 'Clinic not found'),
]
)]
#[Route('/api/v1/clinic/{uuid}', methods: ['GET'])]
public function show(string $uuid): JsonResponse
{
@@ -63,6 +131,57 @@ class ClinicController extends BaseController
return $this->success(['data' => $clinic->toDetailArray($stateData, $cityData)]);
}
#[OA\Patch(
path: '/api/v1/clinic/{uuid}',
summary: 'Update clinic details',
security: [['bearerAuth' => []]],
requestBody: new OA\RequestBody(
required: true,
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'name', type: 'string', nullable: true),
new OA\Property(property: 'info', type: 'string', nullable: true),
new OA\Property(property: 'address', type: 'string', nullable: true),
new OA\Property(property: 'telephone', type: 'string', nullable: true),
new OA\Property(property: 'working_days', type: 'array', items: new OA\Items(type: 'string'), nullable: true),
new OA\Property(property: '24_7', type: 'boolean', nullable: true),
new OA\Property(property: 'latitude', type: 'number', format: 'float', nullable: true),
new OA\Property(property: 'longitude', type: 'number', format: 'float', nullable: true),
new OA\Property(property: 'state', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'city', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'image_clinic', type: 'array', items: new OA\Items(type: 'string'), nullable: true),
new OA\Property(property: 'clinic_logo', type: 'array', items: new OA\Items(type: 'string'), nullable: true),
new OA\Property(property: 'doctors', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'specialties', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'doctor_services', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
new OA\Property(property: 'insurance', type: 'array', items: new OA\Items(type: 'integer'), nullable: true),
]
)
),
parameters: [
new OA\Parameter(
name: 'uuid',
in: 'path',
required: true,
schema: new OA\Schema(type: 'string', format: 'uuid')
),
],
responses: [
new OA\Response(
response: 200,
description: 'Clinic updated',
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'success', type: 'boolean', example: true),
new OA\Property(property: 'data', type: 'object'),
]
)
),
new OA\Response(response: 401, description: 'Unauthorized'),
new OA\Response(response: 403, description: 'Forbidden'),
new OA\Response(response: 404, description: 'Clinic not found'),
]
)]
#[Route('/api/v1/clinic/{uuid}', methods: ['PATCH'])]
#[IsGranted('IS_AUTHENTICATED_FULLY')]
public function update(string $uuid, Request $request, #[CurrentUser] User $user): JsonResponse
@@ -85,6 +204,37 @@ class ClinicController extends BaseController
return $this->success(['data' => $clinic->toDetailArray($stateData, $cityData)]);
}
#[OA\Get(
path: '/api/v1/clinics',
summary: 'List clinics with optional filters (paginated)',
parameters: [
new OA\Parameter(name: 'page', in: 'query', required: false, schema: new OA\Schema(type: 'integer', default: 1)),
new OA\Parameter(name: 'limit', in: 'query', required: false, schema: new OA\Schema(type: 'integer', default: 20)),
new OA\Parameter(name: 'name', in: 'query', required: false, schema: new OA\Schema(type: 'string')),
new OA\Parameter(name: 'city', in: 'query', required: false, schema: new OA\Schema(type: 'integer')),
],
responses: [
new OA\Response(
response: 200,
description: 'Paginated list of clinics',
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'success', type: 'boolean', example: true),
new OA\Property(property: 'data', type: 'array', items: new OA\Items(type: 'object')),
new OA\Property(
property: 'meta',
properties: [
new OA\Property(property: 'totalRecords', type: 'integer'),
new OA\Property(property: 'totalPages', type: 'integer'),
new OA\Property(property: 'currentPage', type: 'integer'),
],
type: 'object'
),
]
)
),
]
)]
#[Route('/api/v1/clinics', methods: ['GET'])]
public function list(Request $request): JsonResponse
{
@@ -99,6 +249,37 @@ class ClinicController extends BaseController
);
}
#[OA\Get(
path: '/api/v1/clinic/doctor-list/{clinicUuid}',
summary: 'Get list of doctors for a clinic',
parameters: [
new OA\Parameter(
name: 'clinicUuid',
in: 'path',
required: true,
schema: new OA\Schema(type: 'string', format: 'uuid')
),
],
responses: [
new OA\Response(
response: 200,
description: 'List of doctors',
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'success', type: 'boolean', example: true),
new OA\Property(
property: 'data',
properties: [
new OA\Property(property: 'data', type: 'array', items: new OA\Items(type: 'object')),
],
type: 'object'
),
]
)
),
new OA\Response(response: 404, description: 'Clinic not found'),
]
)]
#[Route('/api/v1/clinic/doctor-list/{clinicUuid}', methods: ['GET'])]
public function doctorList(string $clinicUuid): JsonResponse
{
@@ -115,6 +296,43 @@ class ClinicController extends BaseController
return $this->success(['data' => $doctors]);
}
#[OA\Post(
path: '/file/upload/clinic_pro/clinic/field_image_clinic',
summary: 'Upload a clinic gallery image',
security: [['bearerAuth' => []]],
requestBody: new OA\RequestBody(
required: true,
content: new OA\MediaType(
mediaType: 'application/octet-stream',
schema: new OA\Schema(type: 'string', format: 'binary')
)
),
responses: [
new OA\Response(
response: 200,
description: 'Image uploaded',
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'success', type: 'boolean', example: true),
new OA\Property(
property: 'data',
properties: [
new OA\Property(property: 'fid', type: 'integer'),
new OA\Property(property: 'uuid', type: 'string', format: 'uuid'),
new OA\Property(property: 'url', type: 'string'),
new OA\Property(property: 'filename', type: 'string'),
new OA\Property(property: 'filemime', type: 'string'),
new OA\Property(property: 'filesize', type: 'integer'),
],
type: 'object'
),
]
)
),
new OA\Response(response: 401, description: 'Unauthorized'),
new OA\Response(response: 422, description: 'Invalid file'),
]
)]
#[Route('/file/upload/clinic_pro/clinic/field_image_clinic', methods: ['POST'])]
#[IsGranted('IS_AUTHENTICATED_FULLY')]
public function uploadImage(Request $request): JsonResponse
@@ -122,6 +340,43 @@ class ClinicController extends BaseController
return $this->handleFileUpload($request, 'clinics/gallery');
}
#[OA\Post(
path: '/file/upload/clinic_pro/clinic/field_clinic_logo',
summary: 'Upload a clinic logo image',
security: [['bearerAuth' => []]],
requestBody: new OA\RequestBody(
required: true,
content: new OA\MediaType(
mediaType: 'application/octet-stream',
schema: new OA\Schema(type: 'string', format: 'binary')
)
),
responses: [
new OA\Response(
response: 200,
description: 'Logo uploaded',
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'success', type: 'boolean', example: true),
new OA\Property(
property: 'data',
properties: [
new OA\Property(property: 'fid', type: 'integer'),
new OA\Property(property: 'uuid', type: 'string', format: 'uuid'),
new OA\Property(property: 'url', type: 'string'),
new OA\Property(property: 'filename', type: 'string'),
new OA\Property(property: 'filemime', type: 'string'),
new OA\Property(property: 'filesize', type: 'integer'),
],
type: 'object'
),
]
)
),
new OA\Response(response: 401, description: 'Unauthorized'),
new OA\Response(response: 422, description: 'Invalid file'),
]
)]
#[Route('/file/upload/clinic_pro/clinic/field_clinic_logo', methods: ['POST'])]
#[IsGranted('IS_AUTHENTICATED_FULLY')]
public function uploadLogo(Request $request): JsonResponse