Skip to content

Commit

Permalink
Merge pull request #930 from bcgov/main
Browse files Browse the repository at this point in the history
Backports
  • Loading branch information
dhaselhan authored Sep 1, 2023
2 parents 83baad4 + dcc1e5d commit d1a460d
Show file tree
Hide file tree
Showing 12 changed files with 4,382 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/schemaspy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@ jobs:
npm install
npm run alcs:migration:run
working-directory: services
- name: Import OATS
run: |
export PGPASSWORD='postgres';
psql -h 127.0.0.1 -p 5432 -U postgres -f ora2pg/data/oats_prod_schema_ddl_18_2.sql
- name: Create Output Folder
run: |
mkdir output
chmod a+rwx -R output
- name: Run Schemaspy
run: docker run --network host -v "$PWD/output:/output" schemaspy/schemaspy:snapshot -t pgsql -db postgres -host 127.0.0.1 -port 5432 -u postgres -p postgres -schemas alcs
run: docker run --network host -v "$PWD/output:/output" schemaspy/schemaspy:snapshot -t pgsql -db postgres -host 127.0.0.1 -port 5432 -u postgres -p postgres -schemas alcs,oats
- name: Deploy to Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: output
target-folder: schemaspy
target-folder: schemaspy
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ This project contains the frontend and backend for the ALCS used for tracking va

To report bugs/issues/features requests, please file an [issue](https://github.com/bcgov/alcs/issues).

## Links
## Links

- [ALCS Frontend Readme](./alcs-frontend/README.md)
- [Portal Frontend Readme](./portal-frontend/README.md)
- [Services Readme](./services/README.md)
- [Architecture](./docs/architecture.md)
- [SchemaSpy - ALCS](https://bcgov.github.io/alcs/schemaspy/alcs/index.html)
- [SchemaSpy - Portal](https://bcgov.github.io/alcs/schemaspy/portal/index.html)
- [SchemaSpy - OATS](https://bcgov.github.io/alcs/schemaspy/oats/index.html)
- [One time Jobs](./docs/jobs.md)
197 changes: 197 additions & 0 deletions docs/Connections.drawio.xml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Deployments
![Deployments](imgs/architecture-Deployments.drawio.png)

# Connections
![Deployments](imgs/architecture-Connections.drawio.png)

# ETL Process
![ETL Process](imgs/architecture-ETL.drawio.png)

Expand Down
Binary file added docs/imgs/architecture-Connections.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,162 changes: 4,162 additions & 0 deletions ora2pg/data/oats_prod_schema_ddl_18_2.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,18 @@ describe('ApplicationModificationService', () => {
expect(modificationRepoMock.save).toHaveBeenCalledTimes(0);
});

it('should call softRemove on delete', async () => {
it('should archive the card and call softRemove on delete', async () => {
const uuid = 'fake';
modificationRepoMock.softRemove.mockResolvedValue({} as any);
cardServiceMock.archive.mockResolvedValue();

await service.delete(uuid);

expect(modificationRepoMock.findOneBy).toBeCalledWith({
uuid,
});
expect(modificationRepoMock.softRemove).toHaveBeenCalledTimes(1);
expect(cardServiceMock.archive).toHaveBeenCalledTimes(1);
});

it('should fail on delete if modification does not exist', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export class ApplicationModificationService {

async delete(uuid: string) {
const modification = await this.getByUuidOrFail(uuid);
await this.cardService.archive(modification.cardUuid);
return this.modificationRepository.softRemove([modification]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,16 @@ describe('ReconsiderationService', () => {
} as ApplicationReconsideration);
});

it('should call softRemove on delete', async () => {
it('should archive the card and call softRemove on delete', async () => {
const uuid = 'fake';
reconsiderationRepositoryMock.softRemove.mockResolvedValue({} as any);
cardServiceMock.archive.mockResolvedValue();

await service.delete(uuid);

expect(reconsiderationRepositoryMock.findOne).toHaveBeenCalledTimes(1);
expect(reconsiderationRepositoryMock.softRemove).toHaveBeenCalledTimes(1);
expect(cardServiceMock.archive).toHaveBeenCalledTimes(1);
});

it('should fail on delete if reconsideration does not exist', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export class ApplicationReconsiderationService {

async delete(uuid: string) {
const reconToDelete = await this.fetchAndValidateReconsideration(uuid);
await this.cardService.archive(reconToDelete.cardUuid);
return this.reconsiderationRepository.softRemove([reconToDelete]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,18 @@ describe('NoticeOfIntentModificationService', () => {
expect(modificationRepoMock.save).toHaveBeenCalledTimes(0);
});

it('should call softRemove on delete', async () => {
it('should archive the card and call softRemove on delete', async () => {
const uuid = 'fake';
modificationRepoMock.softRemove.mockResolvedValue({} as any);
cardServiceMock.archive.mockResolvedValue();

await service.delete(uuid);

expect(modificationRepoMock.findOneBy).toBeCalledWith({
uuid,
});
expect(modificationRepoMock.softRemove).toHaveBeenCalledTimes(1);
expect(cardServiceMock.archive).toHaveBeenCalledTimes(1);
});

it('should fail on delete if modification does not exist', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export class NoticeOfIntentModificationService {

async delete(uuid: string) {
const modification = await this.getByUuidOrFail(uuid);
await this.cardService.archive(modification.cardUuid);
return this.modificationRepository.softRemove([modification]);
}

Expand Down

0 comments on commit d1a460d

Please sign in to comment.