Skip to content

feat: implement Time Capture for Freelancers (DRC-179) #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jul 11, 2025

Conversation

PatrickDEissler
Copy link
Collaborator

@PatrickDEissler PatrickDEissler commented Jul 8, 2025

Freelancer Time Capture

Overview

The Freelancer Time Capture feature extends the Time Capture app to support external freelancers who need to log their working hours on projects and tasks.
This feature provides a simplified interface specifically designed for freelancers with restricted access to only the Time Capture module.

Key Features

1. Assisted Freelancer User Creation

  • Create Freelancer DocType: Allows System Managers to create new freelancer user accounts
  • Automatic Role Assignment: New users are automatically assigned the "Freelancer" role
  • Module Restrictions: All modules except "Time Capture" are blocked for freelancer users
  • User Permissions: Freelancers can only access their own time capture records

2. Freelancer Time Capture Document

New DocType: Freelancer Time Capture.

  • Simplified Interface: Streamlined form focused on time logging
  • User Validation: Only users with "Freelancer" role can create time capture records
  • Project & Task Logging: Log time against specific projects and tasks

Similiar (but simpler) to Time Capture.

3. Workspace Integration

  • Freelancer Workspace: Dedicated workspace with shortcuts for time capture
  • Quick Access: Direct links to create new time capture records
  • User Management: Link to view all freelancer users

Technical Implementation

Validation Rules

  • Duplicate Prevention: Only one time capture record per user per date
  • User Role Validation: Ensures only freelancers can create records
  • Task-Project Consistency: Validates that tasks belong to the specified project
  • Budget Validation: Checks task budget limits before submission
  • Description Validation: Requires meaningful notes for each time log

Integration Points

  • Timesheet Creation: Automatically creates timesheets upon submission
  • ERPNext Integration: Links to Projects, Tasks, and Timesheet modules
  • Billing Support: Supports billable vs non-billable time tracking

Usage Workflow

For System Managers

  1. Navigate to "Create Freelancer" in the Freelancer workspace
  2. Enter freelancer details (email, first name, last name)
  3. Submit to create user account with Freelancer role
  4. Freelancer receives welcome email with login credentials

For Freelancers

  1. Log in with provided credentials
  2. Access the Freelancer workspace
  3. Create new "Freelancer Time Capture" record
  4. Select date and add time logs with project, task, duration, and notes
  5. Submit the record to create associated timesheets

Permissions

  • System Manager: Full access to create freelancers and manage all records
  • Freelancer: Can only create, read, and submit their own time capture records
  • Accounts Manager/Projects Manager: Read and submit access to all records

Configuration

The feature integrates with the existing Time Capture settings and follows the same validation patterns as the main Time Capture functionality. No additional configuration is required beyond the standard Time Capture app setup.

@PatrickDEissler PatrickDEissler marked this pull request as ready for review July 11, 2025 13:19
@PatrickDEissler PatrickDEissler requested a review from Copilot July 11, 2025 13:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Implements Time Capture functionality for Freelancers by creating a new Freelancer Time Capture doctype that shares common validation logic with the existing Time Capture system. The feature includes freelancer user management, role-based permissions, and workspace configuration.

  • Creates Freelancer Time Capture doctype with shared validation and timesheet creation logic
  • Adds freelancer user creation and management system with restricted module access
  • Refactors common Time Capture logic into a shared controller module

Reviewed Changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
time_capture_controller.py New shared controller containing common validation and timesheet creation logic
freelancer_time_capture.py Main doctype implementation for freelancer time tracking
create_freelancer.py Utility doctype for creating pre-configured freelancer users
time_capture.py Refactored to use shared controller functions
patches/create_freelancer_role.py Database migration to create Freelancer role and permissions
time_capture_utils.js Shared JavaScript utilities for task queries

@PatrickDEissler PatrickDEissler merged commit dd974c4 into version-15 Jul 11, 2025
4 of 5 checks passed
@PatrickDEissler PatrickDEissler deleted the drc-179 branch July 11, 2025 14:03
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