Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var types = require('./types');
  2.  
  3. var externalLines = {
  4.   type: 'object',
  5.   required: ['_id', 'name', 'isOnline', 'useForIncoming', 'useForOutgoing',
  6.     'driverRedirectionType', 'rules', 'phoneNumberAutoCorrection', 'incomingPhoneNumberAutoCorrection'],
  7.    
  8.   properties: {
  9.     _id: types.ObjectId,
  10.     name: {type: 'string'},
  11.     overrideOnlineStatus: {type: 'boolean'}, // Если это поле имеется, то при проверки онлайна будет учитываться его значение, а не значение поля isOnline
  12.     isOnline: {type: 'boolean'},
  13.     useForIncoming: {type: 'boolean'},
  14.     useForOutgoing: {type: 'boolean'},
  15.     port: {type: 'string'}, // Если поля нет, то поправка на порт при наборе номера не используется
  16.     comment: {type: 'string'},
  17.     ivrId: types.ObjectId, // Если поля нет, то IVR для данной линии не используется
  18.     driverRedirectionType: {type: 'string', enum: ['callback', 'direct']}, // Тип редиректа пассажира на водителя
  19.     incomingCallType: {type: 'string', enum: ['callback', 'direct']}, // Поля нет, если линия не используется для входящих
  20.  
  21.     rules: {
  22.       type: 'object',
  23.       required: ['regexps']
  24.       properties: {
  25.         regexps: {
  26.           type: 'array',
  27.           minItems: 1,
  28.           uniqueItems: true,
  29.           items: {type: 'RegExp'}
  30.         }
  31.       }
  32.     },
  33.    
  34.     phoneNumberAutoCorrection: { // Автокоррекция исходящего номера
  35.       type: 'array',
  36.       items: {
  37.         type: 'object',
  38.         required: ['condition', 'modifier']
  39.         properties: {
  40.           condition: {type: 'RegExp'}
  41.           modifier: {type: 'string'}
  42.         }
  43.       }
  44.     },
  45.    
  46.     incomingPhoneNumberAutoCorrection: { // Автокоррекция входящего номера
  47.       type: 'array',
  48.       items: {
  49.         type: 'object',
  50.         required: ['condition', 'modifier']
  51.         properties: {
  52.           condition: {type: 'RegExp'}
  53.           modifier: {type: 'string'}
  54.         }
  55.       }
  56.     }
  57.   }
  58. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement