Skip to content

Revert "feat: user database schema OAuth fields + Google authentication"#114

Merged
amina69 merged 1 commit into
mainfrom
revert-113-feat/user-schema-and-google-auth
Jun 8, 2026
Merged

Revert "feat: user database schema OAuth fields + Google authentication"#114
amina69 merged 1 commit into
mainfrom
revert-113-feat/user-schema-and-google-auth

Conversation

@amina69

@amina69 amina69 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

PR: Pet Status Lifecycle Implementation (Closes #17)

Overview

This PR implements the Pet Status Lifecycle feature, enforcing a state machine for pet status transitions throughout the adoption and custody process. It ensures that pets can only move between valid states, maintaining data integrity and preventing invalid transitions.

Features

  • State Machine for Pet Status:
    • Enforces valid transitions: AVAILABLE → PENDING → ADOPTED, AVAILABLE → IN_CUSTODY → AVAILABLE, etc.
    • Blocks invalid transitions (e.g., ADOPTED → PENDING, IN_CUSTODY → ADOPTED).
    • Allows admin override for ADOPTED → AVAILABLE (return scenario).
  • Transition Validation:
    • Centralized validator for all status changes.
    • Throws clear errors for invalid transitions.
    • Logs all status changes for audit trail.
  • API Endpoints:
    • PATCH /pets/:id/status: Update pet status with validation and audit logging.
    • GET /pets/:id/transitions: Get allowed transitions and current status for a pet.
    • GET /pets/:id/transitions/allowed: Get allowed transitions for the current user (role-aware).
  • Swagger Documentation:
    • All endpoints are fully documented and visible in Swagger UI.
    • Request/response schemas and examples included.
  • Test Coverage:
    • Unit tests for all valid and invalid transitions.
    • Tests for admin overrides and edge cases.

Acceptance Criteria

  • Valid transitions work as expected.
  • Invalid transitions are blocked with clear error messages.
  • Admin can override certain restrictions.
  • Status changes are logged.
  • All endpoints are documented in Swagger.
  • Unit tests cover all scenarios.

Closes


Please review the implementation and test the endpoints via Swagger UI (/api/docs).

@amina69 amina69 merged commit c692673 into main Jun 8, 2026
3 checks passed
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.

Pet Status Lifecycle

1 participant