Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into feat/zap-automation
Browse files Browse the repository at this point in the history
jusdino committed Oct 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents d1853ba + 3140b76 commit fd5f12c
Showing 89 changed files with 3,818 additions and 207 deletions.
2 changes: 2 additions & 0 deletions backend/bin/run_tests.sh
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ for dir in \
compact-connect/lambdas/staff-user-pre-token \
compact-connect/lambdas/staff-users \
compact-connect/lambdas/delete-objects \
compact-connect/lambdas/custom-resources \
compact-connect/lambdas/purchases \
multi-account
do
(
9 changes: 9 additions & 0 deletions backend/compact-connect/compact-config/aslp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
compactName: "aslp"
compactCommissionFee:
feeType: "FLAT_RATE"
feeAmount: 3.50
compactOperationsTeamEmails: []
compactAdverseActionsNotificationEmails: []
compactSummaryReportNotificationEmails: []
activeEnvironments: ["test"]
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/aslp/kentucky.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "kentucky"
postalAbbreviation: "ky"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: ["test"]
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/aslp/nebraska.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "nebraska"
postalAbbreviation: "ne"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: ["test"]
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/aslp/ohio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "ohio"
postalAbbreviation: "oh"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: ["test"]
9 changes: 9 additions & 0 deletions backend/compact-connect/compact-config/coun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
compactName: "coun"
compactCommissionFee:
feeType: "FLAT_RATE"
feeAmount: 3.50
compactOperationsTeamEmails: []
compactAdverseActionsNotificationEmails: []
compactSummaryReportNotificationEmails: []
activeEnvironments: []
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/coun/kentucky.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "kentucky"
postalAbbreviation: "ky"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: []
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/coun/nebraska.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "nebraska"
postalAbbreviation: "ne"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: []
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/coun/ohio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "ohio"
postalAbbreviation: "oh"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: []
9 changes: 9 additions & 0 deletions backend/compact-connect/compact-config/octp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
compactName: "octp"
compactCommissionFee:
feeType: "FLAT_RATE"
feeAmount: 3.50
compactOperationsTeamEmails: []
compactAdverseActionsNotificationEmails: []
compactSummaryReportNotificationEmails: []
activeEnvironments: ["test"]
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/octp/kentucky.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "kentucky"
postalAbbreviation: "ky"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: ["test"]
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/octp/nebraska.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "nebraska"
postalAbbreviation: "ne"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: ["test"]
14 changes: 14 additions & 0 deletions backend/compact-connect/compact-config/octp/ohio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PLACEHOLDER DATA, NOT FINAL CONFIGURATION.
jurisdictionName: "ohio"
postalAbbreviation: "oh"
jurisdictionFee: 100
militaryDiscount:
active: true
discountType: "FLAT_RATE"
discountAmount: 10
jurisdictionOperationsTeamEmails: []
jurisdictionAdverseActionsNotificationEmails: []
jurisdictionSummaryReportNotificationEmails: []
jurisprudenceRequirements:
required: true
activeEnvironments: ["test"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Jurisdiction Onboarding for Compact Connect

Before a jurisdiction (i.e. state) can be onboarded to the Compact Connect system, there is certain information that
must be provided for that jurisdiction. This document is intended to be referenced by State IT staff/CSG maintainers
that will need to assist with onboarding new jurisdictions or compacts into the system. It outlines the information
that is required and how that information is to be defined in the system. The following steps must be taken to onboard
a jurisdiction to the Compact Connect system:

1. Decide Jurisdiction Fee for a Compact Privilege
2. Determine Contact Details for System Notifications
3. Ensure Jurisdiction License Names and Adverse Actions are compatible with System
4. Determine Jurisprudence Requirements
5. Determine Active Development Environments for Jurisdiction
6. Add Jurisdiction Configuration File to the System
7. Add Global Compact Configuration File to the System

## Deciding Jurisdiction Fee for a Compact Privilege
The first step in onboarding a jurisdiction to the Compact Connect system is to decide on the fee that the jurisdiction
will charge for a compact privilege. The value must be defined as part of the configuration file under the following field.
```
jurisdictionFee: number
```

### Decide Military Discount
The jurisdiction must also decide if they will offer a military discount for military affiliated licensees.
If they choose to do so, that discount amount must be defined. If you add the 'militaryDiscount' field to the
configuration file, the following fields must be defined:
```
militaryDiscount:
discountType: "FLAT_RATE" # Currently only "FLAT_RATE" type is supported.
active: true # Determines if the discount is active. Does NOT default to false.
discountAmount: <number> # This value will subtracted from the jurisdiction fee.
```

## Determine Contact Details for System Notifications
The jurisdiction must provide contact details for the following notifications:

1. Operations Team Notifications
2. Adverse Actions Notifications
3. Summary Report Notifications

The following subsections detail the information that must be provided for each notification.

### Operations Team Notifications
The jurisdiction must provide an email address for the operations team that will be responsible for handling support
notifications. This can include notifications for invalid data that a jurisdiction has uploaded, or any other issues that
may arise.

NOTE: While the system supports multiple email addresses, jurisdictions should be encouraged to utilize a distribution
list that end users can subscribe to. This gives them the ability to add or remove users from the list as needed
without requiring a change to the configuration file.

The email addresses must be defined as part of the configuration file under the following field.
```
jurisdictionOperationsTeamEmails: ["<email address>"]
```

### Adverse Actions Notifications
The jurisdiction must provide an email address for the adverse actions team that will be responsible for handling notifications
related to adverse actions. This can include notifications for licensees that have had their licenses revoked or suspended.

NOTE: While the system supports multiple email addresses, jurisdictions should be encouraged to utilize a distribution
list that end users can subscribe to. This gives them the ability to add or remove users from the list as needed
without requiring a change to the configuration file.

The email address must be defined as part of the configuration file under the following field.
```
jurisdictionAdverseActionsNotificationEmails: ["<email address>"]
```

### Summary Report Notifications
The jurisdiction must provide an email address for receiving summary reports that will be generated by the system periodically.

NOTE: While the system supports multiple email addresses, jurisdictions should be encouraged to utilize a distribution
list that end users can subscribe to. This gives them the ability to add or remove users from the list as needed
without requiring a change to the configuration file.

This email address must be defined as part of the configuration file under the following field.
```
jurisdictionSummaryReportNotificationEmails: ["<email address>"]
```

## Ensure Jurisdiction License Names and Adverse Actions are compatible with System

### Translate License Names
Each compact supports a specific set of license types, as defined under the `license_types` field in the [`cdk.json`](../../cdk.json) file.
As part of onboarding, the jurisdiction is responsible for translating their license names to correlate with the names
defined for the compact.

### Translate Adverse Actions
In addition to license names, jurisdictions will be responsible for translating their jurisdiction specific
adverse action types for system recognized types. Currently, these have yet to be defined, but will be in the future.

## Determine Jurisprudence Requirements
The jurisdiction must notify the commission as to whether or not there are jurisprudence requirements for licensees
in a jurisdiction (i.e. an assessment of an individual's knowledge of the laws and rules governing the practice of the
medical field related to that license). If jurisprudence requirements exist, this must be defined as part of the
configuration file under the following field.
```
jurisprudenceRequirements:
required: true
```


## Determine Active Development Environments for Jurisdiction
When a jurisdiction is first being onboarded to the system, they may only want to be active in certain development
environments.
The following environment names are supported in the list:
```
test, prod
```

In order for a jurisdiction to be active in a specific environment, you must define the list of environments that the
configuration should be deployed to under the following required field.
```
activeEnvironments: ["test"]
```

NOTE: for sandbox environments deployed locally, ALL defined compacts and jurisdictions will be deployed to
the sandbox environment, regardless of the `activeEnvironments` list. This is to ensure that all configurations are
available for testing purposes.

## Add Jurisdiction Configuration File to the System
Together, the above information constitutes the jurisdiction configuration file, which must be constructed in YAML
format (see https://yaml.org/spec/1.2.2/). The file must be defined in the following format (unless otherwise noted,
all fields are required):

```
jurisdictionName: "<jurisdiction name>"
postalAbbreviation: "<jurisdiction abbreviation>"
jurisdictionFee: <number>
militaryDiscount: # OPTIONAL - only if military discount is offered
active: true | false
discountType: "FLAT_RATE"
discountAmount: <number>
jurisdictionOperationsTeamEmails: ["<email address>"]
jurisdictionAdverseActionsNotificationEmails: ["<email address>"]
jurisdictionSummaryReportNotificationEmails: ["<email address>"]
jurisprudenceRequirements:
required: true | false
activeEnvironments: ["sandbox", "test"]
```

These files are stored in the `compact-config` subdirectory under the `compact-connect` directory.
The file system structure is as follows:

```
compact-connect
└───compact-config
│ <compact-name>.yml
└───<compact-name ie aslp>
│ <jurisdiction-name>.yml
│ <jurisdiction-name>.yml
```

Note the jurisdiction configuration file name must be the name of the jurisdiction with '-'
characters in place of spaces.


## Add Global Compact Configuration File to the System
In addition to the jurisdiction configuration files, if a new compact is being added, a global compact configuration
file must be added to the root of the `compact-config` directory. If it is not present for an associated directory of
the same name, the deployment will fail. The compact file includes the following information (all fields are required):
```
compactName: "<compact name>"
compactCommissionFee:
feeType: "FLAT_RATE" # Currently only "FLAT_RATE" type is supported.
feeAmount: <number> # This value will be added to the jurisdiciton fee.
compactOperationsTeamEmails: ["<email address>"]
compactAdverseActionsNotificationEmails: ["<email address>"]
compactSummaryReportNotificationEmails: ["<email address>"]
activeEnvironments: ["sandbox", "test"]
```
At deploy time, if the environment name matches one of the files in the `activeEnvironments` list, these configuration
files will be written to the database and accessible by the system.


## Updating Snapshot Tests to match Configuration Changes
In order to ensure that the system is functioning as expected, we have tests in place to verify that the configuration
files are being formatted correctly. We do this through 'Snapshot' tests, which are json files stored under the
`tests/resources/snapshots` directory.

Whenever making changes to the configuration files which are active in the test or prod environments, you will need to
update the snapshot to match the expected configuration. The simplest way to do this is to find the test in the
`tests/unit` directory that is checking the snapshot labeled 'COMPACT_CONFIGURATION_UPLOADER_INPUT', and update the
parameter 'overwrite_snapshot=' to 'True'. Rerun the tests to overwrite the snapshot with the updated configuration
json content, then set the parameter back to 'False' to prevent accidental overwrites in the future.
10 changes: 10 additions & 0 deletions backend/compact-connect/lambdas/custom-resources/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
data_file = ../../../.coverage

omit =
*/cdk.out/*
*/smoke-test/*
*/tests/*

[report]
skip_empty = true
24 changes: 24 additions & 0 deletions backend/compact-connect/lambdas/custom-resources/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import logging
import os
from functools import cached_property

import boto3
from aws_lambda_powertools import Logger


logging.basicConfig()
logger = Logger()
logger.setLevel(logging.DEBUG if os.environ.get('DEBUG', 'false').lower() == 'true' else logging.INFO)


class _Config():

@property
def compact_configuration_table_name(self):
return os.environ['COMPACT_CONFIGURATION_TABLE_NAME']

@cached_property
def compact_configuration_table(self):
return boto3.resource('dynamodb').Table(self.compact_configuration_table_name)

config = _Config()
Empty file.
Loading

0 comments on commit fd5f12c

Please sign in to comment.