Skip to main content

paycheck_utils/
constants.rs

1//! Module containing utility constants and enums for payroll calculations.
2//! Tax related constants are based on IRS guidelines for the year 2026.
3//! Focus is given to single filer status, with future implementation plans for other filing statuses.
4
5/// 2 week pay periods
6pub const PAY_PERIOD: f32 = 2.0;
7
8/// 26 bi-weekly pay periods in a year
9pub const PAY_PERIODS_PER_YEAR: f32 = 26.0;
10
11/// standard 40 hour full-time hours per week
12pub const STANDARD_HOURS_PER_WEEK: f32 = 40.0;
13
14/// time and a half
15pub const OVERTIME_MULTIPLIER: f32 = 1.5;
16// pub const PAID_TIME_OFF_WEEKS_PER_YEAR: f32 = 3.0; // possible future integration of overtime not possible during PTO
17
18/// 2026 filing statuses
19#[derive(Debug, Clone, Copy, Default)]
20pub enum FilingStatus {
21    #[default]
22    Single,
23    MarriedFilingJointly,  // for future implementation
24    MarriedFilingSeparate, // for future implementation
25    HeadOfHousehold,       // for future implementation
26}
27
28impl FilingStatus {
29    pub fn default() -> Self {
30        FilingStatus::Single
31    }
32}
33
34/// 2026 standard deduction for single filer: $16,100 (source: irs.gov)
35pub const SINGLE_DEDUCTION: f32 = 16100.00;
36
37/// 2026 standard deduction for head of household filer: $24,150 (source: irs.gov)
38pub const HEAD_OF_HOUSEHOLD_DEDUCTION: f32 = 24150.00; // for future implementation
39
40/// 2026 standard deduction for married filing jointly filer: $32,200 (source: irs.gov)
41pub const MARRIED_FILING_JOINTLY_DEDUCTION: f32 = 32200.00; // for future implementation
42
43/// 2026 standard deduction for married filing separately filer: $16,100 (source: irs.gov)
44pub const MARRIED_FILING_SEPERATE_DEDUCTION: f32 = 16100.00; // for future implementation
45
46/// 2026 Social Security tax rate: 6.2% (source: irs.gov)
47pub const SOCIAL_SECURITY_RATE: f32 = 0.062;
48
49/// 2026 Medicare tax rate: 1.45% (source: irs.gov)
50pub const MEDICARE_RATE: f32 = 0.0145;
51
52/// 2026 tax bracket 1 rate: 10% (source: irs.gov)
53pub const TAX_BRACKET_1_RATE: f32 = 0.10; // 10%
54
55/// 2026 tax bracket 2 rate: 12% (source: irs.gov)
56pub const TAX_BRACKET_2_RATE: f32 = 0.12; // 12%
57
58/// 2026 tax bracket 3 rate: 22% (source: irs.gov)
59pub const TAX_BRACKET_3_RATE: f32 = 0.22; // 22%
60
61/// 2026 tax bracket 4 rate: 24% (source: irs.gov)
62pub const TAX_BRACKET_4_RATE: f32 = 0.24; // 24%
63
64/// 2026 tax bracket 5 rate: 32% (source: irs.gov)
65pub const TAX_BRACKET_5_RATE: f32 = 0.32; // 32%
66
67/// 2026 tax bracket 6 rate: 35% (source: irs.gov)
68pub const TAX_BRACKET_6_RATE: f32 = 0.35; // 35%
69
70/// 2026 tax bracket 7 rate: 37% (source: irs.gov)
71pub const TAX_BRACKET_7_RATE: f32 = 0.37; // 37%
72
73/// 2026 single filer tax bracket 1 upper limit threshold: $12,400 (source: irs.gov)
74pub const SINGLE_BRACKET_1_THRESHOLD: f32 = 12400.00;
75
76/// 2026 single filer tax bracket 2 upper limit threshold: $50,400 (source: irs.gov)
77pub const SINGLE_BRACKET_2_THRESHOLD: f32 = 50400.00;
78
79/// 2026 single filer tax bracket 3 upper limit threshold: $105,700 (source: irs.gov)
80pub const SINGLE_BRACKET_3_THRESHOLD: f32 = 105700.00;
81
82/// 2026 single filer tax bracket 4 upper limit threshold: $201,775 (source: irs.gov)
83pub const SINGLE_BRACKET_4_THRESHOLD: f32 = 201775.00;
84
85/// 2026 single filer tax bracket 5 upper limit threshold: $256,225 (source: irs.gov)
86pub const SINGLE_BRACKET_5_THRESHOLD: f32 = 256225.00;
87
88/// 2026 single filer tax bracket 6 upper limit threshold: $640,600 (source: irs.gov)
89pub const SINGLE_BRACKET_6_THRESHOLD: f32 = 640600.00;
90
91/// 2026 single filer tax bracket 2 base tax amount: $1,240.00 (source: irs.gov)
92pub const SINGLE_BRACKET_2_BASE_TAX: f32 = 1240.00;
93
94/// 2026 single filer tax bracket 3 base tax amount: $5,800.00 (source: irs.gov)
95pub const SINGLE_BRACKET_3_BASE_TAX: f32 = 5800.00;
96
97/// 2026 single filer tax bracket 4 base tax amount: $17,996.00 (source: irs.gov)
98pub const SINGLE_BRACKET_4_BASE_TAX: f32 = 17996.00;
99
100/// 2026 single filer tax bracket 5 base tax amount: $41,024.00 (source: irs.gov)
101pub const SINGLE_BRACKET_5_BASE_TAX: f32 = 41024.00;
102
103/// 2026 single filer tax bracket 6 base tax amount: $58,448.00 (source: irs.gov)
104pub const SINGLE_BRACKET_6_BASE_TAX: f32 = 58448.00;
105
106/// 2026 single filer tax bracket 7 base tax amount: $192,979.25 (source: irs.gov)
107pub const SINGLE_BRACKET_7_BASE_TAX: f32 = 192979.25;
108
109// FUTURE IMPLEMENTATION OF OTHER FILING STATUS TAX BRACKETS
110
111// // 2026 tax brackets thresholds for married filing jointly filers
112// pub const MARRIED_JOINTLY_BRACKET_1_THRESHOLD: f32 = 24800.00;
113// pub const MARRIED_JOINTLY_BRACKET_2_THRESHOLD: f32 = 100800.00;
114// pub const MARRIED_JOINTLY_BRACKET_3_THRESHOLD: f32 = 211400.00;
115// pub const MARRIED_JOINTLY_BRACKET_4_THRESHOLD: f32 = 403550.00;
116// pub const MARRIED_JOINTLY_BRACKET_5_THRESHOLD: f32 = 512450.00;
117// pub const MARRIED_JOINTLY_BRACKET_6_THRESHOLD: f32 = 768700.00;
118// pub const MARRIED_JOINTLY_BRACKET_7_THRESHOLD: f32 = f32::MAX;
119
120// // 2026 tax brackets thresholds for married filing separately filers
121// pub const MARRIED_SEPARATELY_BRACKET_1_THRESHOLD: f32 = 12400.00;
122// pub const MARRIED_SEPARATELY_BRACKET_2_THRESHOLD: f32 = 50400.00;
123// pub const MARRIED_SEPARATELY_BRACKET_3_THRESHOLD: f32 = 105700.00;
124// pub const MARRIED_SEPARATELY_BRACKET_4_THRESHOLD: f32 = 201775.00;
125// pub const MARRIED_SEPARATELY_BRACKET_5_THRESHOLD: f32 = 256225.00;
126// pub const MARRIED_SEPARATELY_BRACKET_6_THRESHOLD: f32 = 384350.00;
127// pub const MARRIED_SEPARATELY_BRACKET_7_THRESHOLD: f32 = f32::MAX;
128
129// // 2026 tax brackets thresholds for head of household filers
130// pub const HEAD_OF_HOUSEHOLD_BRACKET_1_THRESHOLD: f32 = 17700.00;
131// pub const HEAD_OF_HOUSEHOLD_BRACKET_2_THRESHOLD: f32 = 67450.00;
132// pub const HEAD_OF_HOUSEHOLD_BRACKET_3_THRESHOLD: f32 = 105700.00;
133// pub const HEAD_OF_HOUSEHOLD_BRACKET_4_THRESHOLD: f32 = 201750.00;
134// pub const HEAD_OF_HOUSEHOLD_BRACKET_5_THRESHOLD: f32 = 256200.00;
135// pub const HEAD_OF_HOUSEHOLD_BRACKET_6_THRESHOLD: f32 = 640600.00;
136// pub const HEAD_OF_HOUSEHOLD_BRACKET_7_THRESHOLD: f32 = f32::MAX;