-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from pandutibil/dev
Event and dimension validation APIs are implemented
- Loading branch information
Showing
7 changed files
with
232 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { GrammarService } from './grammar.service'; | ||
|
||
describe('GrammarService', () => { | ||
let service: GrammarService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [GrammarService], | ||
}).compile(); | ||
|
||
service = module.get<GrammarService>(GrammarService); | ||
}); | ||
|
||
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,24 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { DatabaseService } from 'src/database/database.service'; | ||
|
||
@Injectable() | ||
export class GrammarService { | ||
constructor(private _databaseService: DatabaseService) { | ||
} | ||
|
||
async getEventSchemas() { | ||
return await this._databaseService.executeQuery(`select id, name, schema from spec."EventGrammar"`); | ||
} | ||
|
||
async getDimensionSchemas() { | ||
return await this._databaseService.executeQuery(`select id, name, schema from spec."DimensionGrammar"`); | ||
} | ||
|
||
async getEventSchemaByID(id) { | ||
return await this._databaseService.executeQuery(`select id, name, schema from spec."EventGrammar" where id = $1`, [id]); | ||
} | ||
|
||
async getDimensionSchemaByID(id) { | ||
return await this._databaseService.executeQuery(`select id, name, schema from spec."DimensionGrammar" where id = $1`, [id]); | ||
} | ||
} |