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/1604 - Clear coverage dates when no coverage date function #2349

Merged
merged 1 commit into from
Nov 12, 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
Expand Up @@ -137,6 +137,8 @@ export class CreateF3XStep1Component extends DestroyerComponent implements OnIni
filingFrequency,
);
this.form.patchValue({ coverage_from_date, coverage_through_date });
} else {
this.form.patchValue({ coverage_from_date: null, coverage_through_date: null });
}
});

Expand Down
15 changes: 0 additions & 15 deletions front-end/src/app/shared/utils/report-code.utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { DateUtils } from './date.utils';

export enum F3xReportCodes {
Q1 = 'Q1',
Q2 = 'Q2',
Expand Down Expand Up @@ -41,9 +39,6 @@ export function getCoverageDatesFunction(
case F3xReportCodes.Q3: {
return createCoverageFunction(6, 1, 8, 30);
}
case F3xReportCodes.YE: {
return getYearEndCoverageDates;
}
case F3xReportCodes.MY: {
return createCoverageFunction(0, 1, 5, 30);
}
Expand Down Expand Up @@ -96,16 +91,6 @@ function createCoverageFunction(
};
}

function getYearEndCoverageDates(year: number, isElectionYear: boolean, filingFrequency: string): [Date, Date] {
year = DateUtils.isCurrentMonthJanuary() ? year - 1 : year;
if (isElectionYear) {
return [new Date(year, 9, 1), new Date(year, 11, 31)];
} else if (filingFrequency === 'Q') {
return [new Date(year, 6, 1), new Date(year, 11, 31)];
}
return [new Date(year, 11, 1), new Date(year, 11, 31)];
}

export const monthlyElectionYearReportCodes: F3xReportCodes[] = [
F3xReportCodes.M2,
F3xReportCodes.M3,
Expand Down