E-Trans Documentation
Developed by Pratik Dimble | Tested by Swapnil Kharat Contact Me

Customer Module

The Customer Module in E-Trans Dashboard allows users to add, update, and manage customer information. This module ensures accurate records for customers associated with the companies on the platform.


๐Ÿ”น Features


๐Ÿ–ฅ๏ธ Form Fields

Field Type Description
Name Text Customer name (Required)
Address Text Full address of the customer (Required)
Mobile No Text Indian mobile number, 10 digits starting with 6-9 (Required)
GSTIN Text GST Identification Number (Required)

โšก Validations

Mobile Number

GSTIN


๐Ÿ“ Example Usage (Vue 3 + Pinia)

import { ref } from 'vue'
import apiClient from '@/axios'

const customer = ref({
  name: 'John Doe',
  address: '456, Industrial Road, Pune',
  mobileNo: '9876543210',
  gstin: '27ABCDE1234F2Z5'
})

const saveCustomer = async () => {
  try {
    await apiClient.post('/customer', customer.value)
    console.log('Customer added successfully')
  } catch (error) {
    console.error('Error saving customer', error)
  }
}

๐Ÿ”— API Endpoints

Action Method Endpoint Description
Add Customer POST /customer Add a new customer
Update Customer PUT /customer/{id} Update an existing customer
Get Customer GET /customer/{id} Fetch a single customerโ€™s details
List Customers GET /customer Fetch all customers

โœ… Workflow

  1. Navigate to Customers from the sidebar.
  2. Click Add Customer or Edit an existing customer.
  3. Fill in all required fields.
  4. Validation will prevent invalid Mobile Numbers or GSTIN.
  5. Click Save or Update.
  6. Toast notifications will appear:

    • โœ… Success
    • โš  Warning (e.g., duplicate customer)
    • โŒ Error (validation failure or server error)
  7. On success, the page redirects to Customer List.

๐Ÿ“ท Screenshot (Example)

Customer Module