Skip to content

Commit

Permalink
Merge pull request #57 from iam-abin/bugfix
Browse files Browse the repository at this point in the history
fixed some bugs in client side of job service
  • Loading branch information
iam-abin authored Jun 27, 2024
2 parents a67434c + cb86504 commit 06e6b6c
Show file tree
Hide file tree
Showing 297 changed files with 876 additions and 777 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### About

This application is built using MERN stack and microservices to be deployed in kubernetes cluster.
This is a Job Finding Application For software developers.
This is a Job Finding Application.

### setup

Expand Down
2 changes: 2 additions & 0 deletions admin/src/config/db.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DatabaseConnectionError } from "@abijobportal/common";
import mongoose from "mongoose";

const connectDB = async () => {
Expand All @@ -6,6 +7,7 @@ const connectDB = async () => {
console.log("admin service connected to mongodb...");
} catch (error) {
console.error("admin service mongodb connection failed!!!!",error);
throw new DatabaseConnectionError()
}
};

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/admin/dashboard.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getAllDashboardCardsDetailsUseCase }} = dependencies

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getDashboardGraphDetailsUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/admin/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

import dashboardController from "./dashboard.controller";
import getDashboardGraphDetailsController from "./get-dashboard-graph-details.controller";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
return {
dashboardController: dashboardController(dependencies),
getDashboardGraphDetailsController: getDashboardGraphDetailsController(dependencies),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";
import { UserUpdatedEventPublisher } from "../../frameworks/utils/kafka-events/publishers/user-updated-publisher";
import { kafkaClient } from "../../config/kafka-connection";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { blockUnblockCandidateUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/candidate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import getAllCandidatesController from "./view-candidates.controller";
import getCandidateByIdController from "./view-profile.controller";
import candidateBlockUnblockController from "./block-unblock-candidate.controller";

import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
return {
getAllCandidatesController: getAllCandidatesController(dependencies),
getCandidateByIdController: getCandidateByIdController(dependencies),
Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/candidate/view-candidates.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getAllCandidatesUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/candidate/view-profile.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getCandidateProfileByuserIdUseCase }} = dependencies

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";
import { kafkaClient } from "../../config/kafka-connection";
import { JobUpdatedEventPublisher } from "../../frameworks/utils/kafka-events/publishers/job-updated-publisher";
import { CompanyProfileUpdatedEventPublisher } from "../../frameworks/utils/kafka-events/publishers/company-profile-updated-publisher";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { blockUnblockCompanyUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/company/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

import blockUnblockCompanyController from "./block-unblock-company.controller";
import viewCompanyProfileController from "./view-company-profile.controller";
import viewCompaniesController from "./view-companies.controller";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
return {
blockUnblockCompanyController: blockUnblockCompanyController(dependencies),
viewCompanyProfileController: viewCompanyProfileController(dependencies),
Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/company/view-companies.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getAllCompaniesUseCase }} = dependencies

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getCompanyByIdUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/job/block-unblock-job.controller.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";
import { kafkaClient } from "../../config/kafka-connection";
import { JobUpdatedEventPublisher } from "../../frameworks/utils/kafka-events/publishers/job-updated-publisher";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { blockUnblockJobUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/job/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

import blockUnblockJobController from "./block-unblock-job.controller";
import viewJobController from "./view-job.controller";
import viewJobsController from "./view-jobs.controller";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
return {
blockUnblockJobController: blockUnblockJobController(dependencies),
viewJobController: viewJobController(dependencies),
Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/job/view-job.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getJobByIdUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/job/view-jobs.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getAllJobsUseCase }} = dependencies

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";
import { kafkaClient } from "../../config/kafka-connection";
// import { JobUpdatedEventPublisher } from "../../frameworks/services/kafka-events/publishers/job-updated-publisher";
import { MemberShipPlanUpdatedEventPublisher } from "../../frameworks/utils/kafka-events/publishers/membership-plan-updated-publisher ";
import { NotAuthorizedError, NotFoundError } from "@abijobportal/common";
// import { produceMessage } from "../../frameworks/services/kafka/producer";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
const {
useCases: {
getMemberShipPlanByIdUseCase,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";
import { BadRequestError, RequestValidationError } from "@abijobportal/common";
import { MemberShipPlanCreatedEventPublisher } from "../../frameworks/utils/kafka-events/publishers/membership-plan-created-publisher";
import { kafkaClient } from "../../config/kafka-connection";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { createMemberShipPlanUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/membership/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

import createMembershipController from "./create-membership.controller";
import updateMembershipController from "./update-membership.controller";
import blockUnblockMembershipController from "./block-unblock-membership.controller";
import viewAllMembershipsController from "./view-all-memberships.controller";
import viewMembershipController from "./view-membership.controller";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
return {
createMembershipController: createMembershipController(dependencies),
updateMembershipController: updateMembershipController(dependencies),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";
import { MemberShipPlanUpdatedEventPublisher } from "../../frameworks/utils/kafka-events/publishers/membership-plan-updated-publisher ";
import { kafkaClient } from "../../config/kafka-connection";
import { BadRequestError, NotAuthorizedError, NotFoundError } from "@abijobportal/common";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { updateMemberShipPlanUseCase, getMemberShipPlanByIdUseCase }} = dependencies

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
const {
useCases: { getAllMembershipPlansUseCase },
} = dependencies;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";
import { BadRequestError } from "@abijobportal/common";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getMemberShipPlanByIdUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/payment/get-all-payments.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getAllPaymentsUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/payment/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

import getAllPaymentsController from "./get-all-payments.controller";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
return {
getAllPaymentsController: getAllPaymentsController(dependencies),
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";
import { UserUpdatedEventPublisher } from "../../frameworks/utils/kafka-events/publishers/user-updated-publisher";
import { kafkaClient } from "../../config/kafka-connection";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { blockUnblockRecruiterUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/recruiter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import getAllRecruitersController from "./view-recruiters.controller";
import getRecruiterByIdController from "./view-recruiter-profile.controller";
import recruiterBlockUnblockController from "./block-unblock-recruiter.controller";

import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData) => {
export = (dependencies: IDependenciesData) => {
return {
getAllRecruitersController: getAllRecruitersController(dependencies),
getRecruiterByIdController: getRecruiterByIdController(dependencies),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getRecruiterProfileByuserIdUseCase }} = dependencies

Expand Down
4 changes: 2 additions & 2 deletions admin/src/controllers/recruiter/view-recruiters.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";
import { DependenciesData } from "../../frameworks/types/dependencyInterface";
import { IDependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData)=>{
export = (dependencies: IDependenciesData)=>{

const { useCases: { getAllRecruitersUseCase }} = dependencies

Expand Down
20 changes: 18 additions & 2 deletions admin/src/entities/candidate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
import { CandidateData } from "../frameworks/types/candidateInterface";
export interface ICandidateData{
name: string;
email: string;
phone: string;
password: string;
userType: string;
userId: string

gender?: string;
currentLocation?: string;
address?: object;
keySkills?: string[];
profile_image?: string;
about?: string;
resume?: string;
experience?: string;
}

export class Candidate {
name: string;
Expand All @@ -17,7 +33,7 @@ export class Candidate {
resume?: string;
experience?: string;

constructor({ name, email, phone, password, userType, userId }: CandidateData) {
constructor({ name, email, phone, password, userType, userId }: ICandidateData) {
this.name = name;
this.email = email;
this.phone = phone;
Expand Down
10 changes: 8 additions & 2 deletions admin/src/entities/membership-plan.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { MembershipPlanData } from "../frameworks/types/membership-plan-interface";
export interface IMembershipPlanData {
name: String;
features: Array<string>;
description: string;
price: number;
isActive?: boolean;
}

export class MembershipPlan {
name: String;
features: Array<string>;
description: string;
price: number;

constructor({ name, features, description, price }: MembershipPlanData) {
constructor({ name, features, description, price }: IMembershipPlanData) {
this.name = name;
this.features = features;
this.description = description;
Expand Down
4 changes: 2 additions & 2 deletions admin/src/entities/payment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface PaymentData {
export interface IPaymentData {
candidateId: string;
membershipPlanId: string;
stripeId?: string;
Expand All @@ -9,7 +9,7 @@ export class Payment {
membershipPlanId: string;
stripeId?: string;

constructor({ candidateId, membershipPlanId, stripeId }: PaymentData) {
constructor({ candidateId, membershipPlanId, stripeId }: IPaymentData) {
this.candidateId = candidateId;
this.membershipPlanId = membershipPlanId;
this.stripeId = stripeId;
Expand Down
Loading

0 comments on commit 06e6b6c

Please sign in to comment.