Skip to content

Commit

Permalink
Merge pull request #18 from bcgov/fix/remove-chefs-submissions
Browse files Browse the repository at this point in the history
Remove any CHEFS and/or submissions functionality
  • Loading branch information
timwekkenbc authored Jul 10, 2024
2 parents f3de579 + 92733e4 commit dc5283b
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 205 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BRMS API/Backend

This project is the API/Backend for the SDPR Business Rules Engine (BRE) and Business Rules Engine Management System (BRMS). It will act as a middle layer between GoRules, CHEFS, and the [frontend](https://github.com/bcgov/brms-simulator-frontend) or any other integration.
This project is the API/Backend for the SDPR Business Rules Engine (BRE) and Business Rules Engine Management System (BRMS). It will act primarly as the backend for the [frontend simulator](https://github.com/bcgov/brms-simulator-frontend).

## Local Development Setup

Expand All @@ -14,7 +14,6 @@ Before running your application locally, you'll need some environment variables.

- MONGODB_URL: The URL for connecting to the MongoDB instance you created in the previous step. Set it to something like mongodb://localhost/nest.
- FRONTEND_URI: The URI for the frontend application. Set it to http://localhost:8080.
- CHEFS_API_URL: The URL for the Chefs API. Set it to https://submit.digital.gov.bc.ca/app/api/v1.

### Including Rules from the Rules Repository

Expand Down
4 changes: 2 additions & 2 deletions src/api/ruleData/ruleData.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class RuleDataController {
try {
return await this.ruleDataService.getAllRuleData();
} catch (error) {
throw new HttpException('Error getting submissions', HttpStatus.INTERNAL_SERVER_ERROR);
throw new HttpException('Error getting list of rule data', HttpStatus.INTERNAL_SERVER_ERROR);
}
}

Expand All @@ -20,7 +20,7 @@ export class RuleDataController {
try {
return await this.ruleDataService.getRuleData(ruleId);
} catch (error) {
throw new HttpException('Error getting submissions', HttpStatus.INTERNAL_SERVER_ERROR);
throw new HttpException('Error getting rule data', HttpStatus.INTERNAL_SERVER_ERROR);
}
}

Expand Down
6 changes: 0 additions & 6 deletions src/api/ruleData/ruleData.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ export class RuleData {

@Prop({ required: true, description: 'The filename of the JSON file containing the rule' })
goRulesJSONFilename: string;

@Prop({ description: 'The ID of the form in Chefs that corresponds to this rule' })
chefsFormId: string;

@Prop({ description: 'The API key of the CHEFS form - needed to access submissions' })
chefsFormAPIKey: string;
}

export const RuleDataSchema = SchemaFactory.createForClass(RuleData);
2 changes: 0 additions & 2 deletions src/api/ruleData/ruleData.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export const mockRuleData = {
_id: 'testId',
title: 'Title',
goRulesJSONFilename: 'filename.json',
chefsFormId: 'formId',
chefsFormAPIKey: '12345',
};

export const mockServiceProviders = [
Expand Down
8 changes: 0 additions & 8 deletions src/api/ruleData/ruleData.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ export class RuleDataService {
}
}

async getFormAPIKeyForFormId(chefsFormId: string): Promise<string> {
const ruleData = await this.ruleDataModel.findOne({ chefsFormId }).exec();
if (!ruleData) {
throw new Error(`Rule data not found for CHEFS form id: ${chefsFormId}`);
}
return ruleData.chefsFormAPIKey;
}

/**
* Add rules to the db that exist in the repo, but not yet the db
*/
Expand Down
10 changes: 0 additions & 10 deletions src/api/submissions/submission.interface.ts

This file was deleted.

46 changes: 0 additions & 46 deletions src/api/submissions/submissions.controller.spec.ts

This file was deleted.

26 changes: 0 additions & 26 deletions src/api/submissions/submissions.controller.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/api/submissions/submissions.service.spec.ts

This file was deleted.

56 changes: 0 additions & 56 deletions src/api/submissions/submissions.service.ts

This file was deleted.

12 changes: 1 addition & 11 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { DecisionsController } from './api/decisions/decisions.controller';
import { DecisionsService } from './api/decisions/decisions.service';
import { DocumentsController } from './api/documents/documents.controller';
import { DocumentsService } from './api/documents/documents.service';
import { SubmissionsController } from './api/submissions/submissions.controller';
import { SubmissionsService } from './api/submissions/submissions.service';
import { RuleMappingController } from './api/ruleMapping/ruleMapping.controller';
import { RuleMappingService } from './api/ruleMapping/ruleMapping.service';
import { ScenarioData, ScenarioDataSchema } from './api/scenarioData/scenarioData.schema';
Expand All @@ -36,17 +34,9 @@ import { ScenarioDataService } from './api/scenarioData/scenarioData.service';
RuleDataController,
DecisionsController,
DocumentsController,
SubmissionsController,
RuleMappingController,
ScenarioDataController,
],
providers: [
RuleDataService,
DecisionsService,
DocumentsService,
SubmissionsService,
RuleMappingService,
ScenarioDataService,
],
providers: [RuleDataService, DecisionsService, DocumentsService, RuleMappingService, ScenarioDataService],
})
export class AppModule {}

0 comments on commit dc5283b

Please sign in to comment.