Добавлены модели и функциональность для управления сотрудниками, включая создание, обновление и удаление сотрудников через GraphQL. Обновлены компоненты для отображения списка сотрудников и их расписания, улучшен интерфейс взаимодействия с пользователем. Реализованы функции экспорта отчетов в CSV и TXT форматах, добавлены новые интерфейсы и типы данных для сотрудников.

This commit is contained in:
Bivekich
2025-07-17 23:55:11 +03:00
parent 3e2a03da8c
commit d361364716
13 changed files with 3444 additions and 428 deletions

View File

@ -43,6 +43,10 @@ export const typeDefs = gql`
# Избранные товары пользователя
myFavorites: [Product!]!
# Сотрудники организации
myEmployees: [Employee!]!
employee(id: ID!): Employee
}
type Mutation {
@ -107,6 +111,12 @@ export const typeDefs = gql`
# Работа с избранным
addToFavorites(productId: ID!): FavoritesResponse!
removeFromFavorites(productId: ID!): FavoritesResponse!
# Работа с сотрудниками
createEmployee(input: CreateEmployeeInput!): EmployeeResponse!
updateEmployee(id: ID!, input: UpdateEmployeeInput!): EmployeeResponse!
deleteEmployee(id: ID!): Boolean!
updateEmployeeSchedule(input: UpdateScheduleInput!): Boolean!
}
# Типы данных
@ -470,6 +480,132 @@ export const typeDefs = gql`
favorites: [Product!]
}
# Типы для сотрудников
type Employee {
id: ID!
firstName: String!
lastName: String!
middleName: String
birthDate: String
avatar: String
passportPhoto: String
passportSeries: String
passportNumber: String
passportIssued: String
passportDate: String
address: String
position: String!
department: String
hireDate: String!
salary: Float
status: EmployeeStatus!
phone: String!
email: String
telegram: String
whatsapp: String
emergencyContact: String
emergencyPhone: String
scheduleRecords: [EmployeeSchedule!]!
organization: Organization!
createdAt: String!
updatedAt: String!
}
enum EmployeeStatus {
ACTIVE
VACATION
SICK
FIRED
}
type EmployeeSchedule {
id: ID!
date: String!
status: ScheduleStatus!
hoursWorked: Float
notes: String
employee: Employee!
createdAt: String!
updatedAt: String!
}
enum ScheduleStatus {
WORK
WEEKEND
VACATION
SICK
ABSENT
}
input CreateEmployeeInput {
firstName: String!
lastName: String!
middleName: String
birthDate: String
avatar: String
passportPhoto: String
passportSeries: String
passportNumber: String
passportIssued: String
passportDate: String
address: String
position: String!
department: String
hireDate: String!
salary: Float
phone: String!
email: String
telegram: String
whatsapp: String
emergencyContact: String
emergencyPhone: String
}
input UpdateEmployeeInput {
firstName: String
lastName: String
middleName: String
birthDate: String
avatar: String
passportPhoto: String
passportSeries: String
passportNumber: String
passportIssued: String
passportDate: String
address: String
position: String
department: String
hireDate: String
salary: Float
status: EmployeeStatus
phone: String
email: String
telegram: String
whatsapp: String
emergencyContact: String
emergencyPhone: String
}
input UpdateScheduleInput {
employeeId: ID!
date: String!
status: ScheduleStatus!
hoursWorked: Float
notes: String
}
type EmployeeResponse {
success: Boolean!
message: String!
employee: Employee
}
type EmployeesResponse {
success: Boolean!
message: String!
employees: [Employee!]!
}
# JSON скаляр
scalar JSON
`