Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <purpose>
- You are an expert Django developer tasked with implementing new features into an existing Django project. Your goal is to seamlessly integrate the new functionality while adhering to the project's structure and best practices. The implementation should be broken down into atomic steps for clarity and ease of execution.
- </purpose>
- <instructions>
- <instruction>Break down the user's request to understand the new feature's requirements.</instruction>
- <instruction>Analyze the relevant Django app where the new feature will be added.</instruction>
- <instruction>Understand any necessary configurations in the Django settings file.</instruction>
- <instruction>Identify any required imports from other components in the Django project, such as models or URL configurations.</instruction>
- <instruction>Produce or identify the acceptance criteria for the new feature.</instruction>
- <instruction>Develop tests using Django's testing framework, including the use of mocks where necessary. Analyze the existing test structure to decide whether to add tests to existing files or create a new test suite.</instruction>
- <instruction>Identify any additional necessary imports for the tests.</instruction>
- <instruction>Break down the implementation into atomic steps, each representing a single, complete task that can be executed independently.</instruction>
- <instruction>Implement the new feature in the Django app following the atomic steps.</instruction>
- <instruction>Verify the implementation by running the developed tests and debug any issues that arise after each atomic step.</instruction>
- </instructions>
- <sections>
- <user-prompt>
- [[user-prompt]]
- </user-prompt>
- <django-app-location>
- [[django-app-location]]
- </django-app-location>
- </sections>
- <examples>
- <example>
- <user-request>
- Implement a new user profile page that shows the user's recent activity.
- </user-request>
- <django-app-location>
- accounts/
- </django-app-location>
- <acceptance-criteria>
- - The user profile page should load without errors.
- - The recent activity section should display the last 5 actions taken by the user.
- </acceptance-criteria>
- <test-files>
- - Create a new test file: accounts/tests/test_profile_page.py
- - Import necessary models: from accounts.models import UserActivity
- - Write test cases to check if the profile page loads and displays recent activities correctly.
- </test-files>
- <atomic-implementation-steps>
- <step>Create a new view function in accounts/views.py to handle the user profile page.</step>
- <step>Update the URL configuration in accounts/urls.py to include the new profile page route.</step>
- <step>Create a new template file accounts/templates/accounts/profile.html to display the user profile and recent activity.</step>
- <step>Modify the UserActivity model to ensure it tracks the last 5 actions of a user.</step>
- <step>Update the view function to query the UserActivity model and pass the recent activities to the template.</step>
- </atomic-implementation-steps>
- <verification>
- Run the tests in accounts/tests/test_profile_page.py to ensure each atomic step works as expected.
- </verification>
- </example>
- <example>
- <user-request>
- Add a feature to allow users to upload profile pictures.
- </user-request>
- <django-app-location>
- users/
- </django-app-location>
- <acceptance-criteria>
- - Users can successfully upload a profile picture.
- - The uploaded picture is displayed on the user's profile page.
- </acceptance-criteria>
- <test-files>
- - Add tests to existing file: users/tests/test_views.py
- - Import necessary models: from users.models import UserProfile
- - Write test cases to verify upload functionality and display on the profile page.
- </test-files>
- <atomic-implementation-steps>
- <step>Update the UserProfile model in users/models.py to include a field for storing profile pictures.</step>
- <step>Modify the view function in users/views.py to handle file uploads for profile pictures.</step>
- <step>Update the URL configuration in users/urls.py to include the upload route.</step>
- <step>Modify the user profile template users/templates/users/profile.html to include an upload form and display the profile picture.</step>
- <step>Add form validation and error handling for the upload process in the view function.</step>
- </atomic-implementation-steps>
- <verification>
- Run the tests in users/tests/test_views.py to confirm each atomic step functions correctly.
- </verification>
- </example>
- <example>
- <user-request>
- Implement a search functionality for blog posts.
- </user-request>
- <django-app-location>
- blog/
- </django-app-location>
- <acceptance-criteria>
- - The search functionality should return relevant blog posts based on the search query.
- - The search results page should load without errors.
- </acceptance-criteria>
- <test-files>
- - Create a new test file: blog/tests/test_search.py
- - Import necessary models: from blog.models import Post
- - Write test cases to check search functionality and result display.
- </test-files>
- <atomic-implementation-steps>
- <step>Create a new view function in blog/views.py to handle the search functionality.</step>
- <step>Update the URL configuration in blog/urls.py to include the search route.</step>
- <step>Create a new template file blog/templates/blog/search_results.html to display the search results.</step>
- <step>Modify the Post model in blog/models.py to include a search method or ensure it's searchable.</step>
- <step>Update the view function to query the Post model based on the search query and pass the results to the template.</step>
- </atomic-implementation-steps>
- <verification>
- Run the tests in blog/tests/test_search.py to ensure each atomic step works as expected.
- </verification>
- </example>
- </examples>
- <epics>
- <think>
- Alright, so the user is asking me to break down the boarding management feature into a detailed roadmap with epics. They mentioned that the previous response provided a high-level overview, and now they want a more detailed breakdown.
- First, I need to understand what exactly boarding management entails. It's about managing pet stays, which includes check-in, check-out, boarding type, and special requests. The user also wants this integrated with the existing appointment model.
- I should start by identifying the key components involved. The core models would be the Boarding and Reservation models. Then, I need to think about the user interface for staff to manage these and for customers to make reservations.
- Next, I'll consider the integration with existing features like appointments and deposits. Payments are crucial, so handling invoices and payments through the system is necessary.
- I should also think about notifications and reporting. Automated emails and SMS updates will keep everyone informed. Additionally, having dashboards and reports will help in managing the business effectively.
- Security and scalability are important too. Ensuring that the system can handle a large number of users and is secure is a must. Finally, providing a good user experience for both staff and customers will make the system more adoptable.
- Now, breaking this down into epics makes sense. Each epic represents a major feature or area that needs to be developed. I'll outline each epic with user stories to provide a clear roadmap.
- I need to make sure each epic is detailed enough to guide the development team but not too rigid. Including user stories within each epic helps in understanding the scope and requirements.
- I should also consider dependencies between epics. For example, setting up the models should come before building the staff interface. Integration with payments would depend on the core models being in place.
- Overall, the goal is to create a structured plan that the development team can follow, ensuring all aspects of boarding management are covered comprehensively.
- </think>
- ### Boarding Management Roadmap: Detailed Breakdown
- The implementation of boarding management can be broken down into a series of **epics**, each representing a major feature or functional area. Below is a detailed breakdown of the epics, user stories, and implementation steps.
- ---
- ### **Epic 1: Core Boarding Models and Database Design**
- **Goal:** Define the data structure and core models for boarding management.
- #### User Stories:
- 1. As a developer, I need to create a `Boarding` model to track pet stays.
- 2. As a developer, I need to create a `Reservation` model to manage bookings.
- 3. As a developer, I need to create a `BoardingType` model to define available accommodations (e.g., kennel, suite).
- 4. As a developer, I need to create a `SpecialRequest` model to capture owner preferences.
- #### Implementation Steps:
- 1. Design the `Boarding` model with fields:
- - `pet` (foreign key to `Pet`)
- - `check_in_date`
- - `check_out_date`
- - `boarding_type` (foreign key to `BoardingType`)
- - `special_requests` (many-to-many to `SpecialRequest`)
- - `status` (e.g., "pending," "in progress," "completed," "cancelled")
- - `notes`
- - `created_at` and `updated_at` timestamps.
- 2. Design the `BoardingType` model with fields:
- - `name` (e.g., "Standard Kennel," "Luxury Suite")
- - `description`
- - `price_per_night`
- - `max_pets_per_unit`
- - `amenities` (e.g., "air conditioning," "private yard")
- - `is_active` (to enable/disable a boarding type).
- 3. Design the `SpecialRequest` model with fields:
- - `name` (e.g., "special diet," "medication administration")
- - `description`.
- 4. Add a `Reservation` model to handle the booking process:
- - `owner` (foreign key to `Owner`)
- - `pet` (foreign key to `Pet`)
- - `boarding_type` (foreign key to `BoardingType`)
- - `check_in_date`
- - `check_out_date`
- - `status` (e.g., "pending," "confirmed," "cancelled")
- - `total_cost`
- - `deposit_paid`
- - `created_at` and `updated_at` timestamps.
- 5. Create database migrations for the new models.
- ---
- ### **Epic 2: Staff Interface for Boarding Management**
- **Goal:** Build a user-friendly interface for staff to manage boarding reservations and stays.
- #### User Stories:
- 1. As a staff member, I need to view a list of all upcoming and current boarding reservations.
- 2. As a staff member, I need to create, update, and cancel reservations.
- 3. As a staff member, I need to view detailed information about a pet's stay, including special requests.
- 4. As a staff member, I need to mark a pet as "checked in" or "checked out."
- 5. As a staff member, I need to assign a boarding unit to a pet.
- #### Implementation Steps:
- 1. Create views for:
- - List of reservations (`BoardingListView`).
- - Detail view for a single reservation (`BoardingDetailView`).
- - Create/edit form for reservations (`BoardingCreateView`, `BoardingUpdateView`).
- - Cancel/confirm actions for reservations.
- 2. Design templates for:
- - `boarding_list.html`: Display a table of reservations with filters for status and date range.
- - `boarding_detail.html`: Show all details of a reservation, including pet info and special requests.
- - `boarding_form.html`: Form for creating/editing reservations.
- 3. Add buttons/actions for:
- - Checking in a pet (update status to "in progress").
- - Checking out a pet (update status to "completed").
- - Assigning a specific unit to the pet.
- 4. Integrate with the `Appointment` model to link boarding stays with existing appointments.
- ---
- ### **Epic 3: Customer-Facing Reservation System**
- **Goal:** Allow pet owners to book boarding reservations through the customer portal.
- #### User Stories:
- 1. As an owner, I need to view available boarding types and their prices.
- 2. As an owner, I need to select a boarding type and dates for my pet.
- 3. As an owner, I need to submit a reservation request with special requests.
- 4. As an owner, I need to receive a confirmation email after booking.
- #### Implementation Steps:
- 1. Create a public-facing page to display available boarding types.
- 2. Implement a calendar view for selecting check-in and check-out dates.
- 3. Create a form for owners to submit special requests.
- 4. Integrate with the `Reservation` model to save the booking.
- 5. Add email notifications for booking confirmations and updates.
- ---
- ### **Epic 4: Payment Integration for Boarding**
- **Goal:** Integrate payment processing for deposits and full payments.
- #### User Stories:
- 1. As an owner, I need to pay a deposit to confirm my reservation.
- 2. As an owner, I need to pay the remaining balance before check-in.
- 3. As a staff member, I need to view payment status for reservations.
- #### Implementation Steps:
- 1. Create an `Invoice` model to track payments:
- - `reservation` (foreign key to `Reservation`)
- - `amount`
- - `payment_method` (e.g., "credit card," "cash")
- - `payment_status` (e.g., "paid," "pending")
- - `created_at` and `updated_at` timestamps.
- 2. Integrate a payment gateway (e.g., Stripe, PayPal) to process payments.
- 3. Add a payment form for owners to submit deposits or full payments.
- 4. Update the reservation status based on payment confirmation.
- ---
- ### **Epic 5: Integration with Feeding Times and Medication**
- **Goal:** Combine boarding management with existing feeding and medication schedules.
- #### User Stories:
- 1. As a staff member, I need to view a pet's feeding schedule during their stay.
- 2. As a staff member, I need to administer medication as per the pet's instructions.
- 3. As an owner, I need to provide special feeding or medication instructions.
- #### Implementation Steps:
- 1. Integrate the `FeedingTimes` model with the boarding system.
- 2. Add medication administration to the boarding detail view.
- 3. Create a daily schedule view for staff to track feeding and medication times.
- ---
- ### **Epic 6: Notifications and Communication**
- **Goal:** Implement automated notifications for key events.
- #### User Stories:
- 1. As an owner, I need to receive email/SMS notifications about reservation confirmations, changes, and cancellations.
- 2. As a staff member, I need to receive notifications when a new reservation is made or updated.
- 3. As an owner, I need to receive reminders about upcoming stays.
- #### Implementation Steps:
- 1. Set up email templates for:
- - Reservation confirmation.
- - Reservation updates.
- - Cancellation confirmation.
- - Payment reminders.
- 2. Integrate SMS notifications using Twilio or a similar service.
- 3. Add a notification system for staff (e.g., dashboard alerts).
- ---
- ### **Epic 7: Reporting and Analytics**
- **Goal:** Provide insights into boarding operations and revenue.
- #### User Stories:
- 1. As a manager, I need to view reports on occupancy rates.
- 2. As a manager, I need to generate revenue reports for boarding.
- 3. As a manager, I need to view popular boarding types and peak seasons.
- #### Implementation Steps:
- 1. Create a dashboard for managers with key metrics:
- - Total bookings.
- - Revenue by boarding type.
- - Occupancy rate over time.
- 2. Generate PDF/CSV reports for:
- - Booking summary.
- - Revenue breakdown.
- - Popular boarding types.
- 3. Add charts and graphs to visualize data.
- ---
- ### **Epic 8: Security and Scalability**
- **Goal:** Ensure the system is secure and scalable.
- #### User Stories:
- 1. As a developer, I need to ensure the system can handle high traffic.
- 2. As a developer, I need to implement rate limiting for public APIs.
- 3. As a developer, I need to ensure sensitive data is encrypted.
- #### Implementation Steps:
- 1. Optimize database queries and add indexing.
- 2. Implement caching for frequently accessed data.
- 3. Add rate limiting to public endpoints.
- 4. Encrypt sensitive data (e.g., payment information).
- ---
- ### **Epic 9: User Experience (UX) Improvements**
- **Goal:** Enhance the user experience for both staff and customers.
- #### User Stories:
- 1. As a staff member, I need an intuitive interface to manage bookings.
- 2. As an owner, I need a seamless experience when making a reservation.
- 3. As a staff member, I need clear visual indicators for reservation status.
- #### Implementation Steps:
- 1. Conduct user testing to identify pain points.
- 2. Improve the UI/UX for the reservation system.
- 3. Add visual cues for reservation status (e.g., color-coding).
- ---
- ### **Epic 10: Documentation and Training**
- **Goal:** Provide comprehensive documentation and training materials.
- #### User Stories:
- 1. As a developer, I need API documentation for the boarding system.
- 2. As a staff member, I need training materials to learn the new system.
- 3. As an owner, I need a guide on how to make a reservation.
- #### Implementation Steps:
- 1. Write API documentation using Swagger or Django REST Framework.
- 2. Create staff training materials (e.g., videos, PDF guides).
- 3. Create a customer guide for using the reservation system.
- ---
- This roadmap provides a structured approach to implementing boarding management, ensuring all critical features are addressed in a logical order. Each epic can be further broken down into smaller tasks for development.
- </epics>
- <user-prompt>
- implement using a TDD approach:
- Epic 1: Core Boarding Models and Database Design into actionable, step-by-step tasks. Each step is designed to be tackled one at a time, with a focus on TDD (Test-Driven Development), ensuring that tests are written before implementation and that all functionality is validated.
- </user-prompt>
- <django-app-location>
- @core
- </django-app-location>
- Your implementation plan for the new Django feature, broken down into atomic steps:e django application and see if there
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement