Skip to content

Commit

Permalink
Merge pull request #22 from tomvin/dev
Browse files Browse the repository at this point in the history
Sprint 3.
  • Loading branch information
tomvin authored Sep 30, 2019
2 parents e664fe6 + 2f6453a commit e7103dd
Show file tree
Hide file tree
Showing 67 changed files with 1,836 additions and 326 deletions.
302 changes: 302 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@apollo/react-hoc": "^3.1.1",
"@apollo/react-hooks": "^3.0.1",
"@fortawesome/fontawesome-svg-core": "^1.2.22",
"@fortawesome/free-regular-svg-icons": "^5.10.2",
Expand All @@ -14,6 +15,7 @@
"@types/react": "16.9.2",
"@types/react-dom": "16.8.5",
"@types/react-redux": "^7.1.2",
"@types/react-select": "^3.0.4",
"@types/redux-logger": "^3.0.7",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"apollo-boost": "^0.4.4",
Expand All @@ -25,6 +27,10 @@
"react-redux": "^7.1.1",
"react-router-dom": "^5.0.1",
"react-scripts": "3.1.1",
"react-select": "^3.0.5",
"react-select-fast-filter-options": "^0.2.3",
"react-virtualized": "^9.21.1",
"react-virtualized-select": "^3.1.3",
"redux-logger": "^3.0.6",
"redux-starter-kit": "^0.6.3",
"typescript": "3.5.3"
Expand Down
26 changes: 26 additions & 0 deletions src/api/fragments/jobDetailsFragment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { gql } from 'apollo-boost';

export const JOB_DETAILS_FRAGMENT = gql`
fragment JobDetails on Job {
_id
name
description
location
salary
company{
_id
name
logoUrl
}
education{
_id
field
level
}
competence{
_id
level
skill
}
}
`;
21 changes: 21 additions & 0 deletions src/api/fragments/userForJobMatchFragment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { gql } from 'apollo-boost';

export type UserForJobMatchFragment = {
_id: string;
email: string;
jobSeeker: {
_id: string;
name: string;
}
}

export const USER_FOR_JOB_MATCH_FRAGMENT = gql`
fragment UserForJobMatch on User {
_id
email
jobSeeker {
_id
name
}
}
`;
26 changes: 0 additions & 26 deletions src/api/jobSeekerApi.ts

This file was deleted.

18 changes: 18 additions & 0 deletions src/api/mutations/acceptJobMutation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import gql from "graphql-tag";

export type AcceptJobVariables = {
acceptInput: {
userId: string;
jobId: string;
}
}

export type AcceptJobResult = {
acceptJob: 'Already 1 Way Match' | '1 Way Match' | string;
}

export const ACCEPT_JOB = gql`
mutation AcceptJob($acceptInput: AcceptInput!) {
acceptJob(acceptInput: $acceptInput)
}
`;
18 changes: 18 additions & 0 deletions src/api/mutations/acceptJobSeekerMutation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import gql from "graphql-tag";

export type AcceptJobSeekerVariables = {
acceptInput: {
userId: string;
jobId: string;
}
}

export type AcceptJobSeekerResult = {
acceptJobSeeker: 'Already 1 Way Match' | '1 Way Match' | string;
}

export const ACCEPT_JOB_SEEKER = gql`
mutation AcceptJobSeeker($acceptInput: AcceptInput!) {
acceptJobSeeker(acceptInput: $acceptInput)
}
`;
27 changes: 27 additions & 0 deletions src/api/mutations/createCompanyMutation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import gql from "graphql-tag";

export type CreateCompanyVariables = {
companyInput: {
name: string;
phone: string;
email: string;
}
userInput: {
email: string;
password: string;
}
}

export type CreateCompanyResult = {
createCompany: {
_id: string;
}
}

export const CREATE_COMPANY = gql`
mutation CreateCompany($companyInput: CompanyInput!, $userInput: UserInput) {
createCompany(companyInput: $companyInput, userInput: $userInput) {
_id
}
}
`;
36 changes: 36 additions & 0 deletions src/api/mutations/createJobSeekerMutation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import gql from "graphql-tag";

export type CreateJobSeekerVariables = {
jobSeekerInput: {
name: string;
phone: string;
education: string[];
competence: string[];
location: string;
typeofwork: number;
salary: number;
education_p: number;
competence_p: number;
location_p: number;
typeofwork_p: number;
salary_p: number;
}
userInput: {
email: string;
password: string;
}
}

export type CreateJobSeekerResult = {
createJobSeeker: {
_id: string;
}
}

export const CREATE_JOB_SEEKER = gql`
mutation CreateJobSeeker($jobSeekerInput: JobSeekerInput!, $userInput: UserInput) {
createJobSeeker(jobSeekerInput: $jobSeekerInput, userInput: $userInput) {
_id
}
}
`;
33 changes: 33 additions & 0 deletions src/api/queries/allJobSeekerUsersQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import gql from "graphql-tag";
import { IUser } from "../../models/User";

export type AllJobSeekerUsersResult = {
users: IUser[] | undefined;
}

export const ALL_JOB_SEEKER_USERS_QUERY = gql`
query AllJobSeekerUsers {
users {
_id
email
jobSeeker {
_id
name
phone
location
typeofwork
salary
education {
_id
level
field
}
competence {
_id
level
skill
}
}
}
}
`;
16 changes: 16 additions & 0 deletions src/api/queries/allJobsDetailsQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import gql from "graphql-tag";
import { IJob } from "../../models/Job";
import { JOB_DETAILS_FRAGMENT } from '../fragments/jobDetailsFragment';

export type AllJobDetailsResult = {
allJobDetails: IJob[] | undefined;
}

export const ALL_JOB_DETAILS_QUERY = gql`
query AllJobDetails {
allJobDetails: jobs{
...JobDetails
}
}
${JOB_DETAILS_FRAGMENT}
`;
23 changes: 23 additions & 0 deletions src/api/queries/jobCompleteMatchesQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import gql from "graphql-tag";
import { USER_FOR_JOB_MATCH_FRAGMENT } from '../fragments/userForJobMatchFragment';
import { IUser } from "../../models/User";

export type JobCompleteMatchVariables = {
companyUserId: string;
}

export type JobCompleteMatchResult = {
jobCompleteMatches: { _id: string; completeJobSeekerMatch: IUser[] }[] | undefined;
}

export const JOB_COMPLETE_MATCH_QUERY = gql`
query JobCompleteMatches($companyUserId:String!) {
jobCompleteMatches(companyUserId:$companyUserId){
_id
completeJobSeekerMatch {
...UserForJobMatch
}
}
}
${USER_FOR_JOB_MATCH_FRAGMENT}
`;
23 changes: 23 additions & 0 deletions src/api/queries/jobMatchQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import gql from "graphql-tag";
import { USER_FOR_JOB_MATCH_FRAGMENT } from '../fragments/userForJobMatchFragment';
import { IJobMatch } from "../../models/JobMatch";

export type JobMatchVariables = {
jobId: string;
}

export type JobMatchResult = {
jobMatch: IJobMatch[] | undefined;
}

export const JOB_MATCH_QUERY = gql`
query JobMatch($jobId:String!) {
jobMatch(jobId:$jobId){
score
user {
...UserForJobMatch
}
}
}
${USER_FOR_JOB_MATCH_FRAGMENT}
`;
25 changes: 25 additions & 0 deletions src/api/queries/jobSeekerCompleteMatchesQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import gql from "graphql-tag";
import { IJob } from "../../models/Job";

export type JobSeekerMatchOverviewsVariables = {
userId: string;
}

export type JobSeekerMatchOverviewsResult = {
JobSeekerMatchOverviews: IJob[] | undefined;
}

export const JOB_SEEKER_MATCH_OVERVIEWS_QUERY = gql`
query JobSeekerMatchOverviews($userId:String!) {
JobSeekerMatchOverviews: jobSeekerCompleteMatches(jobSeekerUserId:$userId){
_id
name
description
company{
_id
name
logoUrl
}
}
}
`;
6 changes: 3 additions & 3 deletions src/mock/Users.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { IUser } from '../models/User';

export const MOCK_USERS: IUser[] = [{
_id: 1,
_id: '1',
email: 'mock.user@email.com',
company: undefined,
jobSeeker: undefined,
isCompany: false,
}, {
_id: 2,
_id: '2',
email: 'mock.user.2@email.com',
company: undefined,
jobSeeker: undefined,
isCompany: false,
}, {
_id: 3,
_id: '3',
email: 'mock.user.3@email.com',
company: undefined,
jobSeeker: undefined,
Expand Down
5 changes: 5 additions & 0 deletions src/models/Competence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ICompetence {
_id: string;
skill: string;
level: 'Basic' | 'Intermediate' | 'Advanced';
}
7 changes: 6 additions & 1 deletion src/models/Job.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { ICompany } from './Company';
import { IEducation } from './Education';
import { IUser } from './User';
import { ICompetence } from './Competence';

export interface IJob {
_id: string;
company: ICompany;
name: string;
description: string;
location: string;
typeofwork: number;
salary: number;
education: IEducation[];
jobSeekerInterest: IUser[];
companyInterest: IUser[];
completeJobSeekerMatch: IUser[];
}
competence: ICompetence[];
}
Loading

0 comments on commit e7103dd

Please sign in to comment.