diff --git a/.github/instructions/FRONTEND.instructions.md b/.github/instructions/FRONTEND.instructions.md index a081e0d..07cbe57 100644 --- a/.github/instructions/FRONTEND.instructions.md +++ b/.github/instructions/FRONTEND.instructions.md @@ -6,6 +6,31 @@ applyTo: "frontend/**/*" "We use the @sveltejs/adapter-static for deployment to GitHub Pages". "Prioritize the new Svelte 5 runes syntax for state management and effects". +## API Usage Rules + +**CRITICAL**: Never guess at API client patterns or imports. Always check existing code first. + +When working with API clients: +1. **Always check** `frontend/src/lib/server/api-client.ts` to see what APIs are already imported and available +2. **Never assume** API methods exist - use `grep_search` or `file_search` to verify +3. **Follow existing patterns exactly** - if other pages use `api.core.methodName({})`, use the same pattern +4. **Before adding new API imports**, check if the OpenAPI client has been regenerated to include new endpoints +5. **If an API class is missing**, tell the user the OpenAPI client needs to be regenerated first, don't just add the import + +Common mistakes to avoid: +- Making up `api(cookies)` or other non-existent patterns +- Adding imports like `DeadlinesApi` before confirming it exists in the generated client +- Creating try/catch wrappers that don't exist in other similar files +- Inventing new authentication patterns + +Always look at existing similar pages (FAQ, guestlist, etc.) for the correct pattern. + +CRITICAL: When using throw redirect() in SvelteKit form actions: + +NEVER place throw redirect() inside a try-catch block +ALWAYS move redirects outside the try-catch to prevent them from being caught as errors +If you need data from the API call for the redirect URL, store it in a variable declared before the try block. The redirect is a Response object that should propagate naturally through SvelteKit's request handling - catching it breaks the flow. + When connected to the svelte-llm MCP server, you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively: diff --git a/.github/workflows/auto_pr.yml b/.github/workflows/auto_pr.yml index 2f494a5..1dab95d 100644 --- a/.github/workflows/auto_pr.yml +++ b/.github/workflows/auto_pr.yml @@ -1,10 +1,9 @@ -name: Generate Development Pull Request +name: Generate Pull Requests on: push: branches-ignore: - main - - develop permissions: contents: write @@ -26,7 +25,14 @@ jobs: id: branch_info run: | BRANCH_NAME="${GITHUB_REF#refs/heads/}" - BASE_BRANCH="develop" + + # Determine base branch based on current branch + if [ "$BRANCH_NAME" = "develop" ]; then + BASE_BRANCH="main" + else + BASE_BRANCH="develop" + fi + echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT echo "base_branch=$BASE_BRANCH" >> $GITHUB_OUTPUT diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f031187..0d07e92 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,6 +80,7 @@ jobs: PR_NUMBER=$(gh pr list --head sync-release-${{ needs.release.outputs.version }} --json number --jq '.[0].number') if [ -n "$PR_NUMBER" ]; then gh pr merge $PR_NUMBER --auto --squash + fi - name: checkout develop branch again uses: actions/checkout@v5 diff --git a/backend/core/management/commands/send_update_email.py b/backend/core/management/commands/send_update_email.py index 59d8575..08797e5 100644 --- a/backend/core/management/commands/send_update_email.py +++ b/backend/core/management/commands/send_update_email.py @@ -8,7 +8,6 @@ from django.contrib.auth import get_user_model from django.db.models import Sum, DecimalField from django.utils import timezone -from django.urls import reverse from django.template.loader import render_to_string from core.models import WeddingSettings @@ -187,7 +186,7 @@ def _build_html_email_body(self, base_url, **data): overdue_deadlines = [] for deadline in data["overdue_deadlines"]: days_overdue = (timezone.now().date() - deadline.due_date).days - deadline_url = f"{base_url}{reverse('deadline:deadline_detail', kwargs={'deadline_slug': deadline.slug})}" + deadline_url = f"{base_url}/settings/deadline/deadline/{deadline.id}" overdue_deadlines.append( { "name": deadline.name, @@ -201,7 +200,7 @@ def _build_html_email_body(self, base_url, **data): upcoming_deadlines = [] for deadline in data["upcoming_deadlines"]: days_until = (deadline.due_date - timezone.now().date()).days - deadline_url = f"{base_url}{reverse('deadline:deadline_detail', kwargs={'deadline_slug': deadline.slug})}" + deadline_url = f"{base_url}/settings/deadline/deadline/{deadline.id}" upcoming_deadlines.append( { "name": deadline.name, diff --git a/backend/core/static/core/css/input.css b/backend/core/static/core/css/input.css index 0da7eae..194d5f5 100644 --- a/backend/core/static/core/css/input.css +++ b/backend/core/static/core/css/input.css @@ -87,11 +87,11 @@ /* start table listing items from associated models */ .associated-card { - @apply card bg-base-100 shadow-xl hover:shadow-2xl transition-shadow duration-300 text-base-content; + @apply card bg-neutral shadow-xl hover:shadow-2xl transition-shadow duration-300 text-neutral-content; } .associated-card-title { - @apply card-title text-base-content lg:text-xl text-lg; + @apply card-title text-neutral-content lg:text-xl text-lg; } .associated-card-body { diff --git a/backend/deadline/api.py b/backend/deadline/api.py new file mode 100644 index 0000000..cb08c75 --- /dev/null +++ b/backend/deadline/api.py @@ -0,0 +1,445 @@ +from datetime import date +from datetime import datetime +from typing import List +from typing import Optional +from uuid import UUID + +from django.contrib.auth import get_user_model +from django.db.models import Q +from django.shortcuts import get_object_or_404 +from ninja import FilterSchema +from ninja import Query +from ninja import Router +from ninja import Schema +from ninja.pagination import PageNumberPagination +from ninja.pagination import paginate + +from core.auth import multi_auth + +from .models import Deadline +from .models import DeadlineList + +User = get_user_model() + +router = Router(tags=["Deadlines"], auth=multi_auth) + + +# Schemas +class DeadlineListSchema(Schema): + id: UUID + name: str + slug: Optional[str] = None + count: int + completed_count: int + pending_count: int + completion_percentage: float + created_by_id: Optional[UUID] = None + created_by_name: Optional[str] = None + updated_by_id: Optional[UUID] = None + updated_by_name: Optional[str] = None + created_at: datetime + updated_at: datetime + + +class DeadlineListCreateSchema(Schema): + name: str + + +class DeadlineListUpdateSchema(Schema): + name: Optional[str] = None + + +class DeadlineSchema(Schema): + id: UUID + name: str + slug: Optional[str] = None + description: Optional[str] = None + deadline_list_id: Optional[UUID] = None + deadline_list_name: Optional[str] = None + due_date: Optional[date] = None + assigned_to_id: Optional[UUID] = None + assigned_to_name: Optional[str] = None + completed: bool + completed_at: Optional[datetime] = None + completed_note: Optional[str] = None + overdue: bool + created_by_id: Optional[UUID] = None + created_by_name: Optional[str] = None + updated_by_id: Optional[UUID] = None + updated_by_name: Optional[str] = None + created_at: datetime + updated_at: datetime + + +class DeadlineFilterSchema(FilterSchema): + deadline_list_id: Optional[UUID] = None + completed: Optional[bool] = None + assigned_to_id: Optional[UUID] = None + + +class DeadlineCreateSchema(Schema): + name: str + description: Optional[str] = None + deadline_list_id: Optional[UUID] = None + due_date: Optional[date] = None + assigned_to_id: Optional[UUID] = None + completed: Optional[bool] = False + completed_note: Optional[str] = None + + +class DeadlineUpdateSchema(Schema): + name: Optional[str] = None + description: Optional[str] = None + deadline_list_id: Optional[UUID] = None + due_date: Optional[date] = None + assigned_to_id: Optional[UUID] = None + completed: Optional[bool] = None + completed_note: Optional[str] = None + + +# DeadlineList CRUD Endpoints +@router.get("/deadline-lists", response=List[DeadlineListSchema]) +@paginate(PageNumberPagination, page_size=50) +def list_deadline_lists(request): + """List all deadline lists (non-deleted)""" + deadline_lists = DeadlineList.objects.filter(is_deleted=False).order_by("name") + + return [ + { + "id": dl.id, + "name": dl.name, + "slug": dl.slug, + "count": dl.count, + "completed_count": dl.completed_count, + "pending_count": dl.pending_count, + "completion_percentage": dl.completion_percentage, + "created_by_id": dl.created_by.id if dl.created_by else None, + "created_by_name": dl.created_by.get_full_name() if dl.created_by else None, + "updated_by_id": dl.updated_by.id if dl.updated_by else None, + "updated_by_name": dl.updated_by.get_full_name() if dl.updated_by else None, + "created_at": dl.created_at, + "updated_at": dl.updated_at, + } + for dl in deadline_lists + ] + + +@router.get("/deadline-lists/{list_id}", response=DeadlineListSchema) +def get_deadline_list(request, list_id: UUID): + """Get a specific deadline list by ID""" + dl = get_object_or_404(DeadlineList, id=list_id, is_deleted=False) + return { + "id": dl.id, + "name": dl.name, + "slug": dl.slug, + "count": dl.count, + "completed_count": dl.completed_count, + "pending_count": dl.pending_count, + "completion_percentage": dl.completion_percentage, + "created_by_id": dl.created_by.id if dl.created_by else None, + "created_by_name": dl.created_by.get_full_name() if dl.created_by else None, + "updated_by_id": dl.updated_by.id if dl.updated_by else None, + "updated_by_name": dl.updated_by.get_full_name() if dl.updated_by else None, + "created_at": dl.created_at, + "updated_at": dl.updated_at, + } + + +@router.post("/deadline-lists", response=DeadlineListSchema) +def create_deadline_list(request, payload: DeadlineListCreateSchema): + """Create a new deadline list""" + data = payload.dict() + + if request.user.is_authenticated: + data["created_by"] = request.user + else: + admin_user = User.objects.filter(is_staff=True, is_active=True).first() + if admin_user: + data["created_by"] = admin_user + + deadline_list = DeadlineList.objects.create(**data) + + return { + "id": deadline_list.id, + "name": deadline_list.name, + "slug": deadline_list.slug, + "count": deadline_list.count, + "completed_count": deadline_list.completed_count, + "pending_count": deadline_list.pending_count, + "completion_percentage": deadline_list.completion_percentage, + "created_by_id": deadline_list.created_by.id if deadline_list.created_by else None, + "created_by_name": deadline_list.created_by.get_full_name() if deadline_list.created_by else None, + "updated_by_id": deadline_list.updated_by.id if deadline_list.updated_by else None, + "updated_by_name": deadline_list.updated_by.get_full_name() if deadline_list.updated_by else None, + "created_at": deadline_list.created_at, + "updated_at": deadline_list.updated_at, + } + + +@router.put("/deadline-lists/{list_id}", response=DeadlineListSchema) +def update_deadline_list(request, list_id: UUID, payload: DeadlineListUpdateSchema): + """Update a deadline list""" + deadline_list = get_object_or_404(DeadlineList, id=list_id, is_deleted=False) + data = payload.dict(exclude_unset=True) + + for attr, value in data.items(): + setattr(deadline_list, attr, value) + + if request.user.is_authenticated: + deadline_list.updated_by = request.user + else: + admin_user = User.objects.filter(is_staff=True, is_active=True).first() + if admin_user: + deadline_list.updated_by = admin_user + + deadline_list.save() + + return { + "id": deadline_list.id, + "name": deadline_list.name, + "slug": deadline_list.slug, + "count": deadline_list.count, + "completed_count": deadline_list.completed_count, + "pending_count": deadline_list.pending_count, + "completion_percentage": deadline_list.completion_percentage, + "created_by_id": deadline_list.created_by.id if deadline_list.created_by else None, + "created_by_name": deadline_list.created_by.get_full_name() if deadline_list.created_by else None, + "updated_by_id": deadline_list.updated_by.id if deadline_list.updated_by else None, + "updated_by_name": deadline_list.updated_by.get_full_name() if deadline_list.updated_by else None, + "created_at": deadline_list.created_at, + "updated_at": deadline_list.updated_at, + } + + +@router.delete("/deadline-lists/{list_id}") +def delete_deadline_list(request, list_id: UUID): + """Soft delete a deadline list""" + deadline_list = get_object_or_404(DeadlineList, id=list_id, is_deleted=False) + deadline_list.is_deleted = True + if request.user.is_authenticated: + deadline_list.updated_by = request.user + else: + admin_user = User.objects.filter(is_staff=True, is_active=True).first() + if admin_user: + deadline_list.updated_by = admin_user + deadline_list.save() + return {"success": True, "message": "Deadline list deleted successfully"} + + +# Deadline CRUD Endpoints +@router.get("/deadlines", response=List[DeadlineSchema]) +@paginate(PageNumberPagination, page_size=50) +def list_deadlines(request, filters: DeadlineFilterSchema = Query(...)): # pyright: ignore[reportCallIssue] + """List all deadlines (non-deleted)""" + q = Q(is_deleted=False) + q &= filters.get_filter_expression() + deadlines = ( + Deadline.objects.filter(q).select_related("deadline_list", "assigned_to").order_by("due_date", "created_at") + ) + + return [ + { + "id": deadline.id, + "name": deadline.name, + "slug": deadline.slug, + "description": deadline.description, + "deadline_list_id": deadline.deadline_list.id if deadline.deadline_list else None, + "deadline_list_name": deadline.deadline_list.name if deadline.deadline_list else None, + "due_date": deadline.due_date, + "assigned_to_id": deadline.assigned_to.id if deadline.assigned_to else None, + "assigned_to_name": deadline.assigned_to.get_full_name() if deadline.assigned_to else None, + "completed": deadline.completed, + "completed_at": deadline.completed_at, + "completed_note": deadline.completed_note, + "overdue": deadline.overdue_status(), + "created_by_id": deadline.created_by.id if deadline.created_by else None, + "created_by_name": deadline.created_by.get_full_name() if deadline.created_by else None, + "updated_by_id": deadline.updated_by.id if deadline.updated_by else None, + "updated_by_name": deadline.updated_by.get_full_name() if deadline.updated_by else None, + "created_at": deadline.created_at, + "updated_at": deadline.updated_at, + } + for deadline in deadlines + ] + + +@router.get("/deadlines/{deadline_id}", response=DeadlineSchema) +def get_deadline(request, deadline_id: UUID): + """Get a specific deadline by ID""" + deadline = get_object_or_404(Deadline, id=deadline_id, is_deleted=False) + return { + "id": deadline.id, + "name": deadline.name, + "slug": deadline.slug, + "description": deadline.description, + "deadline_list_id": deadline.deadline_list.id if deadline.deadline_list else None, + "deadline_list_name": deadline.deadline_list.name if deadline.deadline_list else None, + "due_date": deadline.due_date, + "assigned_to_id": deadline.assigned_to.id if deadline.assigned_to else None, + "assigned_to_name": deadline.assigned_to.get_full_name() if deadline.assigned_to else None, + "completed": deadline.completed, + "completed_at": deadline.completed_at, + "completed_note": deadline.completed_note, + "overdue": deadline.overdue_status(), + "created_by_id": deadline.created_by.id if deadline.created_by else None, + "created_by_name": deadline.created_by.get_full_name() if deadline.created_by else None, + "updated_by_id": deadline.updated_by.id if deadline.updated_by else None, + "updated_by_name": deadline.updated_by.get_full_name() if deadline.updated_by else None, + "created_at": deadline.created_at, + "updated_at": deadline.updated_at, + } + + +@router.post("/deadlines", response=DeadlineSchema) +def create_deadline(request, payload: DeadlineCreateSchema): + """Create a new deadline""" + data = payload.dict() + deadline_list_id = data.pop("deadline_list_id", None) + assigned_to_id = data.pop("assigned_to_id", None) + + if request.user.is_authenticated: + data["created_by"] = request.user + else: + admin_user = User.objects.filter(is_staff=True, is_active=True).first() + if admin_user: + data["created_by"] = admin_user + + if deadline_list_id: + deadline_list = get_object_or_404(DeadlineList, id=deadline_list_id, is_deleted=False) + data["deadline_list"] = deadline_list + + if assigned_to_id: + assigned_to = get_object_or_404(User, id=assigned_to_id) + data["assigned_to"] = assigned_to + + deadline = Deadline.objects.create(**data) + + return { + "id": deadline.id, + "name": deadline.name, + "slug": deadline.slug, + "description": deadline.description, + "deadline_list_id": deadline.deadline_list.id if deadline.deadline_list else None, + "deadline_list_name": deadline.deadline_list.name if deadline.deadline_list else None, + "due_date": deadline.due_date, + "assigned_to_id": deadline.assigned_to.id if deadline.assigned_to else None, + "assigned_to_name": deadline.assigned_to.get_full_name() if deadline.assigned_to else None, + "completed": deadline.completed, + "completed_at": deadline.completed_at, + "completed_note": deadline.completed_note, + "overdue": deadline.overdue_status(), + "created_by_id": deadline.created_by.id if deadline.created_by else None, + "created_by_name": deadline.created_by.get_full_name() if deadline.created_by else None, + "updated_by_id": deadline.updated_by.id if deadline.updated_by else None, + "updated_by_name": deadline.updated_by.get_full_name() if deadline.updated_by else None, + "created_at": deadline.created_at, + "updated_at": deadline.updated_at, + } + + +@router.post("/deadlines/{deadline_id}/toggle_complete", response=DeadlineSchema) +def toggle_deadline_complete(request, deadline_id: UUID): + """Toggle the completion status of a deadline""" + deadline = get_object_or_404(Deadline, id=deadline_id, is_deleted=False) + deadline.completed = not deadline.completed + if deadline.completed: + deadline.completed_at = datetime.now() + else: + deadline.completed_at = None + + if request.user.is_authenticated: + deadline.updated_by = request.user + else: + admin_user = User.objects.filter(is_staff=True, is_active=True).first() + if admin_user: + deadline.updated_by = admin_user + + deadline.save() + + return { + "id": deadline.id, + "name": deadline.name, + "slug": deadline.slug, + "description": deadline.description, + "deadline_list_id": deadline.deadline_list.id if deadline.deadline_list else None, + "deadline_list_name": deadline.deadline_list.name if deadline.deadline_list else None, + "due_date": deadline.due_date, + "assigned_to_id": deadline.assigned_to.id if deadline.assigned_to else None, + "assigned_to_name": deadline.assigned_to.get_full_name() if deadline.assigned_to else None, + "completed": deadline.completed, + "completed_at": deadline.completed_at, + "completed_note": deadline.completed_note, + "overdue": deadline.overdue_status(), + "created_by_id": deadline.created_by.id if deadline.created_by else None, + "created_by_name": deadline.created_by.get_full_name() if deadline.created_by else None, + "updated_by_id": deadline.updated_by.id if deadline.updated_by else None, + "updated_by_name": deadline.updated_by.get_full_name() if deadline.updated_by else None, + "created_at": deadline.created_at, + "updated_at": deadline.updated_at, + } + + +@router.put("/deadlines/{deadline_id}", response=DeadlineSchema) +def update_deadline(request, deadline_id: UUID, payload: DeadlineUpdateSchema): + """Update a deadline""" + deadline = get_object_or_404(Deadline, id=deadline_id, is_deleted=False) + data = payload.dict(exclude_unset=True) + deadline_list_id = data.pop("deadline_list_id", None) + assigned_to_id = data.pop("assigned_to_id", None) + + for attr, value in data.items(): + setattr(deadline, attr, value) + + if deadline_list_id: + deadline_list = get_object_or_404(DeadlineList, id=deadline_list_id, is_deleted=False) + deadline.deadline_list = deadline_list + + if assigned_to_id: + assigned_to = get_object_or_404(User, id=assigned_to_id) + deadline.assigned_to = assigned_to + + if request.user.is_authenticated: + deadline.updated_by = request.user + else: + admin_user = User.objects.filter(is_staff=True, is_active=True).first() + if admin_user: + deadline.updated_by = admin_user + + deadline.save() + + return { + "id": deadline.id, + "name": deadline.name, + "slug": deadline.slug, + "description": deadline.description, + "deadline_list_id": deadline.deadline_list.id if deadline.deadline_list else None, + "deadline_list_name": deadline.deadline_list.name if deadline.deadline_list else None, + "due_date": deadline.due_date, + "assigned_to_id": deadline.assigned_to.id if deadline.assigned_to else None, + "assigned_to_name": deadline.assigned_to.get_full_name() if deadline.assigned_to else None, + "completed": deadline.completed, + "completed_at": deadline.completed_at, + "completed_note": deadline.completed_note, + "overdue": deadline.overdue_status(), + "created_by_id": deadline.created_by.id if deadline.created_by else None, + "created_by_name": deadline.created_by.get_full_name() if deadline.created_by else None, + "updated_by_id": deadline.updated_by.id if deadline.updated_by else None, + "updated_by_name": deadline.updated_by.get_full_name() if deadline.updated_by else None, + "created_at": deadline.created_at, + "updated_at": deadline.updated_at, + } + + +@router.delete("/deadlines/{deadline_id}") +def delete_deadline(request, deadline_id: UUID): + """Soft delete a deadline""" + deadline = get_object_or_404(Deadline, id=deadline_id, is_deleted=False) + deadline.is_deleted = True + if request.user.is_authenticated: + deadline.updated_by = request.user + else: + admin_user = User.objects.filter(is_staff=True, is_active=True).first() + if admin_user: + deadline.updated_by = admin_user + deadline.save() + return {"success": True, "message": "Deadline deleted successfully"} diff --git a/backend/deadline/models.py b/backend/deadline/models.py index a30a429..6307499 100644 --- a/backend/deadline/models.py +++ b/backend/deadline/models.py @@ -39,7 +39,7 @@ def completion_percentage(self): """Return completion percentage of associated deadlines""" if self.completed_count == 0: return 0 - return round((self.completed_count / len(self.deadlines.all())) * 100, 1) + return round((self.completed_count / self.count) * 100, 1) def __str__(self): return self.name diff --git a/backend/okletsdoit/api.py b/backend/okletsdoit/api.py index d377dcd..039ccb9 100644 --- a/backend/okletsdoit/api.py +++ b/backend/okletsdoit/api.py @@ -1,8 +1,10 @@ from ninja import NinjaAPI from guestlist.api import router as guestlist_router from core.api import router as core_router +from deadline.api import router as deadline_router api = NinjaAPI() api.add_router("/guestlist/", guestlist_router) api.add_router("/core/", core_router) +api.add_router("/deadline/", deadline_router) diff --git a/backend/okletsdoit/urls.py b/backend/okletsdoit/urls.py index 51055e2..caca700 100644 --- a/backend/okletsdoit/urls.py +++ b/backend/okletsdoit/urls.py @@ -16,7 +16,7 @@ path("expenses/", include("expenses.urls")), path("contacts/", include("contacts.urls")), path("lists/", include("list.urls")), - path("deadline/", include("deadline.urls")), + # path("deadline/", include("deadline.urls")), path("guestlist/", include("guestlist.urls")), path("attachments/", include("attachments.urls")), re_path( diff --git a/docs/dev/roadmap.md b/docs/dev/roadmap.md index 3f7af5e..10669da 100644 --- a/docs/dev/roadmap.md +++ b/docs/dev/roadmap.md @@ -1,24 +1,43 @@ # Roadmap +## Frontend Migration for Private sections +- [x] Settings +- [X] FAQ +- [ ] Deadlines + - [X] List View + - [x] Delete List and Item + - [x] Toggle completion + - [x] Disable Django components +- [ ] Guestlist +- [ ] Timeline +- [ ] Contacts +- [ ] Dashboard +- [ ] Inspiration +- [ ] Ideas +- [ ] Lists +- [ ] Budget + ## New Functionality -- [ ] Customized Settings +- [ ] Settings * [ ] Timezone * [x] Allow RSVP * [x] Show FAQ - * [ ] Automatically allow RSVP + * [ ] Enable RSVP during configured date ranges - [ ] Guestlist - * [ ] RSVP Form Configuration (Private) - * [ ] RSVP Form (Public) - * [ ] RSVP Preview + * [X] RSVP Form Configuration (Private) + * [X] RSVP Form (Public) + * [X ] RSVP Preview - [ ] Settings Page - [ ] Cleanup import function - [ ] Photo Upload * [ ] Upload form (Public) * [ ] Gallery (Public) * [ ] Photo approval (Private) -- [ ] Deadlines - * [ ] Notification of upcoming deadlines +- [X] Deadlines + * [X] Notification of upcoming deadlines + * [ ] Deletion of deadline list and all associated deadlines - [ ] Private Documentation + * [X] Settings * [ ] Dashboard * [ ] Ideas * [ ] Inspiration @@ -59,9 +78,6 @@ ## Future Enhancements -### Cotton Templates - -* Add description button if description not in record ### Configuration Options diff --git a/frontend/api-client/.openapi-generator/FILES b/frontend/api-client/.openapi-generator/FILES index c9cae89..65b5aa7 100644 --- a/frontend/api-client/.openapi-generator/FILES +++ b/frontend/api-client/.openapi-generator/FILES @@ -1,8 +1,17 @@ apis/CoreApi.ts +apis/DeadlinesApi.ts apis/GuestlistApi.ts apis/index.ts docs/CategoryContentSchema.md docs/CoreApi.md +docs/DeadlineCreateSchema.md +docs/DeadlineFilterSchema.md +docs/DeadlineListCreateSchema.md +docs/DeadlineListSchema.md +docs/DeadlineListUpdateSchema.md +docs/DeadlineSchema.md +docs/DeadlineUpdateSchema.md +docs/DeadlinesApi.md docs/GuestCreateSchema.md docs/GuestGroupCreateSchema.md docs/GuestGroupFilterSchema.md @@ -12,6 +21,8 @@ docs/GuestSchema.md docs/GuestUpdateSchema.md docs/GuestlistApi.md docs/Input.md +docs/PagedDeadlineListSchema.md +docs/PagedDeadlineSchema.md docs/PagedGuestGroupSchema.md docs/PagedGuestSchema.md docs/PagedQuestionSchema.md @@ -50,6 +61,13 @@ docs/WeddingSettingsSchema.md docs/WeddingSettingsUpdateSchema.md index.ts models/CategoryContentSchema.ts +models/DeadlineCreateSchema.ts +models/DeadlineFilterSchema.ts +models/DeadlineListCreateSchema.ts +models/DeadlineListSchema.ts +models/DeadlineListUpdateSchema.ts +models/DeadlineSchema.ts +models/DeadlineUpdateSchema.ts models/GuestCreateSchema.ts models/GuestGroupCreateSchema.ts models/GuestGroupFilterSchema.ts @@ -58,6 +76,8 @@ models/GuestGroupUpdateSchema.ts models/GuestSchema.ts models/GuestUpdateSchema.ts models/Input.ts +models/PagedDeadlineListSchema.ts +models/PagedDeadlineSchema.ts models/PagedGuestGroupSchema.ts models/PagedGuestSchema.ts models/PagedQuestionSchema.ts diff --git a/frontend/api-client/apis/DeadlinesApi.ts b/frontend/api-client/apis/DeadlinesApi.ts new file mode 100644 index 0000000..4c8b04c --- /dev/null +++ b/frontend/api-client/apis/DeadlinesApi.ts @@ -0,0 +1,649 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import type { + DeadlineCreateSchema, + DeadlineListCreateSchema, + DeadlineListSchema, + DeadlineListUpdateSchema, + DeadlineSchema, + DeadlineUpdateSchema, + PagedDeadlineListSchema, + PagedDeadlineSchema, +} from "../models/index"; +import { + DeadlineCreateSchemaFromJSON, + DeadlineCreateSchemaToJSON, + DeadlineListCreateSchemaFromJSON, + DeadlineListCreateSchemaToJSON, + DeadlineListSchemaFromJSON, + DeadlineListSchemaToJSON, + DeadlineListUpdateSchemaFromJSON, + DeadlineListUpdateSchemaToJSON, + DeadlineSchemaFromJSON, + DeadlineSchemaToJSON, + DeadlineUpdateSchemaFromJSON, + DeadlineUpdateSchemaToJSON, + PagedDeadlineListSchemaFromJSON, + PagedDeadlineListSchemaToJSON, + PagedDeadlineSchemaFromJSON, + PagedDeadlineSchemaToJSON, +} from "../models/index"; +import * as runtime from "../runtime"; + +export interface DeadlineApiCreateDeadlineRequest { + deadlineCreateSchema: DeadlineCreateSchema; +} + +export interface DeadlineApiCreateDeadlineListRequest { + deadlineListCreateSchema: DeadlineListCreateSchema; +} + +export interface DeadlineApiDeleteDeadlineRequest { + deadlineId: string; +} + +export interface DeadlineApiDeleteDeadlineListRequest { + listId: string; +} + +export interface DeadlineApiGetDeadlineRequest { + deadlineId: string; +} + +export interface DeadlineApiGetDeadlineListRequest { + listId: string; +} + +export interface DeadlineApiListDeadlineListsRequest { + page?: number; + pageSize?: number | null; +} + +export interface DeadlineApiListDeadlinesRequest { + deadlineListId?: string | null; + completed?: boolean | null; + assignedToId?: string | null; + page?: number; + pageSize?: number | null; +} + +export interface DeadlineApiToggleDeadlineCompleteRequest { + deadlineId: string; +} + +export interface DeadlineApiUpdateDeadlineRequest { + deadlineId: string; + deadlineUpdateSchema: DeadlineUpdateSchema; +} + +export interface DeadlineApiUpdateDeadlineListRequest { + listId: string; + deadlineListUpdateSchema: DeadlineListUpdateSchema; +} + +/** + * + */ +export class DeadlinesApi extends runtime.BaseAPI { + /** + * Create a new deadline + * Create Deadline + */ + async deadlineApiCreateDeadlineRaw( + requestParameters: DeadlineApiCreateDeadlineRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["deadlineCreateSchema"] == null) { + throw new runtime.RequiredError( + "deadlineCreateSchema", + 'Required parameter "deadlineCreateSchema" was null or undefined when calling deadlineApiCreateDeadline().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + let urlPath = `/api/deadline/deadlines`; + + const response = await this.request( + { + path: urlPath, + method: "POST", + headers: headerParameters, + query: queryParameters, + body: DeadlineCreateSchemaToJSON(requestParameters["deadlineCreateSchema"]), + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeadlineSchemaFromJSON(jsonValue)); + } + + /** + * Create a new deadline + * Create Deadline + */ + async deadlineApiCreateDeadline( + requestParameters: DeadlineApiCreateDeadlineRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiCreateDeadlineRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a new deadline list + * Create Deadline List + */ + async deadlineApiCreateDeadlineListRaw( + requestParameters: DeadlineApiCreateDeadlineListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["deadlineListCreateSchema"] == null) { + throw new runtime.RequiredError( + "deadlineListCreateSchema", + 'Required parameter "deadlineListCreateSchema" was null or undefined when calling deadlineApiCreateDeadlineList().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + let urlPath = `/api/deadline/deadline-lists`; + + const response = await this.request( + { + path: urlPath, + method: "POST", + headers: headerParameters, + query: queryParameters, + body: DeadlineListCreateSchemaToJSON(requestParameters["deadlineListCreateSchema"]), + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeadlineListSchemaFromJSON(jsonValue)); + } + + /** + * Create a new deadline list + * Create Deadline List + */ + async deadlineApiCreateDeadlineList( + requestParameters: DeadlineApiCreateDeadlineListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiCreateDeadlineListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Soft delete a deadline + * Delete Deadline + */ + async deadlineApiDeleteDeadlineRaw( + requestParameters: DeadlineApiDeleteDeadlineRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["deadlineId"] == null) { + throw new runtime.RequiredError( + "deadlineId", + 'Required parameter "deadlineId" was null or undefined when calling deadlineApiDeleteDeadline().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + let urlPath = `/api/deadline/deadlines/{deadline_id}`; + urlPath = urlPath.replace(`{${"deadline_id"}}`, encodeURIComponent(String(requestParameters["deadlineId"]))); + + const response = await this.request( + { + path: urlPath, + method: "DELETE", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.VoidApiResponse(response); + } + + /** + * Soft delete a deadline + * Delete Deadline + */ + async deadlineApiDeleteDeadline( + requestParameters: DeadlineApiDeleteDeadlineRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.deadlineApiDeleteDeadlineRaw(requestParameters, initOverrides); + } + + /** + * Soft delete a deadline list + * Delete Deadline List + */ + async deadlineApiDeleteDeadlineListRaw( + requestParameters: DeadlineApiDeleteDeadlineListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["listId"] == null) { + throw new runtime.RequiredError( + "listId", + 'Required parameter "listId" was null or undefined when calling deadlineApiDeleteDeadlineList().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + let urlPath = `/api/deadline/deadline-lists/{list_id}`; + urlPath = urlPath.replace(`{${"list_id"}}`, encodeURIComponent(String(requestParameters["listId"]))); + + const response = await this.request( + { + path: urlPath, + method: "DELETE", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.VoidApiResponse(response); + } + + /** + * Soft delete a deadline list + * Delete Deadline List + */ + async deadlineApiDeleteDeadlineList( + requestParameters: DeadlineApiDeleteDeadlineListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.deadlineApiDeleteDeadlineListRaw(requestParameters, initOverrides); + } + + /** + * Get a specific deadline by ID + * Get Deadline + */ + async deadlineApiGetDeadlineRaw( + requestParameters: DeadlineApiGetDeadlineRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["deadlineId"] == null) { + throw new runtime.RequiredError( + "deadlineId", + 'Required parameter "deadlineId" was null or undefined when calling deadlineApiGetDeadline().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + let urlPath = `/api/deadline/deadlines/{deadline_id}`; + urlPath = urlPath.replace(`{${"deadline_id"}}`, encodeURIComponent(String(requestParameters["deadlineId"]))); + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeadlineSchemaFromJSON(jsonValue)); + } + + /** + * Get a specific deadline by ID + * Get Deadline + */ + async deadlineApiGetDeadline( + requestParameters: DeadlineApiGetDeadlineRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiGetDeadlineRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get a specific deadline list by ID + * Get Deadline List + */ + async deadlineApiGetDeadlineListRaw( + requestParameters: DeadlineApiGetDeadlineListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["listId"] == null) { + throw new runtime.RequiredError( + "listId", + 'Required parameter "listId" was null or undefined when calling deadlineApiGetDeadlineList().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + let urlPath = `/api/deadline/deadline-lists/{list_id}`; + urlPath = urlPath.replace(`{${"list_id"}}`, encodeURIComponent(String(requestParameters["listId"]))); + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeadlineListSchemaFromJSON(jsonValue)); + } + + /** + * Get a specific deadline list by ID + * Get Deadline List + */ + async deadlineApiGetDeadlineList( + requestParameters: DeadlineApiGetDeadlineListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiGetDeadlineListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all deadline lists (non-deleted) + * List Deadline Lists + */ + async deadlineApiListDeadlineListsRaw( + requestParameters: DeadlineApiListDeadlineListsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const queryParameters: any = {}; + + if (requestParameters["page"] != null) { + queryParameters["page"] = requestParameters["page"]; + } + + if (requestParameters["pageSize"] != null) { + queryParameters["page_size"] = requestParameters["pageSize"]; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + let urlPath = `/api/deadline/deadline-lists`; + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => PagedDeadlineListSchemaFromJSON(jsonValue)); + } + + /** + * List all deadline lists (non-deleted) + * List Deadline Lists + */ + async deadlineApiListDeadlineLists( + requestParameters: DeadlineApiListDeadlineListsRequest = {}, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiListDeadlineListsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all deadlines (non-deleted) + * List Deadlines + */ + async deadlineApiListDeadlinesRaw( + requestParameters: DeadlineApiListDeadlinesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const queryParameters: any = {}; + + if (requestParameters["deadlineListId"] != null) { + queryParameters["deadline_list_id"] = requestParameters["deadlineListId"]; + } + + if (requestParameters["completed"] != null) { + queryParameters["completed"] = requestParameters["completed"]; + } + + if (requestParameters["assignedToId"] != null) { + queryParameters["assigned_to_id"] = requestParameters["assignedToId"]; + } + + if (requestParameters["page"] != null) { + queryParameters["page"] = requestParameters["page"]; + } + + if (requestParameters["pageSize"] != null) { + queryParameters["page_size"] = requestParameters["pageSize"]; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + let urlPath = `/api/deadline/deadlines`; + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => PagedDeadlineSchemaFromJSON(jsonValue)); + } + + /** + * List all deadlines (non-deleted) + * List Deadlines + */ + async deadlineApiListDeadlines( + requestParameters: DeadlineApiListDeadlinesRequest = {}, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiListDeadlinesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Toggle the completion status of a deadline + * Toggle Deadline Complete + */ + async deadlineApiToggleDeadlineCompleteRaw( + requestParameters: DeadlineApiToggleDeadlineCompleteRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["deadlineId"] == null) { + throw new runtime.RequiredError( + "deadlineId", + 'Required parameter "deadlineId" was null or undefined when calling deadlineApiToggleDeadlineComplete().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + let urlPath = `/api/deadline/deadlines/{deadline_id}/toggle_complete`; + urlPath = urlPath.replace(`{${"deadline_id"}}`, encodeURIComponent(String(requestParameters["deadlineId"]))); + + const response = await this.request( + { + path: urlPath, + method: "POST", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeadlineSchemaFromJSON(jsonValue)); + } + + /** + * Toggle the completion status of a deadline + * Toggle Deadline Complete + */ + async deadlineApiToggleDeadlineComplete( + requestParameters: DeadlineApiToggleDeadlineCompleteRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiToggleDeadlineCompleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a deadline + * Update Deadline + */ + async deadlineApiUpdateDeadlineRaw( + requestParameters: DeadlineApiUpdateDeadlineRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["deadlineId"] == null) { + throw new runtime.RequiredError( + "deadlineId", + 'Required parameter "deadlineId" was null or undefined when calling deadlineApiUpdateDeadline().', + ); + } + + if (requestParameters["deadlineUpdateSchema"] == null) { + throw new runtime.RequiredError( + "deadlineUpdateSchema", + 'Required parameter "deadlineUpdateSchema" was null or undefined when calling deadlineApiUpdateDeadline().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + let urlPath = `/api/deadline/deadlines/{deadline_id}`; + urlPath = urlPath.replace(`{${"deadline_id"}}`, encodeURIComponent(String(requestParameters["deadlineId"]))); + + const response = await this.request( + { + path: urlPath, + method: "PUT", + headers: headerParameters, + query: queryParameters, + body: DeadlineUpdateSchemaToJSON(requestParameters["deadlineUpdateSchema"]), + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeadlineSchemaFromJSON(jsonValue)); + } + + /** + * Update a deadline + * Update Deadline + */ + async deadlineApiUpdateDeadline( + requestParameters: DeadlineApiUpdateDeadlineRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiUpdateDeadlineRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a deadline list + * Update Deadline List + */ + async deadlineApiUpdateDeadlineListRaw( + requestParameters: DeadlineApiUpdateDeadlineListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["listId"] == null) { + throw new runtime.RequiredError( + "listId", + 'Required parameter "listId" was null or undefined when calling deadlineApiUpdateDeadlineList().', + ); + } + + if (requestParameters["deadlineListUpdateSchema"] == null) { + throw new runtime.RequiredError( + "deadlineListUpdateSchema", + 'Required parameter "deadlineListUpdateSchema" was null or undefined when calling deadlineApiUpdateDeadlineList().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + let urlPath = `/api/deadline/deadline-lists/{list_id}`; + urlPath = urlPath.replace(`{${"list_id"}}`, encodeURIComponent(String(requestParameters["listId"]))); + + const response = await this.request( + { + path: urlPath, + method: "PUT", + headers: headerParameters, + query: queryParameters, + body: DeadlineListUpdateSchemaToJSON(requestParameters["deadlineListUpdateSchema"]), + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeadlineListSchemaFromJSON(jsonValue)); + } + + /** + * Update a deadline list + * Update Deadline List + */ + async deadlineApiUpdateDeadlineList( + requestParameters: DeadlineApiUpdateDeadlineListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deadlineApiUpdateDeadlineListRaw(requestParameters, initOverrides); + return await response.value(); + } +} diff --git a/frontend/api-client/apis/index.ts b/frontend/api-client/apis/index.ts index 0235a13..353c67d 100644 --- a/frontend/api-client/apis/index.ts +++ b/frontend/api-client/apis/index.ts @@ -1,4 +1,5 @@ /* tslint:disable */ /* eslint-disable */ export * from "./CoreApi"; +export * from "./DeadlinesApi"; export * from "./GuestlistApi"; diff --git a/frontend/api-client/docs/DeadlineCreateSchema.md b/frontend/api-client/docs/DeadlineCreateSchema.md new file mode 100644 index 0000000..6b0c015 --- /dev/null +++ b/frontend/api-client/docs/DeadlineCreateSchema.md @@ -0,0 +1,42 @@ +# DeadlineCreateSchema + +## Properties + +| Name | Type | +| ---------------- | ------- | +| `name` | string | +| `description` | string | +| `deadlineListId` | string | +| `dueDate` | Date | +| `assignedToId` | string | +| `completed` | boolean | +| `completedNote` | string | + +## Example + +```typescript +import type { DeadlineCreateSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + name: null, + description: null, + deadlineListId: null, + dueDate: null, + assignedToId: null, + completed: null, + completedNote: null, +} satisfies DeadlineCreateSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeadlineCreateSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/DeadlineFilterSchema.md b/frontend/api-client/docs/DeadlineFilterSchema.md new file mode 100644 index 0000000..3555b54 --- /dev/null +++ b/frontend/api-client/docs/DeadlineFilterSchema.md @@ -0,0 +1,34 @@ +# DeadlineFilterSchema + +## Properties + +| Name | Type | +| ---------------- | ------- | +| `deadlineListId` | string | +| `completed` | boolean | +| `assignedToId` | string | + +## Example + +```typescript +import type { DeadlineFilterSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + deadlineListId: null, + completed: null, + assignedToId: null, +} satisfies DeadlineFilterSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeadlineFilterSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/DeadlineListCreateSchema.md b/frontend/api-client/docs/DeadlineListCreateSchema.md new file mode 100644 index 0000000..70908f1 --- /dev/null +++ b/frontend/api-client/docs/DeadlineListCreateSchema.md @@ -0,0 +1,30 @@ +# DeadlineListCreateSchema + +## Properties + +| Name | Type | +| ------ | ------ | +| `name` | string | + +## Example + +```typescript +import type { DeadlineListCreateSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + name: null, +} satisfies DeadlineListCreateSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeadlineListCreateSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/DeadlineListSchema.md b/frontend/api-client/docs/DeadlineListSchema.md new file mode 100644 index 0000000..b626904 --- /dev/null +++ b/frontend/api-client/docs/DeadlineListSchema.md @@ -0,0 +1,54 @@ +# DeadlineListSchema + +## Properties + +| Name | Type | +| ---------------------- | ------ | +| `id` | string | +| `name` | string | +| `slug` | string | +| `count` | number | +| `completedCount` | number | +| `pendingCount` | number | +| `completionPercentage` | number | +| `createdById` | string | +| `createdByName` | string | +| `updatedById` | string | +| `updatedByName` | string | +| `createdAt` | Date | +| `updatedAt` | Date | + +## Example + +```typescript +import type { DeadlineListSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + id: null, + name: null, + slug: null, + count: null, + completedCount: null, + pendingCount: null, + completionPercentage: null, + createdById: null, + createdByName: null, + updatedById: null, + updatedByName: null, + createdAt: null, + updatedAt: null, +} satisfies DeadlineListSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeadlineListSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/DeadlineListUpdateSchema.md b/frontend/api-client/docs/DeadlineListUpdateSchema.md new file mode 100644 index 0000000..877c8f0 --- /dev/null +++ b/frontend/api-client/docs/DeadlineListUpdateSchema.md @@ -0,0 +1,30 @@ +# DeadlineListUpdateSchema + +## Properties + +| Name | Type | +| ------ | ------ | +| `name` | string | + +## Example + +```typescript +import type { DeadlineListUpdateSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + name: null, +} satisfies DeadlineListUpdateSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeadlineListUpdateSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/DeadlineSchema.md b/frontend/api-client/docs/DeadlineSchema.md new file mode 100644 index 0000000..8cbcbc3 --- /dev/null +++ b/frontend/api-client/docs/DeadlineSchema.md @@ -0,0 +1,66 @@ +# DeadlineSchema + +## Properties + +| Name | Type | +| ------------------ | ------- | +| `id` | string | +| `name` | string | +| `slug` | string | +| `description` | string | +| `deadlineListId` | string | +| `deadlineListName` | string | +| `dueDate` | Date | +| `assignedToId` | string | +| `assignedToName` | string | +| `completed` | boolean | +| `completedAt` | Date | +| `completedNote` | string | +| `overdue` | boolean | +| `createdById` | string | +| `createdByName` | string | +| `updatedById` | string | +| `updatedByName` | string | +| `createdAt` | Date | +| `updatedAt` | Date | + +## Example + +```typescript +import type { DeadlineSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + id: null, + name: null, + slug: null, + description: null, + deadlineListId: null, + deadlineListName: null, + dueDate: null, + assignedToId: null, + assignedToName: null, + completed: null, + completedAt: null, + completedNote: null, + overdue: null, + createdById: null, + createdByName: null, + updatedById: null, + updatedByName: null, + createdAt: null, + updatedAt: null, +} satisfies DeadlineSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeadlineSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/DeadlineUpdateSchema.md b/frontend/api-client/docs/DeadlineUpdateSchema.md new file mode 100644 index 0000000..85fc0c7 --- /dev/null +++ b/frontend/api-client/docs/DeadlineUpdateSchema.md @@ -0,0 +1,42 @@ +# DeadlineUpdateSchema + +## Properties + +| Name | Type | +| ---------------- | ------- | +| `name` | string | +| `description` | string | +| `deadlineListId` | string | +| `dueDate` | Date | +| `assignedToId` | string | +| `completed` | boolean | +| `completedNote` | string | + +## Example + +```typescript +import type { DeadlineUpdateSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + name: null, + description: null, + deadlineListId: null, + dueDate: null, + assignedToId: null, + completed: null, + completedNote: null, +} satisfies DeadlineUpdateSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeadlineUpdateSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/DeadlinesApi.md b/frontend/api-client/docs/DeadlinesApi.md new file mode 100644 index 0000000..be1eee8 --- /dev/null +++ b/frontend/api-client/docs/DeadlinesApi.md @@ -0,0 +1,750 @@ +# DeadlinesApi + +All URIs are relative to _http://localhost_ + +| Method | HTTP request | Description | +| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------- | ------------------------ | +| [**deadlineApiCreateDeadline**](DeadlinesApi.md#deadlineapicreatedeadline) | **POST** /api/deadline/deadlines | Create Deadline | +| [**deadlineApiCreateDeadlineList**](DeadlinesApi.md#deadlineapicreatedeadlinelist) | **POST** /api/deadline/deadline-lists | Create Deadline List | +| [**deadlineApiDeleteDeadline**](DeadlinesApi.md#deadlineapideletedeadline) | **DELETE** /api/deadline/deadlines/{deadline_id} | Delete Deadline | +| [**deadlineApiDeleteDeadlineList**](DeadlinesApi.md#deadlineapideletedeadlinelist) | **DELETE** /api/deadline/deadline-lists/{list_id} | Delete Deadline List | +| [**deadlineApiGetDeadline**](DeadlinesApi.md#deadlineapigetdeadline) | **GET** /api/deadline/deadlines/{deadline_id} | Get Deadline | +| [**deadlineApiGetDeadlineList**](DeadlinesApi.md#deadlineapigetdeadlinelist) | **GET** /api/deadline/deadline-lists/{list_id} | Get Deadline List | +| [**deadlineApiListDeadlineLists**](DeadlinesApi.md#deadlineapilistdeadlinelists) | **GET** /api/deadline/deadline-lists | List Deadline Lists | +| [**deadlineApiListDeadlines**](DeadlinesApi.md#deadlineapilistdeadlines) | **GET** /api/deadline/deadlines | List Deadlines | +| [**deadlineApiToggleDeadlineComplete**](DeadlinesApi.md#deadlineapitoggledeadlinecomplete) | **POST** /api/deadline/deadlines/{deadline_id}/toggle_complete | Toggle Deadline Complete | +| [**deadlineApiUpdateDeadline**](DeadlinesApi.md#deadlineapiupdatedeadline) | **PUT** /api/deadline/deadlines/{deadline_id} | Update Deadline | +| [**deadlineApiUpdateDeadlineList**](DeadlinesApi.md#deadlineapiupdatedeadlinelist) | **PUT** /api/deadline/deadline-lists/{list_id} | Update Deadline List | + +## deadlineApiCreateDeadline + +> DeadlineSchema deadlineApiCreateDeadline(deadlineCreateSchema) + +Create Deadline + +Create a new deadline + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiCreateDeadlineRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // DeadlineCreateSchema + deadlineCreateSchema: ..., + } satisfies DeadlineApiCreateDeadlineRequest; + + try { + const data = await api.deadlineApiCreateDeadline(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------------------ | ----------------------------------------------- | ----------- | ----- | +| **deadlineCreateSchema** | [DeadlineCreateSchema](DeadlineCreateSchema.md) | | | + +### Return type + +[**DeadlineSchema**](DeadlineSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiCreateDeadlineList + +> DeadlineListSchema deadlineApiCreateDeadlineList(deadlineListCreateSchema) + +Create Deadline List + +Create a new deadline list + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiCreateDeadlineListRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // DeadlineListCreateSchema + deadlineListCreateSchema: ..., + } satisfies DeadlineApiCreateDeadlineListRequest; + + try { + const data = await api.deadlineApiCreateDeadlineList(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------------------- | ------------------------------------------------------- | ----------- | ----- | +| **deadlineListCreateSchema** | [DeadlineListCreateSchema](DeadlineListCreateSchema.md) | | | + +### Return type + +[**DeadlineListSchema**](DeadlineListSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiDeleteDeadline + +> deadlineApiDeleteDeadline(deadlineId) + +Delete Deadline + +Soft delete a deadline + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiDeleteDeadlineRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // string + deadlineId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + } satisfies DeadlineApiDeleteDeadlineRequest; + + try { + const data = await api.deadlineApiDeleteDeadline(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------- | -------- | ----------- | ------------------------- | +| **deadlineId** | `string` | | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiDeleteDeadlineList + +> deadlineApiDeleteDeadlineList(listId) + +Delete Deadline List + +Soft delete a deadline list + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiDeleteDeadlineListRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // string + listId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + } satisfies DeadlineApiDeleteDeadlineListRequest; + + try { + const data = await api.deadlineApiDeleteDeadlineList(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | ----------- | ------------------------- | +| **listId** | `string` | | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiGetDeadline + +> DeadlineSchema deadlineApiGetDeadline(deadlineId) + +Get Deadline + +Get a specific deadline by ID + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiGetDeadlineRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // string + deadlineId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + } satisfies DeadlineApiGetDeadlineRequest; + + try { + const data = await api.deadlineApiGetDeadline(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------- | -------- | ----------- | ------------------------- | +| **deadlineId** | `string` | | [Defaults to `undefined`] | + +### Return type + +[**DeadlineSchema**](DeadlineSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiGetDeadlineList + +> DeadlineListSchema deadlineApiGetDeadlineList(listId) + +Get Deadline List + +Get a specific deadline list by ID + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiGetDeadlineListRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // string + listId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + } satisfies DeadlineApiGetDeadlineListRequest; + + try { + const data = await api.deadlineApiGetDeadlineList(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | ----------- | ------------------------- | +| **listId** | `string` | | [Defaults to `undefined`] | + +### Return type + +[**DeadlineListSchema**](DeadlineListSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiListDeadlineLists + +> PagedDeadlineListSchema deadlineApiListDeadlineLists(page, pageSize) + +List Deadline Lists + +List all deadline lists (non-deleted) + +### Example + +```ts +import { Configuration, DeadlinesApi } from ""; +import type { DeadlineApiListDeadlineListsRequest } from ""; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // number (optional) + page: 56, + // number (optional) + pageSize: 56, + } satisfies DeadlineApiListDeadlineListsRequest; + + try { + const data = await api.deadlineApiListDeadlineLists(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------ | -------- | ----------- | ------------------------------------ | +| **page** | `number` | | [Optional] [Defaults to `1`] | +| **pageSize** | `number` | | [Optional] [Defaults to `undefined`] | + +### Return type + +[**PagedDeadlineListSchema**](PagedDeadlineListSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiListDeadlines + +> PagedDeadlineSchema deadlineApiListDeadlines(deadlineListId, completed, assignedToId, page, pageSize) + +List Deadlines + +List all deadlines (non-deleted) + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiListDeadlinesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // string (optional) + deadlineListId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + // boolean (optional) + completed: true, + // string (optional) + assignedToId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + // number (optional) + page: 56, + // number (optional) + pageSize: 56, + } satisfies DeadlineApiListDeadlinesRequest; + + try { + const data = await api.deadlineApiListDeadlines(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------------ | --------- | ----------- | ------------------------------------ | +| **deadlineListId** | `string` | | [Optional] [Defaults to `undefined`] | +| **completed** | `boolean` | | [Optional] [Defaults to `undefined`] | +| **assignedToId** | `string` | | [Optional] [Defaults to `undefined`] | +| **page** | `number` | | [Optional] [Defaults to `1`] | +| **pageSize** | `number` | | [Optional] [Defaults to `undefined`] | + +### Return type + +[**PagedDeadlineSchema**](PagedDeadlineSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiToggleDeadlineComplete + +> DeadlineSchema deadlineApiToggleDeadlineComplete(deadlineId) + +Toggle Deadline Complete + +Toggle the completion status of a deadline + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiToggleDeadlineCompleteRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // string + deadlineId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + } satisfies DeadlineApiToggleDeadlineCompleteRequest; + + try { + const data = await api.deadlineApiToggleDeadlineComplete(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------- | -------- | ----------- | ------------------------- | +| **deadlineId** | `string` | | [Defaults to `undefined`] | + +### Return type + +[**DeadlineSchema**](DeadlineSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiUpdateDeadline + +> DeadlineSchema deadlineApiUpdateDeadline(deadlineId, deadlineUpdateSchema) + +Update Deadline + +Update a deadline + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiUpdateDeadlineRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // string + deadlineId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + // DeadlineUpdateSchema + deadlineUpdateSchema: ..., + } satisfies DeadlineApiUpdateDeadlineRequest; + + try { + const data = await api.deadlineApiUpdateDeadline(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------------------ | ----------------------------------------------- | ----------- | ------------------------- | +| **deadlineId** | `string` | | [Defaults to `undefined`] | +| **deadlineUpdateSchema** | [DeadlineUpdateSchema](DeadlineUpdateSchema.md) | | | + +### Return type + +[**DeadlineSchema**](DeadlineSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deadlineApiUpdateDeadlineList + +> DeadlineListSchema deadlineApiUpdateDeadlineList(listId, deadlineListUpdateSchema) + +Update Deadline List + +Update a deadline list + +### Example + +```ts +import { + Configuration, + DeadlinesApi, +} from ''; +import type { DeadlineApiUpdateDeadlineListRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DeadlinesApi(); + + const body = { + // string + listId: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + // DeadlineListUpdateSchema + deadlineListUpdateSchema: ..., + } satisfies DeadlineApiUpdateDeadlineListRequest; + + try { + const data = await api.deadlineApiUpdateDeadlineList(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------------------- | ------------------------------------------------------- | ----------- | ------------------------- | +| **listId** | `string` | | [Defaults to `undefined`] | +| **deadlineListUpdateSchema** | [DeadlineListUpdateSchema](DeadlineListUpdateSchema.md) | | | + +### Return type + +[**DeadlineListSchema**](DeadlineListSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------- | ---------------- | +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/PagedDeadlineListSchema.md b/frontend/api-client/docs/PagedDeadlineListSchema.md new file mode 100644 index 0000000..ecd9163 --- /dev/null +++ b/frontend/api-client/docs/PagedDeadlineListSchema.md @@ -0,0 +1,32 @@ +# PagedDeadlineListSchema + +## Properties + +| Name | Type | +| ------- | -------------------------------------------------------- | +| `items` | [Array<DeadlineListSchema>](DeadlineListSchema.md) | +| `count` | number | + +## Example + +```typescript +import type { PagedDeadlineListSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + items: null, + count: null, +} satisfies PagedDeadlineListSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as PagedDeadlineListSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/docs/PagedDeadlineSchema.md b/frontend/api-client/docs/PagedDeadlineSchema.md new file mode 100644 index 0000000..6776545 --- /dev/null +++ b/frontend/api-client/docs/PagedDeadlineSchema.md @@ -0,0 +1,32 @@ +# PagedDeadlineSchema + +## Properties + +| Name | Type | +| ------- | ------------------------------------------------ | +| `items` | [Array<DeadlineSchema>](DeadlineSchema.md) | +| `count` | number | + +## Example + +```typescript +import type { PagedDeadlineSchema } from ""; + +// TODO: Update the object below with actual values +const example = { + items: null, + count: null, +} satisfies PagedDeadlineSchema; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as PagedDeadlineSchema; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/frontend/api-client/models/DeadlineCreateSchema.ts b/frontend/api-client/models/DeadlineCreateSchema.ts new file mode 100644 index 0000000..65770b5 --- /dev/null +++ b/frontend/api-client/models/DeadlineCreateSchema.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; + +/** + * + * @export + * @interface DeadlineCreateSchema + */ +export interface DeadlineCreateSchema { + /** + * + * @type {string} + * @memberof DeadlineCreateSchema + */ + name: string; + /** + * + * @type {string} + * @memberof DeadlineCreateSchema + */ + description?: string | null; + /** + * + * @type {string} + * @memberof DeadlineCreateSchema + */ + deadlineListId?: string | null; + /** + * + * @type {Date} + * @memberof DeadlineCreateSchema + */ + dueDate?: Date | null; + /** + * + * @type {string} + * @memberof DeadlineCreateSchema + */ + assignedToId?: string | null; + /** + * + * @type {boolean} + * @memberof DeadlineCreateSchema + */ + completed?: boolean | null; + /** + * + * @type {string} + * @memberof DeadlineCreateSchema + */ + completedNote?: string | null; +} + +/** + * Check if a given object implements the DeadlineCreateSchema interface. + */ +export function instanceOfDeadlineCreateSchema(value: object): value is DeadlineCreateSchema { + if (!("name" in value) || value["name"] === undefined) return false; + return true; +} + +export function DeadlineCreateSchemaFromJSON(json: any): DeadlineCreateSchema { + return DeadlineCreateSchemaFromJSONTyped(json, false); +} + +export function DeadlineCreateSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeadlineCreateSchema { + if (json == null) { + return json; + } + return { + name: json["name"], + description: json["description"] == null ? undefined : json["description"], + deadlineListId: json["deadline_list_id"] == null ? undefined : json["deadline_list_id"], + dueDate: json["due_date"] == null ? undefined : new Date(json["due_date"]), + assignedToId: json["assigned_to_id"] == null ? undefined : json["assigned_to_id"], + completed: json["completed"] == null ? undefined : json["completed"], + completedNote: json["completed_note"] == null ? undefined : json["completed_note"], + }; +} + +export function DeadlineCreateSchemaToJSON(json: any): DeadlineCreateSchema { + return DeadlineCreateSchemaToJSONTyped(json, false); +} + +export function DeadlineCreateSchemaToJSONTyped( + value?: DeadlineCreateSchema | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + name: value["name"], + description: value["description"], + deadline_list_id: value["deadlineListId"], + due_date: value["dueDate"] == null ? value["dueDate"] : value["dueDate"].toISOString().substring(0, 10), + assigned_to_id: value["assignedToId"], + completed: value["completed"], + completed_note: value["completedNote"], + }; +} diff --git a/frontend/api-client/models/DeadlineFilterSchema.ts b/frontend/api-client/models/DeadlineFilterSchema.ts new file mode 100644 index 0000000..4a3d24f --- /dev/null +++ b/frontend/api-client/models/DeadlineFilterSchema.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; + +/** + * + * @export + * @interface DeadlineFilterSchema + */ +export interface DeadlineFilterSchema { + /** + * + * @type {string} + * @memberof DeadlineFilterSchema + */ + deadlineListId?: string | null; + /** + * + * @type {boolean} + * @memberof DeadlineFilterSchema + */ + completed?: boolean | null; + /** + * + * @type {string} + * @memberof DeadlineFilterSchema + */ + assignedToId?: string | null; +} + +/** + * Check if a given object implements the DeadlineFilterSchema interface. + */ +export function instanceOfDeadlineFilterSchema(value: object): value is DeadlineFilterSchema { + return true; +} + +export function DeadlineFilterSchemaFromJSON(json: any): DeadlineFilterSchema { + return DeadlineFilterSchemaFromJSONTyped(json, false); +} + +export function DeadlineFilterSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeadlineFilterSchema { + if (json == null) { + return json; + } + return { + deadlineListId: json["deadline_list_id"] == null ? undefined : json["deadline_list_id"], + completed: json["completed"] == null ? undefined : json["completed"], + assignedToId: json["assigned_to_id"] == null ? undefined : json["assigned_to_id"], + }; +} + +export function DeadlineFilterSchemaToJSON(json: any): DeadlineFilterSchema { + return DeadlineFilterSchemaToJSONTyped(json, false); +} + +export function DeadlineFilterSchemaToJSONTyped( + value?: DeadlineFilterSchema | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + deadline_list_id: value["deadlineListId"], + completed: value["completed"], + assigned_to_id: value["assignedToId"], + }; +} diff --git a/frontend/api-client/models/DeadlineListCreateSchema.ts b/frontend/api-client/models/DeadlineListCreateSchema.ts new file mode 100644 index 0000000..603547f --- /dev/null +++ b/frontend/api-client/models/DeadlineListCreateSchema.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; + +/** + * + * @export + * @interface DeadlineListCreateSchema + */ +export interface DeadlineListCreateSchema { + /** + * + * @type {string} + * @memberof DeadlineListCreateSchema + */ + name: string; +} + +/** + * Check if a given object implements the DeadlineListCreateSchema interface. + */ +export function instanceOfDeadlineListCreateSchema(value: object): value is DeadlineListCreateSchema { + if (!("name" in value) || value["name"] === undefined) return false; + return true; +} + +export function DeadlineListCreateSchemaFromJSON(json: any): DeadlineListCreateSchema { + return DeadlineListCreateSchemaFromJSONTyped(json, false); +} + +export function DeadlineListCreateSchemaFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DeadlineListCreateSchema { + if (json == null) { + return json; + } + return { + name: json["name"], + }; +} + +export function DeadlineListCreateSchemaToJSON(json: any): DeadlineListCreateSchema { + return DeadlineListCreateSchemaToJSONTyped(json, false); +} + +export function DeadlineListCreateSchemaToJSONTyped( + value?: DeadlineListCreateSchema | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + name: value["name"], + }; +} diff --git a/frontend/api-client/models/DeadlineListSchema.ts b/frontend/api-client/models/DeadlineListSchema.ts new file mode 100644 index 0000000..8fa7548 --- /dev/null +++ b/frontend/api-client/models/DeadlineListSchema.ts @@ -0,0 +1,169 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; + +/** + * + * @export + * @interface DeadlineListSchema + */ +export interface DeadlineListSchema { + /** + * + * @type {string} + * @memberof DeadlineListSchema + */ + id: string; + /** + * + * @type {string} + * @memberof DeadlineListSchema + */ + name: string; + /** + * + * @type {string} + * @memberof DeadlineListSchema + */ + slug?: string | null; + /** + * + * @type {number} + * @memberof DeadlineListSchema + */ + count: number; + /** + * + * @type {number} + * @memberof DeadlineListSchema + */ + completedCount: number; + /** + * + * @type {number} + * @memberof DeadlineListSchema + */ + pendingCount: number; + /** + * + * @type {number} + * @memberof DeadlineListSchema + */ + completionPercentage: number; + /** + * + * @type {string} + * @memberof DeadlineListSchema + */ + createdById?: string | null; + /** + * + * @type {string} + * @memberof DeadlineListSchema + */ + createdByName?: string | null; + /** + * + * @type {string} + * @memberof DeadlineListSchema + */ + updatedById?: string | null; + /** + * + * @type {string} + * @memberof DeadlineListSchema + */ + updatedByName?: string | null; + /** + * + * @type {Date} + * @memberof DeadlineListSchema + */ + createdAt: Date; + /** + * + * @type {Date} + * @memberof DeadlineListSchema + */ + updatedAt: Date; +} + +/** + * Check if a given object implements the DeadlineListSchema interface. + */ +export function instanceOfDeadlineListSchema(value: object): value is DeadlineListSchema { + if (!("id" in value) || value["id"] === undefined) return false; + if (!("name" in value) || value["name"] === undefined) return false; + if (!("count" in value) || value["count"] === undefined) return false; + if (!("completedCount" in value) || value["completedCount"] === undefined) return false; + if (!("pendingCount" in value) || value["pendingCount"] === undefined) return false; + if (!("completionPercentage" in value) || value["completionPercentage"] === undefined) return false; + if (!("createdAt" in value) || value["createdAt"] === undefined) return false; + if (!("updatedAt" in value) || value["updatedAt"] === undefined) return false; + return true; +} + +export function DeadlineListSchemaFromJSON(json: any): DeadlineListSchema { + return DeadlineListSchemaFromJSONTyped(json, false); +} + +export function DeadlineListSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeadlineListSchema { + if (json == null) { + return json; + } + return { + id: json["id"], + name: json["name"], + slug: json["slug"] == null ? undefined : json["slug"], + count: json["count"], + completedCount: json["completed_count"], + pendingCount: json["pending_count"], + completionPercentage: json["completion_percentage"], + createdById: json["created_by_id"] == null ? undefined : json["created_by_id"], + createdByName: json["created_by_name"] == null ? undefined : json["created_by_name"], + updatedById: json["updated_by_id"] == null ? undefined : json["updated_by_id"], + updatedByName: json["updated_by_name"] == null ? undefined : json["updated_by_name"], + createdAt: new Date(json["created_at"]), + updatedAt: new Date(json["updated_at"]), + }; +} + +export function DeadlineListSchemaToJSON(json: any): DeadlineListSchema { + return DeadlineListSchemaToJSONTyped(json, false); +} + +export function DeadlineListSchemaToJSONTyped( + value?: DeadlineListSchema | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + id: value["id"], + name: value["name"], + slug: value["slug"], + count: value["count"], + completed_count: value["completedCount"], + pending_count: value["pendingCount"], + completion_percentage: value["completionPercentage"], + created_by_id: value["createdById"], + created_by_name: value["createdByName"], + updated_by_id: value["updatedById"], + updated_by_name: value["updatedByName"], + created_at: value["createdAt"].toISOString(), + updated_at: value["updatedAt"].toISOString(), + }; +} diff --git a/frontend/api-client/models/DeadlineListUpdateSchema.ts b/frontend/api-client/models/DeadlineListUpdateSchema.ts new file mode 100644 index 0000000..16953ff --- /dev/null +++ b/frontend/api-client/models/DeadlineListUpdateSchema.ts @@ -0,0 +1,68 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; + +/** + * + * @export + * @interface DeadlineListUpdateSchema + */ +export interface DeadlineListUpdateSchema { + /** + * + * @type {string} + * @memberof DeadlineListUpdateSchema + */ + name?: string | null; +} + +/** + * Check if a given object implements the DeadlineListUpdateSchema interface. + */ +export function instanceOfDeadlineListUpdateSchema(value: object): value is DeadlineListUpdateSchema { + return true; +} + +export function DeadlineListUpdateSchemaFromJSON(json: any): DeadlineListUpdateSchema { + return DeadlineListUpdateSchemaFromJSONTyped(json, false); +} + +export function DeadlineListUpdateSchemaFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DeadlineListUpdateSchema { + if (json == null) { + return json; + } + return { + name: json["name"] == null ? undefined : json["name"], + }; +} + +export function DeadlineListUpdateSchemaToJSON(json: any): DeadlineListUpdateSchema { + return DeadlineListUpdateSchemaToJSONTyped(json, false); +} + +export function DeadlineListUpdateSchemaToJSONTyped( + value?: DeadlineListUpdateSchema | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + name: value["name"], + }; +} diff --git a/frontend/api-client/models/DeadlineSchema.ts b/frontend/api-client/models/DeadlineSchema.ts new file mode 100644 index 0000000..985d910 --- /dev/null +++ b/frontend/api-client/models/DeadlineSchema.ts @@ -0,0 +1,212 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; + +/** + * + * @export + * @interface DeadlineSchema + */ +export interface DeadlineSchema { + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + id: string; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + name: string; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + slug?: string | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + description?: string | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + deadlineListId?: string | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + deadlineListName?: string | null; + /** + * + * @type {Date} + * @memberof DeadlineSchema + */ + dueDate?: Date | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + assignedToId?: string | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + assignedToName?: string | null; + /** + * + * @type {boolean} + * @memberof DeadlineSchema + */ + completed: boolean; + /** + * + * @type {Date} + * @memberof DeadlineSchema + */ + completedAt?: Date | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + completedNote?: string | null; + /** + * + * @type {boolean} + * @memberof DeadlineSchema + */ + overdue: boolean; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + createdById?: string | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + createdByName?: string | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + updatedById?: string | null; + /** + * + * @type {string} + * @memberof DeadlineSchema + */ + updatedByName?: string | null; + /** + * + * @type {Date} + * @memberof DeadlineSchema + */ + createdAt: Date; + /** + * + * @type {Date} + * @memberof DeadlineSchema + */ + updatedAt: Date; +} + +/** + * Check if a given object implements the DeadlineSchema interface. + */ +export function instanceOfDeadlineSchema(value: object): value is DeadlineSchema { + if (!("id" in value) || value["id"] === undefined) return false; + if (!("name" in value) || value["name"] === undefined) return false; + if (!("completed" in value) || value["completed"] === undefined) return false; + if (!("overdue" in value) || value["overdue"] === undefined) return false; + if (!("createdAt" in value) || value["createdAt"] === undefined) return false; + if (!("updatedAt" in value) || value["updatedAt"] === undefined) return false; + return true; +} + +export function DeadlineSchemaFromJSON(json: any): DeadlineSchema { + return DeadlineSchemaFromJSONTyped(json, false); +} + +export function DeadlineSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeadlineSchema { + if (json == null) { + return json; + } + return { + id: json["id"], + name: json["name"], + slug: json["slug"] == null ? undefined : json["slug"], + description: json["description"] == null ? undefined : json["description"], + deadlineListId: json["deadline_list_id"] == null ? undefined : json["deadline_list_id"], + deadlineListName: json["deadline_list_name"] == null ? undefined : json["deadline_list_name"], + dueDate: json["due_date"] == null ? undefined : new Date(json["due_date"]), + assignedToId: json["assigned_to_id"] == null ? undefined : json["assigned_to_id"], + assignedToName: json["assigned_to_name"] == null ? undefined : json["assigned_to_name"], + completed: json["completed"], + completedAt: json["completed_at"] == null ? undefined : new Date(json["completed_at"]), + completedNote: json["completed_note"] == null ? undefined : json["completed_note"], + overdue: json["overdue"], + createdById: json["created_by_id"] == null ? undefined : json["created_by_id"], + createdByName: json["created_by_name"] == null ? undefined : json["created_by_name"], + updatedById: json["updated_by_id"] == null ? undefined : json["updated_by_id"], + updatedByName: json["updated_by_name"] == null ? undefined : json["updated_by_name"], + createdAt: new Date(json["created_at"]), + updatedAt: new Date(json["updated_at"]), + }; +} + +export function DeadlineSchemaToJSON(json: any): DeadlineSchema { + return DeadlineSchemaToJSONTyped(json, false); +} + +export function DeadlineSchemaToJSONTyped(value?: DeadlineSchema | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + id: value["id"], + name: value["name"], + slug: value["slug"], + description: value["description"], + deadline_list_id: value["deadlineListId"], + deadline_list_name: value["deadlineListName"], + due_date: value["dueDate"] == null ? value["dueDate"] : value["dueDate"].toISOString().substring(0, 10), + assigned_to_id: value["assignedToId"], + assigned_to_name: value["assignedToName"], + completed: value["completed"], + completed_at: value["completedAt"] == null ? value["completedAt"] : value["completedAt"].toISOString(), + completed_note: value["completedNote"], + overdue: value["overdue"], + created_by_id: value["createdById"], + created_by_name: value["createdByName"], + updated_by_id: value["updatedById"], + updated_by_name: value["updatedByName"], + created_at: value["createdAt"].toISOString(), + updated_at: value["updatedAt"].toISOString(), + }; +} diff --git a/frontend/api-client/models/DeadlineUpdateSchema.ts b/frontend/api-client/models/DeadlineUpdateSchema.ts new file mode 100644 index 0000000..e06454d --- /dev/null +++ b/frontend/api-client/models/DeadlineUpdateSchema.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; + +/** + * + * @export + * @interface DeadlineUpdateSchema + */ +export interface DeadlineUpdateSchema { + /** + * + * @type {string} + * @memberof DeadlineUpdateSchema + */ + name?: string | null; + /** + * + * @type {string} + * @memberof DeadlineUpdateSchema + */ + description?: string | null; + /** + * + * @type {string} + * @memberof DeadlineUpdateSchema + */ + deadlineListId?: string | null; + /** + * + * @type {Date} + * @memberof DeadlineUpdateSchema + */ + dueDate?: Date | null; + /** + * + * @type {string} + * @memberof DeadlineUpdateSchema + */ + assignedToId?: string | null; + /** + * + * @type {boolean} + * @memberof DeadlineUpdateSchema + */ + completed?: boolean | null; + /** + * + * @type {string} + * @memberof DeadlineUpdateSchema + */ + completedNote?: string | null; +} + +/** + * Check if a given object implements the DeadlineUpdateSchema interface. + */ +export function instanceOfDeadlineUpdateSchema(value: object): value is DeadlineUpdateSchema { + return true; +} + +export function DeadlineUpdateSchemaFromJSON(json: any): DeadlineUpdateSchema { + return DeadlineUpdateSchemaFromJSONTyped(json, false); +} + +export function DeadlineUpdateSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeadlineUpdateSchema { + if (json == null) { + return json; + } + return { + name: json["name"] == null ? undefined : json["name"], + description: json["description"] == null ? undefined : json["description"], + deadlineListId: json["deadline_list_id"] == null ? undefined : json["deadline_list_id"], + dueDate: json["due_date"] == null ? undefined : new Date(json["due_date"]), + assignedToId: json["assigned_to_id"] == null ? undefined : json["assigned_to_id"], + completed: json["completed"] == null ? undefined : json["completed"], + completedNote: json["completed_note"] == null ? undefined : json["completed_note"], + }; +} + +export function DeadlineUpdateSchemaToJSON(json: any): DeadlineUpdateSchema { + return DeadlineUpdateSchemaToJSONTyped(json, false); +} + +export function DeadlineUpdateSchemaToJSONTyped( + value?: DeadlineUpdateSchema | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + name: value["name"], + description: value["description"], + deadline_list_id: value["deadlineListId"], + due_date: value["dueDate"] == null ? value["dueDate"] : value["dueDate"].toISOString().substring(0, 10), + assigned_to_id: value["assignedToId"], + completed: value["completed"], + completed_note: value["completedNote"], + }; +} diff --git a/frontend/api-client/models/PagedDeadlineListSchema.ts b/frontend/api-client/models/PagedDeadlineListSchema.ts new file mode 100644 index 0000000..9998a37 --- /dev/null +++ b/frontend/api-client/models/PagedDeadlineListSchema.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; +import type { DeadlineListSchema } from "./DeadlineListSchema"; +import { + DeadlineListSchemaFromJSON, + DeadlineListSchemaFromJSONTyped, + DeadlineListSchemaToJSON, + DeadlineListSchemaToJSONTyped, +} from "./DeadlineListSchema"; + +/** + * + * @export + * @interface PagedDeadlineListSchema + */ +export interface PagedDeadlineListSchema { + /** + * + * @type {Array} + * @memberof PagedDeadlineListSchema + */ + items: Array; + /** + * + * @type {number} + * @memberof PagedDeadlineListSchema + */ + count: number; +} + +/** + * Check if a given object implements the PagedDeadlineListSchema interface. + */ +export function instanceOfPagedDeadlineListSchema(value: object): value is PagedDeadlineListSchema { + if (!("items" in value) || value["items"] === undefined) return false; + if (!("count" in value) || value["count"] === undefined) return false; + return true; +} + +export function PagedDeadlineListSchemaFromJSON(json: any): PagedDeadlineListSchema { + return PagedDeadlineListSchemaFromJSONTyped(json, false); +} + +export function PagedDeadlineListSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): PagedDeadlineListSchema { + if (json == null) { + return json; + } + return { + items: (json["items"] as Array).map(DeadlineListSchemaFromJSON), + count: json["count"], + }; +} + +export function PagedDeadlineListSchemaToJSON(json: any): PagedDeadlineListSchema { + return PagedDeadlineListSchemaToJSONTyped(json, false); +} + +export function PagedDeadlineListSchemaToJSONTyped( + value?: PagedDeadlineListSchema | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + items: (value["items"] as Array).map(DeadlineListSchemaToJSON), + count: value["count"], + }; +} diff --git a/frontend/api-client/models/PagedDeadlineSchema.ts b/frontend/api-client/models/PagedDeadlineSchema.ts new file mode 100644 index 0000000..d66d4f7 --- /dev/null +++ b/frontend/api-client/models/PagedDeadlineSchema.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NinjaAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { mapValues } from "../runtime"; +import type { DeadlineSchema } from "./DeadlineSchema"; +import { + DeadlineSchemaFromJSON, + DeadlineSchemaFromJSONTyped, + DeadlineSchemaToJSON, + DeadlineSchemaToJSONTyped, +} from "./DeadlineSchema"; + +/** + * + * @export + * @interface PagedDeadlineSchema + */ +export interface PagedDeadlineSchema { + /** + * + * @type {Array} + * @memberof PagedDeadlineSchema + */ + items: Array; + /** + * + * @type {number} + * @memberof PagedDeadlineSchema + */ + count: number; +} + +/** + * Check if a given object implements the PagedDeadlineSchema interface. + */ +export function instanceOfPagedDeadlineSchema(value: object): value is PagedDeadlineSchema { + if (!("items" in value) || value["items"] === undefined) return false; + if (!("count" in value) || value["count"] === undefined) return false; + return true; +} + +export function PagedDeadlineSchemaFromJSON(json: any): PagedDeadlineSchema { + return PagedDeadlineSchemaFromJSONTyped(json, false); +} + +export function PagedDeadlineSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): PagedDeadlineSchema { + if (json == null) { + return json; + } + return { + items: (json["items"] as Array).map(DeadlineSchemaFromJSON), + count: json["count"], + }; +} + +export function PagedDeadlineSchemaToJSON(json: any): PagedDeadlineSchema { + return PagedDeadlineSchemaToJSONTyped(json, false); +} + +export function PagedDeadlineSchemaToJSONTyped( + value?: PagedDeadlineSchema | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + items: (value["items"] as Array).map(DeadlineSchemaToJSON), + count: value["count"], + }; +} diff --git a/frontend/api-client/models/index.ts b/frontend/api-client/models/index.ts index 924cc0b..34368b8 100644 --- a/frontend/api-client/models/index.ts +++ b/frontend/api-client/models/index.ts @@ -1,6 +1,13 @@ /* tslint:disable */ /* eslint-disable */ export * from "./CategoryContentSchema"; +export * from "./DeadlineCreateSchema"; +export * from "./DeadlineFilterSchema"; +export * from "./DeadlineListCreateSchema"; +export * from "./DeadlineListSchema"; +export * from "./DeadlineListUpdateSchema"; +export * from "./DeadlineSchema"; +export * from "./DeadlineUpdateSchema"; export * from "./GuestCreateSchema"; export * from "./GuestGroupCreateSchema"; export * from "./GuestGroupFilterSchema"; @@ -9,6 +16,8 @@ export * from "./GuestGroupUpdateSchema"; export * from "./GuestSchema"; export * from "./GuestUpdateSchema"; export * from "./Input"; +export * from "./PagedDeadlineListSchema"; +export * from "./PagedDeadlineSchema"; export * from "./PagedGuestGroupSchema"; export * from "./PagedGuestSchema"; export * from "./PagedQuestionSchema"; diff --git a/frontend/src/lib/components/BackToTop.svelte b/frontend/src/lib/components/BackToTop.svelte index 9bf599b..2e71d47 100644 --- a/frontend/src/lib/components/BackToTop.svelte +++ b/frontend/src/lib/components/BackToTop.svelte @@ -25,6 +25,6 @@ data-show={$show} on:click={toTop} data-tip="Back to top" - class="btn tooltip btn-circle translate-y-4 scale-90 opacity-0 transition-all duration-300 data-[show=true]:translate-y-0 data-[show=true]:scale-100 data-[show=true]:opacity-100"> + class="btn bg-accent tooltip tooltip-accent btn-circle translate-y-4 scale-90 opacity-0 transition-all duration-300 data-[show=true]:translate-y-0 data-[show=true]:scale-100 data-[show=true]:opacity-100"> diff --git a/frontend/src/lib/components/Faq.svelte b/frontend/src/lib/components/Faq.svelte index 221bb01..0fcc654 100644 --- a/frontend/src/lib/components/Faq.svelte +++ b/frontend/src/lib/components/Faq.svelte @@ -33,17 +33,17 @@
-
+

{cat.categoryName}

-
+
{#each cat.questions as question (question.id)}
- + class="collapse collapse-arrow bg-secondary text-secondary-content border border-base-300 shadow-md hover:shadow-lg transition-shadow"> +
diff --git a/frontend/src/lib/components/buttons/CreateObject.svelte b/frontend/src/lib/components/buttons/CreateObject.svelte new file mode 100644 index 0000000..0940fa1 --- /dev/null +++ b/frontend/src/lib/components/buttons/CreateObject.svelte @@ -0,0 +1,13 @@ + + + diff --git a/frontend/src/lib/components/layouts/Breadcrumbs.svelte b/frontend/src/lib/components/layouts/Breadcrumbs.svelte new file mode 100644 index 0000000..84066f6 --- /dev/null +++ b/frontend/src/lib/components/layouts/Breadcrumbs.svelte @@ -0,0 +1,28 @@ + + + diff --git a/frontend/src/lib/components/layouts/ProtectedPageShell.svelte b/frontend/src/lib/components/layouts/ProtectedPageShell.svelte index 40cf42b..e025330 100644 --- a/frontend/src/lib/components/layouts/ProtectedPageShell.svelte +++ b/frontend/src/lib/components/layouts/ProtectedPageShell.svelte @@ -1,11 +1,26 @@
+
diff --git a/frontend/src/lib/components/layouts/Topbar.svelte b/frontend/src/lib/components/layouts/Topbar.svelte index b0e3152..81a4dae 100644 --- a/frontend/src/lib/components/layouts/Topbar.svelte +++ b/frontend/src/lib/components/layouts/Topbar.svelte @@ -35,6 +35,7 @@ const protectedMenu: IMenuItem[] = [ { title: "FAQ", href: "/settings/faq", icon: "icon-[lucide--help-circle]" }, + { title: "Deadlines", href: "/settings/deadline", icon: "icon-[lucide--calendar-check]" }, { title: "Settings", href: "/settings/config", @@ -86,10 +87,10 @@ title: "Lists", href: "/lists/", }, - { - title: "Deadlines", - href: "/deadline/", - }, + // { + // title: "Deadlines", + // href: "/deadline/", + // }, { title: "Budget", href: "/expenses/", diff --git a/frontend/src/lib/components/object/ObjectChildItems.svelte b/frontend/src/lib/components/object/ObjectChildItems.svelte new file mode 100644 index 0000000..f7342b2 --- /dev/null +++ b/frontend/src/lib/components/object/ObjectChildItems.svelte @@ -0,0 +1,31 @@ + + +
+
+

+ + + + {title} +

+ {@render children()} +
+
diff --git a/frontend/src/lib/components/object/ObjectDetail.svelte b/frontend/src/lib/components/object/ObjectDetail.svelte new file mode 100644 index 0000000..9073b88 --- /dev/null +++ b/frontend/src/lib/components/object/ObjectDetail.svelte @@ -0,0 +1,103 @@ + + + +
+
+

{title}

+ +
+
+ Edit + {#if deleteAction} +
{ + if (!confirm("Are you sure you want to delete this item? This action cannot be undone.")) { + e.preventDefault(); + } + }}> + {#if deleteRedirect} + + {/if} + +
+ {/if} +
+
+
+
+
+
Item Details
+ {@render mainSnippet()} +
+ {#if mainActionsSnippet} +
{@render mainActionsSnippet()}
+ {/if} +
+
+
+
Record Information
+
+
+
Created By
+
{object.createdByName}
+
+
+
Created At
+
{object.createdAt}
+
+
+
Last Updated By
+
{object.updatedByName}
+
+
+
Last Updated At
+
{object.updatedAt}
+
+
+
+
+ + {#if extraCardsSnippet} + {@render extraCardsSnippet()} + {/if} +
+
diff --git a/frontend/src/lib/components/object/ObjectStatus.svelte b/frontend/src/lib/components/object/ObjectStatus.svelte new file mode 100644 index 0000000..0a266bd --- /dev/null +++ b/frontend/src/lib/components/object/ObjectStatus.svelte @@ -0,0 +1,14 @@ + + +{#if status} +
✓ {text}
+{:else} +
⏳ {text}
+{/if} diff --git a/frontend/src/lib/components/rsvp/RsvpAccept.svelte b/frontend/src/lib/components/rsvp/RsvpAccept.svelte index c7bb20e..6247c0f 100644 --- a/frontend/src/lib/components/rsvp/RsvpAccept.svelte +++ b/frontend/src/lib/components/rsvp/RsvpAccept.svelte @@ -252,13 +252,13 @@
{#if preview}
Back
-
+
Submit RSVP
{:else} Back - + + + Next + + +
+
+ {/if} + {/if} + diff --git a/frontend/src/routes/settings/deadline/deadline/[id]/+page.server.ts b/frontend/src/routes/settings/deadline/deadline/[id]/+page.server.ts new file mode 100644 index 0000000..d8f590a --- /dev/null +++ b/frontend/src/routes/settings/deadline/deadline/[id]/+page.server.ts @@ -0,0 +1,54 @@ +import { api } from "$lib/server/api-client"; +import { error, fail, redirect } from "@sveltejs/kit"; +import type { Actions, PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async ({ params }) => { + try { + const deadline = await api.deadlines.deadlineApiGetDeadline({ + deadlineId: params.id, + }); + + return { + deadline, + }; + } catch (err) { + console.error("Error loading deadline:", err); + throw error(404, "Deadline not found"); + } +}; + +export const actions = { + toggleComplete: async ({ params }) => { + try { + await api.deadlines.deadlineApiToggleDeadlineComplete({ + deadlineId: params.id, + }); + } catch (err) { + console.error("Failed to toggle deadline completion:", err); + return fail(500, { error: "Failed to toggle completion status" }); + } + + return { success: true }; + }, + delete: async ({ params }) => { + let deadline; + try { + deadline = await api.deadlines.deadlineApiGetDeadline({ + deadlineId: params.id, + }); + + await api.deadlines.deadlineApiDeleteDeadline({ + deadlineId: params.id, + }); + } catch (err) { + console.error("Failed to delete deadline:", err); + return fail(500, { error: "Failed to delete deadline" }); + } + + const redirectPath = deadline.deadlineListId + ? `/settings/deadline/list/${deadline.deadlineListId}` + : "/settings/deadline"; + + throw redirect(303, redirectPath); + }, +} satisfies Actions; diff --git a/frontend/src/routes/settings/deadline/deadline/[id]/+page.svelte b/frontend/src/routes/settings/deadline/deadline/[id]/+page.svelte new file mode 100644 index 0000000..78f4c23 --- /dev/null +++ b/frontend/src/routes/settings/deadline/deadline/[id]/+page.svelte @@ -0,0 +1,122 @@ + + + + {#snippet mainSnippet()} +
+ {#if data.deadline.description} +
+
Description
+
{data.deadline.description}
+
+ {/if} + +
+
+
Due Date
+
+ {formatDate(data.deadline.dueDate)} + {#if data.deadline.overdue && !data.deadline.completed} + Overdue + {/if} +
+
+ +
+
Status
+
+ {#if data.deadline.completed} + + + Completed + + {:else} + + + Pending + + {/if} +
+
+
+ + {#if data.deadline.assignedToName} +
+
Assigned To
+
+ + {data.deadline.assignedToName} +
+
+ {/if} + + {#if data.deadline.completed && data.deadline.completedNote} +
+
Completion Note
+
{data.deadline.completedNote}
+
+ {/if} +
+ {/snippet} + + {#snippet mainActionsSnippet()} +
+ +
+ + + Edit + + {/snippet} +
diff --git a/frontend/src/routes/settings/deadline/deadline/[id]/edit/+page.server.ts b/frontend/src/routes/settings/deadline/deadline/[id]/edit/+page.server.ts new file mode 100644 index 0000000..3be7a6a --- /dev/null +++ b/frontend/src/routes/settings/deadline/deadline/[id]/edit/+page.server.ts @@ -0,0 +1,58 @@ +import { api } from "$lib/server/api-client"; +import { fail, redirect } from "@sveltejs/kit"; +import { error } from "@sveltejs/kit"; +import type { Actions, PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async ({ params }) => { + const deadlineId = params.id; + + try { + const deadline = await api.deadlines.deadlineApiGetDeadline({ deadlineId }); + + return { + deadline, + }; + } catch (err) { + console.error("Failed to load deadline:", err); + throw error(404, "Deadline not found"); + } +}; + +export const actions = { + default: async ({ request, params }) => { + const deadlineId = params.id; + const formData = await request.formData(); + const name = formData.get("name"); + const description = formData.get("description"); + const dueDate = formData.get("dueDate"); + const completed = formData.get("completed") === "on"; + const completedNote = formData.get("completedNote"); + + if (!name || typeof name !== "string") { + return fail(400, { error: "Deadline name is required" }); + } + + let updatedDeadline; + try { + updatedDeadline = await api.deadlines.deadlineApiUpdateDeadline({ + deadlineId, + deadlineUpdateSchema: { + name, + description: description && typeof description === "string" ? description : undefined, + dueDate: dueDate && typeof dueDate === "string" ? new Date(dueDate) : undefined, + completed, + completedNote: completedNote && typeof completedNote === "string" ? completedNote : undefined, + }, + }); + } catch (err) { + console.error("Failed to update deadline:", err); + return fail(500, { error: "Failed to update deadline" }); + } + + const redirectPath = updatedDeadline.deadlineListId + ? `/settings/deadline/list/${updatedDeadline.deadlineListId}` + : "/settings/deadline"; + + throw redirect(303, redirectPath); + }, +} satisfies Actions; diff --git a/frontend/src/routes/settings/deadline/deadline/[id]/edit/+page.svelte b/frontend/src/routes/settings/deadline/deadline/[id]/edit/+page.svelte new file mode 100644 index 0000000..33e7d6a --- /dev/null +++ b/frontend/src/routes/settings/deadline/deadline/[id]/edit/+page.svelte @@ -0,0 +1,142 @@ + + + +
+
+

Edit Deadline

+ Cancel +
+ + {#if form?.error} +
+ + + + {form.error} +
+ {/if} + +
+
+
+
+
+ + +
+ +
+ + +
+ +
+ + + {#if data.deadline.overdue && !data.deadline.completed} + This deadline is overdue + {/if} +
+ +
+ + + {#if data.deadline.completedAt} + + Completed on {new Date(data.deadline.completedAt).toLocaleDateString()} + + {/if} +
+ +
+ + +
+
+
+
+ +
+ Cancel + +
+
+
+
diff --git a/frontend/src/routes/settings/deadline/list/[id]/+page.server.ts b/frontend/src/routes/settings/deadline/list/[id]/+page.server.ts new file mode 100644 index 0000000..3c80e64 --- /dev/null +++ b/frontend/src/routes/settings/deadline/list/[id]/+page.server.ts @@ -0,0 +1,22 @@ +import { api } from "$lib/server/api-client"; +import { error } from "@sveltejs/kit"; +import type { PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async ({ params }) => { + const listId = params.id; + + try { + const [deadlineList, deadlines] = await Promise.all([ + api.deadlines.deadlineApiGetDeadlineList({ listId }), + api.deadlines.deadlineApiListDeadlines({ deadlineListId: listId }), + ]); + + return { + deadlineList, + deadlines: deadlines.items || [], + }; + } catch (err) { + console.error("Failed to load deadline list:", err); + throw error(404, "Deadline list not found"); + } +}; diff --git a/frontend/src/routes/settings/deadline/list/[id]/+page.svelte b/frontend/src/routes/settings/deadline/list/[id]/+page.svelte new file mode 100644 index 0000000..c66e6a6 --- /dev/null +++ b/frontend/src/routes/settings/deadline/list/[id]/+page.svelte @@ -0,0 +1,106 @@ + + + + {#snippet mainSnippet()} +
+
+
Total
+
{data.deadlineList.count}
+
+
+
Completed
+
{data.deadlineList.completedCount}
+
+
+
Pending
+
{data.deadlineList.pendingCount}
+
+
+ {/snippet} + {#snippet mainActionsSnippet()} + + {/snippet} + {#snippet extraCardsSnippet()} + + {#if data.deadlines.length === 0} +
+
+ +

No deadlines yet

+

+ Add deadlines to this list to help you stay on track with your wedding planning tasks. +

+ + + Add First Deadline + +
+
+ {:else} +
+ {#each data.deadlines as deadline (deadline.id)} +
+
+ + {#if deadline.description} +
{deadline.description}
+ {/if} +
+ {#if deadline.dueDate} + Due: {new Date(deadline.dueDate).toLocaleDateString()} + {:else} + No due date set + {/if} + {#if deadline.assignedToName} + Assigned to: {deadline.assignedToName} + {:else} + Unassigned + {/if} +
+
+ {#if deadline.completed} +
Completed
+ {:else} +
Pending
+ {/if} +
+
+
+ {/each} +
+ {/if} +
+ {/snippet} +
diff --git a/frontend/src/routes/settings/deadline/list/[id]/deadline/new/+page.server.ts b/frontend/src/routes/settings/deadline/list/[id]/deadline/new/+page.server.ts new file mode 100644 index 0000000..dbd37ec --- /dev/null +++ b/frontend/src/routes/settings/deadline/list/[id]/deadline/new/+page.server.ts @@ -0,0 +1,42 @@ +import { api } from "$lib/server/api-client"; +import { fail, redirect } from "@sveltejs/kit"; +import type { Actions, PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async ({ params }) => { + return { + listId: params.id, + listName: (await api.deadlines.deadlineApiGetDeadlineList({ listId: params.id })).name, + }; +}; + +export const actions = { + default: async ({ request, params }) => { + const listId = params.id; + const formData = await request.formData(); + const name = formData.get("name"); + const description = formData.get("description"); + const dueDate = formData.get("dueDate"); + const completed = formData.get("completed") === "on"; + + if (!name || typeof name !== "string") { + return fail(400, { error: "Deadline name is required" }); + } + + try { + await api.deadlines.deadlineApiCreateDeadline({ + deadlineCreateSchema: { + name, + description: description && typeof description === "string" ? description : undefined, + deadlineListId: listId, + dueDate: dueDate && typeof dueDate === "string" ? new Date(dueDate) : undefined, + completed, + }, + }); + } catch (err) { + console.error("Failed to create deadline:", err); + return fail(500, { error: "Failed to create deadline" }); + } + + throw redirect(303, `/settings/deadline/list/${listId}`); + }, +} satisfies Actions; diff --git a/frontend/src/routes/settings/deadline/list/[id]/deadline/new/+page.svelte b/frontend/src/routes/settings/deadline/list/[id]/deadline/new/+page.svelte new file mode 100644 index 0000000..0e88856 --- /dev/null +++ b/frontend/src/routes/settings/deadline/list/[id]/deadline/new/+page.svelte @@ -0,0 +1,95 @@ + + + +
+
+

Add Deadline

+ Cancel +
+ + {#if form?.error} +
+ + + + {form.error} +
+ {/if} + +
+
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+ +
+ Cancel + +
+
+
+
diff --git a/frontend/src/routes/settings/deadline/list/[id]/edit/+page.server.ts b/frontend/src/routes/settings/deadline/list/[id]/edit/+page.server.ts new file mode 100644 index 0000000..9f1e09b --- /dev/null +++ b/frontend/src/routes/settings/deadline/list/[id]/edit/+page.server.ts @@ -0,0 +1,43 @@ +import { api } from "$lib/server/api-client"; +import { fail, redirect } from "@sveltejs/kit"; +import { error } from "@sveltejs/kit"; +import type { Actions, PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async ({ params }) => { + const listId = params.id; + + try { + const deadlineList = await api.deadlines.deadlineApiGetDeadlineList({ listId }); + + return { + deadlineList, + }; + } catch (err) { + console.error("Failed to load deadline list:", err); + throw error(404, "Deadline list not found"); + } +}; + +export const actions = { + default: async ({ request, params }) => { + const listId = params.id; + const formData = await request.formData(); + const name = formData.get("name"); + + if (!name || typeof name !== "string") { + return fail(400, { error: "List name is required" }); + } + + try { + await api.deadlines.deadlineApiUpdateDeadlineList({ + listId, + deadlineListUpdateSchema: { name }, + }); + } catch (err) { + console.error("Failed to update deadline list:", err); + return fail(500, { error: "Failed to update deadline list" }); + } + + throw redirect(303, `/settings/deadline/list/${listId}`); + }, +} satisfies Actions; diff --git a/frontend/src/routes/settings/deadline/list/[id]/edit/+page.svelte b/frontend/src/routes/settings/deadline/list/[id]/edit/+page.svelte new file mode 100644 index 0000000..01138fd --- /dev/null +++ b/frontend/src/routes/settings/deadline/list/[id]/edit/+page.svelte @@ -0,0 +1,65 @@ + + + +
+
+

Edit Deadline List

+ Cancel +
+ + {#if form?.error} +
+ + + + {form.error} +
+ {/if} + +
+
+
+

Update the name of your deadline list

+
+
+ + +
+
+
+
+ +
+ Cancel + +
+
+
+
diff --git a/frontend/src/routes/settings/deadline/list/new/+page.server.ts b/frontend/src/routes/settings/deadline/list/new/+page.server.ts new file mode 100644 index 0000000..07e379a --- /dev/null +++ b/frontend/src/routes/settings/deadline/list/new/+page.server.ts @@ -0,0 +1,30 @@ +import { api } from "$lib/server/api-client"; +import { fail, redirect } from "@sveltejs/kit"; +import type { Actions, PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async () => { + return {}; +}; + +export const actions = { + default: async ({ request }) => { + const formData = await request.formData(); + const name = formData.get("name"); + + if (!name || typeof name !== "string") { + return fail(400, { error: "List name is required" }); + } + + let newList; + try { + newList = await api.deadlines.deadlineApiCreateDeadlineList({ + deadlineListCreateSchema: { name }, + }); + } catch (err) { + console.error("Failed to create deadline list:", err); + return fail(500, { error: "Failed to create deadline list" }); + } + + throw redirect(303, `/settings/deadline/list/${newList.id}`); + }, +} satisfies Actions; diff --git a/frontend/src/routes/settings/deadline/list/new/+page.svelte b/frontend/src/routes/settings/deadline/list/new/+page.svelte new file mode 100644 index 0000000..d1175d2 --- /dev/null +++ b/frontend/src/routes/settings/deadline/list/new/+page.svelte @@ -0,0 +1,70 @@ + + + +
+
+

Create Deadline List

+ Cancel +
+ + {#if form?.error} +
+ + + + {form.error} +
+ {/if} + +
+
+
+

+ Create a new list to organize your wedding planning deadlines +

+
+
+ + + + Choose a descriptive name for your deadline list + +
+
+
+
+ +
+ Cancel + +
+
+
+
diff --git a/frontend/src/routes/settings/faq/+page.svelte b/frontend/src/routes/settings/faq/+page.svelte index 00accb7..2f852f4 100644 --- a/frontend/src/routes/settings/faq/+page.svelte +++ b/frontend/src/routes/settings/faq/+page.svelte @@ -70,9 +70,10 @@ const totalQuestions = data.questions?.length || 0; const totalTips = data.tips?.length || 0; + const relativeCrumbs = [{ title: "FAQ" }]; - +
diff --git a/frontend/src/routes/settings/faq/question/[id]/edit/+page.svelte b/frontend/src/routes/settings/faq/question/[id]/edit/+page.svelte index 8d35a3c..26b9092 100644 --- a/frontend/src/routes/settings/faq/question/[id]/edit/+page.svelte +++ b/frontend/src/routes/settings/faq/question/[id]/edit/+page.svelte @@ -20,9 +20,11 @@ editingUrlId = null; editingUrl = { url: "", text: "" }; } + + const relativeCrumbs = [{ title: "FAQ" }, { title: "Edit Question" }]; - +
diff --git a/frontend/src/routes/settings/faq/question/new/+page.svelte b/frontend/src/routes/settings/faq/question/new/+page.svelte index 5dd6b4c..590b058 100644 --- a/frontend/src/routes/settings/faq/question/new/+page.svelte +++ b/frontend/src/routes/settings/faq/question/new/+page.svelte @@ -6,9 +6,11 @@ const { data, form } = $props(); let submitting = $state(false); + + const relativeCrumbs = [{ title: "FAQ", href: "/settings/faq" }, { title: "Add Question" }]; - +
diff --git a/frontend/src/routes/settings/faq/tip/[id]/edit/+page.svelte b/frontend/src/routes/settings/faq/tip/[id]/edit/+page.svelte index 9873127..be4a5d8 100644 --- a/frontend/src/routes/settings/faq/tip/[id]/edit/+page.svelte +++ b/frontend/src/routes/settings/faq/tip/[id]/edit/+page.svelte @@ -5,9 +5,11 @@ const { data, form } = $props(); let submitting = $state(false); + + const relativeCrumbs = [{ title: "FAQ", href: "/settings/faq" }, { title: "Edit Tip" }]; - +
diff --git a/frontend/src/routes/settings/faq/tip/new/+page.svelte b/frontend/src/routes/settings/faq/tip/new/+page.svelte index bdad3b1..cacd1e7 100644 --- a/frontend/src/routes/settings/faq/tip/new/+page.svelte +++ b/frontend/src/routes/settings/faq/tip/new/+page.svelte @@ -5,9 +5,11 @@ const { data, form } = $props(); let submitting = $state(false); + + const relativeCrumbs = [{ title: "FAQ", href: "/settings/faq" }, { title: "Add Tip" }]; - +
diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 470dc0c..f65ae14 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -9,3 +9,9 @@ export type IComingSoon = { intro: string; expectations: IExpectations[]; }; + +export type IBreadcrumb = { + title: string; + href?: string; + icon?: string; +}; diff --git a/pyproject.toml b/pyproject.toml index 1aae2e1..88e7198 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -146,7 +146,7 @@ indent_size = 2 version_toml = ["pyproject.toml:project.version"] branch = "main" upload_to_vcs_release = true -build_command = "echo 'No build required'" +build_command = "uv lock --no-install" major_on_zero = false tag_format = "v{version}" diff --git a/uv.lock b/uv.lock index 01d45cd..745ca8e 100644 --- a/uv.lock +++ b/uv.lock @@ -1396,7 +1396,7 @@ wheels = [ [[package]] name = "okletsdoit" -version = "0.4.0" +version = "0.5.0" source = { virtual = "." } dependencies = [ { name = "celery" },