Skip to content

Commit

Permalink
fixed bugs in job add and edit
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-abin committed Apr 2, 2024
1 parent b3f129a commit 737d357
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 94 deletions.
5 changes: 5 additions & 0 deletions job/src/controllers/recruiter/create-job.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export = (dependencies: DependenciesData)=>{
const data = req.body;

if(!data.company_name || !data.company_location ) throw new BadRequestError('Add company details in the profile before creating a job!!');
if(!data.salary_min || !data.salary_max) throw new BadRequestError('must add all salary fields!!');
if(data.salary_min > data.salary_max ) throw new BadRequestError('min salary must be less than max salary!!');
if(data.salary_min <0 || data.salary_max<0 ) throw new BadRequestError('cannot add negative values in the salary field!!');
if(data.available_position && data.available_position<0 ) throw new BadRequestError('cannot add negative values in the available position field!!');

const newJob = await createJobUseCase(dependencies).execute(data);

// // to produce a message to kafka topic
Expand Down
6 changes: 6 additions & 0 deletions job/src/controllers/recruiter/update-job.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ export = (dependencies: DependenciesData)=>{
const data = req.body;
const {jobId} = data;

if(!data.company_name || !data.company_location ) throw new BadRequestError('Add company details in the profile before creating a job!!');
if(!data.salary_min || !data.salary_max) throw new BadRequestError('must add all salary fields!!');
if(data.salary_min > data.salary_max ) throw new BadRequestError('min salary must be less than max salary!!');
if(data.salary_min <0 || data.salary_max<0 ) throw new BadRequestError('cannot add negative values in the salary field!!');
if(data.available_position && data.available_position<0 ) throw new BadRequestError('cannot add negative values in the available position field!!');

const job = await getJobByIdUseCase(dependencies).execute(jobId);
if(!job) throw new NotFoundError();

Expand Down
94 changes: 0 additions & 94 deletions k8s/ingress/dev/ingress-srv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,97 +67,3 @@ spec:
port:
number: 3000


# -----------------------------------------------------------------------------------
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# name: ingress-service
# annotations:
# cert-manager.io/cluster-issuer: "letsencrypt-staging"
# kubernetes.io/ingress.class: nginx
# nginx.ingress.kubernetes.io/use-regex: "true"
# nginx.ingress.kubernetes.io/proxy-body-size: "50m"
# spec:
# tls:
# - hosts:
# - devhive.dev
# secretName: devhive-tls
# rules:
# - host: devhive.dev
# http:
# paths:
# - path: /api/v1/auth/?(.*)
# pathType: Prefix
# backend:
# service:
# name: auth-srv
# port:
# number: 3000
# - path: /api/v1/admin/?(.*)
# pathType: Prefix
# backend:
# service:
# name: admin-srv
# port:
# number: 3000
# - path: /api/v1/job/?(.*)
# pathType: Prefix
# backend:
# service:
# name: job-srv
# port:
# number: 3000
# - path: /api/v1/profile/?(.*)
# pathType: Prefix
# backend:
# service:
# name: profile-srv
# port:
# number: 3000
# - path: /api/v1/chat/?(.*)
# pathType: Prefix
# backend:
# service:
# name: chat-srv
# port:
# number: 3000
# - path: /?(.*)
# pathType: Prefix
# backend:
# service:
# name: client-app-srvs
# port:
# number: 3000
# ---
# apiVersion: v1
# kind: Service
# metadata:
# annotations:
# service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: 'true'
# service.beta.kubernetes.io/do-loadbalancer-hostname: 'devhive.dev'
# labels:
# helm.sh/chart: ingress-nginx-2.0.3
# app.kubernetes.io/name: ingress-nginx
# app.kubernetes.io/instance: ingress-nginx
# app.kubernetes.io/version: 0.32.0
# app.kubernetes.io/managed-by: Helm
# app.kubernetes.io/component: controller
# name: ingress-nginx-controller
# namespace: ingress-nginx
# spec:
# type: LoadBalancer
# externalTrafficPolicy: Local
# ports:
# - name: http
# port: 80
# protocol: TCP
# targetPort: http
# - name: https
# port: 443
# protocol: TCP
# targetPort: https
# selector:
# app.kubernetes.io/name: ingress-nginx
# app.kubernetes.io/instance: ingress-nginx
# app.kubernetes.io/component: controller

0 comments on commit 737d357

Please sign in to comment.