@@ -6,7 +6,7 @@ export interface SendNotificationsOptions {
66 delayMs ?: number ;
77 userId ?: number ;
88 onlyGeneral ?: boolean ;
9- generalRatio ?: number ; // Вероятность general уведомлений (0-1)
9+ generalRatio ?: number ; // Probability of general notifications (0-1)
1010}
1111
1212export async function sendNotificationsWithDelay (
@@ -16,15 +16,15 @@ export async function sendNotificationsWithDelay(
1616 const {
1717 count = 10 ,
1818 delayMs = 2000 ,
19- generalRatio = 0.7 // 70% general, 30% system по умолчанию
19+ generalRatio = 0.7 // 70% general, 30% system default
2020 } = options ;
2121
2222 const systemChannels = [ 'created' , 'updated' , 'deleted' , 'system' ] as const ;
2323 const entities = [ 'user' , 'product' , 'order' , 'category' , 'payment' ] as const ;
2424 const actions = [ 'create' , 'update' , 'delete' , 'approve' , 'reject' ] as const ;
2525
2626 const generateRandomNotification = ( ) : Omit < INotification , 'id' | 'createdAt' | 'icon' > => {
27- // Определяем тип уведомления с учетом вероятности
27+ // Determining the type of notification based on probability
2828 const isGeneral = options . onlyGeneral ? true : faker . number . float ( { min : 0 , max : 1 } ) < generalRatio ;
2929
3030 if ( ! isGeneral ) {
@@ -56,9 +56,9 @@ export async function sendNotificationsWithDelay(
5656 } else {
5757 // General notification
5858 const userIdOption = options . userId ?? faker . helpers . arrayElement ( [
59- undefined , // для всех пользователей
60- 1 , // пользователь с ID 1
61- 2 // пользователь с ID 2
59+ undefined , // for all users
60+ 1 , // user with ID 1
61+ 2 // user with ID 2
6262 ] ) ;
6363
6464 const hasUserId = userIdOption !== undefined ;
@@ -82,7 +82,7 @@ export async function sendNotificationsWithDelay(
8282 channel : '' ,
8383 } ;
8484
85- // Добавляем userId только если он указан
85+ // Add userId only if it is specified
8686 if ( hasUserId ) {
8787 return {
8888 ...notification ,
0 commit comments