diff --git a/migrations.py b/migrations.py index 8f32e80..702b634 100644 --- a/migrations.py +++ b/migrations.py @@ -111,3 +111,12 @@ async def m001_initial(db): await db.execute( "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 '';" + ) diff --git a/models.py b/models.py index 78b7e27..8a239e3 100644 --- a/models.py +++ b/models.py @@ -99,6 +99,10 @@ class CreateRoomData(BaseModel): location: str = "" geohash: str = "" # -> NIP-99 "g" tag 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): @@ -115,6 +119,7 @@ class Room(BaseModel): location: str = "" geohash: str = "" images: list[str] = Field(default_factory=list) + checkin_instructions: str = "" # private; sent in the check-in DM only status: RoomStatus = RoomStatus.inactive listing_event_id: str | None = None # id of the last published kind:30402 created_at: datetime = Field(default_factory=_now)