code sanitized removed mail refernces and url refernces ualong with that routes are secured
This commit is contained in:
parent
80ed407cd8
commit
2fa52b90e3
@ -27,7 +27,6 @@ import { CreateAdminRequest } from '@/pages/CreateAdminRequest/CreateAdminReques
|
||||
import { ApprovalActionModal } from '@/components/modals/ApprovalActionModal';
|
||||
import { Toaster } from '@/components/ui/sonner';
|
||||
import { toast } from 'sonner';
|
||||
import { CUSTOM_REQUEST_DATABASE } from '@/utils/customRequestDatabase';
|
||||
import { AuthCallback } from '@/pages/Auth/AuthCallback';
|
||||
import { createClaimRequest } from '@/services/dealerClaimApi';
|
||||
import { ManagerSelectionModal } from '@/components/modals/ManagerSelectionModal';
|
||||
@ -193,7 +192,7 @@ function AppRoutes({ onLogout }: AppProps) {
|
||||
|
||||
// Regular custom request submission (old flow without API)
|
||||
// Generate unique ID for the new custom request
|
||||
const requestId = `RE-REQ-2024-${String(Object.keys(CUSTOM_REQUEST_DATABASE).length + dynamicRequests.length + 1).padStart(3, '0')}`;
|
||||
const requestId = `RE-REQ-2024-${String(dynamicRequests.length + 1).padStart(3, '0')}`;
|
||||
|
||||
// Create full custom request object
|
||||
const newCustomRequest = {
|
||||
@ -217,7 +216,7 @@ function AppRoutes({ onLogout }: AppProps) {
|
||||
name: 'Current User',
|
||||
role: requestData.initiatorRole || 'Employee',
|
||||
department: requestData.department || 'General',
|
||||
email: 'current.user@royalenfield.com',
|
||||
email: 'current.user@{{API_DOMAIN}}',
|
||||
phone: '+91 98765 43290',
|
||||
avatar: 'CU'
|
||||
},
|
||||
|
||||
@ -297,17 +297,15 @@ export function ApprovalWorkflowStep({
|
||||
<div className="w-px h-6 bg-gray-300"></div>
|
||||
</div>
|
||||
|
||||
<div className={`p-4 rounded-lg border-2 transition-all ${
|
||||
approver.email
|
||||
<div className={`p-4 rounded-lg border-2 transition-all ${approver.email
|
||||
? 'border-green-200 bg-green-50'
|
||||
: 'border-gray-200 bg-gray-50'
|
||||
}`}>
|
||||
}`}>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className={`w-10 h-10 rounded-full flex items-center justify-center ${
|
||||
approver.email
|
||||
<div className={`w-10 h-10 rounded-full flex items-center justify-center ${approver.email
|
||||
? 'bg-green-600'
|
||||
: 'bg-gray-400'
|
||||
}`}>
|
||||
}`}>
|
||||
<span className="text-white font-semibold">{level}</span>
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
@ -336,7 +334,7 @@ export function ApprovalWorkflowStep({
|
||||
<Input
|
||||
id={`approver-${level}`}
|
||||
type="email"
|
||||
placeholder="approver@royalenfield.com"
|
||||
placeholder="approver@{{API_DOMAIN}}"
|
||||
value={approver.email || ''}
|
||||
onChange={(e) => handleApproverEmailChange(index, e.target.value)}
|
||||
className="h-10 border-2 border-gray-300 focus:border-blue-500 mt-1 w-full"
|
||||
|
||||
@ -454,7 +454,7 @@ function BackendAuthProvider({ children }: { children: ReactNode }) {
|
||||
try {
|
||||
setError(null);
|
||||
// Redirect to Okta login
|
||||
const oktaDomain = import.meta.env.VITE_OKTA_DOMAIN || 'https://dev-830839.oktapreview.com';
|
||||
const oktaDomain = import.meta.env.VITE_OKTA_DOMAIN || '{{IDP_DOMAIN}}';
|
||||
const clientId = import.meta.env.VITE_OKTA_CLIENT_ID || '0oa2jgzvrpdwx2iqd0h8';
|
||||
const redirectUri = `${window.location.origin}/login/callback`;
|
||||
const responseType = 'code';
|
||||
@ -497,8 +497,8 @@ function BackendAuthProvider({ children }: { children: ReactNode }) {
|
||||
// Detect which provider was used for login (check sessionStorage or user data)
|
||||
// If auth_provider is set, use it; otherwise check if we have Tanflow id_token pattern
|
||||
const authProvider = sessionStorage.getItem('auth_provider') ||
|
||||
(idToken && idToken.includes('tanflow') ? 'tanflow' : null) ||
|
||||
'okta'; // Default to OKTA if unknown
|
||||
(idToken && idToken.includes('tanflow') ? 'tanflow' : null) ||
|
||||
'okta'; // Default to OKTA if unknown
|
||||
|
||||
// Set logout flag to prevent auto-authentication after redirect
|
||||
// This must be set BEFORE clearing storage so it survives
|
||||
@ -672,7 +672,7 @@ function BackendAuthProvider({ children }: { children: ReactNode }) {
|
||||
export function _Auth0AuthProvider({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<Auth0Provider
|
||||
domain="https://dev-830839.oktapreview.com/oauth2/default/v1"
|
||||
domain="{{IDP_DOMAIN}}/oauth2/default/v1"
|
||||
clientId="0oa2j8slwj5S4bG5k0h8"
|
||||
authorizationParams={{
|
||||
redirect_uri: window.location.origin + '/login/callback',
|
||||
|
||||
@ -141,7 +141,7 @@ export function ClaimApproverSelectionStep({
|
||||
// Create new approver only if it doesn't exist
|
||||
if (step.isAuto) {
|
||||
// System steps
|
||||
const systemEmail = step.level === 8 ? 'finance@royalenfield.com' : 'system@royalenfield.com';
|
||||
const systemEmail = step.level === 8 ? 'finance@{{API_DOMAIN}}' : 'system@{{API_DOMAIN}}';
|
||||
const systemName = step.level === 8 ? 'System/Finance' : 'System';
|
||||
newApprovers.push({
|
||||
email: systemEmail,
|
||||
|
||||
@ -2519,7 +2519,7 @@ export function DealerClaimWorkflowTab({
|
||||
stepNumber={selectedStepForEmail?.stepNumber || 4}
|
||||
stepName={selectedStepForEmail?.stepName || 'Activity Creation'}
|
||||
requestNumber={request?.requestNumber || request?.id || request?.request_number}
|
||||
recipientEmail="system@royalenfield.com"
|
||||
recipientEmail="system@{{API_DOMAIN}}"
|
||||
/>
|
||||
|
||||
{/* Additional Approver Review Modal */}
|
||||
|
||||
@ -32,7 +32,7 @@ export function EmailNotificationTemplateModal({
|
||||
stepNumber,
|
||||
stepName,
|
||||
requestNumber = 'RE-REQ-2024-CM-101',
|
||||
recipientEmail = 'system@royalenfield.com',
|
||||
recipientEmail = 'system@{{API_DOMAIN}}',
|
||||
subject,
|
||||
emailBody,
|
||||
}: EmailNotificationTemplateModalProps) {
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import { useState, useEffect, useMemo, useCallback } from 'react';
|
||||
import workflowApi, { getPauseDetails } from '@/services/workflowApi';
|
||||
import apiClient from '@/services/authApi';
|
||||
import { CUSTOM_REQUEST_DATABASE } from '@/utils/customRequestDatabase';
|
||||
import { CLAIM_MANAGEMENT_DATABASE } from '@/utils/claimManagementDatabase';
|
||||
import { getSocket } from '@/utils/socket';
|
||||
|
||||
/**
|
||||
@ -213,9 +211,9 @@ export function useRequestDetails(
|
||||
*/
|
||||
const filteredActivities = Array.isArray(details.activities)
|
||||
? details.activities.filter((activity: any) => {
|
||||
const activityType = (activity.type || '').toLowerCase();
|
||||
return activityType !== 'sla_warning';
|
||||
})
|
||||
const activityType = (activity.type || '').toLowerCase();
|
||||
return activityType !== 'sla_warning';
|
||||
})
|
||||
: [];
|
||||
|
||||
/**
|
||||
@ -494,9 +492,9 @@ export function useRequestDetails(
|
||||
// Filter out TAT warnings from activities
|
||||
const filteredActivities = Array.isArray(details.activities)
|
||||
? details.activities.filter((activity: any) => {
|
||||
const activityType = (activity.type || '').toLowerCase();
|
||||
return activityType !== 'sla_warning';
|
||||
})
|
||||
const activityType = (activity.type || '').toLowerCase();
|
||||
return activityType !== 'sla_warning';
|
||||
})
|
||||
: [];
|
||||
|
||||
// Fetch pause details only if request is actually paused
|
||||
@ -657,15 +655,7 @@ export function useRequestDetails(
|
||||
// Primary source: API data
|
||||
if (apiRequest) return apiRequest;
|
||||
|
||||
// Fallback 1: Static custom request database
|
||||
const customRequest = CUSTOM_REQUEST_DATABASE[requestIdentifier];
|
||||
if (customRequest) return customRequest;
|
||||
|
||||
// Fallback 2: Static claim management database
|
||||
const claimRequest = CLAIM_MANAGEMENT_DATABASE[requestIdentifier];
|
||||
if (claimRequest) return claimRequest;
|
||||
|
||||
// Fallback 3: Dynamic requests passed as props
|
||||
// Fallback: Dynamic requests passed as props
|
||||
const dynamicRequest = dynamicRequests.find((req: any) =>
|
||||
req.id === requestIdentifier ||
|
||||
req.requestNumber === requestIdentifier ||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import { TokenManager } from '../utils/tokenManager';
|
||||
import axios from 'axios';
|
||||
|
||||
const TANFLOW_BASE_URL = import.meta.env.VITE_TANFLOW_BASE_URL || 'https://ssodev.rebridge.co.in/realms/RE';
|
||||
const TANFLOW_BASE_URL = import.meta.env.VITE_TANFLOW_BASE_URL || '{{IDP_DOMAIN}}/realms/RE';
|
||||
const TANFLOW_CLIENT_ID = import.meta.env.VITE_TANFLOW_CLIENT_ID || 'REFLOW';
|
||||
const TANFLOW_REDIRECT_URI = `${window.location.origin}/login/callback`;
|
||||
|
||||
|
||||
@ -2,166 +2,7 @@
|
||||
// This database is exclusively for claim management requests created via ClaimManagementWizard
|
||||
// Template: Claim Management (8-step workflow)
|
||||
|
||||
export const CLAIM_MANAGEMENT_DATABASE: any = {
|
||||
'RE-REQ-2024-CM-001': {
|
||||
id: 'RE-REQ-2024-CM-001',
|
||||
title: 'Dealer Marketing Activity Claim - Diwali Festival Campaign',
|
||||
description: 'Claim request for dealer-led Diwali festival marketing campaign including showroom decoration, test ride events, customer engagement activities, and promotional merchandise distribution. Activity conducted at Royal Motors Mumbai dealership.',
|
||||
category: 'Dealer Operations',
|
||||
subcategory: 'Claim Management',
|
||||
status: 'pending',
|
||||
priority: 'standard',
|
||||
amount: 'TBD',
|
||||
slaProgress: 35,
|
||||
slaRemaining: '4 days 12 hours',
|
||||
slaEndDate: 'Oct 16, 2024 5:00 PM',
|
||||
currentStep: 1,
|
||||
totalSteps: 8,
|
||||
template: 'claim-management',
|
||||
templateName: 'Claim Management',
|
||||
initiator: {
|
||||
name: 'Sneha Patil',
|
||||
role: 'Regional Marketing Coordinator',
|
||||
department: 'Marketing - West Zone',
|
||||
email: 'sneha.patil@royalenfield.com',
|
||||
phone: '+91 98765 43250',
|
||||
avatar: 'SP'
|
||||
},
|
||||
department: 'Marketing - West Zone',
|
||||
createdAt: 'Oct 7, 2024 9:30 AM',
|
||||
updatedAt: 'Oct 7, 2024 9:30 AM',
|
||||
dueDate: '2024-10-16T17:00:00Z',
|
||||
conclusionRemark: '',
|
||||
claimDetails: {
|
||||
activityName: 'Diwali Festival Campaign 2024',
|
||||
activityType: 'Marketing Activity',
|
||||
activityDate: 'Oct 5, 2024',
|
||||
location: 'Mumbai, Maharashtra',
|
||||
dealerCode: 'RE-MH-001',
|
||||
dealerName: 'Royal Motors Mumbai',
|
||||
dealerEmail: 'dealer@royalmotorsmumbai.com',
|
||||
dealerPhone: '+91 98765 12345',
|
||||
dealerAddress: '123 Main Street, Andheri West, Mumbai, Maharashtra 400053',
|
||||
requestDescription: 'Marketing campaign for Diwali festival including showroom decoration, test ride events, customer engagement activities, and promotional merchandise distribution at Royal Motors Mumbai dealership.',
|
||||
estimatedBudget: '₹2,45,000',
|
||||
periodStart: 'Oct 1, 2024',
|
||||
periodEnd: 'Oct 10, 2024'
|
||||
},
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Royal Motors Mumbai (Dealer)',
|
||||
role: 'Dealer - Document Upload',
|
||||
status: 'pending',
|
||||
tatHours: 72,
|
||||
elapsedHours: 12,
|
||||
assignedAt: '2024-10-07T09:30:00Z',
|
||||
comment: null,
|
||||
timestamp: null,
|
||||
description: 'Dealer uploads proposal document, cost breakup, timeline for closure, and other supporting documents'
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Sneha Patil (Initiator)',
|
||||
role: 'Initiator Evaluation',
|
||||
status: 'waiting',
|
||||
tatHours: 48,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null,
|
||||
description: 'Initiator reviews dealer documents and approves or requests modifications'
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'System Auto-Process',
|
||||
role: 'IO Confirmation',
|
||||
status: 'waiting',
|
||||
tatHours: 1,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null,
|
||||
description: 'Automatic IO (Internal Order) confirmation generated upon initiator approval'
|
||||
},
|
||||
{
|
||||
step: 4,
|
||||
approver: 'Rajesh Kumar',
|
||||
role: 'Department Lead Approval',
|
||||
status: 'waiting',
|
||||
tatHours: 72,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null,
|
||||
description: 'Department head approves and blocks budget in IO for this activity'
|
||||
},
|
||||
{
|
||||
step: 5,
|
||||
approver: 'Royal Motors Mumbai (Dealer)',
|
||||
role: 'Dealer - Completion Documents',
|
||||
status: 'waiting',
|
||||
tatHours: 120,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null,
|
||||
description: 'Dealer submits activity completion documents and description'
|
||||
},
|
||||
{
|
||||
step: 6,
|
||||
approver: 'Sneha Patil (Initiator)',
|
||||
role: 'Initiator Verification',
|
||||
status: 'waiting',
|
||||
tatHours: 48,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null,
|
||||
description: 'Initiator verifies completion documents and can modify approved amount'
|
||||
},
|
||||
{
|
||||
step: 7,
|
||||
approver: 'System Auto-Process',
|
||||
role: 'E-Invoice Generation',
|
||||
status: 'waiting',
|
||||
tatHours: 1,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null,
|
||||
description: 'Auto-generate e-invoice based on final approved amount'
|
||||
},
|
||||
{
|
||||
step: 8,
|
||||
approver: 'Meera Patel',
|
||||
role: 'Finance - Credit Note Issuance',
|
||||
status: 'waiting',
|
||||
tatHours: 48,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null,
|
||||
description: 'Finance team issues credit note to dealer'
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'Claim_Proposal_Diwali_2024.pdf', size: '1.8 MB', type: 'PDF', uploadedBy: 'Sneha Patil', uploadedAt: 'Oct 7, 2024 9:35 AM' },
|
||||
{ name: 'Cost_Breakup_Detailed.xlsx', size: '450 KB', type: 'Excel', uploadedBy: 'Sneha Patil', uploadedAt: 'Oct 7, 2024 9:38 AM' },
|
||||
{ name: 'Activity_Timeline.pdf', size: '320 KB', type: 'PDF', uploadedBy: 'Sneha Patil', uploadedAt: 'Oct 7, 2024 9:40 AM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Arjun Menon', role: 'Brand Manager', avatar: 'AM' },
|
||||
{ name: 'Finance Team', role: 'Budget Monitoring', avatar: 'FT' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Claim Request Created', details: 'Diwali festival campaign claim initiated using Claim Management template', user: 'Sneha Patil', timestamp: 'Oct 7, 2024 9:30 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Dealer', details: 'Dealer Royal Motors Mumbai assigned for document upload', user: 'System', timestamp: 'Oct 7, 2024 9:31 AM' },
|
||||
{ type: 'status_change', action: 'Workflow Started', details: 'Step 1: Dealer document upload phase initiated', user: 'System', timestamp: 'Oct 7, 2024 9:31 AM' }
|
||||
],
|
||||
tags: ['claim-management', 'dealer-activity', 'marketing', 'diwali-campaign', 'template']
|
||||
}
|
||||
};
|
||||
export const CLAIM_MANAGEMENT_DATABASE: any = {};
|
||||
|
||||
// API Endpoints for Claim Management (to be implemented with backend)
|
||||
export const CLAIM_MANAGEMENT_API_ENDPOINTS = {
|
||||
|
||||
@ -2,720 +2,7 @@
|
||||
// This database is exclusively for custom requests created via NewRequestWizard
|
||||
// Users define their own workflow, approvers, spectators, and tagged participants
|
||||
|
||||
export const CUSTOM_REQUEST_DATABASE: any = {
|
||||
'RE-REQ-2024-001': {
|
||||
id: 'RE-REQ-2024-001',
|
||||
title: 'Himalayan 450 Launch Campaign - Digital Media Blitz',
|
||||
description: 'Comprehensive digital marketing campaign for Himalayan 450 adventure motorcycle launch. Includes social media campaigns, influencer partnerships, performance marketing, content creation, and digital advertising across platforms. Target: Reach 10M adventure enthusiasts across India.\n\nEquipment Specifications:\n• 10x MacBook Pro 16-inch (M2 Pro chip)\n• 5x Professional Camera Kits (Canon EOS R5)\n• Video Editing Workstations\n• Social Media Management Tools',
|
||||
category: 'Marketing & Campaigns',
|
||||
subcategory: 'Digital Marketing',
|
||||
status: 'pending',
|
||||
priority: 'express',
|
||||
amount: '₹3,75,00,000',
|
||||
slaProgress: 65,
|
||||
slaRemaining: '8 hours 45 minutes',
|
||||
slaEndDate: 'Oct 9, 2024 5:00 PM',
|
||||
currentStep: 1,
|
||||
totalSteps: 3,
|
||||
template: 'custom',
|
||||
initiator: {
|
||||
name: 'Priya Sharma',
|
||||
role: 'Senior Digital Marketing Manager',
|
||||
department: 'Marketing',
|
||||
email: 'priya.sharma@royalenfield.com',
|
||||
phone: '+91 98765 43210',
|
||||
avatar: 'PS'
|
||||
},
|
||||
department: 'Marketing',
|
||||
createdAt: 'Oct 6, 2024 10:30 AM',
|
||||
updatedAt: 'Oct 7, 2024 2:15 PM',
|
||||
dueDate: '2024-10-09T17:00:00Z',
|
||||
conclusionRemark: '',
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Rajesh Kumar',
|
||||
role: 'Marketing Director - India',
|
||||
status: 'pending',
|
||||
tatHours: 24,
|
||||
elapsedHours: 22,
|
||||
assignedAt: '2024-10-06T10:30:00Z',
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Amit Desai',
|
||||
role: 'VP Product Marketing',
|
||||
status: 'waiting',
|
||||
tatHours: 48,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'Deepika Sharma',
|
||||
role: 'VP Sales & Marketing',
|
||||
status: 'waiting',
|
||||
tatHours: 72,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'Himalayan_450_Digital_Strategy.pdf', size: '5.2 MB', type: 'PDF', uploadedBy: 'Priya Sharma', uploadedAt: 'Oct 6, 2024 10:45 AM' },
|
||||
{ name: 'Budget_Breakdown_Q4_2024.xlsx', size: '980 KB', type: 'Excel', uploadedBy: 'Priya Sharma', uploadedAt: 'Oct 6, 2024 11:15 AM' },
|
||||
{ name: 'Influencer_Partnership_List.xlsx', size: '450 KB', type: 'Excel', uploadedBy: 'Marketing Team', uploadedAt: 'Oct 6, 2024 2:30 PM' },
|
||||
{ name: 'Creative_Campaign_Assets.zip', size: '125 MB', type: 'ZIP', uploadedBy: 'Creative Team', uploadedAt: 'Oct 6, 2024 4:15 PM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Sarah Khan', role: 'Brand Strategy Lead', avatar: 'SK' },
|
||||
{ name: 'Finance Team', role: 'Budget Approval', avatar: 'FT' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Request Created', details: 'New digital marketing campaign request submitted', user: 'Priya Sharma', timestamp: 'Oct 6, 2024 10:30 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Rajesh Kumar', details: 'Forwarded to Marketing Director for review', user: 'System', timestamp: 'Oct 6, 2024 10:31 AM' },
|
||||
{ type: 'comment', action: 'Work Note Added', details: 'Reviewed budget allocation and target metrics', user: 'Rajesh Kumar', timestamp: 'Oct 7, 2024 2:15 PM' },
|
||||
{ type: 'reminder', action: 'SLA Reminder', details: 'TAT approaching - 8 hours remaining', user: 'System', timestamp: 'Oct 7, 2024 8:15 AM' }
|
||||
],
|
||||
tags: ['digital-marketing', 'launch-campaign', 'himalayan-450', 'high-priority']
|
||||
},
|
||||
|
||||
'RE-REQ-2024-002': {
|
||||
id: 'RE-REQ-2024-002',
|
||||
title: 'New Laptop Procurement - Design Team Expansion',
|
||||
description: 'Purchase of 10 high-performance laptops for the newly expanded Product Design team. Required specifications: Latest generation processor, 32GB RAM, dedicated graphics card for 3D modeling and rendering work.',
|
||||
category: 'IT & Infrastructure',
|
||||
subcategory: 'Hardware Procurement',
|
||||
status: 'in-review',
|
||||
priority: 'standard',
|
||||
amount: '₹12,50,000',
|
||||
slaProgress: 45,
|
||||
slaRemaining: '2 days 8 hours',
|
||||
slaEndDate: 'Oct 11, 2024 5:00 PM',
|
||||
currentStep: 2,
|
||||
totalSteps: 3,
|
||||
template: 'custom',
|
||||
initiator: {
|
||||
name: 'Vikram Singh',
|
||||
role: 'Head - IT Operations',
|
||||
department: 'Information Technology',
|
||||
email: 'vikram.singh@royalenfield.com',
|
||||
phone: '+91 98765 43221',
|
||||
avatar: 'VS'
|
||||
},
|
||||
department: 'Information Technology',
|
||||
createdAt: 'Oct 5, 2024 9:15 AM',
|
||||
updatedAt: 'Oct 7, 2024 3:45 PM',
|
||||
dueDate: '2024-10-11T17:00:00Z',
|
||||
conclusionRemark: '',
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Meera Patel',
|
||||
role: 'IT Manager',
|
||||
status: 'approved',
|
||||
tatHours: 24,
|
||||
actualHours: 18,
|
||||
assignedAt: '2024-10-05T09:15:00Z',
|
||||
comment: 'Technical specifications verified. Hardware meets design team requirements.',
|
||||
timestamp: '2024-10-06T03:15:00Z'
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Anil Kapoor',
|
||||
role: 'Finance Manager',
|
||||
status: 'in-review',
|
||||
tatHours: 48,
|
||||
elapsedHours: 32,
|
||||
assignedAt: '2024-10-06T03:15:00Z',
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'Ramesh Kulkarni',
|
||||
role: 'VP Operations',
|
||||
status: 'waiting',
|
||||
tatHours: 72,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'Laptop_Specifications.pdf', size: '850 KB', type: 'PDF', uploadedBy: 'Vikram Singh', uploadedAt: 'Oct 5, 2024 9:20 AM' },
|
||||
{ name: 'Vendor_Quotations.xlsx', size: '1.2 MB', type: 'Excel', uploadedBy: 'Procurement Team', uploadedAt: 'Oct 5, 2024 11:45 AM' },
|
||||
{ name: 'Team_Expansion_Plan.pdf', size: '620 KB', type: 'PDF', uploadedBy: 'Design Team', uploadedAt: 'Oct 5, 2024 2:30 PM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Design Team Lead', role: 'End Users', avatar: 'DT' },
|
||||
{ name: 'Procurement Team', role: 'Vendor Management', avatar: 'PT' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Request Created', details: 'Laptop procurement request for design team', user: 'Vikram Singh', timestamp: 'Oct 5, 2024 9:15 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Meera Patel', details: 'IT Manager to verify specifications', user: 'System', timestamp: 'Oct 5, 2024 9:16 AM' },
|
||||
{ type: 'approval', action: 'Approved by Meera Patel', details: 'Technical specifications approved', user: 'Meera Patel', timestamp: 'Oct 6, 2024 3:15 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Anil Kapoor', details: 'Forwarded to Finance for budget approval', user: 'System', timestamp: 'Oct 6, 2024 3:15 AM' }
|
||||
],
|
||||
tags: ['hardware', 'procurement', 'design-team', 'laptops']
|
||||
},
|
||||
|
||||
'RE-REQ-2024-003': {
|
||||
id: 'RE-REQ-2024-003',
|
||||
title: 'Annual Service Center Expansion - Western Region',
|
||||
description: 'Proposal for opening 15 new authorized service centers across tier-2 cities in Western region. Includes infrastructure setup, technician training, spare parts inventory, and marketing support. Expected to improve service accessibility by 35% in the target region.',
|
||||
category: 'Operations & Expansion',
|
||||
subcategory: 'Service Network',
|
||||
status: 'pending',
|
||||
priority: 'standard',
|
||||
amount: '₹8,75,00,000',
|
||||
slaProgress: 78,
|
||||
slaRemaining: '1 day 4 hours',
|
||||
slaEndDate: 'Oct 10, 2024 5:00 PM',
|
||||
currentStep: 1,
|
||||
totalSteps: 4,
|
||||
template: 'custom',
|
||||
initiator: {
|
||||
name: 'Sanjay Reddy',
|
||||
role: 'Regional Service Manager - West',
|
||||
department: 'After Sales Service',
|
||||
email: 'sanjay.reddy@royalenfield.com',
|
||||
phone: '+91 98765 43232',
|
||||
avatar: 'SR'
|
||||
},
|
||||
department: 'After Sales Service',
|
||||
createdAt: 'Oct 3, 2024 8:45 AM',
|
||||
updatedAt: 'Oct 6, 2024 5:45 PM',
|
||||
dueDate: '2024-10-10T17:00:00Z',
|
||||
conclusionRemark: '',
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Ramesh Kulkarni',
|
||||
role: 'Head - After Sales Service',
|
||||
status: 'pending',
|
||||
tatHours: 72,
|
||||
elapsedHours: 85,
|
||||
assignedAt: '2024-10-03T08:45:00Z',
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Finance Team',
|
||||
role: 'Budget Allocation',
|
||||
status: 'waiting',
|
||||
tatHours: 96,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'Legal Team',
|
||||
role: 'Compliance Review',
|
||||
status: 'waiting',
|
||||
tatHours: 120,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 4,
|
||||
approver: 'Deepika Sharma',
|
||||
role: 'VP Sales & Marketing',
|
||||
status: 'waiting',
|
||||
tatHours: 72,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'Western_Region_Expansion_Plan.pdf', size: '7.5 MB', type: 'PDF', uploadedBy: 'Sanjay Reddy', uploadedAt: 'Oct 3, 2024 9:00 AM' },
|
||||
{ name: 'Service_Center_Requirements.xlsx', size: '2.8 MB', type: 'Excel', uploadedBy: 'Planning Team', uploadedAt: 'Oct 3, 2024 11:30 AM' },
|
||||
{ name: 'Customer_Demand_Analysis.pptx', size: '4.2 MB', type: 'PowerPoint', uploadedBy: 'Analytics Team', uploadedAt: 'Oct 4, 2024 2:15 PM' },
|
||||
{ name: 'ROI_Projections_Service_Network.xlsx', size: '1.9 MB', type: 'Excel', uploadedBy: 'Finance Team', uploadedAt: 'Oct 5, 2024 10:45 AM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Regional Managers', role: 'Service Operations', avatar: 'RM' },
|
||||
{ name: 'Training Team', role: 'Technician Development', avatar: 'TT' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Request Created', details: 'Service center expansion proposal submitted', user: 'Sanjay Reddy', timestamp: 'Oct 3, 2024 8:45 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Ramesh Kulkarni', details: 'Forwarded to Head of After Sales Service', user: 'System', timestamp: 'Oct 3, 2024 8:46 AM' },
|
||||
{ type: 'reminder', action: 'Reminder Sent', details: 'TAT breach reminder sent to approver', user: 'System', timestamp: 'Oct 6, 2024 5:45 PM' },
|
||||
{ type: 'updated', action: 'Additional Documents', details: 'ROI projections added by finance team', user: 'Finance Team', timestamp: 'Oct 5, 2024 10:45 AM' }
|
||||
],
|
||||
tags: ['service-expansion', 'western-region', 'tier2-cities', 'overdue']
|
||||
},
|
||||
|
||||
'RE-REQ-2024-004': {
|
||||
id: 'RE-REQ-2024-004',
|
||||
title: 'Employee Training Program - Advanced Motorcycle Mechanics',
|
||||
description: 'Comprehensive training program for 50 service center technicians covering advanced diagnostics, electrical systems, fuel injection troubleshooting, and customer service excellence. Program duration: 3 weeks. Includes certification upon completion.',
|
||||
category: 'Human Resources',
|
||||
subcategory: 'Training & Development',
|
||||
status: 'approved',
|
||||
priority: 'standard',
|
||||
amount: '₹18,50,000',
|
||||
slaProgress: 100,
|
||||
slaRemaining: 'Completed',
|
||||
slaEndDate: 'Oct 5, 2024 5:00 PM',
|
||||
currentStep: 3,
|
||||
totalSteps: 3,
|
||||
template: 'custom',
|
||||
initiator: {
|
||||
name: 'Kavita Menon',
|
||||
role: 'Training Manager',
|
||||
department: 'Human Resources',
|
||||
email: 'kavita.menon@royalenfield.com',
|
||||
phone: '+91 98765 43243',
|
||||
avatar: 'KM'
|
||||
},
|
||||
department: 'Human Resources',
|
||||
createdAt: 'Sep 28, 2024 11:00 AM',
|
||||
updatedAt: 'Oct 5, 2024 4:30 PM',
|
||||
dueDate: '2024-10-05T17:00:00Z',
|
||||
submittedDate: '2024-09-28T11:00:00Z',
|
||||
estimatedCompletion: 'Oct 5, 2024',
|
||||
currentApprover: 'Completed',
|
||||
approverLevel: '3 of 3',
|
||||
conclusionRemark: 'All approvals completed. Training program scheduled for November 2024.',
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Ramesh Kulkarni',
|
||||
role: 'Head - After Sales Service',
|
||||
status: 'approved',
|
||||
tatHours: 48,
|
||||
actualHours: 36,
|
||||
assignedAt: '2024-09-28T11:00:00Z',
|
||||
comment: 'Excellent initiative. Training content approved.',
|
||||
timestamp: 'Sep 29, 2024 11:00 PM'
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Anil Kapoor',
|
||||
role: 'Finance Manager',
|
||||
status: 'approved',
|
||||
tatHours: 72,
|
||||
actualHours: 48,
|
||||
assignedAt: '2024-09-29T23:00:00Z',
|
||||
comment: 'Budget approved. Cost per participant is reasonable.',
|
||||
timestamp: 'Oct 1, 2024 11:00 PM'
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'Deepika Sharma',
|
||||
role: 'VP Sales & Marketing',
|
||||
status: 'approved',
|
||||
tatHours: 96,
|
||||
actualHours: 72,
|
||||
assignedAt: '2024-10-01T23:00:00Z',
|
||||
comment: 'Final approval granted. Proceed with program execution.',
|
||||
timestamp: 'Oct 5, 2024 4:30 PM'
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'Training_Curriculum.pdf', size: '3.2 MB', type: 'PDF', uploadedBy: 'Kavita Menon', uploadedAt: 'Sep 28, 2024 11:15 AM' },
|
||||
{ name: 'Trainer_Profiles.pdf', size: '1.8 MB', type: 'PDF', uploadedBy: 'HR Team', uploadedAt: 'Sep 28, 2024 2:45 PM' },
|
||||
{ name: 'Budget_Training_Program.xlsx', size: '680 KB', type: 'Excel', uploadedBy: 'Finance Team', uploadedAt: 'Sep 29, 2024 10:30 AM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Service Center Managers', role: 'Participant Coordination', avatar: 'SC' },
|
||||
{ name: 'Quality Assurance', role: 'Training Quality', avatar: 'QA' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Request Created', details: 'Training program proposal submitted', user: 'Kavita Menon', timestamp: 'Sep 28, 2024 11:00 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Ramesh Kulkarni', details: 'Forwarded to After Sales Service Head', user: 'System', timestamp: 'Sep 28, 2024 11:01 AM' },
|
||||
{ type: 'approval', action: 'Approved by Ramesh Kulkarni', details: 'Level 1 approval completed', user: 'Ramesh Kulkarni', timestamp: 'Sep 29, 2024 11:00 PM' },
|
||||
{ type: 'assignment', action: 'Assigned to Anil Kapoor', details: 'Forwarded to Finance Manager', user: 'System', timestamp: 'Sep 29, 2024 11:01 PM' },
|
||||
{ type: 'approval', action: 'Approved by Anil Kapoor', details: 'Budget approval completed', user: 'Anil Kapoor', timestamp: 'Oct 1, 2024 11:00 PM' },
|
||||
{ type: 'assignment', action: 'Assigned to Deepika Sharma', details: 'Forwarded to VP for final approval', user: 'System', timestamp: 'Oct 1, 2024 11:01 PM' },
|
||||
{ type: 'approval', action: 'Approved by Deepika Sharma', details: 'Final approval - Request completed', user: 'Deepika Sharma', timestamp: 'Oct 5, 2024 4:30 PM' },
|
||||
{ type: 'completed', action: 'Request Completed', details: 'All approvals obtained. Training scheduled.', user: 'System', timestamp: 'Oct 5, 2024 4:31 PM' }
|
||||
],
|
||||
tags: ['training', 'technicians', 'approved', 'completed']
|
||||
},
|
||||
|
||||
'RE-REQ-2024-005': {
|
||||
id: 'RE-REQ-2024-005',
|
||||
title: 'Showroom Renovation - Chennai Flagship Store',
|
||||
description: 'Complete renovation of Chennai flagship showroom including modern interior design, interactive display zones, customer lounge upgrade, motorcycle test ride facility, and digital experience center. Project timeline: 8 weeks.',
|
||||
category: 'Infrastructure',
|
||||
subcategory: 'Retail & Showroom',
|
||||
status: 'rejected',
|
||||
priority: 'standard',
|
||||
amount: '₹65,00,000',
|
||||
slaProgress: 100,
|
||||
slaRemaining: 'Rejected',
|
||||
slaEndDate: 'Oct 4, 2024 5:00 PM',
|
||||
currentStep: 2,
|
||||
totalSteps: 4,
|
||||
template: 'custom',
|
||||
initiator: {
|
||||
name: 'Arjun Nair',
|
||||
role: 'Showroom Manager - South',
|
||||
department: 'Retail Operations',
|
||||
email: 'arjun.nair@royalenfield.com',
|
||||
phone: '+91 98765 43254',
|
||||
avatar: 'AN'
|
||||
},
|
||||
department: 'Retail Operations',
|
||||
createdAt: 'Oct 1, 2024 9:30 AM',
|
||||
updatedAt: 'Oct 4, 2024 3:15 PM',
|
||||
dueDate: '2024-10-04T17:00:00Z',
|
||||
submittedDate: '2024-10-01T09:30:00Z',
|
||||
estimatedCompletion: 'N/A',
|
||||
currentApprover: 'Rejected by Anil Kapoor',
|
||||
approverLevel: '2 of 4',
|
||||
conclusionRemark: 'Request rejected due to insufficient budget justification. Please revise with detailed ROI analysis.',
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Suresh Iyer',
|
||||
role: 'Regional Manager - South',
|
||||
status: 'approved',
|
||||
tatHours: 48,
|
||||
actualHours: 24,
|
||||
assignedAt: '2024-10-01T09:30:00Z',
|
||||
comment: 'Renovation is necessary. Current showroom needs upgrade.',
|
||||
timestamp: 'Oct 2, 2024 9:30 AM'
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Anil Kapoor',
|
||||
role: 'Finance Manager',
|
||||
status: 'rejected',
|
||||
tatHours: 72,
|
||||
actualHours: 48,
|
||||
assignedAt: '2024-10-02T09:30:00Z',
|
||||
comment: 'Budget allocation not justified. Need detailed ROI analysis and comparison with alternative renovation options. Please revise and resubmit with comprehensive financial projections.',
|
||||
timestamp: 'Oct 4, 2024 3:15 PM'
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'Legal Team',
|
||||
role: 'Compliance & Contracts',
|
||||
status: 'cancelled',
|
||||
tatHours: 96,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 4,
|
||||
approver: 'Ramesh Kulkarni',
|
||||
role: 'VP Operations',
|
||||
status: 'cancelled',
|
||||
tatHours: 72,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'Showroom_Renovation_Plan.pdf', size: '12.5 MB', type: 'PDF', uploadedBy: 'Arjun Nair', uploadedAt: 'Oct 1, 2024 9:45 AM' },
|
||||
{ name: 'Interior_Design_Mockups.zip', size: '85 MB', type: 'ZIP', uploadedBy: 'Design Team', uploadedAt: 'Oct 1, 2024 2:30 PM' },
|
||||
{ name: 'Contractor_Quotations.xlsx', size: '2.1 MB', type: 'Excel', uploadedBy: 'Procurement Team', uploadedAt: 'Oct 2, 2024 11:15 AM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Marketing Team', role: 'Brand Experience', avatar: 'MT' },
|
||||
{ name: 'Customer Experience', role: 'Feedback & Analysis', avatar: 'CX' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Request Created', details: 'Showroom renovation request submitted', user: 'Arjun Nair', timestamp: 'Oct 1, 2024 9:30 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Suresh Iyer', details: 'Forwarded to Regional Manager', user: 'System', timestamp: 'Oct 1, 2024 9:31 AM' },
|
||||
{ type: 'approval', action: 'Approved by Suresh Iyer', details: 'Level 1 approval completed', user: 'Suresh Iyer', timestamp: 'Oct 2, 2024 9:30 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Anil Kapoor', details: 'Forwarded to Finance Manager', user: 'System', timestamp: 'Oct 2, 2024 9:31 AM' },
|
||||
{ type: 'rejection', action: 'Rejected by Anil Kapoor', details: 'Budget justification insufficient', user: 'Anil Kapoor', timestamp: 'Oct 4, 2024 3:15 PM' },
|
||||
{ type: 'completed', action: 'Request Rejected', details: 'Workflow terminated. Requires resubmission with revisions.', user: 'System', timestamp: 'Oct 4, 2024 3:16 PM' }
|
||||
],
|
||||
tags: ['showroom', 'renovation', 'rejected', 'south-region']
|
||||
},
|
||||
|
||||
'RE-REQ-2024-006': {
|
||||
id: 'RE-REQ-2024-006',
|
||||
title: 'Spare Parts Inventory Optimization System',
|
||||
description: 'Implementation of AI-powered inventory management system for spare parts across all service centers. Features include demand forecasting, automated reordering, stock level optimization, and real-time tracking. Expected to reduce inventory costs by 20% and improve part availability.',
|
||||
category: 'Technology & Innovation',
|
||||
subcategory: 'Software Implementation',
|
||||
status: 'pending',
|
||||
priority: 'express',
|
||||
amount: '₹42,00,000',
|
||||
slaProgress: 35,
|
||||
slaRemaining: '1 day 16 hours',
|
||||
slaEndDate: 'Oct 12, 2024 5:00 PM',
|
||||
currentStep: 1,
|
||||
totalSteps: 4,
|
||||
template: 'custom',
|
||||
initiator: {
|
||||
name: 'Rahul Deshmukh',
|
||||
role: 'Head - Supply Chain Technology',
|
||||
department: 'Supply Chain',
|
||||
email: 'rahul.deshmukh@royalenfield.com',
|
||||
phone: '+91 98765 43265',
|
||||
avatar: 'RD'
|
||||
},
|
||||
department: 'Supply Chain',
|
||||
createdAt: 'Oct 7, 2024 10:00 AM',
|
||||
updatedAt: 'Oct 8, 2024 9:15 AM',
|
||||
dueDate: '2024-10-12T17:00:00Z',
|
||||
submittedDate: '2024-10-07T10:00:00Z',
|
||||
estimatedCompletion: 'Oct 12, 2024',
|
||||
currentApprover: 'Vikram Singh',
|
||||
approverLevel: '1 of 4',
|
||||
conclusionRemark: '',
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Vikram Singh',
|
||||
role: 'Head - IT Operations',
|
||||
status: 'pending',
|
||||
tatHours: 48,
|
||||
elapsedHours: 23,
|
||||
assignedAt: '2024-10-07T10:00:00Z',
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Supply Chain Director',
|
||||
role: 'Operations Approval',
|
||||
status: 'waiting',
|
||||
tatHours: 72,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'Anil Kapoor',
|
||||
role: 'Finance Manager',
|
||||
status: 'waiting',
|
||||
tatHours: 96,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 4,
|
||||
approver: 'Ramesh Kulkarni',
|
||||
role: 'VP Operations',
|
||||
status: 'waiting',
|
||||
tatHours: 72,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'AI_Inventory_System_Proposal.pdf', size: '8.9 MB', type: 'PDF', uploadedBy: 'Rahul Deshmukh', uploadedAt: 'Oct 7, 2024 10:15 AM' },
|
||||
{ name: 'Vendor_Comparison_Analysis.xlsx', size: '3.4 MB', type: 'Excel', uploadedBy: 'IT Procurement', uploadedAt: 'Oct 7, 2024 2:45 PM' },
|
||||
{ name: 'Cost_Benefit_Analysis.pptx', size: '6.2 MB', type: 'PowerPoint', uploadedBy: 'Analytics Team', uploadedAt: 'Oct 7, 2024 4:30 PM' },
|
||||
{ name: 'Implementation_Timeline.pdf', size: '1.5 MB', type: 'PDF', uploadedBy: 'Project Management', uploadedAt: 'Oct 8, 2024 9:15 AM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Service Center Network', role: 'End Users', avatar: 'SN' },
|
||||
{ name: 'Data Analytics Team', role: 'System Integration', avatar: 'DA' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Request Created', details: 'AI inventory system proposal submitted', user: 'Rahul Deshmukh', timestamp: 'Oct 7, 2024 10:00 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Vikram Singh', details: 'Forwarded to IT Operations Head', user: 'System', timestamp: 'Oct 7, 2024 10:01 AM' },
|
||||
{ type: 'updated', action: 'Documents Added', details: 'Implementation timeline document uploaded', user: 'Project Management', timestamp: 'Oct 8, 2024 9:15 AM' }
|
||||
],
|
||||
tags: ['technology', 'ai', 'inventory', 'supply-chain', 'high-priority']
|
||||
},
|
||||
|
||||
'RE-REQ-2024-007': {
|
||||
id: 'RE-REQ-2024-007',
|
||||
title: 'Dealer Network Meeting - Q4 Business Review',
|
||||
description: 'Quarterly business review meeting for all authorized dealers across India. Venue: Bangalore. Topics include Q3 performance review, Q4 targets, new model launches, marketing initiatives, service excellence programs, and dealer support policies. Expected attendance: 250 dealers.',
|
||||
category: 'Events & Conferences',
|
||||
subcategory: 'Dealer Meetings',
|
||||
status: 'in-review',
|
||||
priority: 'standard',
|
||||
amount: '₹28,50,000',
|
||||
slaProgress: 58,
|
||||
slaRemaining: '1 day 12 hours',
|
||||
slaEndDate: 'Oct 11, 2024 5:00 PM',
|
||||
currentStep: 2,
|
||||
totalSteps: 3,
|
||||
template: 'custom',
|
||||
initiator: {
|
||||
name: 'Neha Kapoor',
|
||||
role: 'Dealer Network Manager',
|
||||
department: 'Sales & Distribution',
|
||||
email: 'neha.kapoor@royalenfield.com',
|
||||
phone: '+91 98765 43276',
|
||||
avatar: 'NK'
|
||||
},
|
||||
department: 'Sales & Distribution',
|
||||
createdAt: 'Oct 6, 2024 2:00 PM',
|
||||
updatedAt: 'Oct 8, 2024 11:30 AM',
|
||||
dueDate: '2024-10-11T17:00:00Z',
|
||||
submittedDate: '2024-10-06T14:00:00Z',
|
||||
estimatedCompletion: 'Oct 11, 2024',
|
||||
currentApprover: 'Anil Kapoor',
|
||||
approverLevel: '2 of 3',
|
||||
conclusionRemark: '',
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Suresh Mehta',
|
||||
role: 'Sales Director',
|
||||
status: 'approved',
|
||||
tatHours: 48,
|
||||
actualHours: 36,
|
||||
assignedAt: '2024-10-06T14:00:00Z',
|
||||
comment: 'Dealer meeting approved. Agenda looks comprehensive.',
|
||||
timestamp: 'Oct 8, 2024 2:00 AM'
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Anil Kapoor',
|
||||
role: 'Finance Manager',
|
||||
status: 'in-review',
|
||||
tatHours: 72,
|
||||
elapsedHours: 33,
|
||||
assignedAt: '2024-10-08T02:00:00Z',
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'Deepika Sharma',
|
||||
role: 'VP Sales & Marketing',
|
||||
status: 'waiting',
|
||||
tatHours: 48,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'Q4_Dealer_Meeting_Agenda.pdf', size: '2.8 MB', type: 'PDF', uploadedBy: 'Neha Kapoor', uploadedAt: 'Oct 6, 2024 2:15 PM' },
|
||||
{ name: 'Venue_Booking_Confirmation.pdf', size: '980 KB', type: 'PDF', uploadedBy: 'Events Team', uploadedAt: 'Oct 6, 2024 4:45 PM' },
|
||||
{ name: 'Event_Budget_Breakdown.xlsx', size: '1.2 MB', type: 'Excel', uploadedBy: 'Finance Team', uploadedAt: 'Oct 7, 2024 10:30 AM' },
|
||||
{ name: 'Dealer_Invitations_List.xlsx', size: '580 KB', type: 'Excel', uploadedBy: 'Sales Team', uploadedAt: 'Oct 7, 2024 3:15 PM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Marketing Team', role: 'Presentation Support', avatar: 'MT' },
|
||||
{ name: 'Events Management', role: 'Logistics Coordination', avatar: 'EM' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Request Created', details: 'Dealer meeting proposal submitted', user: 'Neha Kapoor', timestamp: 'Oct 6, 2024 2:00 PM' },
|
||||
{ type: 'assignment', action: 'Assigned to Suresh Mehta', details: 'Forwarded to Sales Director', user: 'System', timestamp: 'Oct 6, 2024 2:01 PM' },
|
||||
{ type: 'approval', action: 'Approved by Suresh Mehta', details: 'Sales approval completed', user: 'Suresh Mehta', timestamp: 'Oct 8, 2024 2:00 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Anil Kapoor', details: 'Forwarded to Finance Manager', user: 'System', timestamp: 'Oct 8, 2024 2:01 AM' },
|
||||
{ type: 'updated', action: 'Documents Added', details: 'Dealer invitations list uploaded', user: 'Sales Team', timestamp: 'Oct 7, 2024 3:15 PM' }
|
||||
],
|
||||
tags: ['dealer-meeting', 'q4-review', 'event', 'bangalore']
|
||||
},
|
||||
|
||||
'RE-REQ-2024-008': {
|
||||
id: 'RE-REQ-2024-008',
|
||||
title: 'Cybersecurity Infrastructure Upgrade',
|
||||
description: 'Comprehensive upgrade of cybersecurity infrastructure including next-gen firewall, intrusion detection system, endpoint protection for 500+ devices, security information and event management (SIEM) system, and employee security awareness training. Critical for protecting customer data and business operations.',
|
||||
category: 'IT & Infrastructure',
|
||||
subcategory: 'Security & Compliance',
|
||||
status: 'pending',
|
||||
priority: 'urgent',
|
||||
amount: '₹52,00,000',
|
||||
slaProgress: 82,
|
||||
slaRemaining: '4 hours 20 minutes',
|
||||
slaEndDate: 'Oct 8, 2024 6:00 PM',
|
||||
currentStep: 2,
|
||||
totalSteps: 3,
|
||||
template: 'custom',
|
||||
initiator: {
|
||||
name: 'Sameer Joshi',
|
||||
role: 'Chief Information Security Officer',
|
||||
department: 'Information Technology',
|
||||
email: 'sameer.joshi@royalenfield.com',
|
||||
phone: '+91 98765 43287',
|
||||
avatar: 'SJ'
|
||||
},
|
||||
department: 'Information Technology',
|
||||
createdAt: 'Oct 5, 2024 11:30 AM',
|
||||
updatedAt: 'Oct 8, 2024 12:45 PM',
|
||||
dueDate: '2024-10-08T18:00:00Z',
|
||||
submittedDate: '2024-10-05T11:30:00Z',
|
||||
estimatedCompletion: 'Oct 8, 2024',
|
||||
currentApprover: 'Anil Kapoor',
|
||||
approverLevel: '2 of 3',
|
||||
conclusionRemark: '',
|
||||
approvalFlow: [
|
||||
{
|
||||
step: 1,
|
||||
approver: 'Vikram Singh',
|
||||
role: 'Head - IT Operations',
|
||||
status: 'approved',
|
||||
tatHours: 24,
|
||||
actualHours: 18,
|
||||
assignedAt: '2024-10-05T11:30:00Z',
|
||||
comment: 'Critical security upgrade. Approve immediately.',
|
||||
timestamp: 'Oct 6, 2024 5:30 AM'
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
approver: 'Anil Kapoor',
|
||||
role: 'Finance Manager',
|
||||
status: 'pending',
|
||||
tatHours: 48,
|
||||
elapsedHours: 55,
|
||||
assignedAt: '2024-10-06T05:30:00Z',
|
||||
comment: null,
|
||||
timestamp: null
|
||||
},
|
||||
{
|
||||
step: 3,
|
||||
approver: 'Ramesh Kulkarni',
|
||||
role: 'VP Operations',
|
||||
status: 'waiting',
|
||||
tatHours: 72,
|
||||
elapsedHours: 0,
|
||||
assignedAt: null,
|
||||
comment: null,
|
||||
timestamp: null
|
||||
}
|
||||
],
|
||||
documents: [
|
||||
{ name: 'Security_Assessment_Report.pdf', size: '15.3 MB', type: 'PDF', uploadedBy: 'Sameer Joshi', uploadedAt: 'Oct 5, 2024 11:45 AM' },
|
||||
{ name: 'Vendor_Solutions_Comparison.xlsx', size: '4.8 MB', type: 'Excel', uploadedBy: 'IT Security Team', uploadedAt: 'Oct 5, 2024 3:30 PM' },
|
||||
{ name: 'Implementation_Roadmap.pptx', size: '7.6 MB', type: 'PowerPoint', uploadedBy: 'Project Management', uploadedAt: 'Oct 6, 2024 10:15 AM' },
|
||||
{ name: 'Risk_Analysis_Report.pdf', size: '5.9 MB', type: 'PDF', uploadedBy: 'Security Consultant', uploadedAt: 'Oct 6, 2024 4:45 PM' }
|
||||
],
|
||||
spectators: [
|
||||
{ name: 'Legal & Compliance', role: 'Data Protection', avatar: 'LC' },
|
||||
{ name: 'IT Infrastructure', role: 'System Integration', avatar: 'IT' }
|
||||
],
|
||||
auditTrail: [
|
||||
{ type: 'created', action: 'Request Created', details: 'Cybersecurity upgrade proposal submitted', user: 'Sameer Joshi', timestamp: 'Oct 5, 2024 11:30 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Vikram Singh', details: 'Forwarded to IT Operations Head', user: 'System', timestamp: 'Oct 5, 2024 11:31 AM' },
|
||||
{ type: 'approval', action: 'Approved by Vikram Singh', details: 'IT approval - marked as critical', user: 'Vikram Singh', timestamp: 'Oct 6, 2024 5:30 AM' },
|
||||
{ type: 'assignment', action: 'Assigned to Anil Kapoor', details: 'Forwarded to Finance Manager', user: 'System', timestamp: 'Oct 6, 2024 5:31 AM' },
|
||||
{ type: 'reminder', action: 'Urgent Reminder', details: 'TAT breach warning - 4 hours remaining', user: 'System', timestamp: 'Oct 8, 2024 12:45 PM' }
|
||||
],
|
||||
tags: ['cybersecurity', 'urgent', 'critical', 'infrastructure', 'overdue']
|
||||
}
|
||||
};
|
||||
export const CUSTOM_REQUEST_DATABASE: any = {};
|
||||
|
||||
// API Endpoints for Custom Requests (to be implemented with backend)
|
||||
export const CUSTOM_REQUEST_API_ENDPOINTS = {
|
||||
|
||||
@ -1,188 +0,0 @@
|
||||
// Mock Dealer Database - In production, this would be fetched from API
|
||||
export interface DealerInfo {
|
||||
code: string;
|
||||
name: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
address: string;
|
||||
city: string;
|
||||
state: string;
|
||||
region: string;
|
||||
managerName: string;
|
||||
}
|
||||
|
||||
export const DEALER_DATABASE: Record<string, DealerInfo> = {
|
||||
'RE-MH-001': {
|
||||
code: 'RE-MH-001',
|
||||
name: 'Royal Motors Mumbai',
|
||||
email: 'dealer@royalmotorsmumbai.com',
|
||||
phone: '+91 98765 12345',
|
||||
address: 'Shop No. 12-15, Central Avenue, Andheri West',
|
||||
city: 'Mumbai',
|
||||
state: 'Maharashtra',
|
||||
region: 'West',
|
||||
managerName: 'Rahul Deshmukh'
|
||||
},
|
||||
'RE-DL-002': {
|
||||
code: 'RE-DL-002',
|
||||
name: 'Delhi Enfield Center',
|
||||
email: 'contact@delhienfield.com',
|
||||
phone: '+91 98765 23456',
|
||||
address: '45-48, Rajouri Garden, Main Market',
|
||||
city: 'New Delhi',
|
||||
state: 'Delhi',
|
||||
region: 'North',
|
||||
managerName: 'Vikram Singh'
|
||||
},
|
||||
'RE-BLR-003': {
|
||||
code: 'RE-BLR-003',
|
||||
name: 'Bangalore Royal Bikes',
|
||||
email: 'info@bangaloreroyalbikes.com',
|
||||
phone: '+91 98765 34567',
|
||||
address: '123, MG Road, Near Trinity Metro',
|
||||
city: 'Bangalore',
|
||||
state: 'Karnataka',
|
||||
region: 'South',
|
||||
managerName: 'Suresh Kumar'
|
||||
},
|
||||
'RE-CHN-004': {
|
||||
code: 'RE-CHN-004',
|
||||
name: 'Chennai Enfield Hub',
|
||||
email: 'chennai@enfieldhub.com',
|
||||
phone: '+91 98765 45678',
|
||||
address: '78-80, Anna Salai, T Nagar',
|
||||
city: 'Chennai',
|
||||
state: 'Tamil Nadu',
|
||||
region: 'South',
|
||||
managerName: 'Venkat Ramanan'
|
||||
},
|
||||
'RE-HYD-005': {
|
||||
code: 'RE-HYD-005',
|
||||
name: 'Hyderabad Royal Motorcycles',
|
||||
email: 'hyderabad@royalmotorcycles.com',
|
||||
phone: '+91 98765 56789',
|
||||
address: '234, Banjara Hills, Road No. 12',
|
||||
city: 'Hyderabad',
|
||||
state: 'Telangana',
|
||||
region: 'South',
|
||||
managerName: 'Anil Reddy'
|
||||
},
|
||||
'RE-KOL-006': {
|
||||
code: 'RE-KOL-006',
|
||||
name: 'Kolkata Enfield Motors',
|
||||
email: 'kolkata@enfieldmotors.com',
|
||||
phone: '+91 98765 67890',
|
||||
address: '56-58, Park Street, Near Park Hotel',
|
||||
city: 'Kolkata',
|
||||
state: 'West Bengal',
|
||||
region: 'East',
|
||||
managerName: 'Amit Chatterjee'
|
||||
},
|
||||
'RE-PUN-007': {
|
||||
code: 'RE-PUN-007',
|
||||
name: 'Pune Royal Dealership',
|
||||
email: 'pune@royaldealership.com',
|
||||
phone: '+91 98765 78901',
|
||||
address: '345, FC Road, Deccan Gymkhana',
|
||||
city: 'Pune',
|
||||
state: 'Maharashtra',
|
||||
region: 'West',
|
||||
managerName: 'Sandeep Patil'
|
||||
},
|
||||
'RE-AHM-008': {
|
||||
code: 'RE-AHM-008',
|
||||
name: 'Ahmedabad Enfield Plaza',
|
||||
email: 'ahmedabad@enfieldplaza.com',
|
||||
phone: '+91 98765 89012',
|
||||
address: '123, CG Road, Navrangpura',
|
||||
city: 'Ahmedabad',
|
||||
state: 'Gujarat',
|
||||
region: 'West',
|
||||
managerName: 'Kiran Patel'
|
||||
},
|
||||
'RE-JP-009': {
|
||||
code: 'RE-JP-009',
|
||||
name: 'Jaipur Royal Enfield',
|
||||
email: 'jaipur@royalenfield.com',
|
||||
phone: '+91 98765 90123',
|
||||
address: '67, MI Road, C-Scheme',
|
||||
city: 'Jaipur',
|
||||
state: 'Rajasthan',
|
||||
region: 'North',
|
||||
managerName: 'Rajesh Sharma'
|
||||
},
|
||||
'RE-LKO-010': {
|
||||
code: 'RE-LKO-010',
|
||||
name: 'Lucknow Enfield Showroom',
|
||||
email: 'lucknow@enfieldshowroom.com',
|
||||
phone: '+91 98765 01234',
|
||||
address: '89, Hazratganj, Near Halwasiya Crossing',
|
||||
city: 'Lucknow',
|
||||
state: 'Uttar Pradesh',
|
||||
region: 'North',
|
||||
managerName: 'Ankit Verma'
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get dealer information by dealer code
|
||||
* @param dealerCode - The dealer code (e.g., 'RE-MH-001')
|
||||
* @returns DealerInfo object or null if not found
|
||||
*/
|
||||
export function getDealerInfo(dealerCode: string): DealerInfo | null {
|
||||
return DEALER_DATABASE[dealerCode] || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all dealers for a specific region
|
||||
* @param region - Region name (North, South, East, West)
|
||||
* @returns Array of DealerInfo objects
|
||||
*/
|
||||
export function getDealersByRegion(region: string): DealerInfo[] {
|
||||
return Object.values(DEALER_DATABASE).filter(
|
||||
dealer => dealer.region.toLowerCase() === region.toLowerCase()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all dealers for a specific state
|
||||
* @param state - State name
|
||||
* @returns Array of DealerInfo objects
|
||||
*/
|
||||
export function getDealersByState(state: string): DealerInfo[] {
|
||||
return Object.values(DEALER_DATABASE).filter(
|
||||
dealer => dealer.state.toLowerCase() === state.toLowerCase()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all dealers as an array (for dropdowns, etc.)
|
||||
* @returns Array of DealerInfo objects
|
||||
*/
|
||||
export function getAllDealers(): DealerInfo[] {
|
||||
return Object.values(DEALER_DATABASE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search dealers by name or code
|
||||
* @param searchTerm - Search term
|
||||
* @returns Array of matching DealerInfo objects
|
||||
*/
|
||||
export function searchDealers(searchTerm: string): DealerInfo[] {
|
||||
const term = searchTerm.toLowerCase();
|
||||
return Object.values(DEALER_DATABASE).filter(
|
||||
dealer =>
|
||||
dealer.name.toLowerCase().includes(term) ||
|
||||
dealer.code.toLowerCase().includes(term) ||
|
||||
dealer.city.toLowerCase().includes(term)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format dealer address for display
|
||||
* @param dealer - DealerInfo object
|
||||
* @returns Formatted address string
|
||||
*/
|
||||
export function formatDealerAddress(dealer: DealerInfo): string {
|
||||
return `${dealer.address}, ${dealer.city}, ${dealer.state}`;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user