Add generate-share-package endpoint for residence sharing

- Add POST /api/residences/:id/generate-share-package/ endpoint
- Add SharePackageResponse DTO with share code and metadata
- Add GenerateSharePackage service method to create one-time share codes
- Update JoinWithCode to deactivate share code after successful use

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-06 18:55:48 -06:00
parent 83384db014
commit 3b9e37d12b
5 changed files with 90 additions and 1 deletions

View File

@@ -91,6 +91,15 @@ type GenerateShareCodeResponse struct {
ShareCode ShareCodeResponse `json:"share_code"`
}
// SharePackageResponse represents the response for generating a share package
// This contains the share code plus metadata for the .casera file
type SharePackageResponse struct {
ShareCode string `json:"share_code"`
ResidenceName string `json:"residence_name"`
SharedBy string `json:"shared_by"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
// === Factory Functions ===
// NewResidenceUserResponse creates a ResidenceUserResponse from a User model