Skip to content

Commit

Permalink
fix:ts error while building due to (@) alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Rithick574 committed Jul 9, 2024
1 parent 64db0ca commit 7bc10e2
Show file tree
Hide file tree
Showing 173 changed files with 244 additions and 253 deletions.
4 changes: 2 additions & 2 deletions chat-service/src/_boot/consumer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { consumer } from "@/infrastructure/kafka/index";
import { IChatSubscriber, createSubscriber } from "@/infrastructure/kafka/subscribe";
import { consumer } from "../infrastructure/kafka/index";
import { IChatSubscriber, createSubscriber } from "../infrastructure/kafka/subscribe";
import { EachMessagePayload } from "kafkajs";

export const runConsumer = async () => {
Expand Down
2 changes: 1 addition & 1 deletion chat-service/src/_boot/dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as repositories from '../infrastructure/database/mongoDB/repositories'
import { IDependencies } from "@/application/interfaces/IDependencies"
import { IDependencies } from "../application/interfaces/IDependencies"
import * as useCases from "../application/useCases"

export const dependencies:IDependencies={
Expand Down
2 changes: 1 addition & 1 deletion chat-service/src/application/interfaces/IUseCases.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ICreateChatUseCase, ICreateMessageUseCase, IFindNotificationUseCase, IfindChatByUseCase, IfindChatByUserIdUseCase, IfindGroupByUserUseCase } from "@/domain/useCases";
import { ICreateChatUseCase, ICreateMessageUseCase, IFindNotificationUseCase, IfindChatByUseCase, IfindChatByUserIdUseCase, IfindGroupByUserUseCase } from "../../domain/useCases";
import { IDependencies } from "./IDependencies";

export interface IUseCases{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MessageEntity } from "@/domain/entities";
import { MessageEntity } from "../../domain/entities";
import { IDependencies } from "../interfaces/IDependencies";

export const createMessageUseCase =(dependencies:IDependencies)=>{
Expand Down
4 changes: 2 additions & 2 deletions chat-service/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import database from "@/_boot/config";
import server from "@/presentation/index";
import database from "./_boot/config";
import server from "./presentation";
import { runConsumer, stopConsumer } from "./_boot/consumer";

(async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Schema, model } from "mongoose";
import { UserEntity } from "@/domain/entities";
import { UserEntity } from "../../../../domain/entities";

const userSchema = new Schema({
firstName: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChatEntity } from "@/domain/entities";
import { ChatEntity } from "../../../../../domain/entities";
import { User } from "../../models/user";
import { Chat } from "../../models/chat";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MessageEntity } from "@/domain/entities";
import { MessageEntity } from "../../../../../domain/entities";
import { Chat } from "../../models/chat";
import { Message } from "../../models/message";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChatEntity } from "@/domain/entities";
import { ChatEntity } from "../../../../../domain/entities";
import { Chat } from "../../models/chat";

export const findChatById = async (chatId: string): Promise<ChatEntity | null> => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChatEntity } from "@/domain/entities";
import { ChatEntity } from "../../../../../domain/entities";
import { Chat } from "../../models/chat";
import { Types } from "mongoose";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChatEntity } from "@/domain/entities";
import { ChatEntity } from "../../../../../domain/entities";
import { Chat } from "../../models/chat";
import { Types } from "mongoose";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChatEntity } from "@/domain/entities";
import { ChatEntity } from "../../../../../domain/entities";
import { Chat } from "../../models/chat";
import { Types } from "mongoose";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ErrorResponse } from "@learnwise/common";
import { User } from "../../models/user";
import { UserEntity } from "@/domain/entities";
import { UserEntity } from "../../../../../domain/entities";

export const createUser = async (
data: UserEntity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createChat } from "@/infrastructure/database/mongoDB/repositories"
import { createChat } from "../../database/mongoDB/repositories"


export default async(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User } from "@/infrastructure/database/mongoDB/models/user";
import { User } from "../../database/mongoDB/models/user";

export async function userBlockStatusChanged(data: {
id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createChat } from "@/infrastructure/database/mongoDB/repositories";
import { createChat } from "../../database/mongoDB/repositories";


export default async(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UserEntity } from "@/domain/entities";
import { User } from "@/infrastructure/database/mongoDB/models/user";
import { UserEntity } from "../../../domain/entities";
import { User } from "../../database/mongoDB/models/user";

export async function updateUserProfileConsumer(data: { kafkaMessage: { email: string, updatedUserData: UserEntity }}): Promise<void>{
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User } from "@/infrastructure/database/mongoDB/models/user";
import { User } from "../../database/mongoDB/models/user";

export async function updateUserRoleConsumer(data: {
email: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UserEntity } from "@/domain/entities";
import { createUser } from "@/infrastructure/database/mongoDB/repositories/user/createUser";
import { UserEntity } from "../../../domain/entities";
import { createUser } from "../../database/mongoDB/repositories/user/createUser";

export default async (data: UserEntity) => {
try {
Expand Down
4 changes: 2 additions & 2 deletions chat-service/src/infrastructure/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { controllers } from "@/presentation/controllers";
import { IDependencies } from "../../application/interfaces/IDependencies";
import { controllers } from "../../presentation/controllers";
import { Router } from "express";

export const router = (dependencies: IDependencies) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../application/interfaces/IDependencies";
import { Request, Response, NextFunction } from "express";
import mongoose from 'mongoose';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../application/interfaces/IDependencies";
import { NextFunction, Request, Response } from "express";

export const createMessageController = (dependecies: IDependencies) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../application/interfaces/IDependencies";
import { NextFunction, Request, Response } from "express";

export const findNotificationController=(dependencies:IDependencies)=>{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../application/interfaces/IDependencies";
import { NextFunction, Request, Response } from "express";

export const getChatAndMessages=(dependancies:IDependencies)=>{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../application/interfaces/IDependencies";
import { ErrorResponse } from "@learnwise/common";
import { NextFunction, Request, Response } from "express";

Expand Down
2 changes: 1 addition & 1 deletion chat-service/src/presentation/controllers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from '@/application/interfaces/IDependencies'
import { IDependencies } from '../../application/interfaces/IDependencies'
import { createChatController } from './createChatController'
import { createMessageController } from './createMessageController'
import { getChatAndMessages } from './getChatAndMessages'
Expand Down
6 changes: 3 additions & 3 deletions chat-service/src/presentation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import helmet from "helmet";
import cors from "cors";
import http from "http";
import morgan from "morgan";
import connectSocketIo from "@/infrastructure/socket";
import { router } from "@/infrastructure/routes";
import { dependencies } from "@/_boot/dependencies";
import connectSocketIo from "../infrastructure/socket";
import { router } from "../infrastructure/routes";
import { dependencies } from "../_boot/dependencies";

dotenv.config();

Expand Down
4 changes: 2 additions & 2 deletions course-service/src/_boot/consumer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { consumer } from "@/infrastructure/kafka/index";
import { createSubscriber,ICourseSubscriber } from "@/infrastructure/kafka/subscriber";
import { consumer } from "../infrastructure/kafka/index";
import { createSubscriber,ICourseSubscriber } from "../infrastructure/kafka/subscriber";

export const runConsumer = async () => {
try {
Expand Down
6 changes: 3 additions & 3 deletions course-service/src/_boot/dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as repositories from "@/infrastructure/database/mongoDB/repositories";
import * as useCases from "@/application/useCases";
import { IDependencies } from "@/application/interfaces/IDependencies";
import * as repositories from "../infrastructure/database/mongoDB/repositories";
import * as useCases from "../application/useCases";
import { IDependencies } from "../application/interfaces/IDependencies";

export const dependencies: IDependencies = {
repositories,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import jwt from 'jsonwebtoken';
import { generateAccessToken } from "@/_lib/jwt";
import { generateAccessToken } from "../../../_lib/jwt";
import { Request, Response, NextFunction } from "express";

interface UserPayload {
Expand Down
4 changes: 2 additions & 2 deletions course-service/src/_lib/common/middlewares/verifyAdmin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Request, Response, NextFunction } from "express";
import {ErrorResponse} from "@/_lib/common/error"
import { findUserById } from "@/infrastructure/database/mongoDB/repositories";
import {ErrorResponse} from "../../../_lib/common/error"
import { findUserById } from "../../../infrastructure/database/mongoDB/repositories";

export const verifyAdmin = async (req: Request, res: Response, next: NextFunction) => {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Request, Response, NextFunction } from "express";
import { ErrorResponse } from "../error";
import { findUserById } from "@/infrastructure/database/mongoDB/repositories";
import { findUserById } from "./../../../infrastructure/database/mongoDB/repositories";

export const verifyInstructor = async (req: Request, res: Response, next: NextFunction) => {

Expand Down
2 changes: 1 addition & 1 deletion course-service/src/application/interfaces/IRepositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
IReview,
CategoryEntity,
CourseEntity,
} from "@/domain/entities";
} from "../../domain/entities";

export interface IRepositories {
getAllCategories: (
Expand Down
4 changes: 2 additions & 2 deletions course-service/src/application/interfaces/IUsecases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import {
IEditCourseUseCase,
IEnrollmentProgressUseCase,
IGetEnrollmentByUserIdUseCase
} from "@/domain/useCases";
} from "../../domain/useCases";
import { IDependencies } from "./IDependencies";
import { ICreateExamUseCase, IGetExamUseCase, ISubmitExamUseCase } from "@/domain/useCases/exams";
import { ICreateExamUseCase, IGetExamUseCase, ISubmitExamUseCase } from "../../domain/useCases/exams";

export interface IUseCases {
getAllCategoriesUseCase: (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";
import { CategoryEntity } from "../../../domain/entities/categoryEntity";


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CategoryEntity } from "@/domain/entities/categoryEntity";
import { CategoryEntity } from "../../../domain/entities";
import { IDependencies } from "../../interfaces/IDependencies";

export const updateCategoryUseCase = (dependencies: IDependencies) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const PublishCoursesUseCase = (dependencies: IDependencies) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { CourseEntity } from "@/domain/entities/CourseEntity";
import { IDependencies } from "../../../application/interfaces/IDependencies";
import { CourseEntity } from "../../../domain/entities/CourseEntity";


export const createCourseUseCase = (dependencies: IDependencies) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { CourseEntity } from "@/domain/entities/CourseEntity";
import { IDependencies } from "../../../application/interfaces/IDependencies";
import { CourseEntity } from "../../../domain/entities/CourseEntity";

export const editCourseUseCase=(dependencies:IDependencies)=>{
const {repositories:{editCourse}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getAllCoursesUseCase = (dependencies: IDependencies) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getCourseUseCase = (dependencies: IDependencies) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getInstructorCourseUseCase = (dependencies: IDependencies) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getPublishedCoursesUseCase = (dependencies: IDependencies) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const updateCourseStatusUseCase = (dependencies: IDependencies) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";


export const adminDashboardUseCase = (dependencies : IDependencies)=>{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const enrollmentProgressUseCase=(dependencies:IDependencies)=>{
const {repositories:{enrollmentProgress}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getEnrollmentByUserIdUseCase=(dependencies:IDependencies)=>{
const {repositories:{getEnrollmentByUserId}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";


export const getEnrollmentUseCase = (dependencies : IDependencies)=>{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getEnrollmentsForInstructorOverTimeUseCase=(dependencies:IDependencies)=>{
const {repositories:{getEnrollmentsForInstructorOverTime}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";


export const getTopCourseUseCase = (dependencies : IDependencies)=>{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getTopCoursesForInstructorUseCase=(dependencies:IDependencies)=>{
const {repositories:{getTopCoursesForInstructor}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getTotalCoursesForInstructorUseCase=(dependencies:IDependencies)=>{
const {repositories:{getTotalCoursesForInstructor}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getTotalStudentsForInstructorUseCase=(dependencies:IDependencies)=>{
const {repositories:{getTotalStudentsForInstructor}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";


export const myStudentsUseCase = (dependencies : IDependencies)=>{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";


export const paymentListUseCase = (dependencies : IDependencies)=>{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const salesReportUseCase = (dependencies: IDependencies) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const createExamUseCase=(dependencies:IDependencies)=>{
const {repositories:{createExam}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const getExamUseCase=(dependencies:IDependencies)=>{
const {repositories:{getExam}} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDependencies } from "@/application/interfaces/IDependencies";
import { IDependencies } from "../../../application/interfaces/IDependencies";

export const submitExamUseCase=(dependencies:IDependencies)=>{
const {repositories:{submitExam}} = dependencies;
Expand Down
Loading

0 comments on commit 7bc10e2

Please sign in to comment.