Commit Graph

17 Commits

Author SHA1 Message Date
Xiaoxia AI f0cf4e2c14 feat(quota): add quota checking and management system
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 6s
Tests / lint (push) Failing after 5s
- Implement QuotaChecker for project and storage limits
- Check project count before creation (respect max_projects)
- Check storage availability before upload
- Get quota status with usage percentages
- Update storage usage (increase/decrease)
- Define warning levels (normal/warning/critical/exceeded)
- Add ProjectRepository interface for project counting
- Add 14 comprehensive unit tests (all passed)

Phase 4 Task 22/68 completed
2026-06-17 07:24:14 +08:00
Xiaoxia AI 6e1b0786d8 feat(subscription): add upgrade and cancel subscription use cases
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 6s
Tests / lint (push) Failing after 5s
- Implement UpgradeSubscriptionUseCase (Free→Pro→Enterprise)
- Prevent downgrades (must use cancel to return to Free)
- Auto-set quotas and expiration date on upgrade
- Implement CancelSubscriptionUseCase to downgrade to Free
- Only workspace owner can manage subscription
- Add 8 comprehensive unit tests (all passed)

Phase 4 Task 21/68 completed
2026-06-17 07:20:34 +08:00
Xiaoxia AI fa2c9968e6 feat(permissions): add permission system and checker
Deploy / Deploy Staging (push) Failing after 5s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 6s
Tests / lint (push) Failing after 5s
- Implement PermissionChecker for workspace access control
- Define Permission constants for all operations
- Define ROLE_PERMISSIONS mapping (Owner/Admin/Member/Viewer)
- Support workspace/member/project/asset permission checks
- Helper functions: check_is_owner, check_can_manage_members, etc.
- Add 15 comprehensive unit tests (all passed)

Phase 4 Task 20/68 completed
2026-06-17 07:16:02 +08:00
Xiaoxia AI a040f33d6a feat(workspace): add list members use case
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 6s
Tests / lint (push) Failing after 5s
- Implement ListMembersUseCase to get all workspace members
- Return member info with user details (username, email, display_name)
- Show role, inviter, and join time for each member
- Only workspace members can view member list
- Add 6 comprehensive unit tests (all passed)

Phase 4 Task 18/68 completed
2026-06-17 07:06:33 +08:00
Xiaoxia AI 6f3c881322 feat(workspace): add list workspaces and get detail use cases
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 7s
Tests / lint (push) Failing after 5s
- Implement ListWorkspacesUseCase to get user's all workspaces
- Return workspace info with user's role and member count
- Implement GetWorkspaceDetailUseCase with permission check
- Show detailed subscription and storage info
- Verify user is member before showing details
- Add 8 comprehensive unit tests (all passed)

Phase 4 Task 17/68 completed
2026-06-17 07:04:55 +08:00
Xiaoxia AI ce33eb900d feat(workspace): add update member role use case
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 6s
Tests / lint (push) Failing after 6s
- Implement UpdateMemberRoleUseCase with role-based permission
- Owner/Admin can change roles, but Admin cannot change other Admins
- Cannot change owner's role or change your own role
- Cannot change to owner role (owner is unique)
- Validate role not already assigned
- Add 8 comprehensive unit tests (all passed)

Phase 4 Task 16/68 completed
2026-06-17 05:12:34 +08:00
Xiaoxia AI 0bb499e039 feat(workspace): add remove member and leave workspace use cases
Deploy / Deploy Staging (push) Failing after 5s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 7s
Tests / lint (push) Failing after 5s
- Implement RemoveMemberUseCase with role-based permission
- Owner/Admin can remove members, but Admin cannot remove other Admins
- Cannot remove workspace owner or remove yourself
- Implement LeaveWorkspaceUseCase for self-removal
- Owner cannot leave (must transfer ownership or delete workspace first)
- Add 9 comprehensive unit tests (all passed)

Phase 4 Task 15/68 completed
2026-06-17 05:10:06 +08:00
Xiaoxia AI a8a1f6d290 feat(workspace): add accept and decline invitation use cases
Deploy / Deploy Staging (push) Failing after 5s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 6s
Tests / lint (push) Failing after 5s
- Implement AcceptInvitationUseCase with validation
- Check invitation status, expiration, and email match
- Auto-create WorkspaceMember on accept
- Handle case when user is already a member
- Implement DeclineInvitationUseCase to reject invitations
- Update invitation status (accepted/declined/expired)
- Add 9 comprehensive unit tests (all passed)

Phase 4 Task 14/68 completed
2026-06-17 05:08:31 +08:00
Xiaoxia AI bcc3089f53 feat(workspace): add invite member use case
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 6s
Tests / lint (push) Failing after 5s
- Implement InviteMemberUseCase with role-based permission check
- Only owner/admin can invite members (not regular members)
- Cannot invite as owner (owner is unique per workspace)
- Check for duplicate invitations and existing members
- Generate invitation token with 7-day expiration
- Send invitation email with accept link
- Add 7 comprehensive unit tests (all passed)

Phase 4 Task 13/68 completed
2026-06-17 05:06:57 +08:00
Xiaoxia AI c44ec56207 feat(workspace): add create workspace use case
Deploy / Deploy Staging (push) Failing after 7s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 7s
Tests / lint (push) Failing after 7s
- Implement CreateWorkspaceUseCase with subscription plan support
- Auto-configure quotas based on plan (free/pro/enterprise)
- Auto-create owner membership record on workspace creation
- Validate workspace name (required, max 100 chars)
- Validate owner user exists before creation
- Add 7 comprehensive unit tests (all passed)

Phase 4 Task 12/68 completed
2026-06-17 01:28:09 +08:00
Xiaoxia AI 1aa111ffd2 feat(auth): add password reset functionality
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 8s
Tests / lint (push) Failing after 9s
- Implement RequestPasswordResetUseCase to generate reset token
- Send password reset email with 1-hour expiration
- Implement ResetPasswordUseCase to verify token and update password
- Security: return success even if user not exists (avoid enumeration)
- Validate new password strength before reset
- Clear reset token after successful password change
- Add 9 comprehensive unit tests (all passed)

Phase 4 Task 8/68 completed
2026-06-17 01:25:53 +08:00
Xiaoxia AI 651bbd0142 feat(auth): add login, logout and refresh token use cases
Deploy / Deploy Staging (push) Failing after 8s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 7s
Tests / lint (push) Failing after 6s
- Implement LoginUseCase with password verification and JWT token generation
- Generate user_auth token (without workspace) for initial login
- Create session with refresh_token in Redis
- Track last_login_at and last_login_ip
- Implement LogoutUseCase for single device or all devices
- Add RefreshTokenUseCase placeholder (to be implemented)
- Add 9 comprehensive unit tests (all passed)

Phase 4 Task 7/68 completed
2026-06-17 01:24:45 +08:00
Xiaoxia AI 424327c762 feat(auth): add user registration with email verification
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 8s
Tests / lint (push) Failing after 7s
- Implement RegisterUserUseCase with password validation and email verification
- Implement VerifyEmailUseCase for email confirmation
- Add UserRepository interface and InMemoryUserRepository implementation
- Support duplicate email/username checking
- Generate verification tokens and send verification emails
- Add 9 comprehensive unit tests (all passed)

Phase 4 Task 6/68 completed
2026-06-17 01:20:40 +08:00
Xiaoxia AI c72be74727 feat(auth): add email service with SMTP support
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 7s
Tests / lint (push) Failing after 6s
- Implement EmailService class with configurable SMTP
- Support verification/password-reset/invitation email templates
- Support HTML and plain text fallback
- Support CC/BCC recipients
- Add 8 comprehensive unit tests with Mock SMTP (all passed)

Phase 4 Task 4/68 completed
2026-06-17 01:17:19 +08:00
Xiaoxia AI 402a767d33 feat(auth): add Redis session store for refresh tokens
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 9s
Tests / lint (push) Failing after 8s
- Implement SessionStore class with Redis backend
- Support save/get/delete session and refresh_token
- Support user multi-device sessions management
- Add last_active tracking and force logout all devices
- Add 10 comprehensive unit tests with Mock Redis (all passed)
- Install redis dependency

Phase 4 Task 3/68 completed
2026-06-17 01:15:08 +08:00
Xiaoxia AI 16f715a1e0 feat(auth): add bcrypt password hasher with strength validator
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 8s
Tests / lint (push) Failing after 7s
- Implement PasswordHasher class with bcrypt (cost=12)
- Add PasswordValidator for password strength checking
- Support min length, uppercase, lowercase, digit, special chars
- Add 18 comprehensive unit tests (all passed)
- Install bcrypt dependency

Phase 4 Task 2/68 completed
2026-06-17 01:08:10 +08:00
Xiaoxia AI e344fe2e9e feat(auth): add JWT service with sign/verify/refresh functionality
Deploy / Deploy Staging (push) Failing after 5s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 8s
Tests / lint (push) Failing after 7s
- Implement JWTService class with access_token and refresh_token support
- Add token type validation (access vs refresh)
- Add comprehensive unit tests (9 tests all passed)
- Install PyJWT dependency

Phase 4 Task 1/68 completed
2026-06-17 01:01:22 +08:00