Skip to content

Commit a955b91

Browse files
committed
Provide function to get new office details map
Jira ticket: CAMS-283 Co-authored-by: Brian Posey <[email protected]>,
1 parent e81d56d commit a955b91

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

backend/functions/lib/adapters/gateways/storage/local-storage-gateway.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { CamsRole } from '../../../../../../common/src/cams/roles';
22
import { StorageGateway } from '../../types/storage';
3+
import { UstpOfficeDetails } from '../../../../../../common/src/cams/courts';
4+
import { USTP_OFFICE_DATA_MAP } from './ustp-office-data-map';
35

46
let roleMapping;
57
let officeMapping;
@@ -55,6 +57,10 @@ function getOfficeMapping(): Map<string, GroupDesignators> {
5557
return officeMapping;
5658
}
5759

60+
function getUstpOffices(): Map<string, UstpOfficeDetails> {
61+
return USTP_OFFICE_DATA_MAP;
62+
}
63+
5864
function getRoleMapping(): Map<string, CamsRole> {
5965
if (!roleMapping) {
6066
const roleArray = ROLE_MAPPING.split('\n');
@@ -74,6 +80,7 @@ function getRoleMapping(): Map<string, CamsRole> {
7480
export const LocalStorageGateway: StorageGateway = {
7581
get,
7682
getOfficeMapping,
83+
getUstpOffices,
7784
getRoleMapping,
7885
};
7986

backend/functions/lib/adapters/types/ustp-office-data-map.ts renamed to backend/functions/lib/adapters/gateways/storage/ustp-office-data-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UstpOfficeDetails } from '../../../../../common/src/cams/courts';
1+
import { UstpOfficeDetails } from '../../../../../../common/src/cams/courts';
22

33
//TODO: We should probably put this in Cosmos so we don't have to deal with this locally
44
export const USTP_OFFICE_DATA_MAP = new Map<string, UstpOfficeDetails>([
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { CamsRole } from '../../../../../common/src/cams/roles';
22
import { GroupDesignators } from '../gateways/storage/local-storage-gateway';
3+
import { UstpOfficeDetails } from '../../../../../common/src/cams/courts';
34

45
export type StorageGateway = {
56
get(key: string): string | null;
67
getOfficeMapping(): Map<string, GroupDesignators>;
8+
getUstpOffices(): Map<string, UstpOfficeDetails>;
79
getRoleMapping(): Map<string, CamsRole>;
810
};

0 commit comments

Comments
 (0)