Files
yara724api/src/workflow-step-management/dto/workflow-step.examples.ts

1542 lines
52 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Swagger example bodies for workflow step management
*/
export const createWorkflowStepExamples = {
example1: {
summary: 'Request Type Selection Step',
value: {
stepKey: 'CREATED',
type: 'THIRD_PARTY',
stepNumber: 1,
isActive: true,
stepName_fa: 'ایجاد نوع درخواست',
stepName_en: 'request_type',
description_fa: 'انتخاب نوع درخواست توسط کاربر (شخص ثالث یا بدنه)',
description_en: 'Select request type by user (THIRD_PARTY or CAR_BODY)',
category: 'INITIAL',
requiredPreviousSteps: [],
nextPossibleSteps: ['FIRST_BLAME_CONFESSION'],
allowedRoles: ['user'],
estimatedDuration: 1,
fields: [
{
id: '507f1f77bcf86cd799439011',
name_fa: 'نوع درخواست',
name_en: 'requestType',
label_fa: 'نوع درخواست',
label_en: 'Request Type',
placeholder_fa: 'نوع درخواست خود را انتخاب کنید',
placeholder_en: 'Select your request type',
value: [
{ label_fa: 'شخص ثالث', label_en: 'Third Party', value: 'THIRD_PARTY' },
{ label_fa: 'بدنه', label_en: 'Car Body', value: 'CAR_BODY' }
],
dataType: 'select',
required: true,
order: 1,
isActive: true,
validation: {
enum: ['THIRD_PARTY', 'CAR_BODY']
}
}
],
metadata: {
icon: 'clipboard-list',
color: '#8B5CF6'
}
}
},
example2: {
summary: 'Blame Confession Step',
value: {
stepKey: 'FIRST_BLAME_CONFESSION',
type: 'THIRD_PARTY',
stepNumber: 2,
isActive: true,
stepName_fa: 'اعتراف طرف اول',
stepName_en: 'First Party Blame Confession',
description_fa: 'طرف اول وضعیت تقصیر و اعتراف خود را مشخص می‌کند',
description_en: 'First party declares blame status and confession',
category: 'FIRST_PARTY',
requiredPreviousSteps: ['CREATED'],
nextPossibleSteps: ['FIRST_VIDEO'],
allowedRoles: ['user'],
estimatedDuration: 2,
fields: [
{
id: '507f1f77bcf86cd799439012',
name_fa: 'وضعیت تقصیر',
name_en: 'blameStatus',
label_fa: 'وضعیت تقصیر',
label_en: 'Blame Status',
placeholder_fa: 'وضعیت تقصیر را انتخاب کنید',
placeholder_en: 'Select blame status',
value: [
{ label_fa: 'موافق', label_en: 'Agreed', value: 'AGREED' },
{ label_fa: 'مخالف', label_en: 'Disagreement', value: 'DISAGREEMENT' }
],
dataType: 'select',
required: true,
order: 1,
isActive: true,
validation: {
enum: ['AGREED', 'DISAGREEMENT']
}
},
{
id: '507f1f77bcf86cd799439013',
name_fa: 'اعتراف',
name_en: 'confess',
label_fa: 'اعتراف',
label_en: 'Confession',
placeholder_fa: 'نوع اعتراف خود را انتخاب کنید',
placeholder_en: 'Select your confession type',
value: [
{ label_fa: 'مقصر', label_en: 'Guilty', value: 'guilty' },
{ label_fa: 'آسیب دیده', label_en: 'Damaged', value: 'damaged' }
],
dataType: 'select',
required: true,
order: 2,
isActive: true,
validation: {
enum: ['guilty', 'damaged']
}
}
],
metadata: {
icon: 'balance-scale',
color: '#F59E0B',
requiresAuth: true
}
}
},
example3: {
summary: 'Live Video Capture Step',
value: {
stepKey: 'FIRST_VIDEO',
type: 'THIRD_PARTY',
stepNumber: 3,
isActive: true,
stepName_fa: 'ضبط ویدیو طرف اول',
stepName_en: 'First Party Video Capture',
description_fa: 'ضبط ویدیو مستقیم از دوربین توسط طرف اول (گالری مجاز نیست)',
description_en: 'Live video capture from camera by first party (gallery not allowed)',
category: 'FIRST_PARTY',
requiredPreviousSteps: ['FIRST_BLAME_CONFESSION'],
nextPossibleSteps: ['FIRST_INITIAL_FORM'],
allowedRoles: ['user'],
estimatedDuration: 3,
fields: [
{
id: '507f1f77bcf86cd799439014',
name_fa: 'فایل ویدیو',
name_en: 'file',
label_fa: 'ضبط ویدیو',
label_en: 'Video Recording',
placeholder_fa: 'ویدیو خود را از دوربین ضبط کنید',
placeholder_en: 'Record your video from camera',
value: null,
dataType: 'video-capture',
required: true,
order: 1,
isActive: true,
validation: {
maxSize: 52428800,
maxDuration: 180,
allowedTypes: ['video/mp4', 'video/webm'],
captureMode: 'camera-only',
allowGallery: false
}
}
],
metadata: {
icon: 'video-camera',
color: '#EF4444',
captureType: 'live-camera',
allowGallerySelection: false,
requiresCamera: true
}
}
},
example4: {
summary: 'Main Form Step - Driver & Insurer Details',
value: {
stepKey: 'FIRST_INITIAL_FORM',
type: 'THIRD_PARTY',
stepNumber: 4,
isActive: true,
stepName_fa: 'فرم اصلی اطلاعات راننده و بیمه‌گذار',
stepName_en: 'Main Form - Driver & Insurer Information',
description_fa: 'وارد کردن اطلاعات کامل راننده، بیمه‌گذار و خودرو',
description_en: 'Enter complete driver, insurer and vehicle information',
category: 'FIRST_PARTY',
requiredPreviousSteps: ['FIRST_VIDEO'],
nextPossibleSteps: ['FIRST_LOCATION'],
allowedRoles: ['user'],
estimatedDuration: 5,
fields: [
{
id: '507f1f77bcf86cd799439015',
name_fa: 'کد ملی مالک',
name_en: 'nationalCodeOfOwner',
label_fa: 'کد ملی مالک',
label_en: 'National Code of Owner',
placeholder_fa: 'کد ملی ۱۰ رقمی مالک را وارد کنید',
placeholder_en: 'Enter 10-digit national code of insurer',
value: null,
dataType: 'string',
required: true,
order: 1,
isActive: true,
validation: {
pattern: '^[0-9]{10}$',
minLength: 10,
maxLength: 10
}
},
{
id: '507f1f77bcf86cd799439016',
name_fa: 'کد ملی راننده',
name_en: 'nationalCodeOfDriver',
label_fa: 'کد ملی راننده',
label_en: 'National Code of Driver',
placeholder_fa: 'کد ملی ۱۰ رقمی راننده را وارد کنید',
placeholder_en: 'Enter 10-digit national code of driver',
value: null,
dataType: 'string',
required: true,
order: 2,
isActive: true,
validation: {
pattern: '^[0-9]{10}$',
minLength: 10,
maxLength: 10
}
},
{
id: '507f1f77bcf86cd799439017',
name_fa: 'شماره گواهینامه بیمه‌گذار',
name_en: 'insurerLicense',
label_fa: 'شماره گواهینامه بیمه‌گذار',
label_en: 'Insurer License Number',
placeholder_fa: 'شماره گواهینامه بیمه‌گذار را وارد کنید',
placeholder_en: 'Enter insurer license number',
value: null,
dataType: 'string',
required: true,
order: 3,
isActive: true,
validation: {
minLength: 5,
maxLength: 20
}
},
{
id: '507f1f77bcf86cd799439018',
name_fa: 'شماره گواهینامه راننده',
name_en: 'driverLicense',
label_fa: 'شماره گواهینامه راننده',
label_en: 'Driver License Number',
placeholder_fa: 'شماره گواهینامه راننده را وارد کنید',
placeholder_en: 'Enter driver license number',
value: null,
dataType: 'string',
required: true,
order: 4,
isActive: true,
validation: {
minLength: 5,
maxLength: 20
}
},
{
id: '507f1f77bcf86cd799439019',
name_fa: 'پلاک خودرو',
name_en: 'plate',
label_fa: 'پلاک خودرو',
label_en: 'Vehicle Plate',
placeholder_fa: 'اطلاعات پلاک خودرو را وارد کنید',
placeholder_en: 'Enter vehicle plate information',
value: null,
dataType: 'object',
required: true,
order: 5,
isActive: true,
validation: {
type: 'object',
properties: {
leftDigits: { type: 'number', min: 10, max: 99 },
centerAlphabet: { type: 'string', pattern: '^[آ-ی]{1}$' },
centerDigits: { type: 'number', min: 100, max: 999 },
ir: { type: 'number', min: 10, max: 99 }
}
}
},
{
id: '507f1f77bcf86cd79943901a',
name_fa: 'راننده همان بیمه‌گذار است',
name_en: 'driverIsInsurer',
label_fa: 'راننده همان بیمه‌گذار است',
label_en: 'Driver is Insurer',
placeholder_fa: '',
placeholder_en: '',
value: null,
dataType: 'boolean',
required: true,
order: 6,
isActive: true,
validation: {
type: 'boolean'
}
},
{
id: '507f1f77bcf86cd79943901b',
name_fa: 'خودرو صفر است',
name_en: 'isNewCar',
label_fa: 'خودرو صفر است',
label_en: 'Is New Car',
placeholder_fa: '',
placeholder_en: '',
value: null,
dataType: 'boolean',
required: true,
order: 7,
isActive: true,
validation: {
type: 'boolean'
}
},
{
id: '507f1f77bcf86cd79943901c',
name_fa: 'بدون گواهی',
name_en: 'userNoCertificate',
label_fa: 'کاربر گواهی ندارد',
label_en: 'User Has No Certificate',
placeholder_fa: '',
placeholder_en: '',
value: null,
dataType: 'boolean',
required: true,
order: 8,
isActive: true,
validation: {
type: 'boolean'
}
},
{
id: '507f1f77bcf86cd79943901d',
name_fa: 'تاریخ تولد بیمه‌گذار',
name_en: 'insurerBirthday',
label_fa: 'تاریخ تولد بیمه‌گذار',
label_en: 'Insurer Birthday',
placeholder_fa: 'تاریخ تولد بیمه‌گذار (timestamp)',
placeholder_en: 'Insurer birthday (timestamp)',
value: null,
dataType: 'number',
required: true,
order: 9,
isActive: true,
validation: {
type: 'number',
min: 0
}
},
{
id: '507f1f77bcf86cd79943901e',
name_fa: 'تاریخ تولد راننده',
name_en: 'driverBirthday',
label_fa: 'تاریخ تولد راننده',
label_en: 'Driver Birthday',
placeholder_fa: 'تاریخ تولد راننده را وارد کنید',
placeholder_en: 'Enter driver birthday',
value: null,
dataType: 'string',
required: true,
order: 10,
isActive: true,
validation: {
format: 'date'
}
}
],
metadata: {
icon: 'clipboard-list',
color: '#8B5CF6',
formType: 'detailed',
hasComplexValidation: true
}
}
},
example5: {
summary: 'Location Step - GPS Coordinates',
value: {
stepKey: 'FIRST_LOCATION',
type: 'THIRD_PARTY',
stepNumber: 5,
isActive: true,
stepName_fa: 'موقعیت مکانی حادثه',
stepName_en: 'Accident Location',
description_fa: 'ثبت موقعیت جغرافیایی محل وقوع حادثه',
description_en: 'Record geographical location of accident scene',
category: 'FIRST_PARTY',
requiredPreviousSteps: ['FIRST_INITIAL_FORM'],
nextPossibleSteps: ['FIRST_DESCRIPTION'],
allowedRoles: ['user'],
estimatedDuration: 2,
fields: [
{
id: '507f1f77bcf86cd79943901f',
name_fa: 'عرض جغرافیایی',
name_en: 'lat',
label_fa: 'عرض جغرافیایی',
label_en: 'Latitude',
placeholder_fa: 'عرض جغرافیایی را وارد کنید',
placeholder_en: 'Enter latitude',
value: null,
dataType: 'number',
required: true,
order: 1,
isActive: true,
validation: {
type: 'number',
min: -90,
max: 90
}
},
{
id: '507f1f77bcf86cd799439020',
name_fa: 'طول جغرافیایی',
name_en: 'lon',
label_fa: 'طول جغرافیایی',
label_en: 'Longitude',
placeholder_fa: 'طول جغرافیایی را وارد کنید',
placeholder_en: 'Enter longitude',
value: null,
dataType: 'number',
required: true,
order: 2,
isActive: true,
validation: {
type: 'number',
min: -180,
max: 180
}
}
],
metadata: {
icon: 'map-pin',
color: '#10B981',
requiresGPS: true,
autoDetectLocation: true
}
}
},
example6: {
summary: 'Voice Recording Step',
value: {
stepKey: 'FIRST_VOICE',
type: 'THIRD_PARTY',
stepNumber: 6,
isActive: true,
stepName_fa: 'ضبط صدای طرف اول',
stepName_en: 'First Party Voice Recording',
description_fa: 'ضبط توضیحات صوتی توسط طرف اول',
description_en: 'Voice recording of explanations by first party',
category: 'FIRST_PARTY',
requiredPreviousSteps: ['FIRST_LOCATION'],
nextPossibleSteps: ['FIRST_DESCRIPTION'],
allowedRoles: ['user'],
estimatedDuration: 3,
fields: [
{
id: '507f1f77bcf86cd799439021',
name_fa: 'فایل صوتی',
name_en: 'file',
label_fa: 'ضبط صدا',
label_en: 'Voice Recording',
placeholder_fa: 'توضیحات صوتی خود را ضبط کنید',
placeholder_en: 'Record your voice explanation',
value: null,
dataType: 'audio-file',
required: true,
order: 1,
isActive: true,
validation: {
maxSize: 10485760,
maxDuration: 300,
allowedTypes: ['audio/mp3', 'audio/mpeg', 'audio/wav', 'audio/m4a', 'audio/webm']
}
}
],
metadata: {
icon: 'microphone',
color: '#F59E0B',
recordingType: 'voice',
requiresMicrophone: true
}
}
},
example7: {
summary: 'First Party Description Step',
value: {
stepKey: 'FIRST_DESCRIPTION',
type: 'THIRD_PARTY',
stepNumber: 7,
isActive: true,
stepName_fa: 'توضیحات طرف اول',
stepName_en: 'First Party Description',
description_fa: 'ثبت توضیحات و جزئیات حادثه توسط طرف اول',
description_en: 'Record accident description and details by first party',
category: 'FIRST_PARTY',
requiredPreviousSteps: ['FIRST_VOICE'],
nextPossibleSteps: ['FIRST_INVITE_SECOND'],
allowedRoles: ['user'],
estimatedDuration: 4,
fields: [
{
id: '507f1f77bcf86cd799439022',
name_fa: 'توضیحات',
name_en: 'desc',
label_fa: 'توضیحات حادثه',
label_en: 'Accident Description',
placeholder_fa: 'توضیحات کامل حادثه را وارد کنید',
placeholder_en: 'Enter complete accident description',
value: null,
dataType: 'textarea',
required: true,
order: 1,
isActive: true,
validation: {
minLength: 10,
maxLength: 2000
}
},
{
id: '507f1f77bcf86cd799439023',
name_fa: 'تاریخ حادثه',
name_en: 'accidentDate',
label_fa: 'تاریخ حادثه',
label_en: 'Accident Date',
placeholder_fa: 'تاریخ وقوع حادثه را وارد کنید',
placeholder_en: 'Enter accident date',
value: null,
dataType: 'date',
required: true,
order: 2,
isActive: true,
validation: {
format: 'YYYY-MM-DD'
}
},
{
id: '507f1f77bcf86cd799439024',
name_fa: 'زمان حادثه',
name_en: 'accidentTime',
label_fa: 'زمان حادثه',
label_en: 'Accident Time',
placeholder_fa: 'زمان وقوع حادثه را وارد کنید',
placeholder_en: 'Enter accident time',
value: null,
dataType: 'time',
required: true,
order: 3,
isActive: true,
validation: {
format: 'HH:mm'
}
}
],
metadata: {
icon: 'file-text',
color: '#6366F1'
}
}
},
example8: {
summary: 'Invite Second Party Step',
value: {
stepKey: 'FIRST_INVITE_SECOND',
type: 'THIRD_PARTY',
stepNumber: 8,
isActive: true,
stepName_fa: 'دعوت طرف دوم',
stepName_en: 'Invite Second Party',
description_fa: 'ارسال دعوتنامه به طرف دوم برای ثبت اطلاعات',
description_en: 'Send invitation to second party to register information',
category: 'FIRST_PARTY',
requiredPreviousSteps: ['FIRST_DESCRIPTION'],
nextPossibleSteps: ['SECOND_INITIAL_FORM'],
allowedRoles: ['user'],
estimatedDuration: 1,
fields: [],
metadata: {
icon: 'user-plus',
color: '#8B5CF6',
requiresPhoneNumber: true,
actionType: 'invitation'
}
}
},
example9: {
summary: 'Second Party Main Form',
value: {
stepKey: 'SECOND_INITIAL_FORM',
type: 'THIRD_PARTY',
stepNumber: 9,
isActive: true,
stepName_fa: 'فرم اصلی اطلاعات طرف دوم',
stepName_en: 'Second Party Main Form',
description_fa: 'وارد کردن اطلاعات کامل راننده، بیمه‌گذار و خودرو طرف دوم',
description_en: 'Enter complete driver, insurer and vehicle information for second party',
category: 'SECOND_PARTY',
requiredPreviousSteps: ['FIRST_INVITE_SECOND'],
nextPossibleSteps: ['SECOND_LOCATION'],
allowedRoles: ['user'],
estimatedDuration: 5,
fields: [
{
id: '507f1f77bcf86cd799439025',
name_fa: 'کد ملی مالک',
name_en: 'nationalCodeOfOwner',
label_fa: 'کد ملی مالک',
label_en: 'National Code of Owner',
placeholder_fa: 'کد ملی ۱۰ رقمی مالک را وارد کنید',
placeholder_en: 'Enter 10-digit national code of insurer',
value: null,
dataType: 'string',
required: true,
order: 1,
isActive: true,
validation: {
pattern: '^[0-9]{10}$',
minLength: 10,
maxLength: 10
}
},
{
id: '507f1f77bcf86cd799439026',
name_fa: 'کد ملی راننده',
name_en: 'nationalCodeOfDriver',
label_fa: 'کد ملی راننده',
label_en: 'National Code of Driver',
placeholder_fa: 'کد ملی ۱۰ رقمی راننده را وارد کنید',
placeholder_en: 'Enter 10-digit national code of driver',
value: null,
dataType: 'string',
required: true,
order: 2,
isActive: true,
validation: {
pattern: '^[0-9]{10}$',
minLength: 10,
maxLength: 10
}
},
{
id: '507f1f77bcf86cd799439027',
name_fa: 'شماره گواهینامه بیمه‌گذار',
name_en: 'insurerLicense',
label_fa: 'شماره گواهینامه بیمه‌گذار',
label_en: 'Insurer License Number',
placeholder_fa: 'شماره گواهینامه بیمه‌گذار را وارد کنید',
placeholder_en: 'Enter insurer license number',
value: null,
dataType: 'string',
required: true,
order: 3,
isActive: true,
validation: {
minLength: 5,
maxLength: 20
}
},
{
id: '507f1f77bcf86cd799439028',
name_fa: 'شماره گواهینامه راننده',
name_en: 'driverLicense',
label_fa: 'شماره گواهینامه راننده',
label_en: 'Driver License Number',
placeholder_fa: 'شماره گواهینامه راننده را وارد کنید',
placeholder_en: 'Enter driver license number',
value: null,
dataType: 'string',
required: true,
order: 4,
isActive: true,
validation: {
minLength: 5,
maxLength: 20
}
},
{
id: '507f1f77bcf86cd799439029',
name_fa: 'پلاک خودرو',
name_en: 'plate',
label_fa: 'پلاک خودرو',
label_en: 'Vehicle Plate',
placeholder_fa: 'اطلاعات پلاک خودرو را وارد کنید',
placeholder_en: 'Enter vehicle plate information',
value: null,
dataType: 'object',
required: true,
order: 5,
isActive: true,
validation: {
type: 'object',
properties: {
leftDigits: { type: 'number', min: 10, max: 99 },
centerAlphabet: { type: 'string', pattern: '^[آ-ی]{1}$' },
centerDigits: { type: 'number', min: 100, max: 999 },
ir: { type: 'number', min: 10, max: 99 }
}
}
},
{
id: '507f1f77bcf86cd79943902a',
name_fa: 'راننده همان بیمه‌گذار است',
name_en: 'driverIsInsurer',
label_fa: 'راننده همان بیمه‌گذار است',
label_en: 'Driver is Insurer',
value: null,
dataType: 'boolean',
required: true,
order: 6,
isActive: true
},
{
id: '507f1f77bcf86cd79943902b',
name_fa: 'خودرو صفر است',
name_en: 'isNewCar',
label_fa: 'خودرو صفر است',
label_en: 'Is New Car',
value: null,
dataType: 'boolean',
required: true,
order: 7,
isActive: true
},
{
id: '507f1f77bcf86cd79943902c',
name_fa: 'بدون گواهی',
name_en: 'userNoCertificate',
label_fa: 'کاربر گواهی ندارد',
label_en: 'User Has No Certificate',
value: null,
dataType: 'boolean',
required: true,
order: 8,
isActive: true
},
{
id: '507f1f77bcf86cd79943902d',
name_fa: 'تاریخ تولد بیمه‌گذار',
name_en: 'insurerBirthday',
label_fa: 'تاریخ تولد بیمه‌گذار',
label_en: 'Insurer Birthday',
placeholder_fa: 'تاریخ تولد بیمه‌گذار (timestamp)',
placeholder_en: 'Insurer birthday (timestamp)',
value: null,
dataType: 'number',
required: true,
order: 9,
isActive: true,
validation: {
type: 'number',
min: 0
}
},
{
id: '507f1f77bcf86cd79943902e',
name_fa: 'تاریخ تولد راننده',
name_en: 'driverBirthday',
label_fa: 'تاریخ تولد راننده',
label_en: 'Driver Birthday',
placeholder_fa: 'تاریخ تولد راننده را وارد کنید',
placeholder_en: 'Enter driver birthday',
value: null,
dataType: 'string',
required: true,
order: 10,
isActive: true,
validation: {
format: 'date'
}
}
],
metadata: {
icon: 'clipboard-list',
color: '#8B5CF6',
formType: 'detailed',
hasComplexValidation: true,
party: 'second'
}
}
},
example10: {
summary: 'Second Party Location',
value: {
stepKey: 'SECOND_LOCATION',
type: 'THIRD_PARTY',
stepNumber: 10,
isActive: true,
stepName_fa: 'موقعیت مکانی طرف دوم',
stepName_en: 'Second Party Location',
description_fa: 'ثبت موقعیت جغرافیایی طرف دوم',
description_en: 'Record second party geographical location',
category: 'SECOND_PARTY',
requiredPreviousSteps: ['SECOND_INITIAL_FORM'],
nextPossibleSteps: ['SECOND_VOICE'],
allowedRoles: ['user'],
estimatedDuration: 2,
fields: [
{
id: '507f1f77bcf86cd79943902f',
name_fa: 'عرض جغرافیایی',
name_en: 'lat',
label_fa: 'عرض جغرافیایی',
label_en: 'Latitude',
placeholder_fa: 'عرض جغرافیایی را وارد کنید',
placeholder_en: 'Enter latitude',
value: null,
dataType: 'number',
required: true,
order: 1,
isActive: true,
validation: {
type: 'number',
min: -90,
max: 90
}
},
{
id: '507f1f77bcf86cd799439030',
name_fa: 'طول جغرافیایی',
name_en: 'lon',
label_fa: 'طول جغرافیایی',
label_en: 'Longitude',
placeholder_fa: 'طول جغرافیایی را وارد کنید',
placeholder_en: 'Enter longitude',
value: null,
dataType: 'number',
required: true,
order: 2,
isActive: true,
validation: {
type: 'number',
min: -180,
max: 180
}
}
],
metadata: {
icon: 'map-pin',
color: '#10B981',
requiresGPS: true,
autoDetectLocation: true,
party: 'second'
}
}
},
example11: {
summary: 'Second Party Voice Recording',
value: {
stepKey: 'SECOND_VOICE',
type: 'THIRD_PARTY',
stepNumber: 11,
isActive: true,
stepName_fa: 'ضبط صدای طرف دوم',
stepName_en: 'Second Party Voice Recording',
description_fa: 'ضبط توضیحات صوتی توسط طرف دوم',
description_en: 'Voice recording of explanations by second party',
category: 'SECOND_PARTY',
requiredPreviousSteps: ['SECOND_LOCATION'],
nextPossibleSteps: ['SECOND_DESCRIPTION'],
allowedRoles: ['user'],
estimatedDuration: 3,
fields: [
{
id: '507f1f77bcf86cd799439031',
name_fa: 'فایل صوتی',
name_en: 'file',
label_fa: 'ضبط صدا',
label_en: 'Voice Recording',
placeholder_fa: 'توضیحات صوتی خود را ضبط کنید',
placeholder_en: 'Record your voice explanation',
value: null,
dataType: 'audio-file',
required: true,
order: 1,
isActive: true,
validation: {
maxSize: 10485760,
maxDuration: 300,
allowedTypes: ['audio/mp3', 'audio/mpeg', 'audio/wav', 'audio/m4a', 'audio/webm']
}
}
],
metadata: {
icon: 'microphone',
color: '#F59E0B',
recordingType: 'voice',
requiresMicrophone: true,
party: 'second'
}
}
},
example12: {
summary: 'Second Party Description',
value: {
stepKey: 'SECOND_DESCRIPTION',
type: 'THIRD_PARTY',
stepNumber: 12,
isActive: true,
stepName_fa: 'توضیحات طرف دوم',
stepName_en: 'Second Party Description',
description_fa: 'ثبت توضیحات و جزئیات حادثه توسط طرف دوم',
description_en: 'Record accident description and details by second party',
category: 'SECOND_PARTY',
requiredPreviousSteps: ['SECOND_VOICE'],
nextPossibleSteps: ['WAITING_FOR_GUILT_DECISION'],
allowedRoles: ['user'],
estimatedDuration: 4,
fields: [
{
id: '507f1f77bcf86cd799439032',
name_fa: 'توضیحات',
name_en: 'desc',
label_fa: 'توضیحات حادثه',
label_en: 'Accident Description',
placeholder_fa: 'توضیحات کامل حادثه را وارد کنید',
placeholder_en: 'Enter complete accident description',
value: null,
dataType: 'textarea',
required: true,
order: 1,
isActive: true,
validation: {
minLength: 10,
maxLength: 2000
}
},
{
id: '507f1f77bcf86cd799439033',
name_fa: 'تاریخ حادثه',
name_en: 'accidentDate',
label_fa: 'تاریخ حادثه',
label_en: 'Accident Date',
placeholder_fa: 'تاریخ وقوع حادثه را وارد کنید',
placeholder_en: 'Enter accident date',
value: null,
dataType: 'date',
required: true,
order: 2,
isActive: true,
validation: {
format: 'YYYY-MM-DD'
}
},
{
id: '507f1f77bcf86cd799439034',
name_fa: 'زمان حادثه',
name_en: 'accidentTime',
label_fa: 'زمان حادثه',
label_en: 'Accident Time',
placeholder_fa: 'زمان وقوع حادثه را وارد کنید',
placeholder_en: 'Enter accident time',
value: null,
dataType: 'time',
required: true,
order: 3,
isActive: true,
validation: {
format: 'HH:mm'
}
}
],
metadata: {
icon: 'file-text',
color: '#6366F1',
party: 'second'
}
}
}
};
export const updateWorkflowStepExamples = {
example1: {
summary: 'Update step name and description',
value: {
stepName_fa: 'ویدیو طرف اول - بروزرسانی شده',
stepName_en: 'First Party Video - Updated',
description_fa: 'توضیحات بروزرسانی شده',
description_en: 'Updated description',
category: 'FIRST_PARTY',
isActive: true
}
},
example2: {
summary: 'Update video capture field settings',
value: {
fields: [
{
id: '507f1f77bcf86cd799439014',
name_fa: 'فایل ویدیو',
name_en: 'file',
label_fa: 'ضبط ویدیو',
label_en: 'Video Recording',
placeholder_fa: 'ویدیو خود را از دوربین ضبط کنید',
placeholder_en: 'Record your video from camera',
value: null,
dataType: 'video-capture',
required: true,
order: 1,
isActive: true,
validation: {
maxSize: 104857600,
maxDuration: 300,
allowedTypes: ['video/mp4', 'video/webm'],
captureMode: 'camera-only',
allowGallery: false
}
}
]
}
},
example3: {
summary: 'Update step metadata',
value: {
metadata: {
icon: 'video-camera',
color: '#10B981',
priority: 'high',
captureType: 'live-camera',
requiresCamera: true
}
}
}
};
export const bulkUpsertWorkflowStepExamples = {
example1: {
summary: 'Bulk upsert example',
value: [
{
stepKey: 'FIRST_VIDEO',
type: 'THIRD_PARTY',
stepNumber: 3,
stepName_fa: 'ویدیو طرف اول',
stepName_en: 'First Party Video',
category: 'FIRST_PARTY',
isActive: true
},
{
stepKey: 'FIRST_INITIAL_FORM',
type: 'THIRD_PARTY',
stepNumber: 4,
stepName_fa: 'فرم اولیه طرف اول',
stepName_en: 'First Party Initial Form',
category: 'FIRST_PARTY',
isActive: true
}
]
}
};
export const validateAccessExamples = {
example1: {
summary: 'Validate access example',
value: {
stepKey: 'FIRST_VIDEO',
completedSteps: ['CREATED']
}
}
};
// ============================================================
// CLAIM WORKFLOW STEP EXAMPLES
// ============================================================
export const claimWorkflowStepExamples = {
claimCreated: {
summary: 'Claim Step 1: CLAIM_CREATED',
value: {
"stepKey": "CLAIM_CREATED",
"type": "CLAIM",
"stepNumber": 1,
"isActive": true,
"stepName_fa": "ایجاد درخواست خسارت",
"stepName_en": "Create Claim Request",
"description_fa": "ایجاد درخواست خسارت از پرونده تعیین تقصیر تکمیل شده - فقط طرف آسیب‌دیده می‌تواند درخواست دهد",
"description_en": "Create claim request from completed blame case - only damaged party can proceed",
"category": "CLAIM",
"requiredPreviousSteps": [],
"nextPossibleSteps": ["SELECT_OUTER_PARTS"],
"allowedRoles": ["user"],
"estimatedDuration": 1,
"fields": [],
"metadata": {
"icon": "file-plus",
"color": "#8B5CF6",
"requiresBlameCase": true,
"blameStatusRequired": "COMPLETED",
"bothPartiesMustAccept": true,
"userMustBeDamagedParty": true
}
}
},
selectOuterParts: {
summary: 'Claim Step 2: SELECT_OUTER_PARTS',
value: {
"stepKey": "SELECT_OUTER_PARTS",
"type": "CLAIM",
"stepNumber": 2,
"isActive": true,
"stepName_fa": "انتخاب قطعات خارجی آسیب‌دیده",
"stepName_en": "Select Damaged Outer Parts",
"description_fa": "انتخاب قطعات خارجی خودرو که در حادثه آسیب دیده‌اند (کاپوت، درب‌ها، سپر و...)",
"description_en": "Select vehicle outer parts damaged in the accident (hood, doors, bumpers, etc.)",
"category": "CLAIM",
"requiredPreviousSteps": ["CLAIM_CREATED"],
"nextPossibleSteps": ["SELECT_OTHER_PARTS"],
"allowedRoles": ["user"],
"estimatedDuration": 3,
"fields": [
{
"id": "67fa10c259e15f231a2d1001",
"name_fa": "قطعات خارجی",
"name_en": "outerParts",
"label_fa": "قطعات خارجی آسیب‌دیده",
"label_en": "Damaged Outer Parts",
"placeholder_fa": "قطعات خارجی آسیب‌دیده را انتخاب کنید",
"placeholder_en": "Select damaged outer parts",
"value": [
{ "label_fa": "کاپوت", "label_en": "Hood", "value": "hood" },
{ "label_fa": "درب جلو راست", "label_en": "Front Right Door", "value": "front_right_door" },
{ "label_fa": "درب جلو چپ", "label_en": "Front Left Door", "value": "front_left_door" },
{ "label_fa": "درب عقب راست", "label_en": "Rear Right Door", "value": "rear_right_door" },
{ "label_fa": "درب عقب چپ", "label_en": "Rear Left Door", "value": "rear_left_door" },
{ "label_fa": "سپر جلو", "label_en": "Front Bumper", "value": "front_bumper" },
{ "label_fa": "سپر عقب", "label_en": "Rear Bumper", "value": "rear_bumper" },
{ "label_fa": "گلگیر جلو راست", "label_en": "Front Right Fender", "value": "front_right_fender" },
{ "label_fa": "گلگیر جلو چپ", "label_en": "Front Left Fender", "value": "front_left_fender" },
{ "label_fa": "گلگیر عقب راست", "label_en": "Rear Right Fender", "value": "rear_right_fender" },
{ "label_fa": "گلگیر عقب چپ", "label_en": "Rear Left Fender", "value": "rear_left_fender" },
{ "label_fa": "صندوق عقب", "label_en": "Trunk", "value": "trunk" },
{ "label_fa": "سقف", "label_en": "Roof", "value": "roof" }
],
"dataType": "multiselect",
"required": true,
"order": 1,
"isActive": true,
"validation": {
"minItems": 1,
"maxItems": 13
}
}
],
"metadata": {
"icon": "car",
"color": "#3B82F6",
"requiresMultipleSelection": true
}
}
},
selectOtherParts: {
summary: 'Claim Step 3: SELECT_OTHER_PARTS',
value: {
"stepKey": "SELECT_OTHER_PARTS",
"type": "CLAIM",
"stepNumber": 3,
"isActive": true,
"stepName_fa": "انتخاب سایر قطعات و اطلاعات بانکی",
"stepName_en": "Select Other Parts & Bank Information",
"description_fa": "انتخاب سایر قطعات آسیب‌دیده (غیر از بدنه)، شماره شبا و کد ملی بیمه‌گذار",
"description_en": "Select other damaged parts (non-body), Sheba number and insurer national code",
"category": "CLAIM",
"requiredPreviousSteps": ["SELECT_OUTER_PARTS"],
"nextPossibleSteps": ["UPLOAD_REQUIRED_DOCUMENTS"],
"allowedRoles": ["user"],
"estimatedDuration": 4,
"fields": [
{
"id": "67fa10c259e15f231a2d1002",
"name_fa": "سایر قطعات",
"name_en": "otherParts",
"label_fa": "سایر قطعات آسیب‌دیده",
"label_en": "Other Damaged Parts",
"placeholder_fa": "سایر قطعات آسیب‌دیده را انتخاب کنید",
"placeholder_en": "Select other damaged parts",
"value": [
{ "label_fa": "موتور", "label_en": "Engine", "value": "engine" },
{ "label_fa": "سیستم تعلیق", "label_en": "Suspension", "value": "suspension" },
{ "label_fa": "سیستم ترمز", "label_en": "Brake System", "value": "brake_system" },
{ "label_fa": "سیستم برق", "label_en": "Electrical System", "value": "electrical" },
{ "label_fa": "رادیاتور", "label_en": "Radiator", "value": "radiator" },
{ "label_fa": "گیربکس", "label_en": "Transmission", "value": "transmission" },
{ "label_fa": "اگزوز", "label_en": "Exhaust", "value": "exhaust" },
{ "label_fa": "چراغ جلو", "label_en": "Headlight", "value": "headlight" },
{ "label_fa": "چراغ عقب", "label_en": "Taillight", "value": "taillight" },
{ "label_fa": "آینه", "label_en": "Mirror", "value": "mirror" },
{ "label_fa": "شیشه", "label_en": "Glass", "value": "glass" }
],
"dataType": "multiselect",
"required": false,
"order": 1,
"isActive": true,
"validation": {
"minItems": 0,
"maxItems": 11
}
},
{
"id": "67fa10c259e15f231a2d1003",
"name_fa": "شماره شبا",
"name_en": "shebaNumber",
"label_fa": "شماره شبا",
"label_en": "Sheba Number",
"placeholder_fa": "شماره شبا (24 رقم بدون IR)",
"placeholder_en": "Sheba number (24 digits without IR)",
"value": null,
"dataType": "string",
"required": true,
"order": 2,
"isActive": true,
"validation": {
"pattern": "^[0-9]{24}$",
"minLength": 24,
"maxLength": 24
}
},
{
"id": "67fa10c259e15f231a2d1004",
"name_fa": "کد ملی مالک",
"name_en": "nationalCodeOfOwner",
"label_fa": "کد ملی مالک",
"label_en": "National Code of Owner",
"placeholder_fa": "کد ملی 10 رقمی مالک",
"placeholder_en": "10-digit national code of insurer",
"value": null,
"dataType": "string",
"required": true,
"order": 3,
"isActive": true,
"validation": {
"pattern": "^[0-9]{10}$",
"minLength": 10,
"maxLength": 10
}
}
],
"metadata": {
"icon": "list",
"color": "#10B981",
"requiresBankInfo": true
}
}
},
uploadRequiredDocuments: {
summary: 'Claim Step 4: UPLOAD_REQUIRED_DOCUMENTS',
value: {
"stepKey": "UPLOAD_REQUIRED_DOCUMENTS",
"type": "CLAIM",
"stepNumber": 4,
"isActive": true,
"stepName_fa": "آپلود مدارک مورد نیاز",
"stepName_en": "Upload Required Documents",
"description_fa": "آپلود مدارک مورد نیاز برای بررسی خسارت (لیست داینامیک بر اساس قطعات انتخاب شده)",
"description_en": "Upload required documents for claim review (dynamic list based on selected parts)",
"category": "CLAIM",
"requiredPreviousSteps": ["SELECT_OTHER_PARTS"],
"nextPossibleSteps": ["CAPTURE_PART_DAMAGES"],
"allowedRoles": ["user"],
"estimatedDuration": 5,
"fields": [],
"metadata": {
"icon": "upload",
"color": "#F59E0B",
"dynamicFields": true,
"requiresAPI": "/claim-request-management/car-part-image-required/:claimRequestID"
}
}
},
capturePartDamages: {
summary: 'Claim Step 5: CAPTURE_PART_DAMAGES',
value: {
"stepKey": "CAPTURE_PART_DAMAGES",
"type": "CLAIM",
"stepNumber": 5,
"isActive": true,
"stepName_fa": "ثبت تصاویر آسیب‌های قطعات",
"stepName_en": "Capture Part Damages",
"description_fa": "ثبت تصاویر آسیب برای هر قطعه (یک درخواست به ازای هر قطعه)",
"description_en": "Capture damage images for each part (one request per part)",
"category": "CLAIM",
"requiredPreviousSteps": ["UPLOAD_REQUIRED_DOCUMENTS"],
"nextPossibleSteps": ["USER_SUBMISSION_COMPLETE"],
"allowedRoles": ["user"],
"estimatedDuration": 10,
"fields": [],
"metadata": {
"icon": "camera",
"color": "#EF4444",
"dynamicFields": true,
"requiresAPI": "/claim-request-management/capture-car-part-damage/:claimRequestID/:partId",
"requiresCamera": true,
"multipleRequests": true
}
}
},
userSubmissionComplete: {
summary: 'Claim Step 6: USER_SUBMISSION_COMPLETE',
value: {
"stepKey": "USER_SUBMISSION_COMPLETE",
"type": "CLAIM",
"stepNumber": 6,
"isActive": true,
"stepName_fa": "تکمیل ثبت اطلاعات کاربر",
"stepName_en": "User Submission Complete",
"description_fa": "اطلاعات کاربر به طور کامل ثبت شد و در انتظار بررسی کارشناس خسارت",
"description_en": "User information completed, waiting for damage expert review",
"category": "CLAIM",
"requiredPreviousSteps": ["CAPTURE_PART_DAMAGES"],
"nextPossibleSteps": ["EXPERT_DAMAGE_ASSESSMENT"],
"allowedRoles": ["user", "damage_expert", "admin"],
"estimatedDuration": 0,
"fields": [],
"metadata": {
"icon": "check-circle",
"color": "#10B981",
"readOnly": true,
"isSystemStep": true
}
}
},
expertDamageAssessment: {
summary: 'Claim Step 7: EXPERT_DAMAGE_ASSESSMENT',
value: {
"stepKey": "EXPERT_DAMAGE_ASSESSMENT",
"type": "CLAIM",
"stepNumber": 7,
"isActive": true,
"stepName_fa": "ارزیابی خسارت توسط کارشناس",
"stepName_en": "Expert Damage Assessment",
"description_fa": "بررسی و ارزیابی خسارت توسط کارشناس خسارت",
"description_en": "Damage review and assessment by damage expert",
"category": "EXPERT",
"requiredPreviousSteps": ["USER_SUBMISSION_COMPLETE"],
"nextPossibleSteps": ["EXPERT_COST_EVALUATION"],
"allowedRoles": ["damage_expert", "admin"],
"estimatedDuration": 30,
"fields": [
{
"id": "67fa10c259e15f231a2d1005",
"name_fa": "وضعیت ارزیابی",
"name_en": "assessmentStatus",
"label_fa": "وضعیت ارزیابی",
"label_en": "Assessment Status",
"placeholder_fa": "وضعیت ارزیابی را انتخاب کنید",
"placeholder_en": "Select assessment status",
"value": [
{ "label_fa": "تایید شده", "label_en": "Approved", "value": "approved" },
{ "label_fa": "نیاز به بازنگری", "label_en": "Needs Revision", "value": "needs_revision" },
{ "label_fa": "رد شده", "label_en": "Rejected", "value": "rejected" }
],
"dataType": "select",
"required": true,
"order": 1,
"isActive": true,
"validation": {
"enum": ["approved", "needs_revision", "rejected"]
}
},
{
"id": "67fa10c259e15f231a2d1006",
"name_fa": "توضیحات کارشناس",
"name_en": "expertComments",
"label_fa": "توضیحات کارشناس",
"label_en": "Expert Comments",
"placeholder_fa": "توضیحات خود را وارد کنید",
"placeholder_en": "Enter your comments",
"value": null,
"dataType": "textarea",
"required": true,
"order": 2,
"isActive": true,
"validation": {
"minLength": 10,
"maxLength": 2000
}
}
],
"metadata": {
"icon": "clipboard-check",
"color": "#8B5CF6",
"requiresExpertRole": true
}
}
},
expertCostEvaluation: {
summary: 'Claim Step 8: EXPERT_COST_EVALUATION',
value: {
"stepKey": "EXPERT_COST_EVALUATION",
"type": "CLAIM",
"stepNumber": 8,
"isActive": true,
"stepName_fa": "برآورد هزینه توسط کارشناس",
"stepName_en": "Expert Cost Evaluation",
"description_fa": "محاسبه و برآورد هزینه تعمیرات توسط کارشناس",
"description_en": "Repair cost calculation and estimation by expert",
"category": "EXPERT",
"requiredPreviousSteps": ["EXPERT_DAMAGE_ASSESSMENT"],
"nextPossibleSteps": ["INSURER_REVIEW"],
"allowedRoles": ["damage_expert", "admin"],
"estimatedDuration": 20,
"fields": [
{
"id": "67fa10c259e15f231a2d1007",
"name_fa": "هزینه کل برآورد شده",
"name_en": "estimatedTotalCost",
"label_fa": "هزینه کل برآورد شده (ریال)",
"label_en": "Estimated Total Cost (Rials)",
"placeholder_fa": "مبلغ را وارد کنید",
"placeholder_en": "Enter amount",
"value": null,
"dataType": "number",
"required": true,
"order": 1,
"isActive": true,
"validation": {
"min": 0,
"max": 999999999999
}
},
{
"id": "67fa10c259e15f231a2d1008",
"name_fa": "جزئیات هزینه",
"name_en": "costBreakdown",
"label_fa": "جزئیات هزینه",
"label_en": "Cost Breakdown",
"placeholder_fa": "جزئیات هزینه را وارد کنید",
"placeholder_en": "Enter cost breakdown",
"value": null,
"dataType": "textarea",
"required": true,
"order": 2,
"isActive": true,
"validation": {
"minLength": 20,
"maxLength": 5000
}
}
],
"metadata": {
"icon": "dollar-sign",
"color": "#F59E0B",
"requiresExpertRole": true,
"requiresCostCalculation": true
}
}
},
insurerReview: {
summary: 'Claim Step 9: INSURER_REVIEW',
value: {
"stepKey": "INSURER_REVIEW",
"type": "CLAIM",
"stepNumber": 9,
"isActive": true,
"stepName_fa": "بررسی بیمه‌گر",
"stepName_en": "Insurer Review",
"description_fa": "بررسی نهایی و تایید یا رد خسارت توسط بیمه‌گر",
"description_en": "Final review and approval/rejection by insurer",
"category": "INSURER",
"requiredPreviousSteps": ["EXPERT_COST_EVALUATION"],
"nextPossibleSteps": ["CLAIM_COMPLETED"],
"allowedRoles": ["insurer", "admin"],
"estimatedDuration": 60,
"fields": [
{
"id": "67fa10c259e15f231a2d1009",
"name_fa": "تصمیم بیمه‌گر",
"name_en": "insurerDecision",
"label_fa": "تصمیم بیمه‌گر",
"label_en": "Insurer Decision",
"placeholder_fa": "تصمیم خود را انتخاب کنید",
"placeholder_en": "Select your decision",
"value": [
{ "label_fa": "تایید", "label_en": "Approved", "value": "approved" },
{ "label_fa": "رد", "label_en": "Rejected", "value": "rejected" }
],
"dataType": "select",
"required": true,
"order": 1,
"isActive": true,
"validation": {
"enum": ["approved", "rejected"]
}
},
{
"id": "67fa10c259e15f231a2d1010",
"name_fa": "توضیحات بیمه‌گر",
"name_en": "insurerNotes",
"label_fa": "توضیحات بیمه‌گر",
"label_en": "Insurer Notes",
"placeholder_fa": "توضیحات خود را وارد کنید",
"placeholder_en": "Enter your notes",
"value": null,
"dataType": "textarea",
"required": true,
"order": 2,
"isActive": true,
"validation": {
"minLength": 10,
"maxLength": 2000
}
}
],
"metadata": {
"icon": "shield-check",
"color": "#6366F1",
"requiresInsurerRole": true,
"isFinalStep": false
}
}
},
claimCompleted: {
summary: 'Claim Step 10: CLAIM_COMPLETED',
value: {
"stepKey": "CLAIM_COMPLETED",
"type": "CLAIM",
"stepNumber": 10,
"isActive": true,
"stepName_fa": "تکمیل خسارت",
"stepName_en": "Claim Completed",
"description_fa": "خسارت به طور کامل بررسی و نتیجه‌گیری شده است",
"description_en": "Claim has been fully reviewed and concluded",
"category": "FINAL",
"requiredPreviousSteps": ["INSURER_REVIEW"],
"nextPossibleSteps": [],
"allowedRoles": ["user", "damage_expert", "insurer", "admin"],
"estimatedDuration": 0,
"fields": [],
"metadata": {
"icon": "check-circle",
"color": "#10B981",
"readOnly": true,
"isSystemStep": true,
"isFinalStep": true
}
}
}
};