-
Notifications
You must be signed in to change notification settings - Fork 0
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 #121 from hisptz/develop
Develop
- Loading branch information
Showing
21 changed files
with
1,361 additions
and
1,242 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
export interface QueryOption { | ||
status: string; | ||
destinationDataSetId: string; | ||
sourceDataElementId: string; | ||
sourceExchangePeriod: string; | ||
sourceExchangeDate: string; | ||
sourceSystemId: string; | ||
destinationSystemId: string; | ||
} |
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 { DataController } from './data.controller'; | ||
|
||
describe('Data Controller', () => { | ||
let controller: DataController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [DataController], | ||
}).compile(); | ||
|
||
controller = module.get<DataController>(DataController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).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,11 @@ | ||
import { Controller } from '@nestjs/common'; | ||
import { BaseController } from 'src/core/controllers/base.contoller'; | ||
import { Data } from '../../entities/data.entity'; | ||
import { DataService } from '../../services/data/data.service'; | ||
|
||
@Controller('api/' + Data.APIEndPoint) | ||
export class DataController extends BaseController<Data> { | ||
constructor(private dataService: DataService) { | ||
super(dataService, Data) | ||
} | ||
} |
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,16 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { PassportModule } from '@nestjs/passport'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { Data } from './entities/data.entity'; | ||
import { DataController } from './controllers/data/data.controller'; | ||
import { DataService } from './services/data/data.service'; | ||
|
||
@Module({ | ||
imports: [ | ||
PassportModule.register({ defaultStrategy: 'basic', session: true }), | ||
TypeOrmModule.forFeature([Data]), | ||
], | ||
controllers: [DataController], | ||
providers: [DataService], | ||
}) | ||
export class DataModule { } |
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,21 @@ | ||
import { Entity, Column } from 'typeorm'; | ||
import { EntityCoreProps } from 'src/core/entities/core-props'; | ||
|
||
@Entity('data', { schema: 'public' }) | ||
export class Data extends EntityCoreProps { | ||
static APIEndPoint = 'datas'; | ||
|
||
@Column({ | ||
type: 'varchar', | ||
name: 'name', | ||
nullable: false, | ||
}) | ||
name: string; | ||
|
||
@Column({ | ||
type: 'varchar', | ||
name: 'type', | ||
nullable: false, | ||
}) | ||
type: string; | ||
} |
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,7 @@ | ||
import { Data } from './data.entity'; | ||
|
||
describe('Data', () => { | ||
it('should be defined', () => { | ||
expect(new Data()).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,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { DataService } from './data.service'; | ||
|
||
describe('DataService', () => { | ||
let service: DataService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [DataService], | ||
}).compile(); | ||
|
||
service = module.get<DataService>(DataService); | ||
}); | ||
|
||
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,15 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { BaseService } from 'src/core/services/base.service'; | ||
import { Data } from '../../entities/data.entity'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
import { Repository } from 'typeorm'; | ||
|
||
@Injectable() | ||
export class DataService extends BaseService<Data> { | ||
constructor( | ||
@InjectRepository(Data) | ||
private readonly dataRepository: Repository<Data>, | ||
) { | ||
super(dataRepository, Data); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/modules/dataset/controllers/dataset/dataset.controller.spec.ts
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 { DatasetController } from './dataset.controller'; | ||
|
||
describe('Dataset Controller', () => { | ||
let controller: DatasetController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [DatasetController], | ||
}).compile(); | ||
|
||
controller = module.get<DatasetController>(DatasetController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
src/modules/dataset/controllers/dataset/dataset.controller.ts
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,11 @@ | ||
import { Controller } from '@nestjs/common'; | ||
import { BaseController } from 'src/core/controllers/base.contoller'; | ||
import { Dataset } from '../../entities/dataset.entity'; | ||
import { DatasetService } from '../../services/dataset/dataset.service'; | ||
|
||
@Controller('api/' + Dataset.APIEndPoint) | ||
export class DatasetController extends BaseController<Dataset> { | ||
constructor(private dataSetService: DatasetService) { | ||
super(dataSetService, Dataset); | ||
} | ||
} |
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,16 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { PassportModule } from '@nestjs/passport'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { Dataset } from './entities/dataset.entity'; | ||
import { DatasetController } from './controllers/dataset/dataset.controller'; | ||
import { DatasetService } from './services/dataset/dataset.service'; | ||
|
||
@Module({ | ||
imports: [ | ||
PassportModule.register({ defaultStrategy: 'basic', session: true }), | ||
TypeOrmModule.forFeature([Dataset]), | ||
], | ||
controllers: [DatasetController], | ||
providers: [DatasetService], | ||
}) | ||
export class DatasetModule { } |
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,14 @@ | ||
import { EntityCoreProps } from 'src/core/entities/core-props'; | ||
import { Column, Entity } from 'typeorm'; | ||
|
||
@Entity('datasets', { schema: 'public' }) | ||
export class Dataset extends EntityCoreProps { | ||
static APIEndPoint = 'dataSets'; | ||
|
||
@Column({ | ||
type: 'varchar', | ||
name: 'name', | ||
nullable: false, | ||
}) | ||
name: string; | ||
} |
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,7 @@ | ||
import { Dataset } from './dataset.entity'; | ||
|
||
describe('Dataset', () => { | ||
it('should be defined', () => { | ||
expect(new Dataset()).toBeDefined(); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
src/modules/dataset/services/dataset/dataset.service.spec.ts
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 { DatasetService } from './dataset.service'; | ||
|
||
describe('DatasetService', () => { | ||
let service: DatasetService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [DatasetService], | ||
}).compile(); | ||
|
||
service = module.get<DatasetService>(DatasetService); | ||
}); | ||
|
||
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,15 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { BaseService } from 'src/core/services/base.service'; | ||
import { Dataset } from '../../entities/dataset.entity'; | ||
import { Repository } from 'typeorm'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
|
||
@Injectable() | ||
export class DatasetService extends BaseService<Dataset> { | ||
constructor( | ||
@InjectRepository(Dataset) | ||
private readonly dataSetRepository: Repository<Dataset>, | ||
) { | ||
super(dataSetRepository, Dataset); | ||
} | ||
} |
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