Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OTE-419] Add GB_GEO to compliance reasons #1697

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Knex from 'knex';

import { formatAlterTableEnumSql } from '../helpers';

export async function up(knex: Knex): Promise<void> {
return knex.raw(formatAlterTableEnumSql(
'compliance_status',
'reason',
['MANUAL', 'US_GEO', 'CA_GEO', 'GB_GEO', 'SANCTIONED_GEO', 'COMPLIANCE_PROVIDER'],
));
}

export async function down(knex: Knex): Promise<void> {
return knex.raw(formatAlterTableEnumSql(
'compliance_status',
'reason',
['MANUAL', 'US_GEO', 'CA_GEO', 'SANCTIONED_GEO', 'COMPLIANCE_PROVIDER'],
));
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum ComplianceReason {
MANUAL = 'MANUAL',
US_GEO = 'US_GEO',
CA_GEO = 'CA_GEO',
GB_GEO = 'GB_GEO',
SANCTIONED_GEO = 'SANCTIONED_GEO',
COMPLIANCE_PROVIDER = 'COMPLIANCE_PROVIDER',
}
Expand Down
1 change: 1 addition & 0 deletions indexer/services/comlink/public/api-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3575,6 +3575,7 @@ This operation does not require authentication
|*anonymous*|MANUAL|
|*anonymous*|US_GEO|
|*anonymous*|CA_GEO|
|*anonymous*|GB_GEO|
|*anonymous*|SANCTIONED_GEO|
|*anonymous*|COMPLIANCE_PROVIDER|

Expand Down
1 change: 1 addition & 0 deletions indexer/services/comlink/public/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@
"MANUAL",
"US_GEO",
"CA_GEO",
"GB_GEO",
"SANCTIONED_GEO",
"COMPLIANCE_PROVIDER"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export function getGeoComplianceReason(
return ComplianceReason.US_GEO;
} else if (country === 'CA') {
return ComplianceReason.CA_GEO;
} else if (country === 'GB') {
return ComplianceReason.GB_GEO;
} else {
return ComplianceReason.SANCTIONED_GEO;
}
Comment on lines +13 to 17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider simplifying the control flow by removing unnecessary else clauses.

-    } else if (country === 'GB') {
-      return ComplianceReason.GB_GEO;
-    } else {
+    } else if (country === 'GB') {
+      return ComplianceReason.GB_GEO;
+    }

Committable suggestion was skipped due to low confidence.

Tools
Biome

[error] 11-17: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 13-17: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)


[error] 15-17: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Expand Down
Loading