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/463 national party recount legal proceedings #698

Merged
17 changes: 15 additions & 2 deletions front-end/cypress/support/transaction_nav_trees.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ export type SchATransactionName =
| 'Party Receipt'
| 'PAC Receipt'
| 'Transfer'
| 'Earmark Receipt';
| 'Earmark Receipt'
| 'Joint Fundraising Transfer - National Party Recount Account';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The transaction names that are used throughout this file are associated with the transaction accordion on the front-end. Those entries are sometimes different from their Unique Transaction Identifiers.


export type ChildTransactionName =
| 'PAC Joint Fundraising Transfer Memo'
| 'Party Joint Fundraising Transfer Memo'
| 'Individual Joint Fundraising Transfer Memo'
| 'Tribal Joint Fundraising Transfer Memo'
| 'Earmark Receipt Step';
| 'Earmark Receipt Step One'
| 'Earmark Receipt Step Two';

export type TransactionNavTree = {
[category in TransactionCategory]?: {
Expand Down Expand Up @@ -278,6 +280,16 @@ const jointFundraisingTransfer: TransactionForm = {
],
};

const jointFundraisingTransferNationalPartyRecount: TransactionForm = {
transaction_name: 'Joint Fundraising Transfer - National Party Recount Account',
transaction_category: 'TRANSFERS',
...entityCommittee,
fields: {
...memoFields,
...contributionFields,
},
};

const offsetToOpex: TransactionForm = {
transaction_name: 'Offsets to Operating Expenditures',
transaction_category: 'OTHER',
Expand Down Expand Up @@ -375,6 +387,7 @@ export const groupANavTree: TransactionNavTree = {
TRANSFERS: {
Transfer: transfer,
'Joint Fundraising Transfer': jointFundraisingTransfer,
'Joint Fundraising Transfer - National Party Recount Account': jointFundraisingTransferNationalPartyRecount,
},
//"REFUNDS":{},
OTHER: {
Expand Down
12 changes: 6 additions & 6 deletions front-end/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion front-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@popperjs/core": "^2.10.2",
"bootstrap": "5.1.3",
"class-transformer": "^0.5.1",
"fecfile-validate": "https://github.com/fecgov/fecfile-validate#8474a6caa45f33e89512f1b885eca2cd89615701",
"fecfile-validate": "https://github.com/fecgov/fecfile-validate#ef7b38e0a7107776a540da4c0d7dc88b139048e1",
"intl-tel-input": "^17.0.18",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
Expand Down
17 changes: 16 additions & 1 deletion front-end/src/app/shared/models/scha-transaction.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export enum ScheduleATransactionTypes {
JOINT_FUNDRAISING_TRANSFER = 'JOINT_FUNDRAISING_TRANSFER',
IN_KIND_TRANSFER = 'IK_TRAN',
IN_KIND_TRANSFER_FEA = 'IK_TRAN_FEA',
JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT = 'JF_TRAN_NP_RECNT_ACC',
JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT = 'JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT',
JF_TRANSFER_NATIONAL_PARTY_CONVENTION_ACCOUNT = 'JF_TRAN_NP_CONVEN_ACC',
JF_TRANSFER_NATIONAL_PARTY_HEADQUARTERS_ACCOUNT = 'JF_TRAN_NP_HQ_ACC',
// Refunds
Expand Down Expand Up @@ -158,6 +158,9 @@ export enum ScheduleATransactionTypes {
INDIVIDUAL_JF_TRANSFER_MEMO = 'INDIVIDUAL_JF_TRANSFER_MEMO',
PARTY_JF_TRANSFER_MEMO = 'PARTY_JF_TRANSFER_MEMO',
TRIBAL_JF_TRANSFER_MEMO = 'TRIBAL_JF_TRANSFER_MEMO',
INDIVIDUAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO = 'INDIVIDUAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO',
PAC_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO = 'PAC_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO',
TRIBAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO = 'TRIBAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO',
}

export const ScheduleATransactionTypeLabels: LabelList = [
Expand Down Expand Up @@ -271,6 +274,18 @@ export const ScheduleATransactionTypeLabels: LabelList = [
ScheduleATransactionTypes.EARMARK_RECEIPT_FOR_HEADQUARTERS_ACCOUNT_CONTRIBUTION,
'Earmark Receipt for Headquarters Account (Contribution)',
],
[
ScheduleATransactionTypes.INDIVIDUAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO,
'Individual National Party Recount/Legal Proceedings Account JF Transfer Memo',
],
[
ScheduleATransactionTypes.PAC_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO,
'PAC National Party Recount/Legal Proceedings Account JF Transfer Memo',
],
[
ScheduleATransactionTypes.TRIBAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO,
'Tribal National Party Recount/Legal Proceedings Account JF Transfer Memo',
],
];

export enum AggregationGroups {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { SchATransaction, ScheduleATransactionTypes } from '../scha-transaction.model';
import { JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT } from './JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT.model';

describe('JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT', () => {
let transactionType: JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT;

beforeEach(() => {
transactionType = new JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT();
});

it('should create an instance', () => {
expect(transactionType).toBeTruthy();
expect(transactionType.scheduleId).toBe('A');
expect(transactionType.componentGroupId).toBe('E');
});

it('#factory() should return a SchATransaction', () => {
const txn: SchATransaction = transactionType.getNewTransaction();
expect(txn.form_type).toBe('SA17');
expect(txn.transaction_type_identifier).toBe(ScheduleATransactionTypes.JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT);
});

it('#contributionPurposeDescripReadonly() should return constant', () => {
const descrip = transactionType.contributionPurposeDescripReadonly();
expect(descrip).toBe('Recount/Legal Proceedings Account Transfer of JF Proceeds');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { LabelUtils } from 'app/shared/utils/label.utils';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT';
import { TransactionType } from '../../interfaces/transaction-type.interface';
import {
AggregationGroups,
SchATransaction,
ScheduleATransactionTypeLabels,
ScheduleATransactionTypes,
} from '../scha-transaction.model';
import {
CANCEL_CONTROL,
SAVE_ANOTHER_CONTROL,
SAVE_LIST_CONTROL,
TransactionNavigationControls,
} from '../transaction-navigation-controls.model';

export class JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT implements TransactionType {
scheduleId = 'A';
componentGroupId = 'E';
isDependentChild = false;
title = LabelUtils.get(
ScheduleATransactionTypeLabels,
ScheduleATransactionTypes.JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT
);
schema = schema;
transaction = undefined;
parentTransaction = undefined;
childTransactionType = undefined;
subTransactionTypes = [
ScheduleATransactionTypes.TRIBAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO,
ScheduleATransactionTypes.INDIVIDUAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO,
ScheduleATransactionTypes.TRIBAL_NATIONAL_PARTY_RECOUNT_JF_TRANSFER_MEMO,
];
navigationControls?: TransactionNavigationControls = new TransactionNavigationControls(
[],
[CANCEL_CONTROL],
[SAVE_LIST_CONTROL, SAVE_ANOTHER_CONTROL]
);

contributionPurposeDescripReadonly(): string {
return 'Recount/Legal Proceedings Account Transfer of JF Proceeds';
}

getNewTransaction() {
return SchATransaction.fromJSON({
form_type: 'SA17',
transaction_type_identifier: ScheduleATransactionTypes.JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT,
aggregation_group: AggregationGroups.NPARTY_RECOUNT_ACCOUNT,
});
}
}
2 changes: 2 additions & 0 deletions front-end/src/app/shared/utils/transaction-type.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { TRANSFER } from '../models/transaction-types/TRANSFER.model';
import { TRIBAL_JF_TRANSFER_MEMO } from '../models/transaction-types/TRIBAL_JF_TRANSFER_MEMO.model';
import { TRIBAL_RECEIPT } from '../models/transaction-types/TRIBAL_RECEIPT.model';
import { TRIBAL_RECOUNT_RECEIPT } from '../models/transaction-types/TRIBAL_RECOUNT_RECEIPT.model';
import { JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT } from '../models/transaction-types/JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT.model';

// prettier-ignore
const transactionTypeClasses: any = { // eslint-disable-line @typescript-eslint/no-explicit-any
Expand All @@ -38,6 +39,7 @@ const transactionTypeClasses: any = { // eslint-disable-line @typescript-eslint/
TRIBAL_JF_TRANSFER_MEMO,
TRIBAL_RECEIPT,
TRIBAL_RECOUNT_RECEIPT,
JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT,
}

export class TransactionTypeUtils {
Expand Down