Introduce `AuthContext` with login, logout, and token management. Includes protected route handling, token refresh logic, and user session persistence via React Context API. Prepares the app for authentication workflows.
Introduced `openapi-ts.config.ts` to generate client code from the OpenAPI spec. Updated several dependencies to enable OpenAPI integration, including `@hey-api` plugins, `axios`, and `@tanstack/react-query`. These changes set up the project for streamlined API access using autogenerated TypeScript clients.
This commit adds the `operation_id` parameter to all relevant API endpoints in the `auth` routes. These identifiers enhance API documentation and make routes easier to distinguish in tools like Swagger or OpenAPI. No functionality is altered, but these additions improve clarity and maintainability.
Removed tests for missing `first_name` and `last_name` in `test_user` as database integrity constraints already ensure these validations. This reduces duplication and simplifies the test suite.
Introduced a script to create the initial superuser during app startup if none exists. Updated the entrypoint to call this script and added stricter logging for passlib. Adjusted .env.template for a stronger default superuser password.
Updated the schemas and models to make `last_name` optional and set a default value of "user" for `first_name`. This change enhances flexibility for user data handling and ensures proper defaults when values are not provided.
Implemented user CRUD operations including creation, retrieval, updating, and deletion through a generic CRUD base class. Enhanced user schemas with additional attributes and created tests to verify functionality, covering edge cases such as duplicates and pagination. Updated the test suite with new fixtures and methods to support the tests.
Implemented comprehensive authentication endpoints including user registration, login, token refresh, password change, and user info retrieval. Added extensive test cases for these endpoints to ensure functionality and error handling.
Eliminated redundant token-related schemas to simplify the codebase. These models were not actively utilized and their removal helps improve maintainability and reduce clutter in the project.
Improved phone number validation logic with stricter rules and better error messages in `UserBase`. Updated access token expiration to 1 day in config. Added extensive tests for phone number validation, including valid and invalid cases across different formats.
Moved `auth` module from `dependencies.py` to `dependencies/auth.py` for better organization. Added extensive unit tests for authentication services and API dependencies to ensure robust verification of users, tokens, and permissions.
Eliminated the `RevokedToken` model and associated logic for managing token revocation. Removed unused files, related tests, and outdated dependencies in authentication modules. Simplified token decoding, user validation, and dependency injection by streamlining the flow and enhancing maintainability.
Improved the `decode_token` function to clarify and extend error handling for token validation and decoding. Enhanced error messages for invalid tokens, added checks for missing claims, and ensured clear differentiation of failure scenarios. Updated imports and added a `scope` field to token response for completeness.
Improved the `decode_token` function to clarify and extend error handling for token validation and decoding. Enhanced error messages for invalid tokens, added checks for missing claims, and ensured clear differentiation of failure scenarios. Updated imports and added a `scope` field to token response for completeness.
This commit introduces a system to revoke tokens by storing their `jti` in a new `RevokedToken` model. It includes APIs for logging out (revoking a current token) and logging out from all devices (revoking all tokens). Additionally, token validation now checks revocation status during the decode process.
Cleaned up unused imports including `timezone` and `ExpiredSignatureError`. Streamlined the import structure to improve readability and maintainability. These changes do not affect functionality but enhance code clarity.
Adjusted `datetime.utcnow` to `datetime.now` for consistency and refactored token creation functions for cleaner structure. Removed duplicated `create_access_token` and `create_refresh_token` definitions by consolidating them into a single location.
Expanded exception handling to cover more specific JWT and JOSE-related errors, including signature verification failures and malformed tokens. This ensures better error messaging and robustness in token validation.
Updated `decode_token` for stricter validation of token claims and explicit error handling. Added utilities for token revocation and verification, improving
Introduced unit tests for `get_current_user`, `get_current_active_user`, and security functions like token creation and decoding. Also refactored imports for consistency and cleaned up unused or misplaced code to improve maintainability.
Introduces schemas for user management, token handling, and password hashing. Implements routes for user registration, login, token refresh, and user info retrieval. Sets up authentication dependencies and integrates the API router with the application.
MediaType and MediaPurpose have been added to the `__all__` exports in the `models` module. This ensures they are properly exposed for import and use throughout the application.
Enhanced test coverage includes `repr` methods, model functionality, and validation logic for key models like `GiftItem`, `GiftCategory`, `EventMedia`, `RSVP`, and `GiftPurchase`. Refactored and added fixtures to support comprehensive testing scenarios. Addresses validation for gift reordering and updates `EventMedia` representation format for consistency.
Introduced comprehensive unit tests for EmailTemplate and NotificationLog, including creation, field validation, and custom methods. Added relevant test fixtures to support these models and expanded `conftest.py` for reusability. Validates functionality and maintains model integrity.
Introduce a new pytest fixture for creating ActivityLog entries. Add comprehensive tests to verify ActivityLog creation and logging functionality, including user, event, and guest activities. Ensure proper test coverage for key methods and representations.
Introduce unit tests for the Guest model covering properties, methods, and behaviors such as creation, status updates, and permissions. Add `guest_fixture` in `conftest.py` to streamline reusable test setup for Guest instances.
Introduce a new pytest fixture for creating EventTheme instances and add comprehensive unit tests covering its properties, relationships, and behaviors. These changes improve test coverage and ensure the EventTheme model functions as expected.
Introduce a `validate_display_order` method to ensure a default value of 0 for `display_order`. Extend testing infrastructure with fixtures and unit tests for `EventMedia` to validate properties, metadata, and default behaviors.
This commit introduces comprehensive unit tests for the RSVP model, including creation, status updates, attendance checks, unique constraints, and dietary requirements handling. These tests ensure the RSVP model
Introduced comprehensive test coverage for GiftItem, GiftCategory, and GiftPurchase models to validate core functionality such as creation, updates, deletions, and derived properties. Also updated the `total_gifts` method in `GiftCategory` to calculate the total requested quantity rather than the count of gifts.
Introduce comprehensive tests for the Event model, covering creation, updates, deletions, relationships, defaults, and constraints. Added the `mock_user` fixture to streamline user-related test setups and ensure proper linkage between users and events. Improves test coverage and ensures model behavior consistency.
Introduce a `db_session` pytest fixture to provide a fresh SQLite in-memory database for each test function. This ensures isolated and consistent database state across tests by setting up and tearing down the database automatically.
Introduce a `db_session` pytest fixture to provide a fresh SQLite in-memory database for each test function. This ensures isolated and consistent database state across tests by setting up and tearing down the database automatically.
This commit introduces multiple test cases for the User model, covering creation, updating, deletion, unique constraints, required fields, default values, string representation, and handling of complex JSON preferences. These tests help ensure the model behaves as
Simplify database module by re-organizing engine creation, session handling, and removing redundant methods. Introduce SQLite compatibility for testing and add a utility module for test database setup and teardown. Integrate initial unit tests for user models and update dependencies for security and testing.
Clarify and fix relationship definitions by specifying foreign keys explicitly in User model. Add new relationships for gift categories and email templates to the Event model, and comment out unused EventUpdate relationship. These changes ensure better structure and future maintainability.
Introduced robust database connection configuration with PostgreSQL-specific tuning, connection pooling, and performance metrics logging. Added utility functions to manage database health checks, initialization, and cleanup at application lifecycle stages. Improved error handling with logging support for transactions and slow queries.
Updated `metadata` field names to `media_metadata` and `notification_metadata` in the eventspace ER schema. This improves clarity by providing more context-specific naming for better understanding and maintainability.
Updated `metadata` field names to `media_metadata` and `notification_metadata` in the eventspace ER schema. This improves clarity by providing more context-specific naming for better understanding and maintainability.
This migration introduces all initial database models and their respective tables, relationships, and constraints. It includes entities such as users, events, guests, themes, media, and various related entities to support application functionality. This serves as a foundational schema for the project.
Updated Alembic configuration and folder structure to reference the `app` module. Introduced a new `migrate.py` script to manage migrations efficiently with commands for generating, applying, and inspecting migrations. Adjusted `env.py` to ensure proper model imports and use environment-driven database URLs.
Move configuration logic to a more modular structure and enhance database URL generation using individual components from environment variables. Adjust database initialization to utilize the updated settings for improved maintainability and clarity.
Updated `Base` import to use centralized `app.core.database.Base` for consistency. Enhanced `TimestampMixin` and `UUIDMixin` with docstrings for clarity. Fixed metadata reference in `guest_gifts` table and added relationships in `email_template`.
Added the `env_file` directive to both `docker-compose.yml` and `docker-compose.dev.yml` to load environment variables from a `.env` file. This ensures consistent environment variable management across different configurations.
Rename metadata fields for clarity and fix imports.
Updated metadata-related field names across models to improve clarity and consistency (e.g., `metadata` to `media_metadata` and `notification_metadata`). Fixed an error in `guest_gifts` metadata reference and added a proper imports initialization in `__init__.py` for all models.
```
Introduced new database models to handle email templates, activity logs, and notification logs, including relevant enums and utilities. Updated ER diagram to reflect new relationships and attributes, enhancing event tracking and notification management capabilities.
Updated attributes, relationships, and data types to improve schema accuracy and flexibility. Added new enums, foreign keys, and reordered fields for better organization. Renamed and adjusted components to reflect evolving business logic.
Introduce EventMedia for managing media files linked to events, including file metadata, purpose, and relationships. Add GiftCategory to categorize gifts, featuring unique constraints, display options, and utility methods for handling related gifts.
Introduce a new RSVP model to manage responses for events, including status, guest count, and additional details like dietary requirements. Enforce uniqueness for each guest per event and provide functionality to update RSVP status. This will support efficient event RSVP handling and data integrity.