chatlabs
chatlabs copied to clipboard
Feature: invite by email to workspace
Implement Workspace User Management, Shared Billing, and Entity Visibility Enhancements
Context
Our application includes a Workspace entity that is currently hidden and not fully developed. Users have expressed a need for collaborative functionality within workspaces, such as inviting other users, sharing resources (like chats, assistants, prompts), and having unified billing for all users in a workspace.
We already have some visibility rules implemented:
- Each entity (e.g., chats, assistants, prompts) is associated with a
workspace_id
. - Entities have a
sharing
field set toprivate
orpublic
.
Please research these existing implementations and build upon them.
Problem
- User Collaboration: Users cannot invite others into the same workspace, limiting collaboration and shared access to workspace-related entities.
-
Shared Resources: Although entities are tied to a
workspace_id
, there is no functionality for multiple users to share the same workspace and access shared entities. - Unified Billing: Customers desire a single billing system associated with the workspace to cover all users within it, simplifying payment processes.
Currently, there is only one payment method (Stripe) associated with the user profile. This needs to be moved to the workspace level to enable workspace-based billing.
Solution
Implement the following features to enhance workspace functionality:
1. User Management
- Invitations: Allow users to invite others into their workspace via email.
- Member Management: Provide an interface for users to view and manage members within their workspace (e.g., remove members).
2. Workspace-Based Billing
- Billing Association: Modify the billing system to associate charges with the workspace rather than individual user profiles.
- Payment Methods: Move the Stripe payment method from being associated with user profiles to being associated with workspaces.
- Billing Overview: Provide a section where workspace owners can view billing history and current charges associated with the workspace.
- Access Control for Billing: Only workspace owners or designated billing contacts can manage payment methods and view billing information.
3. Entity Visibility Enhancements
- Shared Entities: Ensure that all entities (chats, assistants, prompts, and other related items) associated with a workspace are visible and accessible to all users within that workspace.
-
Existing Visibility Rules: Leverage and enhance the existing visibility rules that use
workspace_id
andsharing
fields to control access to entities. - Synchronization: Ensure that any changes to entities are reflected for all workspace members in real-time or near-real-time.
- Note: No need to implement additional visibility controls; focus on ensuring that existing entities are appropriately shared within the workspace.
Design Notes
- UI/UX Responsibility: There are no existing UI designs for these features. You are expected to leverage your knowledge of user experience principles to design intuitive and user-friendly interfaces for the new functionalities.
- Placement: Decisions about where and how the management features are integrated into the existing application are left to your discretion.
- Consistency: Maintain consistency with the application's existing design patterns and styling.
- User Experience: Consider the best practices for collaborative workspaces to provide an optimal user experience.
Acceptance Criteria
- Users can successfully invite and manage other users within their workspace.
- Billing is associated with the workspace, and all charges for workspace activities are consolidated under a single billing account.
- The Stripe payment method is moved from the user profile level to the workspace level.
- All entities related to a workspace are visible and accessible to all members of that workspace, leveraging the existing visibility rules.
- The implementation includes a user-friendly interface for managing users and billing, despite the absence of dedicated design resources.
- Code changes are clean, well-documented, and follow the project's coding standards.
- Use Your Best Judgment: Approach this task as you would in a professional setting. Demonstrate your best effort in terms of design decisions, code quality, and user experience. Think critically about the needs of the users and the application, and implement solutions that are efficient, scalable, and maintainable.
Delivery
- Pull Request: Submit a pull request (PR) with the implemented features to the repository.
- Testing Environment: Upon submission, an environment will be set up automatically for testing the PR.
- Review Process: The PR will undergo code review and testing to ensure all acceptance criteria are met.
Bounty
- Reward: A bounty of $300 will be awarded upon successful completion and approval of the PR.
If you have any questions or need further clarification during development, feel free to reach out to the team for support.