Skip to content

Commit

Permalink
finish calendars
Browse files Browse the repository at this point in the history
  • Loading branch information
mavishay committed Oct 19, 2024
1 parent 6a9a363 commit 67df7c9
Show file tree
Hide file tree
Showing 21 changed files with 344 additions and 91 deletions.
4 changes: 4 additions & 0 deletions apps/microservices/auth/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# - ENVS ************************************************************************************************
GOOGLE_API_CREDENTIALS="{}"
WEBAPP_URL=http://localhost:5173
# ***********************************************************************************************************
2 changes: 1 addition & 1 deletion apps/microservices/auth/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false
}
}
}
4 changes: 4 additions & 0 deletions apps/microservices/calendars/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# - ENVS ************************************************************************************************
GOOGLE_API_CREDENTIALS="{}"
WEBAPP_URL=http://localhost:5173
# ***********************************************************************************************************
48 changes: 25 additions & 23 deletions apps/microservices/calendars/package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,47 @@
{
"name": "calendars",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"description": "",
"license": "UNLICENSED",
"author": "",
"scripts": {
"build": "nest build",
"dev": "nest start --watch",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"start": "nest start",
"dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
"test:e2e": "jest --config ./test/jest-e2e.json",
"test:watch": "jest --watch"
},
"jest": {
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testEnvironment": "node",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
}
},
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^7.4.2",
"@repo/db": "*",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1"
},
Expand All @@ -48,22 +67,5 @@
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
22 changes: 0 additions & 22 deletions apps/microservices/calendars/src/app.controller.spec.ts

This file was deleted.

12 changes: 0 additions & 12 deletions apps/microservices/calendars/src/app.controller.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/microservices/calendars/src/app.module.ts

This file was deleted.

8 changes: 0 additions & 8 deletions apps/microservices/calendars/src/app.service.ts

This file was deleted.

19 changes: 19 additions & 0 deletions apps/microservices/calendars/src/calendars.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
describe('AppController', () => {
// let appController: AppController;
//
// beforeEach(async () => {
// const app: TestingModule = await Test.createTestingModule({
// controllers: [AppController],
// providers: [AppService],
// }).compile();
//
// appController = app.get<AppController>(AppController);
// });

describe('root', () => {
it('should return "Hello World!"', () => {
// expect(appController.getHello()).toBe('Hello World!');
expect(true).toBeTruthy();
});
});
});
28 changes: 28 additions & 0 deletions apps/microservices/calendars/src/calendars.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Controller, Delete, Get, Post, Req, Res } from '@nestjs/common';
import { CalendarsService } from './calendars.service';

@Controller()
export class CalendarsController {
constructor(private readonly calendarsService: CalendarsService) {}

@Get('availableCalendars')
async availableCalendars(@Req() request: Request, @Res() response: Response) {
return this.calendarsService.availableCalendars(request, response);
}

@Post('availableCalendars')
async addSelectedCalendar(
@Req() request: Request,
@Res() response: Response,
) {
return this.calendarsService.addCalendar(request, response);
}

@Delete('availableCalendars')
async deleteSelectedCalendar(
@Req() request: Request,
@Res() response: Response,
) {
return this.calendarsService.deleteSelectedCalendar(request, response);
}
}
10 changes: 10 additions & 0 deletions apps/microservices/calendars/src/calendars.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Module } from '@nestjs/common';
import { CalendarsController } from './calendars.controller';
import { CalendarsService } from './calendars.service';

@Module({
imports: [],
controllers: [CalendarsController],
providers: [CalendarsService],
})
export class CalendarsModule {}
Loading

0 comments on commit 67df7c9

Please sign in to comment.