Skip to content

Commit ea88bc2

Browse files
committed
Дописать отправку уведомлений об оценках для основных действий
1 parent 9c9dd97 commit ea88bc2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+478
-211
lines changed

apps/api/src/helpers/notificationController.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let isWorker: boolean = false;
2+
3+
export const setIsWorker = (value: boolean) => isWorker = value;
4+
5+
export const getIsWorker = () => isWorker;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './markGetByData'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type {ICacheData} from "@helpers";
2+
import {MarkModel} from "../../model";
3+
4+
export const markGetByData = async (taskId: bigint, authData: ICacheData) =>
5+
MarkModel.findOne({
6+
where: {
7+
taskId,
8+
diaryUserId: authData.localUserId
9+
}
10+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './save'
22
export * from './delete'
3+
export * from './get'

apps/api/src/models/Mark/actions/save/markSaveOrGet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { MarkKeys, Task } from '@diary-spo/shared'
22
import { type ICacheData, retriesForError } from '@helpers'
33
import { formatDate } from '@utils'
4-
import { addNewMarkEvent } from '../../../../helpers/notificationController'
4+
import { addNewMarkEvent } from '../../../../worker/notificator/bot'
55
import { markValueSaveOrGet } from '../../../MarkValue'
66
import type { IScheduleModel } from '../../../Schedule'
77
import { markSaveOrGetUnSafe } from './markSaveOrGetUnSafe'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {MarkValueModel} from "../../model";
2+
3+
export const markValueGetById = async (markValueId: number) => MarkValueModel.findOne({
4+
where: {
5+
id: markValueId
6+
}
7+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './requiredGetByData'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {RequiredModel} from "../../model";
2+
3+
export const requiredGetByData = (diaryUserId: bigint, taskId: bigint) => RequiredModel.findOne({
4+
where: {
5+
diaryUserId,
6+
taskId
7+
}
8+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './save'
2+
export * from './get'

0 commit comments

Comments
 (0)