Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

  • Initial repository setup
  • Implement dynamic action buttons based on status
    • Update getActionButtons helper to show correct actions per status
    • Add Expired status support
    • Implement handleAction function with separate handler functions per action
    • Update status filter options (removed Closing, kept Expired)
    • Create Storybook stories for all status variants
    • Pass biome linting checks
  • Implement acceptReservationRequest functionality
    • Create update.ts application service (replaces separate accept.ts)
    • Add GraphQL mutation schema and resolver
    • Integrate mutation in UI container component
    • Implement handleAccept with error handling
    • Add loading state during mutation execution
    • Auto-refetch data after successful acceptance
  • Address code review critical issues
    • Remove dev-server.log and add *.log to .gitignore
    • Fix invalid seed data user IDs
    • Fix quote style violations (enforce single quotes)
    • Optimize accept.ts to eliminate double-fetch
    • Fix bracket notation in resolvers
  • Standardize state terminology across all layers
    • Align domain, persistence, GraphQL, and UI to use 'Requested' and 'Accepted'
    • Remove 'Pending' and 'Approved' terminology for consistency
    • Update seed data to use standardized states
    • Remove state-mappings.ts - states now match directly
    • Establish 1:1 state mapping between all layers
  • Address Sourcery AI code review feedback
    • Remove debug console.log calls from production code paths
    • Remove accidentally committed node_modules from service-twilio
    • Add clarifying comment explaining domain's state setter behavior
    • Implement separate handler functions for each action type
    • Remove unused sharerEmail field from ReservationRequestUpdateCommand
  • Address @jasonmorais final code review feedback
    • Remove archive feature (not in BRD/SRD spec)
    • Remove Closing status and duplicate message logic
    • Refactor to separate handler functions per action (handleAccept, handleReject, etc.)
    • Keep business logic in domain aggregate (state setter validates transitions)
    • Simplify read-repository hydration (remove excessive casting)
    • Fix test file typing without biome-ignore comments
    • Preserve resolver mapping for domain-to-UI transformation

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Summary by Sourcery

Add authenticated reservation request acceptance and overlapping request auto-rejection, expose it via GraphQL and wire it into the My Listings UI, while standardizing request states and improving data hydration and testing across layers.

New Features:

  • Introduce an update application service for reservation requests that supports accepting and closing flags, including overlap-aware auto-rejection logic.
  • Expose an acceptReservationRequest GraphQL mutation with authorization and listing ownership checks, and integrate it into the My Listings requests table UI with feedback and refetching.
  • Add My Listings dashboard wiring for authenticated sharers, including per-sharer requests count and sharer-scoped requests tab with dynamic action buttons.
  • Extend request listing GraphQL mapping to return real listing imagery and normalized request statuses, and support richer listing/request Storybook stories.

Bug Fixes:

  • Fix Mongo read repository population so populate operations run before lean and add missing reserver lookup in listing-requests-by-sharer aggregation to avoid hydration issues.
  • Correct mock data relationships for item listings and reservation requests to use valid sharer and reserver IDs, and adjust tests for resolver helper behaviors around invalid or non-ObjectId identifiers.
  • Ensure GraphQL server initialization tests assert depth-limit configuration more robustly without relying on specific function instances.

Enhancements:

  • Refine reservation request domain model to emit a ReservationRequestAcceptedEvent when a request is accepted, wiring through a new domain event type export.
  • Improve reservation request read and domain repositories with overlap query support and simplified hydration for listing and reserver relations.
  • Standardize reservation request status terminology (e.g., Requested vs Pending, Expired support) across UI helpers, filters, seed data, and Storybook stories, and add unit tests for status/action helpers.
  • Polish My Listings UI components with sharer-scoped data loading, safer error logging, improved button text and Ant Design App context usage, plus small code style and type tweaks across UI and GraphQL tests.

CI:

  • Relax exact depthLimit validation in GraphQL handler tests to assert on structure rather than specific function instances, keeping CI resilient to implementation changes.

Documentation:

  • Document reservation request update and acceptance behavior through new BDD-style .feature files for both application service and GraphQL resolver layers.

Tests:

  • Add cucumber-style tests for the reservation request update application service, including acceptance, close flags, overlap auto-rejection, and error cases.
  • Extend reservation request GraphQL resolver tests to cover acceptReservationRequest mutation behaviors and add feature definitions for these scenarios.
  • Add unit tests for request status helper functions and additional scenarios in resolver-helper and tracing tests to verify fallback and tracing behaviors.
  • Update Storybook stories and Apollo mocks for profile, requests card, and requests table to use the new schemas and status variants, and verify My Listings data flows.

Copilot AI changed the title [WIP] Refactor import formatting in listing information component Initial repository setup with listing information component Nov 5, 2025
Copilot AI requested a review from dani-vaibhav November 5, 2025 12:14
@dani-vaibhav
Copy link

@copilot
@copilot /plan
@copilot /suggest
Implement the logic for handleAction function based on the following actions

  • Update UI (My Listings → Requests) to show dynamic actions based on status:
    • Pending → Accept / Reject
    • Accepted → Close / Message
    • Rejected → Delete / Archive
    • Expired → Archive

…tatus

- Update action buttons to match status requirements:
  - Pending → Accept / Reject
  - Accepted → Close / Message
  - Rejected → Delete / Archive
  - Expired → Archive
  - Closed → Message
  - Cancelled → Delete
- Implement handleAction function with switch statement for each action
- Add Expired status to filter options and status tag styling
- Update Storybook stories to demonstrate all status variants
- Reorganize getActionButtons helper for clarity with inline comments

Co-authored-by: dani-vaibhav <182140623+dani-vaibhav@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 5, 2025

@copilot
@copilot /plan
@copilot /suggest
...

Implemented dynamic action buttons based on reservation request status in commit 815cd1f.

Changes made:

Status → Actions mapping:

  • Pending → Accept / Reject
  • Accepted → Close / Message
  • Rejected → Delete / Archive
  • Expired → Archive
  • Closed → Message
  • Cancelled → Delete

Implementation details:

  1. Updated getActionButtons helper in requests-status-helpers.tsx with clear status-based logic and inline comments
  2. Implemented handleAction function in requests-table.container.tsx with switch statement for each action (accept, reject, close, message, delete, archive)
  3. Added "Expired" status to filter options and status tag styling
  4. Created Storybook stories demonstrating all status variants (Pending, Accepted, Rejected, Closed, Expired)

The UI now dynamically displays the appropriate action buttons based on the current status of each reservation request. The handleAction function is ready for future integration with GraphQL mutations.

Copilot AI changed the title Initial repository setup with listing information component Initial repository setup with listing information and dynamic reservation request actions Nov 5, 2025
@dani-vaibhav
Copy link

@copilot
@workspace /fix Implement acceptReservationRequest and implement the logic for the case 'accept'

- Create accept.ts application service for accepting reservation requests
- Add acceptReservationRequest GraphQL mutation with input type
- Implement mutation resolver with authentication check
- Add GraphQL mutation to requests-table.container.graphql
- Integrate useMutation hook in RequestsTableContainer
- Implement handleAction 'accept' case with mutation call and refetch
- Add loading state for accept action
- Export accept service from reservation-request index
- Pass biome linting checks

Co-authored-by: dani-vaibhav <182140623+dani-vaibhav@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 5, 2025

@copilot
@workspace /fix Implement acceptReservationRequest and implement the logic for the case 'accept'

Implemented acceptReservationRequest mutation and integrated it with the UI in commit 8eba1a5.

Implementation details:

1. Application Service Layer (accept.ts):

  • Created ReservationRequestAcceptCommand interface with id and sharerEmail
  • Implemented accept() service that:
    • Validates reservation request exists
    • Verifies sharer owns the listing
    • Calls domain state = 'Accepted' to trigger acceptance logic
    • Persists changes via Unit of Work transaction

2. GraphQL Layer:

  • Added acceptReservationRequest mutation to schema with AcceptReservationRequestInput
  • Implemented resolver with authentication check using verifiedJwt.email
  • Returns updated ReservationRequest with new state

3. UI Layer (requests-table.container.tsx):

  • Added useMutation hook for acceptReservationRequest
  • Implemented handleAction 'accept' case:
    • Calls mutation with request ID
    • Auto-refetches list to show updated status
    • Includes error handling with console logging
    • Shows loading state during mutation execution

The accept button now fully functions - when clicked on a Pending request, it accepts the reservation and updates the status to Accepted in real-time.

Copilot AI changed the title Initial repository setup with listing information and dynamic reservation request actions Initial repository setup with listing information and reservation request accept functionality Nov 5, 2025
@dani-vaibhav
Copy link

@copilot
Deploy this branch

Copy link
Contributor Author

Copilot AI commented Nov 7, 2025

@copilot
Deploy this branch

I don't have the ability to deploy branches or trigger deployment pipelines. Deployment typically requires access to CI/CD systems, cloud infrastructure, and production credentials that I don't have.

To deploy this branch, you'll need to:

  1. Merge this PR to your main/deployment branch, or
  2. Manually trigger your CI/CD pipeline for this branch, or
  3. Use your deployment tooling (e.g., Azure DevOps, GitHub Actions, etc.)

If you need help with code changes, configuration files, or deployment scripts that I can assist with, please let me know the specific changes needed.

@dani-vaibhav dani-vaibhav marked this pull request as ready for review November 7, 2025 19:39
@jasonmorais jasonmorais marked this pull request as draft December 18, 2025 20:21
Fixes TypeScript build error TS6133: 'useNavigate' is declared but its value is never read.

The import was added but not used in the component, causing the strict TypeScript build to fail in CI/CD.
@dani-vaibhav dani-vaibhav marked this pull request as ready for review December 22, 2025 16:30
Copy link
Contributor

@jasonmorais jasonmorais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments for the most part

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont want a single component that exports multiple versions of the component, goes against our practices. Also the file names here arent following our naming conventions with dashes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same idea here as the above comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here with file name

let displayRequests = transformedAllRequests;

// Apply sorting (keep existing behavior)
if (sorter.field && sorter.order) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typically sorting and filtering and pagination we do on the backend

const allRequests = data?.myListingsRequests ?? [];

// Transform domain fields to UI format (no client-side search/status filtering in this container)
const transformedAllRequests = allRequests.map((request) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the handling here seems strange, like checking for type personaluser. I would determine if this is all needed or is an issue with just the interface mapping, as in we should adjust that rather than remap fully.

onPageChange,
onAction,
onAccept,
onReject: _onReject,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why underscores for the actual function names? It isnt the field itself so from what i understand it isnt making it optional. if it serves no actual purpose i would name them normally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reservation Request - Accept Request

5 participants