Skip to content

Commit

Permalink
🔨 server imports updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanptm committed Oct 3, 2024
1 parent 1e7a344 commit 9bc4c0b
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 70 deletions.
6 changes: 3 additions & 3 deletions client/types/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ export interface IPrescription {

export interface IMedication {
readonly name: string;
readonly dosage: string; // e.g., '2 tablets'
readonly frequency: string; // e.g., 'twice a day'
readonly duration: string; // e.g., '5 days'
readonly dosage: string;
readonly frequency: string;
readonly duration: string;
readonly additionalInstructions?: string;
}
3 changes: 1 addition & 2 deletions client/types/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ export enum PrescriptionStatus {
PENDING = 'pending',
ISSUED = 'issued',
CANCELLED = 'cancelled',
}

}
8 changes: 4 additions & 4 deletions server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import express from "express";
import { createServer } from "http";
import { connectDB } from "./config/connectDB";
import routes from "./presentation/routers/index";
import cors from "cors";
import cookieParser from "cookie-parser";
import helmet from "helmet";
import logger from "./utils/logger";
import bodyParser from "body-parser";
import { webhook } from "./presentation/routers/appointment/AppointmentRoutes";
import { connectDB } from "./config/connectDB";
import routes from "./presentation/routers/index";
import { CLIENT_URL, PORT } from "./config/env";
import JWTService from "./infrastructure/services/JWTService";
import SocketServer from "./presentation/socket/SocketServer";
import { webhook } from "./presentation/routers/appointment/AppointmentRoutes";
import VideoSocketManager from "./presentation/socket/VideoSocketManager";
import logger from "./utils/logger";

const port = PORT || 8080;

Expand Down
2 changes: 1 addition & 1 deletion server/src/use_case/UnauthenticatedUseCases.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import IDoctor from "../domain/entities/IDoctor";
import IDoctorRepository from "../domain/interface/repositories/IDoctorRepository";
import IDoctor from "../domain/entities/IDoctor";
import { PaginatedResult } from "../types";

export default class UnauthenticatedUseCases {
Expand Down
4 changes: 2 additions & 2 deletions server/src/use_case/admin/AuthenticationUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { IPasswordServiceRepository } from "../../domain/interface/services/IPasswordServiceRepository";
import IDoctorRepository from "../../domain/interface/repositories/IDoctorRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import IOtpRepository from "../../domain/interface/repositories/IOtpRepository";
import IEmailService from "../../domain/interface/services/IEmailService";
import ITokenService from "../../domain/interface/services/ITokenService";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import CustomError from "../../domain/entities/CustomError";
import { IPasswordServiceRepository } from "../../domain/interface/services/IPasswordServiceRepository";
import { StatusCode, UserRole } from "../../types";

export default class AuthenticationUseCase {
Expand Down
6 changes: 3 additions & 3 deletions server/src/use_case/admin/DoctorUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import IDoctor from "../../domain/entities/IDoctor";
import CustomError from "../../domain/entities/CustomError";
import IDoctorRepository from "../../domain/interface/repositories/IDoctorRepository";
import IEmailService from "../../domain/interface/services/IEmailService";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import IEmailService from "../../domain/interface/services/IEmailService";
import { DoctorsFilter, PaginatedResult, StatusCode } from "../../types";
import CustomError from "../../domain/entities/CustomError";
import IDoctor from "../../domain/entities/IDoctor";
import { CLIENT_URL } from "../../config/env";

export default class AdminDoctorUseCase {
Expand Down
2 changes: 1 addition & 1 deletion server/src/use_case/admin/PatientUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import IPatientRepository from "../../domain/interface/repositories/IPatientRepository";
import IPatient from "../../domain/entities/IPatient";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import IPatient from "../../domain/entities/IPatient";
import { PaginatedResult } from "../../types";

export default class AdminPatientUseCase {
Expand Down
22 changes: 11 additions & 11 deletions server/src/use_case/appointment/CreateAppointmentUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import CustomError from "../../domain/entities/CustomError";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import ISlotRepository from "../../domain/interface/repositories/ISlotRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import IPaymentService from "../../domain/interface/services/IPaymentService";
import IPaymentRepository from "../../domain/interface/repositories/IPaymentRepository";
import IPayment, { PaymentStatus } from "../../domain/entities/IPayment";
import IAppointment, { AppointmentStatus, AppointmentType } from "../../domain/entities/IAppointment";
import { StatusCode } from "../../types";
import IVideoSectionRepository from "../../domain/interface/repositories/IVideoSectionRepository";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import IPatientRepository from "../../domain/interface/repositories/IPatientRepository";
import IPaymentRepository from "../../domain/interface/repositories/IPaymentRepository";
import IDoctorRepository from "../../domain/interface/repositories/IDoctorRepository";
import IDoctor from "../../domain/entities/IDoctor";
import IPatient from "../../domain/entities/IPatient";
import ISlotRepository from "../../domain/interface/repositories/ISlotRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import IPaymentService from "../../domain/interface/services/IPaymentService";
import { VideoSectionStatus } from "../../domain/entities/IVideoChatSection";
import IPayment, { PaymentStatus } from "../../domain/entities/IPayment";
import IUUIDService from "../../domain/interface/services/IUUIDService";
import { addMinutes, parse, format } from "../../utils/date-formatter";
import CustomError from "../../domain/entities/CustomError";
import IPatient from "../../domain/entities/IPatient";
import IDoctor from "../../domain/entities/IDoctor";
import { CLIENT_URL } from "../../config/env";
import IUUIDService from "../../domain/interface/services/IUUIDService";
import { StatusCode } from "../../types";

export default class AppointmentUseCase {
bookingAmount: number;
Expand Down
5 changes: 2 additions & 3 deletions server/src/use_case/appointment/GetAppointmentUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import IAppointment, { AppointmentStatus, IExtendedAppointment } from "../../domain/entities/IAppointment";
import IPrescriptionRepository from "../../domain/interface/repositories/IPrescriptionRepository";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import IPaymentRepository from "../../domain/interface/repositories/IPaymentRepository";
import IPrescriptionRepository from "../../domain/interface/repositories/IPrescriptionRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import CustomError from "../../domain/entities/CustomError";
import IAppointment, { AppointmentStatus, IExtendedAppointment } from "../../domain/entities/IAppointment";
import { PaginatedResult, StatusCode } from "../../types";
import logger from "../../utils/logger";

export default class GetAppointmentUseCase {
constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import IVideoSectionRepository from "../../domain/interface/repositories/IVideoSectionRepository";
import INotificationRepository from "../../domain/interface/repositories/INotificationRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import { AppointmentStatus } from "../../domain/entities/IAppointment";
import { NotificationTypes } from "../../domain/entities/INotification";
import IVideoSectionRepository from "../../domain/interface/repositories/IVideoSectionRepository";
import { VideoSectionStatus } from "../../domain/entities/IVideoChatSection";

export default class UpdateAppointmentUseCase {
Expand Down
6 changes: 3 additions & 3 deletions server/src/use_case/chat/CreateChatUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import CustomError from "../../domain/entities/CustomError";
import IChatRepository from "../../domain/interface/repositories/IChatRepository";
import IDoctorRepository from "../../domain/interface/repositories/IDoctorRepository";
import IMessageRepository from "../../domain/interface/repositories/IMessageRepository";
import IPatientRepository from "../../domain/interface/repositories/IPatientRepository";
import IDoctorRepository from "../../domain/interface/repositories/IDoctorRepository";
import IChatRepository from "../../domain/interface/repositories/IChatRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import CustomError from "../../domain/entities/CustomError";
import { StatusCode } from "../../types";

export default class CreateChatUseCase {
Expand Down
10 changes: 5 additions & 5 deletions server/src/use_case/chat/GetChatUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import CustomError from "../../domain/entities/CustomError";
import IChat from "../../domain/entities/IChat";
import IMessage from "../../domain/entities/IMessage";
import IPatient from "../../domain/entities/IPatient";
import IChatRepository from "../../domain/interface/repositories/IChatRepository";
import IMessageRepository from "../../domain/interface/repositories/IMessageRepository";
import IPatientRepository from "../../domain/interface/repositories/IPatientRepository";
import IChatRepository from "../../domain/interface/repositories/IChatRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import CustomError from "../../domain/entities/CustomError";
import { PaginatedResult, StatusCode } from "../../types";
import IMessage from "../../domain/entities/IMessage";
import IPatient from "../../domain/entities/IPatient";
import IChat from "../../domain/entities/IChat";

export default class GetChatUseCase {
constructor(
Expand Down
10 changes: 5 additions & 5 deletions server/src/use_case/doctor/AuthenticationUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import IDoctor from "../../domain/entities/IDoctor";
import { IPasswordServiceRepository } from "../../domain/interface/services/IPasswordServiceRepository";
import ICloudStorageService from "../../domain/interface/services/ICloudStorageService";
import IDoctorRepository from "../../domain/interface/repositories/IDoctorRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import IOtpRepository from "../../domain/interface/repositories/IOtpRepository";
import ICloudStorageService from "../../domain/interface/services/ICloudStorageService";
import IEmailService from "../../domain/interface/services/IEmailService";
import ITokenService from "../../domain/interface/services/ITokenService";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import { AWS_REGION, CLIENT_URL, S3_BUCKET_NAME } from "../../config/env";
import CustomError from "../../domain/entities/CustomError";
import { IPasswordServiceRepository } from "../../domain/interface/services/IPasswordServiceRepository";
import IDoctor from "../../domain/entities/IDoctor";
import { StatusCode, UserRole } from "../../types";
import { AWS_REGION, CLIENT_URL, S3_BUCKET_NAME } from "../../config/env";

export default class AuthenticationUseCase {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion server/src/use_case/notification/NotificationUseCae.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import INotification from "../../domain/entities/INotification";
import INotificationRepository from "../../domain/interface/repositories/INotificationRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import INotification from "../../domain/entities/INotification";

export default class NotificationUseCase {
constructor(
Expand Down
10 changes: 5 additions & 5 deletions server/src/use_case/patient/AuthenticationUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ITokenService from "../../domain/interface/services/ITokenService";
import IOtpRepository from "../../domain/interface/repositories/IOtpRepository";
import { IPasswordServiceRepository } from "../../domain/interface/services/IPasswordServiceRepository";
import IPatientRepository from "../../domain/interface/repositories/IPatientRepository";
import IEmailService from "../../domain/interface/services/IEmailService";
import IPatient from "../../domain/entities/IPatient";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import IOtpRepository from "../../domain/interface/repositories/IOtpRepository";
import ITokenService from "../../domain/interface/services/ITokenService";
import IEmailService from "../../domain/interface/services/IEmailService";
import CustomError from "../../domain/entities/CustomError";
import { IPasswordServiceRepository } from "../../domain/interface/services/IPasswordServiceRepository";
import IPatient from "../../domain/entities/IPatient";
import { StatusCode, UserRole } from "../../types";
import { CLIENT_URL } from "../../config/env";

Expand Down
8 changes: 4 additions & 4 deletions server/src/use_case/patient/PatientUseCases.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import IVideoSectionRepository from "../../domain/interface/repositories/IVideoSectionRepository";
import IPatientRepository from "../../domain/interface/repositories/IPatientRepository";
import ICloudStorageService from "../../domain/interface/services/ICloudStorageService";
import IPatient from "../../domain/entities/IPatient";
import IChatRepository from "../../domain/interface/repositories/IChatRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import { AWS_REGION, S3_BUCKET_NAME } from "../../config/env";
import CustomError from "../../domain/entities/CustomError";
import IPatient from "../../domain/entities/IPatient";
import { StatusCode } from "../../types";
import { AWS_REGION, S3_BUCKET_NAME } from "../../config/env";
import IChatRepository from "../../domain/interface/repositories/IChatRepository";
import IVideoSectionRepository from "../../domain/interface/repositories/IVideoSectionRepository";

export default class PatientUseCase {
constructor(
Expand Down
6 changes: 3 additions & 3 deletions server/src/use_case/prescription/CreatePrescriptionUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import CustomError from "../../domain/entities/CustomError";
import IPrescription, { PrescriptionStatus } from "../../domain/entities/IPrescription";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import IPrescriptionRepository from "../../domain/interface/repositories/IPrescriptionRepository";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import IPrescription, { PrescriptionStatus } from "../../domain/entities/IPrescription";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import CustomError from "../../domain/entities/CustomError";
import { StatusCode } from "../../types";

export default class CreatePrescriptionUseCase {
Expand Down
4 changes: 2 additions & 2 deletions server/src/use_case/slot/CreateSlotUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { parse, format, addHours } from "../../utils/date-formatter";
import ISlotRepository from "../../domain/interface/repositories/ISlotRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import ISlot, { SlotStatus, Days } from "../../domain/entities/ISlot";
import { parse, format, addHours } from "../../utils/date-formatter";
import CustomError from "../../domain/entities/CustomError";
import { StatusCode } from "../../types";
import ISlot, { SlotStatus, Days } from "../../domain/entities/ISlot";

export default class CreateSlotUseCase {
protected interval: number;
Expand Down
8 changes: 4 additions & 4 deletions server/src/use_case/slot/DeleteSlotUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ISlotRepository from "../../domain/interface/repositories/ISlotRepository";
import INotificationRepository from "../../domain/interface/repositories/INotificationRepository";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import CustomError from "../../domain/entities/CustomError";
import ISlotRepository from "../../domain/interface/repositories/ISlotRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import INotificationRepository from "../../domain/interface/repositories/INotificationRepository";
import ISlot, { Days } from "../../domain/entities/ISlot";
import { NotificationTypes } from "../../domain/entities/INotification";
import { AppointmentStatus } from "../../domain/entities/IAppointment";
import CustomError from "../../domain/entities/CustomError";
import ISlot, { Days } from "../../domain/entities/ISlot";
import { StatusCode } from "../../types";

export default class DeleteSlotUseCase {
Expand Down
2 changes: 1 addition & 1 deletion server/src/use_case/slot/GetSlotUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ISlotRepository from "../../domain/interface/repositories/ISlotRepository";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import ISlotRepository from "../../domain/interface/repositories/ISlotRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import ISlot, { Days } from "../../domain/entities/ISlot";
import { addHours } from "../../utils/date-formatter";
Expand Down
2 changes: 1 addition & 1 deletion server/src/use_case/slot/UpdateSlotUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ISlot from "../../domain/entities/ISlot";
import ISlotRepository from "../../domain/interface/repositories/ISlotRepository";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import ISlot from "../../domain/entities/ISlot";

export default class UpdateSlotUseCase {
constructor(
Expand Down
6 changes: 3 additions & 3 deletions server/src/use_case/video/GetVideoSectionUseCase.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import IAppointment, { AppointmentStatus } from "../../domain/entities/IAppointment";
import IVideoSection, { VideoSectionStatus } from "../../domain/entities/IVideoChatSection";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import IVideoSectionRepository from "../../domain/interface/repositories/IVideoSectionRepository";
import IAppointmentRepository from "../../domain/interface/repositories/IAppointmentRepository";
import IVideoSection, { VideoSectionStatus } from "../../domain/entities/IVideoChatSection";
import IAppointment, { AppointmentStatus } from "../../domain/entities/IAppointment";
import IValidatorService from "../../domain/interface/services/IValidatorService";
import { addDays } from "../../utils/date-formatter";

Expand Down
4 changes: 2 additions & 2 deletions server/src/utils/logger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createLogger, format, transports } from "winston";
import path from "path";
import "winston-daily-rotate-file";
import { NODE_ENV } from "../config/env";
import "winston-daily-rotate-file";
import path from "path";

const logDirectory = path.resolve(path.join(__dirname,'../../'), "logs");

Expand Down

1 comment on commit 9bc4c0b

@vercel
Copy link

@vercel vercel bot commented on 9bc4c0b Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.