-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into HRIS-379
- Loading branch information
Showing
39 changed files
with
1,581 additions
and
823 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} | ||
"trailingComma": "all", | ||
"endOfLine": "lf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import { BullModuleOptions, BullOptionsFactory } from "@nestjs/bull"; | ||
import { BullModuleOptions, BullOptionsFactory } from '@nestjs/bull'; | ||
|
||
export class BullConfigService implements BullOptionsFactory { | ||
|
||
createBullOptions(): BullModuleOptions { | ||
return { | ||
redis: { | ||
host: process.env.QUEUE_HOST || 'localhost', | ||
port: process.env.QUEUE_PORT ? parseInt(process.env.QUEUE_PORT) : 6379 | ||
} | ||
} | ||
} | ||
} | ||
createBullOptions(): BullModuleOptions { | ||
return { | ||
redis: { | ||
host: process.env.QUEUE_HOST || 'localhost', | ||
port: process.env.QUEUE_PORT ? parseInt(process.env.QUEUE_PORT) : 6379, | ||
}, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default () => ({ | ||
cacheTTL: process.env.CACHE_TTL || '3600', | ||
}) | ||
cacheTTL: process.env.CACHE_TTL || '3600', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export default () => ({ | ||
hrisApiGraphQLEndpoint: process.env.HRIS_API_GRAPHQL_ENDPOINT || 'http://localhost:5257/graphql', | ||
}) | ||
hrisApiGraphQLEndpoint: | ||
process.env.HRIS_API_GRAPHQL_ENDPOINT || 'http://localhost:5257/graphql', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default () => ({ | ||
jwtSecret: process.env.JWT_SECRET_KEY, | ||
jwtSigningExpiration: process.env.JWT_SIGNING_EXPIRATION || '7d', | ||
jwtSigningAlgorithm: process.env.JWT_SIGNING_ALGORITHM || 'HS256', | ||
}) | ||
jwtSecret: process.env.JWT_SECRET_KEY, | ||
jwtSigningExpiration: process.env.JWT_SIGNING_EXPIRATION || '7d', | ||
jwtSigningAlgorithm: process.env.JWT_SIGNING_ALGORITHM || 'HS256', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default () => ({ | ||
queueHost: process.env.QUEUE_HOST || 'localhost', | ||
queuePort: process.env.QUEUE_PORT || 6379 | ||
}) | ||
queueHost: process.env.QUEUE_HOST || 'localhost', | ||
queuePort: process.env.QUEUE_PORT || 6379, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default () => ({ | ||
slackOAuthToken: process.env.SLACK_O_AUTH_TOKEN | ||
}) | ||
slackOAuthToken: process.env.SLACK_O_AUTH_TOKEN, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { DtrManagementService } from './dtr-management.service'; | ||
import { DtrManagementResolver } from './dtr-management.resolver'; | ||
import { PrismaService } from '@/prisma/prisma.service'; | ||
|
||
@Module({ | ||
providers: [DtrManagementResolver, DtrManagementService, PrismaService], | ||
}) | ||
export class DtrManagementModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { DtrManagementResolver } from './dtr-management.resolver'; | ||
import { DtrManagementService } from './dtr-management.service'; | ||
import { PrismaService } from '@/prisma/prisma.service'; | ||
|
||
describe('DtrManagementResolver', () => { | ||
let resolver: DtrManagementResolver; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [DtrManagementResolver, DtrManagementService, PrismaService], | ||
}).compile(); | ||
|
||
resolver = module.get<DtrManagementResolver>(DtrManagementResolver); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(resolver).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Resolver, Query } from '@nestjs/graphql'; | ||
import { DtrManagementService } from './dtr-management.service'; | ||
import { TimeEntryDTO } from '@/graphql/graphql'; | ||
|
||
@Resolver(() => TimeEntryDTO) | ||
export class DtrManagementResolver { | ||
constructor(private readonly dtrManagementService: DtrManagementService) {} | ||
|
||
@Query(() => [TimeEntryDTO]) | ||
async timeEntries() { | ||
return this.dtrManagementService.timeEntries(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { DtrManagementService } from './dtr-management.service'; | ||
import { PrismaService } from '@/prisma/prisma.service'; | ||
|
||
describe('DtrManagementService', () => { | ||
let service: DtrManagementService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [DtrManagementService, PrismaService], | ||
}).compile(); | ||
|
||
service = module.get<DtrManagementService>(DtrManagementService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { PrismaService } from '@/prisma/prisma.service'; | ||
import { Injectable } from '@nestjs/common'; | ||
import { TimeEntry } from '@prisma/client'; | ||
|
||
@Injectable() | ||
export class DtrManagementService { | ||
constructor(private readonly prisma: PrismaService) {} | ||
async timeEntries(): Promise<TimeEntry[]> { | ||
return this.prisma.timeEntry.findMany({ | ||
include: { | ||
user: { | ||
include: { | ||
position: true, | ||
}, | ||
}, | ||
timeIn: true, | ||
timeOut: true, | ||
overtime: true, | ||
changeShiftRequest: true, | ||
workInterruptions: true, | ||
eslOffsets: true, | ||
}, | ||
}); | ||
} | ||
} |
Oops, something went wrong.