-
Notifications
You must be signed in to change notification settings - Fork 1
[WIP] Исправление нерабочего эндпоинта #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: undefined
Added two new endpoints to support user-specific shift operations: - GET /shifts/my - Returns paginated list of shifts for authenticated user with optional filters: status, date_from, date_to - GET /shifts/my/current - Returns current active shift for authenticated user or null if no active shift exists These endpoints were missing from the API but are expected by TaskMateFrontend and documented in the frontend's swagger specification. Changes: - Added ShiftController::my() method for user's shift history - Added ShiftController::myCurrent() method for user's current active shift - Updated routes/api.php to register the new endpoints - Updated swagger.yaml with complete API documentation for both endpoints Fixes issue where frontend received 404 error when accessing /shifts/my/current 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit a8b7f55.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 📎 Log file uploaded as GitHub Gist (361KB) Now working session is ended, feel free to review and add any feedback on the solution draft. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 3 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="swagger.yaml">
<violation number="1" location="swagger.yaml:2001">
`type: 'null'` is not a valid OpenAPI 3.0 schema type, so this schema becomes invalid. Model the nullable Shift by marking the `$ref` as `nullable: true` or using an allowed type.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| data: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/Shift' | ||
| - type: 'null' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: 'null' is not a valid OpenAPI 3.0 schema type, so this schema becomes invalid. Model the nullable Shift by marking the $ref as nullable: true or using an allowed type.
Prompt for AI agents
Address the following comment on swagger.yaml at line 2001:
<comment>`type: 'null'` is not a valid OpenAPI 3.0 schema type, so this schema becomes invalid. Model the nullable Shift by marking the `$ref` as `nullable: true` or using an allowed type.</comment>
<file context>
@@ -1909,6 +1909,108 @@ paths:
+ data:
+ oneOf:
+ - $ref: '#/components/schemas/Shift'
+ - type: 'null'
+ nullable: true
+ message:
</file context>
🎯 Исправление нерабочих эндпоинтов shifts
Исправлена работа всех эндпоинтов shifts, добавлены недостающие эндпоинты согласно спецификации API.
📋 Issue Reference
Fixes #22
✨ Что было сделано
Добавлены недостающие эндпоинты:
GET /api/v1/shifts/my
GET /api/v1/shifts/my/current
{success: true, data: Shift|null, message?: string}📝 Технические детали
Изменённые файлы:
app/Http/Controllers/Api/V1/ShiftController.php- добавлены методыmy()иmyCurrent()routes/api.php- зарегистрированы новые роутыswagger.yaml- добавлена полная документация для новых эндпоинтовОсобенности реализации:
🔗 Связь с другими компонентами
Эти эндпоинты требуются для работы
TaskMateFrontend, где они используются в:src/api/shifts.ts- методыgetMyShifts()иgetMyCurrentShift()✅ Тестирование
📊 Swagger документация
Добавлена полная OpenAPI спецификация для обоих эндпоинтов включая:
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com