Updates type hints in `crud.py`, `helpers.py`, and `models.py` for improved readability and maintainability.
Replaces `Merchant | None` with `Optional[Merchant]` and `list[X]` with `List[X]` for consistency with standard Python typing practices.
Enhances the processing of Nostr messages by adding more robust error handling and logging, providing better insights into potential issues.
Specifically:
- Improves the checks on the websocket connection to log errors and debug information.
- Implements more comprehensive error logging for failed product quantity checks.
- Enhances logging and validation of EVENT messages to prevent potential errors.
- Implements a more robust merchant lookup logic to avoid double processing of events.
- Implements a more lenient time window for direct message subscriptions.
Adds a document analyzing the order discovery mechanism in Nostrmarket.
The document identifies the reasons merchants need to manually refresh to see new orders, instead of receiving them automatically. It analyzes timing window issues, connection stability, subscription state management, and event processing delays. It proposes solutions such as enhanced persistent subscriptions, periodic auto-refresh, WebSocket health monitoring, and event gap detection.
Improves websocket connection reliability by predefining the websocket URL and handling potential queueing errors.
This change also updates the websocket close message for clarity.
Enhance the merchant creation process by automatically generating Nostr keypairs
for users who don't have them, and streamline the API interface.
Changes:
- Add CreateMerchantRequest model to simplify merchant creation API
- Auto-generate Nostr keypairs for users without existing keys
- Update merchant creation endpoint to use user account keypairs
- Improve error handling and validation in merchant creation flow
- Clean up frontend JavaScript for merchant creation
This ensures all merchants have proper Nostr keypairs for marketplace
functionality without requiring manual key management from users.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Refactor merchant details layout for improved responsiveness and styling in index.html
* Revamp key pair component layout with improved styling and functionality. Added a header with a toggle for showing the private key, enhanced QR code display for both public and private keys, and included copy buttons for better user interaction.
Update key pair component styling and functionality: adjust QR code dimensions, improve key display format with truncation, and refine button margins for enhanced user experience.
Add 'show-buttons' prop to QR code components in key pair template for improved functionality
Update key pair component layout to use 'col-sm-6' for responsive design of QR code sections, enhancing display on smaller screens.
* Enhance direct messages component layout with improved styling and responsiveness. Updated class names for better alignment, added ellipsis for long customer labels, and modified button styles for consistency. Improved select options display with custom templates for better user experience.
* Refactor customer label generation in direct messages component for improved readability. Added checks for undefined customer data, enhanced label formatting with truncation for long descriptions, and adjusted unread message display format.
* make format