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

Feature/237 aggregation groups #610

Merged
merged 10 commits into from
Oct 12, 2022
Merged

Conversation

Elaine-Krauss-TCG
Copy link
Contributor

@Elaine-Krauss-TCG Elaine-Krauss-TCG commented Oct 7, 2022

@@ -255,3 +256,11 @@ export const ScheduleATransactionTypeLabels: LabelList = [
'Earmark Receipt for Headquarters Account (Contribution)',
],
];

export type AggregationGroup =
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to make this an enum instead (similar to ScheduleATransactionGroups for example)?

@@ -20,6 +20,7 @@ export class EARMARK_RECEIPT implements TransactionType {
return SchATransaction.fromJSON({
form_type: 'SA11AI',
transaction_type_identifier: ScheduleATransactionTypes.EARMARK_RECEIPT,
aggregation_group: "General",
Copy link
Contributor

@dheitzer dheitzer Oct 11, 2022

Choose a reason for hiding this comment

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

If we make AggregationGroup an enum, we can reference it directly here (and aggregation_group will be typed). Same comment applies for all the similar .fromJSON( calls in this diff.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with David, an enum has a bit more flexibility. Here it would be referenced by something like AggregationGroup.GENERAL rather than "General". That way if the internal ID ever changes or something of the sort then the enum is changed and the references in the code can stay as is. See what was done with the combination of enums and typing for F3XFormTypes and F3xFormType in f3x-summary.model.ts

Copy link
Contributor

@mjtravers mjtravers left a comment

Choose a reason for hiding this comment

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

See inline comments for requested changes

@@ -20,6 +20,7 @@ export class EARMARK_RECEIPT implements TransactionType {
return SchATransaction.fromJSON({
form_type: 'SA11AI',
transaction_type_identifier: ScheduleATransactionTypes.EARMARK_RECEIPT,
aggregation_group: "General",
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with David, an enum has a bit more flexibility. Here it would be referenced by something like AggregationGroup.GENERAL rather than "General". That way if the internal ID ever changes or something of the sort then the enum is changed and the references in the code can stay as is. See what was done with the combination of enums and typing for F3XFormTypes and F3xFormType in f3x-summary.model.ts

@sonarcloud
Copy link

sonarcloud bot commented Oct 11, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
13.3% 13.3% Duplication

@mjtravers mjtravers merged commit ec1459b into develop Oct 12, 2022
@mjtravers mjtravers deleted the feature/237-Aggregation-Groups branch October 12, 2022 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants