Skip to content

Commit 7da92d6

Browse files
Removed graphql job models for now.
1 parent 17d66bb commit 7da92d6

File tree

8 files changed

+355
-361
lines changed

8 files changed

+355
-361
lines changed

src/jobs/job.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Module } from '@nestjs/common';
22
import { JobService } from './job.service';
33
import { JobController } from './job.controller';
4-
import { JobResolver } from './job.resolver';
4+
//import { JobResolver } from './job.resolver';
55
import { CommonModule } from '../common/common.module';
66

77
/**
@@ -22,7 +22,7 @@ import { CommonModule } from '../common/common.module';
2222
CommonModule, // Provides database, authentication, and other shared services
2323
],
2424
controllers: [JobController], // REST API endpoints
25-
providers: [JobService, JobResolver], // Business logic and GraphQL resolvers
25+
providers: [JobService], // Business logic and GraphQL resolvers //JobResolver
2626
exports: [JobService], // Allow other modules to use JobService
2727
})
2828
export class JobModule {}

src/jobs/job.resolver.ts

Lines changed: 102 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,110 @@
1-
import { Resolver, Query, Mutation, Args, Int } from '@nestjs/graphql';
2-
import { UseGuards } from '@nestjs/common';
3-
import { JobService } from './job.service';
4-
import { Job } from './models/job.model';
5-
import { CreateJobDto } from './dto/create-job.dto';
6-
import { UpdateJobDto } from './dto/update-job.dto';
7-
import { JobArgs } from './args/job.args';
8-
import { GqlAuthGuard } from '../common/auth/gql-auth.guard';
9-
import { UserEntity as User } from './../common/decorators/user.decorator';
1+
// import { Resolver, Query, Mutation, Args, Int } from '@nestjs/graphql';
2+
// import { UseGuards } from '@nestjs/common';
3+
// import { JobService } from './job.service';
4+
// import { Job } from './models/job.model';
5+
// import { CreateJobDto } from './dto/create-job.dto';
6+
// import { UpdateJobDto } from './dto/update-job.dto';
7+
// import { JobArgs } from './args/job.args';
8+
// import { GqlAuthGuard } from '../common/auth/gql-auth.guard';
9+
// import { UserEntity as User } from './../common/decorators/user.decorator';
1010

11-
/**
12-
* Job GraphQL Resolver
13-
*
14-
* Provides GraphQL queries and mutations for job management.
15-
* Handles both public queries (viewing jobs) and protected mutations
16-
* (creating, updating, deleting jobs).
17-
*
18-
* Queries:
19-
* - jobs: Get paginated list of jobs with filtering
20-
* - job: Get single job by ID
21-
* - jobsByCompany: Get jobs for a specific company
22-
* - jobsByTag: Get jobs with a specific tag
23-
*
24-
* Mutations:
25-
* - createJob: Create a new job listing
26-
* - updateJob: Update an existing job listing
27-
* - deleteJob: Delete a job listing
28-
*/
29-
@Resolver(() => Job)
30-
export class JobResolver {
31-
constructor(private readonly jobService: JobService) {}
11+
// /**
12+
// * Job GraphQL Resolver
13+
// *
14+
// * Provides GraphQL queries and mutations for job management.
15+
// * Handles both public queries (viewing jobs) and protected mutations
16+
// * (creating, updating, deleting jobs).
17+
// *
18+
// * Queries:
19+
// * - jobs: Get paginated list of jobs with filtering
20+
// * - job: Get single job by ID
21+
// * - jobsByCompany: Get jobs for a specific company
22+
// * - jobsByTag: Get jobs with a specific tag
23+
// *
24+
// * Mutations:
25+
// * - createJob: Create a new job listing
26+
// * - updateJob: Update an existing job listing
27+
// * - deleteJob: Delete a job listing
28+
// */
29+
// @Resolver(() => Job)
30+
// export class JobResolver {
31+
// constructor(private readonly jobService: JobService) {}
3232

33-
/**
34-
* Get all jobs with optional filtering and pagination
35-
* Public query - no authentication required
36-
*/
37-
@Query(() => [Job])
38-
async jobs(@Args() args: JobArgs) {
39-
const result = await this.jobService.findAll({
40-
paginationArgs: args,
41-
orderBy: args.orderBy,
42-
search: args.search,
43-
companyId: args.companyId,
44-
location: args.location,
45-
isRemote: args.isRemote,
46-
tags: args.tags,
47-
});
48-
return result.jobs;
49-
}
33+
// /**
34+
// * Get all jobs with optional filtering and pagination
35+
// * Public query - no authentication required
36+
// */
37+
// @Query(() => [Job])
38+
// async jobs(@Args() args: JobArgs) {
39+
// const result = await this.jobService.findAll({
40+
// paginationArgs: args,
41+
// orderBy: args.orderBy,
42+
// search: args.search,
43+
// companyId: args.companyId,
44+
// location: args.location,
45+
// isRemote: args.isRemote,
46+
// tags: args.tags,
47+
// });
48+
// return result.jobs;
49+
// }
5050

51-
/**
52-
* Get a single job by ID
53-
* Public query - no authentication required
54-
*/
55-
@Query(() => Job, { name: 'job' })
56-
async findOne(@Args('id', { type: () => Int }) id: number) {
57-
return this.jobService.findOne(id);
58-
}
51+
// /**
52+
// * Get a single job by ID
53+
// * Public query - no authentication required
54+
// */
55+
// @Query(() => Job, { name: 'job' })
56+
// async findOne(@Args('id', { type: () => Int }) id: number) {
57+
// return this.jobService.findOne(id);
58+
// }
5959

60-
/**
61-
* Get jobs for a specific company
62-
* Public query - no authentication required
63-
*/
64-
@Query(() => [Job])
65-
async jobsByCompany(@Args('companyId', { type: () => Int }) companyId: number, @Args() args: JobArgs) {
66-
const result = await this.jobService.findByCompany(companyId, args, args.orderBy);
67-
return result.jobs;
68-
}
60+
// /**
61+
// * Get jobs for a specific company
62+
// * Public query - no authentication required
63+
// */
64+
// @Query(() => [Job])
65+
// async jobsByCompany(@Args('companyId', { type: () => Int }) companyId: number, @Args() args: JobArgs) {
66+
// const result = await this.jobService.findByCompany(companyId, args, args.orderBy);
67+
// return result.jobs;
68+
// }
6969

70-
/**
71-
* Get jobs with a specific tag
72-
* Public query - no authentication required
73-
*/
74-
@Query(() => [Job])
75-
async jobsByTag(@Args('tagName') tagName: string, @Args() args: JobArgs) {
76-
const result = await this.jobService.findByTag(tagName, args, args.orderBy);
77-
return result.jobs;
78-
}
70+
// /**
71+
// * Get jobs with a specific tag
72+
// * Public query - no authentication required
73+
// */
74+
// @Query(() => [Job])
75+
// async jobsByTag(@Args('tagName') tagName: string, @Args() args: JobArgs) {
76+
// const result = await this.jobService.findByTag(tagName, args, args.orderBy);
77+
// return result.jobs;
78+
// }
7979

80-
/**
81-
* Create a new job listing
82-
* Protected mutation - requires authentication
83-
*/
84-
@Mutation(() => Job)
85-
@UseGuards(GqlAuthGuard)
86-
async createJob(@Args('createJobInput') createJobDto: CreateJobDto, @User() user: any) {
87-
return this.jobService.create(createJobDto, user.id);
88-
}
80+
// /**
81+
// * Create a new job listing
82+
// * Protected mutation - requires authentication
83+
// */
84+
// @Mutation(() => Job)
85+
// @UseGuards(GqlAuthGuard)
86+
// async createJob(@Args('createJobInput') createJobDto: CreateJobDto, @User() user: any) {
87+
// return this.jobService.create(createJobDto, user.id);
88+
// }
8989

90-
/**
91-
* Update an existing job listing
92-
* Protected mutation - requires authentication
93-
*/
94-
@Mutation(() => Job)
95-
@UseGuards(GqlAuthGuard)
96-
async updateJob(@Args('id', { type: () => Int }) id: number, @Args('updateJobInput') updateJobDto: UpdateJobDto, @User() user: any) {
97-
return this.jobService.update(id, updateJobDto, user.id);
98-
}
90+
// /**
91+
// * Update an existing job listing
92+
// * Protected mutation - requires authentication
93+
// */
94+
// @Mutation(() => Job)
95+
// @UseGuards(GqlAuthGuard)
96+
// async updateJob(@Args('id', { type: () => Int }) id: number, @Args('updateJobInput') updateJobDto: UpdateJobDto, @User() user: any) {
97+
// return this.jobService.update(id, updateJobDto, user.id);
98+
// }
9999

100-
/**
101-
* Delete a job listing
102-
* Protected mutation - requires authentication
103-
*/
104-
@Mutation(() => Boolean)
105-
@UseGuards(GqlAuthGuard)
106-
async deleteJob(@Args('id', { type: () => Int }) id: number, @User() user: any) {
107-
await this.jobService.remove(id, user.id);
108-
return true;
109-
}
110-
}
100+
// /**
101+
// * Delete a job listing
102+
// * Protected mutation - requires authentication
103+
// */
104+
// @Mutation(() => Boolean)
105+
// @UseGuards(GqlAuthGuard)
106+
// async deleteJob(@Args('id', { type: () => Int }) id: number, @User() user: any) {
107+
// await this.jobService.remove(id, user.id);
108+
// return true;
109+
// }
110+
// }

src/jobs/models/company.model.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import { Field, ObjectType, Int } from '@nestjs/graphql';
2-
import { BaseModel } from '../../common/models/base.model';
3-
import { Job } from './job.model';
1+
// import { Field, ObjectType, Int } from '@nestjs/graphql';
2+
// import { BaseModel } from '../../common/models/base.model';
3+
// import { Job } from './job.model';
44

5-
/**
6-
* GraphQL ObjectType for Company entities
7-
* Represents a company that posts jobs
8-
*/
9-
@ObjectType()
10-
export class Company extends BaseModel {
11-
/**
12-
* The name of the company
13-
* @example "Tech Corp Inc."
14-
*/
15-
@Field()
16-
name: string;
5+
// /**
6+
// * GraphQL ObjectType for Company entities
7+
// * Represents a company that posts jobs
8+
// */
9+
// @ObjectType()
10+
// export class Company extends BaseModel {
11+
// /**
12+
// * The name of the company
13+
// * @example "Tech Corp Inc."
14+
// */
15+
// @Field()
16+
// name: string;
1717

18-
/**
19-
* Jobs posted by this company
20-
* One-to-many relationship with Job
21-
*/
22-
@Field(() => [Job], { nullable: true })
23-
jobs?: Job[];
24-
}
18+
// /**
19+
// * Jobs posted by this company
20+
// * One-to-many relationship with Job
21+
// */
22+
// @Field(() => [Job], { nullable: true })
23+
// jobs?: Job[];
24+
// }
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { ObjectType, Field } from '@nestjs/graphql';
2-
import { PaginatedResponse } from '../../common/models/paginated-response.model';
3-
import { Job } from './job.model';
1+
// import { ObjectType, Field } from '@nestjs/graphql';
2+
// import { PaginatedResponse } from '../../common/models/paginated-response.model';
3+
// import { Job } from './job.model';
44

5-
/**
6-
* GraphQL ObjectType for paginated job responses
7-
* Extends the base PaginatedResponse to provide job-specific pagination
8-
*/
9-
@ObjectType()
10-
export class JobConnection implements PaginatedResponse<Job> {
11-
results: Job[];
12-
hasNextPage: boolean;
13-
cursor?: string;
14-
@Field(() => [Job])
15-
items: Job[];
16-
}
5+
// /**
6+
// * GraphQL ObjectType for paginated job responses
7+
// * Extends the base PaginatedResponse to provide job-specific pagination
8+
// */
9+
// @ObjectType()
10+
// export class JobConnection implements PaginatedResponse<Job> {
11+
// results: Job[];
12+
// hasNextPage: boolean;
13+
// cursor?: string;
14+
// @Field(() => [Job])
15+
// items: Job[];
16+
// }

0 commit comments

Comments
 (0)