diff --git a/package-lock.json b/package-lock.json index e3dcd5a49..ab3d3d5f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "digital-office-frontend", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3073,6 +3073,16 @@ "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "blob": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", @@ -6627,6 +6637,13 @@ } } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -10231,6 +10248,13 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, + "nan": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", + "dev": true, + "optional": true + }, "nanoid": { "version": "3.1.16", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.16.tgz", @@ -16383,7 +16407,11 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", @@ -17022,7 +17050,11 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", diff --git a/src/app/core/models/leave-time.model.ts b/src/app/core/models/leave-time.model.ts new file mode 100644 index 000000000..0a338394a --- /dev/null +++ b/src/app/core/models/leave-time.model.ts @@ -0,0 +1,23 @@ +import { LeaveType } from '@data/api/time-service/models/leave-type'; + +export interface ILeaveType { + leaveType: LeaveType; + leaveInRussian: string; +} + +export class LeaveTimeModel { + private static _leaveTypes: ILeaveType[] = [ + { leaveType: LeaveType.SickLeave, leaveInRussian: 'Больничный' }, + { leaveType: LeaveType.Idle, leaveInRussian: 'Отгул' }, + { leaveType: LeaveType.Training, leaveInRussian: 'Обучение' }, + { leaveType: LeaveType.Vacation, leaveInRussian: 'Отпуск' }, + ]; + + public static getLeaveInfoByLeaveType(leaveType: LeaveType) { + return this._leaveTypes.find((leave: ILeaveType) => leave.leaveType === leaveType); + } + + public static getAllLeaveTypes(): ILeaveType[] { + return this._leaveTypes.slice(); + } +} diff --git a/src/app/core/services/attendance.service.ts b/src/app/core/services/attendance.service.ts index 568d3cb70..e2ea5047e 100644 --- a/src/app/core/services/attendance.service.ts +++ b/src/app/core/services/attendance.service.ts @@ -1,4 +1,3 @@ -//@ts-nocheck import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { Time } from '@angular/common'; @@ -8,11 +7,11 @@ import { DateService } from './date.service'; @Injectable() export class AttendanceService { - private readonly _datePeriod = new BehaviorSubject(this.dateService.getDefaultDatePeriod(6)); + private readonly _datePeriod = new BehaviorSubject(this.dateService.getDefaultDatePeriod()); readonly datePeriod$ = this._datePeriod.asObservable(); - private readonly _recommendedTime = new BehaviorSubject