Skip to content

Commit

Permalink
COMPENF-648 map marker using location data (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
barrfalk authored Aug 23, 2023
1 parent 3d4de30 commit de86cc1
Show file tree
Hide file tree
Showing 22 changed files with 583 additions and 79 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
dir: [backend, frontend]
include:
- dir: backend
sonar_projectKey: bcgov_nr-quickstart-typescript_backend
sonar_projectKey: bcgov_nr-compliance-enforcement_backend
token: SONAR_TOKEN_BACKEND
- dir: frontend
sonar_projectKey: bcgov_nr-quickstart-typescript_frontend
sonar_projectKey: bcgov_nr-compliance-enforcement_frontend
token: SONAR_TOKEN_FRONTEND
steps:
- uses: bcgov-nr/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ This product currently has no support and is experimental. That could change in

## Reporting a Vulnerability

Please report any issues or vulerabilities with an [issue](https://github.com/bcgov/nr-quickstart-typescript/issues).
Please report any issues or vulerabilities with an [issue](https://github.com/bcgov/nr-compliance-enforcement/issues).
5 changes: 5 additions & 0 deletions backend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ objects:
secretKeyRef:
name: ceds-backend-oicd
key: jwt-issuer
- name: BC_GEOCODER_API_URL
valueFrom:
secretKeyRef:
name: bc-geo-coder
key: BC_GEOCODER_API_URL
ports:
- containerPort: 3000
protocol: TCP
Expand Down
91 changes: 78 additions & 13 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nr-quickstart-typescript",
"name": "nr-compliance-enforcement",
"version": "0.0.1",
"description": "BCGov devops quickstart. For reference, testing and new projects.",
"main": "index.js",
Expand Down Expand Up @@ -40,6 +40,7 @@
},
"homepage": "https://github.com/bcgov/nr-compliance-enforcement#readme",
"dependencies": {
"@nestjs/axios": "^3.0.0",
"@nestjs/cli": "^9.3.0",
"@nestjs/common": "^9.2.1",
"@nestjs/config": "^2.2.0",
Expand All @@ -51,6 +52,7 @@
"@nestjs/swagger": "^6.1.4",
"@nestjs/testing": "^9.2.1",
"@nestjs/typeorm": "^9.0.1",
"axios": "^1.4.0",
"date-fns": "^2.30.0",
"dotenv": "^16.0.1",
"geojson": "^0.5.0",
Expand Down
4 changes: 3 additions & 1 deletion backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { CosGeoOrgUnitModule } from "./v1/cos_geo_org_unit/cos_geo_org_unit.modu
import { HTTPLoggerMiddleware } from "./middleware/req.res.logger";
import { PersonComplaintXrefModule } from "./v1/person_complaint_xref/person_complaint_xref.module";
import { PersonComplaintXrefCodeModule } from "./v1/person_complaint_xref_code/person_complaint_xref_code.module";
import { BcGeoCoderModule } from "./external_api/bc_geo_coder/bc_geo_coder.module";


console.log("Var check - POSTGRESQL_HOST", process.env.POSTGRESQL_HOST);
Expand Down Expand Up @@ -71,7 +72,8 @@ if (process.env.POSTGRESQL_PASSWORD != null ){
AttractantHwcrXrefModule,
CosGeoOrgUnitModule,
PersonComplaintXrefModule,
PersonComplaintXrefCodeModule
PersonComplaintXrefCodeModule,
BcGeoCoderModule,
],
controllers: [AppController],
providers: [AppService],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Test, TestingModule } from "@nestjs/testing";
import { BcGeoCoderController } from "./bc_geo_coder.controller";
import { BcGeoCoderService } from "./bc_geo_coder.service";
import { HttpModule } from "@nestjs/axios";

describe("BcGeoCoderController", () => {
let controller: BcGeoCoderController;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [BcGeoCoderController],
providers: [BcGeoCoderService],
imports: [HttpModule],
}).compile();

controller = module.get<BcGeoCoderController>(BcGeoCoderController);
});

it("should be defined", () => {
expect(controller).toBeDefined();
});
});
16 changes: 16 additions & 0 deletions backend/src/external_api/bc_geo_coder/bc_geo_coder.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Controller, Get, Param } from '@nestjs/common';
import { BcGeoCoderService } from './bc_geo_coder.service';
import { Roles } from '../../auth/decorators/roles.decorator';
import { Role } from '../../enum/role.enum';

@Controller('bc-geo-coder')
export class BcGeoCoderController {
constructor(private readonly bcGeoCoderService: BcGeoCoderService) {}

@Get('/address/:query')
@Roles(Role.COS_OFFICER)
findAll(@Param('query') query: string) {
return this.bcGeoCoderService.findAll(query);
}

}
11 changes: 11 additions & 0 deletions backend/src/external_api/bc_geo_coder/bc_geo_coder.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Module } from "@nestjs/common";
import { BcGeoCoderService } from "./bc_geo_coder.service";
import { HttpModule } from "@nestjs/axios";
import { BcGeoCoderController } from "./bc_geo_coder.controller";

@Module({
imports: [HttpModule],
controllers: [BcGeoCoderController],
providers: [BcGeoCoderService],
})
export class BcGeoCoderModule {}
Loading

0 comments on commit de86cc1

Please sign in to comment.