Skip to content

Commit

Permalink
Merge pull request #604 from fecgov/feature/113-update-transaction-id…
Browse files Browse the repository at this point in the history
…entifiers

Feature/113 update transaction identifiers
  • Loading branch information
mjtravers authored Oct 6, 2022
2 parents ec09832 + 056f35d commit 4a2d91e
Show file tree
Hide file tree
Showing 28 changed files with 120 additions and 119 deletions.
14 changes: 7 additions & 7 deletions front-end/package-lock.json

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

6 changes: 3 additions & 3 deletions 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#54e19d7d977bbfc64a2c3eca82e411e770487a8a",
"fecfile-validate": "https://github.com/fecgov/fecfile-validate#577e90e2eee166d8ae2d08f5d142ff5220c1dc3a",
"intl-tel-input": "^17.0.18",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -70,7 +70,7 @@
"@types/node": "^12.11.1",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"cypress": "10.7.0",
"cypress": "^10.7.0",
"eslint": "^8.2.0",
"jasmine-core": "~4.0.0",
"karma": "~6.3.0",
Expand All @@ -85,4 +85,4 @@
"browser": {
"crypto": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ describe('TransactionTypeBaseComponent', () => {
component.transactionType = {
transaction: testTransaction,
} as TransactionType;
const expectedRoute = '/transactions/report/999/list/edit/123/create-sub-transaction/INDV_REC';
const expectedRoute = '/transactions/report/999/list/edit/123/create-sub-transaction/INDIVIDUAL_RECEIPT';
const routerNavigateByUrlSpy = spyOn(testRouter, 'navigateByUrl');
component.navigateTo('add-sub-tran', '123', 'INDV_REC');
component.navigateTo('add-sub-tran', '123', 'INDIVIDUAL_RECEIPT');
expect(routerNavigateByUrlSpy).toHaveBeenCalledOnceWith(expectedRoute);
});

Expand Down
18 changes: 9 additions & 9 deletions front-end/src/app/shared/models/scha-transaction.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ export type ScheduleATransactionGroupsType =

export enum ScheduleATransactionTypes {
// Contributions from Individuals/Persons
INDIVIDUAL_RECEIPT = 'INDV_REC',
TRIBAL_RECEIPT = 'TRIB_REC',
INDIVIDUAL_RECEIPT = 'INDIVIDUAL_RECEIPT',
TRIBAL_RECEIPT = 'TRIBAL_RECEIPT',
PARTNERSHIP_RECEIPT = 'PARTN_REC',
REATTRIBUTION = 'REATT_FROM',
IN_KIND_RECEIPT = 'IK_REC',
RETURNED_BOUNCED_RECEIPT_INDIVIDUAL = 'RET_REC',
EARMARK_RECEIPT = 'EAR_REC',
EARMARK_RECEIPT = 'EARMARK_RECEIPT',
CONDUIT_EARMARK_DEPOSITED = 'CONDUIT_EARMARK_DEPOSITED',
CONDUIT_EARMARK_UNDEPOSITED = 'CONDUIT_EARMARK_UNDEPOSITED',
UNREGISTERED_RECEIPT_FROM_PERSON = 'PAC_NON_FED_REC',
Expand All @@ -109,8 +109,8 @@ export enum ScheduleATransactionTypes {
RETURNED_BOUNCED_RECEIPT_PAC = 'PAC_RET',
// Transfers
TRANSFERS = 'TRAN',
JF_TRANSFER = 'JF_TRAN',
JF_TRAN_PAC_MEMO = 'JF_TRAN_PAC_MEMO',
JOINT_FUNDRAISING_TRANSFER = 'JOINT_FUNDRAISING_TRANSFER',
PAC_JF_TRANSFER_MEMO = 'PAC_JF_TRANSFER_MEMO',
IN_KIND_TRANSFER = 'IK_TRAN',
IN_KIND_TRANSFER_FEA = 'IK_TRAN_FEA',
JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT = 'JF_TRAN_NP_RECNT_ACC',
Expand All @@ -120,8 +120,8 @@ export enum ScheduleATransactionTypes {
REFUNDS_OF_CONTRIBUTIONS_TO_REGISTERED_COMMITTEES = 'REF_TO_FED_CAN',
REFUNDS_OF_CONTRIBUTIONS_TO_UNREGISTERED_COMMITTEES = 'REF_TO_OTH_CMTE',
// Other
OFFSETS_TO_OPERATING_EXPENDITURES = 'OFFSET_TO_OPEX',
OTHER_RECEIPTS = 'OTH_REC',
OFFSETS_TO_OPERATING_EXPENDITURES = 'OFFSET_TO_OPERATING_EXPENDITURES',
OTHER_RECEIPTS = 'OTHER_RECEIPT',
IND_RECEIPT_NON_CONTRIBUTION_ACCOUNT = 'IND_REC_NON_CONT_ACC',
OTHER_COMMITTEE_RECEIPT_NON_CONTRIBUTION_ACCOUNT = 'OTH_CMTE_NON_CONT_ACC',
BUSINESS_LABOR_ORG_RECEIPT_NON_CONTRIBUTION_ACCOUNT = 'BUS_LAB_NON_CONT_ACC',
Expand Down Expand Up @@ -174,8 +174,8 @@ export const ScheduleATransactionTypeLabels: LabelList = [
[ScheduleATransactionTypes.RETURNED_BOUNCED_RECEIPT_PAC, 'Returned/Bounced Receipt (PAC)'],
// Transfers
[ScheduleATransactionTypes.TRANSFERS, 'Transfers'],
[ScheduleATransactionTypes.JF_TRANSFER, 'Joint Fundraising Transfer'],
[ScheduleATransactionTypes.JF_TRAN_PAC_MEMO, 'PAC Joint Fundraising Transfer Memo'],
[ScheduleATransactionTypes.JOINT_FUNDRAISING_TRANSFER, 'Joint Fundraising Transfer'],
[ScheduleATransactionTypes.PAC_JF_TRANSFER_MEMO, 'PAC Joint Fundraising Transfer Memo'],
[ScheduleATransactionTypes.IN_KIND_TRANSFER, 'In-Kind Transfer'],
[ScheduleATransactionTypes.IN_KIND_TRANSFER_FEA, 'In-Kind Transfer - Federal Election Activity'],
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { EAR_REC } from './EAR_REC.model';
import { EARMARK_RECEIPT } from './EARMARK_RECEIPT.model';
import { SchATransaction, ScheduleATransactionTypes } from '../scha-transaction.model';

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

beforeEach(() => {
transactionType = new EAR_REC();
transactionType = new EARMARK_RECEIPT();
});

it('should create an instance', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { LabelUtils } from 'app/shared/utils/label.utils';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/EAR_REC';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/EARMARK_RECEIPT';
import { TransactionType } from '../../interfaces/transaction-type.interface';
import { SchATransaction, ScheduleATransactionTypeLabels, ScheduleATransactionTypes } from '../scha-transaction.model';

export class EAR_REC implements TransactionType {
export class EARMARK_RECEIPT implements TransactionType {
scheduleId = 'A';
componentGroupId = 'AG';
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.EARMARK_RECEIPT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { INDV_REC } from './INDV_REC.model';
import { INDIVIDUAL_RECEIPT } from './INDIVIDUAL_RECEIPT.model';
import { SchATransaction, ScheduleATransactionTypes } from '../scha-transaction.model';

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

beforeEach(() => {
transactionType = new INDV_REC();
transactionType = new INDIVIDUAL_RECEIPT();
});

it('should create an instance', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TransactionType } from '../../interfaces/transaction-type.interface';
import { SchATransaction, ScheduleATransactionTypes, ScheduleATransactionTypeLabels } from '../scha-transaction.model';
import { LabelUtils } from 'app/shared/utils/label.utils';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/INDV_REC';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/INDIVIDUAL_RECEIPT';

export class INDV_REC implements TransactionType {
export class INDIVIDUAL_RECEIPT implements TransactionType {
scheduleId = 'A';
componentGroupId = 'A';
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.INDIVIDUAL_RECEIPT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SchATransaction, ScheduleATransactionTypes } from '../scha-transaction.model';
import { JF_TRAN } from './JF_TRAN.model';
import { JOINT_FUNDRAISING_TRANSFER } from './JOINT_FUNDRAISING_TRANSFER.model';

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

beforeEach(() => {
transactionType = new JF_TRAN();
transactionType = new JOINT_FUNDRAISING_TRANSFER();
});

it('should create an instance', () => {
Expand All @@ -17,11 +17,11 @@ describe('JF_TRAN', () => {
it('#factory() should return a SchATransaction', () => {
const txn: SchATransaction = transactionType.getNewTransaction();
expect(txn.form_type).toBe('SA12');
expect(txn.transaction_type_identifier).toBe(ScheduleATransactionTypes.JF_TRANSFER);
expect(txn.transaction_type_identifier).toBe(ScheduleATransactionTypes.JOINT_FUNDRAISING_TRANSFER);
});

it('#contributionPurposeDescripReadonly() should return constant', () => {
const descrip = transactionType.contributionPurposeDescripReadonly();
expect(descrip).toBe('Transfer of JF Proceeds');
expect(descrip).toBe('Transfer of Joint Fundraising Proceeds');
});
});
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { LabelUtils } from 'app/shared/utils/label.utils';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/JF_TRAN';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/JOINT_FUNDRAISING_TRANSFER';
import { TransactionType } from '../../interfaces/transaction-type.interface';
import { SchATransaction, ScheduleATransactionTypeLabels, ScheduleATransactionTypes } from '../scha-transaction.model';

export class JF_TRAN implements TransactionType {
export class JOINT_FUNDRAISING_TRANSFER implements TransactionType {
scheduleId = 'A';
componentGroupId = 'E';
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.JF_TRANSFER);
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.JOINT_FUNDRAISING_TRANSFER);
schema = schema;
transaction = undefined;
contact = undefined;
parent = undefined;

contributionPurposeDescripReadonly(): string {
return 'Transfer of JF Proceeds';
return 'Transfer of Joint Fundraising Proceeds';
}

getNewTransaction() {
return SchATransaction.fromJSON({
form_type: 'SA12',
transaction_type_identifier: ScheduleATransactionTypes.JF_TRANSFER,
transaction_type_identifier: ScheduleATransactionTypes.JOINT_FUNDRAISING_TRANSFER,
});
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { OFFSET_TO_OPEX } from './OFFSET_TO_OPEX.model';
import { OFFSET_TO_OPERATING_EXPENDITURES } from './OFFSET_TO_OPERATING_EXPENDITURES.model';
import { SchATransaction, ScheduleATransactionTypes } from '../scha-transaction.model';

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

beforeEach(() => {
transactionType = new OFFSET_TO_OPEX();
transactionType = new OFFSET_TO_OPERATING_EXPENDITURES();
});

it('should create an instance', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TransactionType } from '../../interfaces/transaction-type.interface';
import { SchATransaction, ScheduleATransactionTypes, ScheduleATransactionTypeLabels } from '../scha-transaction.model';
import { LabelUtils } from 'app/shared/utils/label.utils';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/OFFSET_TO_OPEX';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/OFFSET_TO_OPERATING_EXPENDITURES';

export class OFFSET_TO_OPEX implements TransactionType {
export class OFFSET_TO_OPERATING_EXPENDITURES implements TransactionType {
scheduleId = 'A';
componentGroupId = 'B';
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.OFFSETS_TO_OPERATING_EXPENDITURES);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { OTH_REC } from './OTH_REC.model';
import { OTHER_RECEIPT } from './OTHER_RECEIPT.model';
import { SchATransaction, ScheduleATransactionTypes } from '../scha-transaction.model';

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

beforeEach(() => {
transactionType = new OTH_REC();
transactionType = new OTHER_RECEIPT();
});

it('should create an instance', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TransactionType } from '../../interfaces/transaction-type.interface';
import { SchATransaction, ScheduleATransactionTypes, ScheduleATransactionTypeLabels } from '../scha-transaction.model';
import { LabelUtils } from 'app/shared/utils/label.utils';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/OTH_REC';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/OTHER_RECEIPT';

export class OTH_REC implements TransactionType {
export class OTHER_RECEIPT implements TransactionType {
scheduleId = 'A';
componentGroupId = 'C';
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.OTHER_RECEIPTS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SchATransaction, ScheduleATransactionTypes } from '../scha-transaction.model';
import { JF_TRAN_PAC_MEMO } from './JF_TRAN_PAC_MEMO.model';
import { PAC_JF_TRANSFER_MEMO } from './PAC_JF_TRANSFER_MEMO.model';

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

beforeEach(() => {
transactionType = new JF_TRAN_PAC_MEMO();
transactionType = new PAC_JF_TRANSFER_MEMO();
});

it('should create an instance', () => {
Expand All @@ -17,11 +17,11 @@ describe('JF_TRAN_PAC_MEMO', () => {
it('#factory() should return a SchATransaction', () => {
const txn: SchATransaction = transactionType.getNewTransaction();
expect(txn.form_type).toBe('SA12');
expect(txn.transaction_type_identifier).toBe(ScheduleATransactionTypes.JF_TRAN_PAC_MEMO);
expect(txn.transaction_type_identifier).toBe(ScheduleATransactionTypes.PAC_JF_TRANSFER_MEMO);
});

it('#contributionPurposeDescripReadonly() should return an empty string', () => {
const descrip = transactionType.contributionPurposeDescripReadonly();
expect(descrip).toBe(`JF Memo: ${transactionType.parent?.contributor_organization_name}`);
expect(descrip).toBe(`Joint Fundraising Memo: ${transactionType.parent?.contributor_organization_name}`);
});
});
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { TransactionType } from '../../interfaces/transaction-type.interface';
import { SchATransaction, ScheduleATransactionTypes, ScheduleATransactionTypeLabels } from '../scha-transaction.model';
import { LabelUtils } from 'app/shared/utils/label.utils';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/JF_TRAN_PAC_MEMO';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/PAC_JF_TRANSFER_MEMO';
import { Transaction } from '../../interfaces/transaction.interface';

export class JF_TRAN_PAC_MEMO implements TransactionType {
export class PAC_JF_TRANSFER_MEMO implements TransactionType {
scheduleId = 'A';
componentGroupId = 'F';
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.JF_TRAN_PAC_MEMO);
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.PAC_JF_TRANSFER_MEMO);
schema = schema;
transaction: Transaction | undefined;
contact = undefined;
parent: SchATransaction | undefined;

contributionPurposeDescripReadonly(): string {
return `JF Memo: ${this.parent?.contributor_organization_name}`;
return `Joint Fundraising Memo: ${this.parent?.contributor_organization_name}`;
}

getNewTransaction() {
return SchATransaction.fromJSON({
form_type: 'SA12',
transaction_type_identifier: ScheduleATransactionTypes.JF_TRAN_PAC_MEMO,
transaction_type_identifier: ScheduleATransactionTypes.PAC_JF_TRANSFER_MEMO,
back_reference_sched_name: 'SA12',
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TRIB_REC } from './TRIB_REC.model';
import { TRIBAL_RECEIPT } from './TRIBAL_RECEIPT.model';
import { SchATransaction, ScheduleATransactionTypes } from '../scha-transaction.model';

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

beforeEach(() => {
transactionType = new TRIB_REC();
transactionType = new TRIBAL_RECEIPT();
});

it('should create an instance', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TransactionType } from '../../interfaces/transaction-type.interface';
import { SchATransaction, ScheduleATransactionTypes, ScheduleATransactionTypeLabels } from '../scha-transaction.model';
import { LabelUtils } from 'app/shared/utils/label.utils';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/TRIB_REC';
import { schema } from 'fecfile-validate/fecfile_validate_js/dist/TRIBAL_RECEIPT';

export class TRIB_REC implements TransactionType {
export class TRIBAL_RECEIPT implements TransactionType {
scheduleId = 'A';
componentGroupId = 'D';
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.TRIBAL_RECEIPT);
Expand Down
Loading

0 comments on commit 4a2d91e

Please sign in to comment.