Project - thenibirahmed/wp-client-management GitHub Wiki

Project overview page..

For topbar ->

Note: This is for all project overviews like invoices, revenue, dues, and the total project number.

   /projects-overview

We can filter the overview with date range + currency.

example,

   /projects-overview?from=2010-09-15&to=2024-09-30&currency=BDT 

For the projects table ->

Note: All projects with client names and other stuff must be shown below the overview topbar.

   /projects

We can filter projects with date range + status_id + priority_id + search .

example,

   /projects?from=2010-09-15&to=2024-09-30&status_id={id}&priority_id={id}&search=blablabla

Create a project ->

Note: We need a few API's according to the project create form need,

   /select-employee
   /select-client
   /select/project/status
   /select/project/priority
   /select-currency

payload for creating a project ->

  {
      title : '',
      manager_id: , // this will come from the "/select-employee" endpoint.
      client_id: , // In this case, the client_id should be autoselected.
      status_id: , // this will come from the "/select/project/status" endpoint.
      priority_id: , // this will come from the "/select/project/priority" endpoint.
      currency_id: , // this will come from the "/select-currency endpoint. /optional
      budget: ,
      start_date: '',
      due_date: '',
      description: ,
      assignee_ids: [], // we can assign employees while creating a project, Those ids will come from "/select-employee" endpoint, and it must be an 
                           array. Just pass the IDs of the employee. 
}
 

Update project ->

First, we need the project details for filling out the update form.

   /project/{id}/edit

Note: All assigned employees of the project should be selected. It should match with the "/select-employee" endpoints response.

Note: We need a few API's according to the project update form need,

   /select-employee
   /select-client
   /select/project/status
   /select/project/priority
   /select-currency

payload for updating a project ->

  {
      title : '',
      manager_id: , //This will come from the "/select-employee" endpoint.
      client_id: , // In this case, the client_id should be autoselected.
      status_id: , // this will come from the "/select/project/status" endpoint.
      priority_id: , // This will come from the "/select/project/priority" endpoint.
      currency_id: , // this will come from the "/select-currency endpoint. /optional
      budget: ,
      start_date: '',
      due_date: '',
      description: ,
      assignee_ids: [], // previous assigned ids will selected and we can reduce or add employees from the update page. / Just pass the id of the employee.
}

There are a few tabs (tasks, invoices, notes, files, email). We have to call 1 API per tab.

Tasks

   /project/{id}/tasks

We can filter tasks by date range, status_id , priority_id, and search

   /project/{id}/tasks?from=2010-09-15&to=2024-09-30&status_id={id}&priority_id={id}&search={blablabla} 

Create a task

   /task/create

Note: We need two APIs to create a task:

   /select-employee
   /select/task/priority
   /select/task/status

Payload for creating task

 {
    title : '',
    project_id:  ,   // project should auto-selected 
    assigned_to : ,  // this will come from the "/select-employee" endpoint
    priority_id : ,  // this will come from the "/select/task/priority" endpoint 
    status_id : ,  // this will come from the "/select/task/status" endpoint 
    start_date : '',
    end_date : ,
    description : ,
 }

Update task,

Endpoint for getting task details,

   /task/{id}/edit

Note: We need two APIs to create a task:

   /select-employee
   /select/task/priority
   /select/task/status

Payload for updating task

 {
    title : '',
    assigned_to : ,  // this will come from the "/select-employee" endpoint
    priority_id : ,  // this will come from the "/select/task/priority" endpoint 
    status_id : ,  // this will come from the "/select/task/status" endpoint 
    start_date : '',
    end_date : ,
    description : ,
 }

Invoices

   /project/{id}/invoices

Filter & Search for invoices.

   /project/{id}/invoices?from=2010-09-15&to=2024-09-30&status_id={id}&currency=BDT&search=blablabla // search with code, total or project title or client name  

Create an Invoice ->

Endpoint

   /invoice/create

Note: We need a few API's according to the invoice creation form need,

   /select-project
   /select-currency
   /select-payment-method
   /select-employee // for showing the name in billing from 
   /select-client   // In this case, the client_id should auto-select
   /employee/{id}/details //for auto-filling address, phone number & email
   /client/{id}/details  // for auto-filling address , phone number & email 
   /select-client

Payload for creating an invoice

 {
    client_id: , // current selected client ID
    project_id : , // must be pre-selected from "/select-project" 
    title : '',
    invoice_number: '',
    payment_method_id : ,  // this will come from the "/select-payment-method" endpoint    
    currency_id : ,  // this will come from the "/select-currency" endpoint
    date: '',
    due_date: '',
    bill_to_id: , // the client id . 
    billing_address: '',  // this will come from "/client/{id}/details"
    billing_phone_number: , // "/client/{id}/details"
    billing_email: , // "/client/{id}/details"
    bill_from_id: , // the EicCrmUser id ,  
    bill_from_address: '',  // this will come from "/employee/{id}/details"
    bill_from_phone_number: , // "/client/{id}/details"
    bill_from_email: , // "/client/{id}/details"
    note: '', 

    // below data will come after the calculation of the Invoice item,
    sub_total: ,
    total: ,
    discount: ,
    tax: ,
    fee: ,
    
   // A single invoice might have multiple items, all items should pass as an array,
   invoice_items: [
            {
                details: '',  
                quantity: '',
                unit_price: '',
                discount_type: '',
                discount_value: '',
                tax_type: '',
                tax_value: '',
                line_total: ''
            },
            {
                details: '',  
                quantity: '',
                unit_price: '',
                discount_type: '',
                discount_value: '',
                tax_type: '',
                tax_value: '',
                line_total: ''
            }

     ]

 }

Update Invoice,

Note: Endpoint for getting the invoice data,

   /invoice/{id}/edit

Note: We need a few API's according to the project create form need,

   /select-project
   /select-currency
   /select-payment-method
   /select-employee // for showing the name in billing from 
   /select-client   // In this case, the client_id should auto-select
   /employee/{id}/details //for auto-filling address, phone number & email
   /client/{id}/details  // for auto-filling address , phone number & email 
   /select-client

Update endpoint,

   /invoice/update/{id}

Payload for updating an invoice

 {
    client_id: , // current selected client ID
    project_id : , // must be pre-selected from "/select-project" 
    title : '',
    invoice_number: '',
    payment_method_id : ,  // this will come from the "/select-payment-method" endpoint    
    currency_id : ,  // this will come from the "/select-currency" endpoint
    date: '',
    due_date: '',
    billing_address: '',  // this will come from "/client/{id}/details"
    billing_phone_number: , // "/client/{id}/details"
    billing_email: , // "/client/{id}/details"
    bill_from_address: '',  // this will come from "/employee/{id}/details"
    bill_from_phone_number: , // "/client/{id}/details"
    bill_from_email: , // "/client/{id}/details"
    note: '', 

    // below data will come after the calculation of the Invoice item,
    sub_total: ,
    total: ,
    discount: ,
    tax: ,
    fee: ,
    
   // A single invoice might have multiple items, all items should pass as a array,
   invoice_items: [
            {
                details: '',  
                quantity: '',
                unit_price: '',
                discount_type: '',
                discount_value: '',
                tax_type: '',
                tax_value: '',
                line_total: ''
            },
            {
                details: '',  
                quantity: '',
                unit_price: '',
                discount_type: '',
                discount_value: '',
                tax_type: '',
                tax_value: '',
                line_total: ''
            }

     ]

 }

Note: Previous invoice items will be retrieved from the "/invoice/{id}/edit" endpoint. If a new invoice item is added, it will not have an ID. All previous items must have an ID to update themselves properly.

Example:


 invoice_items: [
           // this is already added in this invoice , 
            {
                id: ,
                details: '',  
                quantity: '',
                unit_price: '',
                discount_type: '',
                discount_value: '',
                tax_type: '',
                tax_value: '',
                line_total: ''
            },
           // this is a new item we are adding,
            {
                details: '',  
                quantity: '',
                unit_price: '',
                discount_type: '',
                discount_value: '',
                tax_type: '',
                tax_value: '',
                line_total: ''
            }

     ]

Notes

Endpoint

/project/{id}/notes

Search & filter for notes .

   /project/{id}/notes?from=2010-09-15&to=2024-09-30&search=blablabla  // Search with note, creator 

Creating a note

Endpoint

/note/create

Payload for creating note

 {
    project_id : ,  // selected project id
    note: ''
 }

Endpoint for getting the note value

   /note/{id}/edit

Endpoint

/note/update/{id}

Payload for updating note

 {
    project_id : ,  // selected project id
    note: ''
 }

Files

   /project/{id}/files

Search & filter :

   /project/{id}/files?from=2010-09-15&to=2024-09-30&search=blablabla // search with title, url, author name

Create a file

Payload for creating a file

 {
    project_id : ,  // selected project_id
    title : '',
    url : '' 
}

Update File

Endpoint for getting the file value

   /file/{id}/edit

Endpoint

/file/update/{id}

Payload for updating a file

 {
    project_id : ,  // selected project_id
    title : '',
    url : '' 
}

Emails

   /project/{id}/emails
   /project/{id}/emails?from=2010-09-15&to=2024-09-30&search=blablabla // search with title, subject, body, name

Create an email

Payload for creating email

 {
    project_id : ,  // must be auto-selected
    subject : '',
    body : ,
 }

We have two single overview pages (task, email):

Single Email

   /email/{id}

Single Task

   /task/{id}

Note: In the single-task (/task/{id}) API response, all comments & replies are included. Please take a good look at the response

Add a comment on a task or reply to a task comment.

   /add-comment

Payload for Creating comment or reply

   {
       task_id : , // the selected task_id
       reply_to : , // if you selected any comment to send a reply to it. If there is a "reply_to" it is a reply , else top-level comment 
       comment : ''
   }