feat: add merchant profile edit, keys dialog, and publish to Nostr

- Add PATCH endpoint for updating merchant profile config
- Add website field to MerchantProfile model
- Fix to_nostr_event to include all profile fields (display_name, banner, website, nip05, lud16)
- Always publish merchant profile (kind 0) when publishing to Nostr
- Extract edit-profile-dialog and nostr-keys-dialog into separate components
- Fix profile avatar alignment to match original design
- Simplify keys dialog to show only npub QR code (no nsec QR)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ben Weeks 2025-12-24 12:42:03 +00:00
parent c3dea9f01d
commit a21b5289c1
12 changed files with 635 additions and 109 deletions

View file

@ -37,6 +37,7 @@ class MerchantProfile(BaseModel):
about: str | None = None
picture: str | None = None
banner: str | None = None
website: str | None = None
nip05: str | None = None
lud16: str | None = None
@ -90,11 +91,23 @@ class Merchant(PartialMerchant, Nostrable):
return merchant
def to_nostr_event(self, pubkey: str) -> NostrEvent:
content = {
"name": self.config.name,
"about": self.config.about,
"picture": self.config.picture,
}
content: dict[str, str] = {}
if self.config.name:
content["name"] = self.config.name
if self.config.display_name:
content["display_name"] = self.config.display_name
if self.config.about:
content["about"] = self.config.about
if self.config.picture:
content["picture"] = self.config.picture
if self.config.banner:
content["banner"] = self.config.banner
if self.config.website:
content["website"] = self.config.website
if self.config.nip05:
content["nip05"] = self.config.nip05
if self.config.lud16:
content["lud16"] = self.config.lud16
event = NostrEvent(
pubkey=pubkey,
created_at=round(time.time()),