feat: NIP-17 gift-wrapped check-in DM on confirmation (#5) #12

Merged
padreug merged 4 commits from feat/checkin-dm into main 2026-07-19 20:55:34 +00:00
2 changed files with 14 additions and 0 deletions
Showing only changes of commit df95fd37dc - Show all commits

feat: add Room.checkin_instructions + migration

Private per-room access details (address, gate/door code). Sent to the
guest only in the encrypted check-in DM after payment — never in the
public listing. m002 adds the column (default '').

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VUQCfdqiLSsFS2jcGnaFD
Padreug 2026-07-19 20:34:12 +02:00

View file

@ -111,3 +111,12 @@ async def m001_initial(db):
await db.execute( await db.execute(
"CREATE INDEX idx_chatelet_blocks_room ON chatelet.blocks (room_id);" "CREATE INDEX idx_chatelet_blocks_room ON chatelet.blocks (room_id);"
) )
async def m002_room_checkin_instructions(db):
"""Private per-room access details (address, gate code), sent to the guest
only in the encrypted NIP-17 check-in DM after payment never public."""
await db.execute(
"ALTER TABLE chatelet.rooms ADD COLUMN checkin_instructions TEXT "
"NOT NULL DEFAULT '';"
)

View file

@ -99,6 +99,10 @@ class CreateRoomData(BaseModel):
location: str = "" location: str = ""
geohash: str = "" # -> NIP-99 "g" tag geohash: str = "" # -> NIP-99 "g" tag
images: list[str] = Field(default_factory=list) images: list[str] = Field(default_factory=list)
# Private access details (address, gate/door code) sent to the guest only
# after payment, over the encrypted NIP-17 check-in DM. Never in the
# public listing.
checkin_instructions: str = ""
class Room(BaseModel): class Room(BaseModel):
@ -115,6 +119,7 @@ class Room(BaseModel):
location: str = "" location: str = ""
geohash: str = "" geohash: str = ""
images: list[str] = Field(default_factory=list) images: list[str] = Field(default_factory=list)
checkin_instructions: str = "" # private; sent in the check-in DM only
status: RoomStatus = RoomStatus.inactive status: RoomStatus = RoomStatus.inactive
listing_event_id: str | None = None # id of the last published kind:30402 listing_event_id: str | None = None # id of the last published kind:30402
created_at: datetime = Field(default_factory=_now) created_at: datetime = Field(default_factory=_now)