Skip to content

Feat/collection sharing backend#154

Open
INagaty wants to merge 9 commits into
ZimengXiong:mainfrom
CalibtOS:feat/collection-sharing-backend
Open

Feat/collection sharing backend#154
INagaty wants to merge 9 commits into
ZimengXiong:mainfrom
CalibtOS:feat/collection-sharing-backend

Conversation

@INagaty
Copy link
Copy Markdown

@INagaty INagaty commented Apr 27, 2026

PR request for the feature of collection sharing for backend changes only
This pull request introduces support for sharing collections with other users, including view and edit roles, and adds comprehensive integration tests for collection sharing. It also adds the new CollectionShare model to the Prisma schema and migration files, updates relationships in existing models, and makes minor code formatting improvements.

Collection Sharing Feature:

  • Added a new CollectionShare model and corresponding database migration to support sharing collections with users, including fields for role, createdByUserId, and unique constraints. [1] [2]
  • Updated the User and Collection models to include relations to CollectionShare, enabling tracking of shares for both collections and users. [1] [2]

Integration Tests:

  • Added a comprehensive integration test suite (collection-sharing.integration.ts) to verify collection sharing, access control for view/edit roles, revocation of access, and behavior when collections are deleted.

Schema and Code Cleanups:

  • Removed inline comments from Prisma schema fields and normalized field formatting for consistency. [1] [2] [3] [4]
  • Applied code formatting improvements in sharing.ts for readability, including consistent parameter formatting and line breaks. [1] [2] [3] [4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant