Skip to content
Draft
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
1 change: 0 additions & 1 deletion docs/reference/Translations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3867,7 +3867,6 @@ Translation keys for the `Payroll.Common` i18n namespace.
| `status.processing` |
| `status.readyToSubmit` |
| `status.submitted` |
| `status.unprocessed` |
| `status.waitingForWireIn` |

***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,6 @@ export const AllStatusesShowcase = () => {
},

// Priority 4: Fallback Statuses
{
...createBasePayroll('unprocessed'),
payPeriod: {
...createBasePayroll('unprocessed').payPeriod,
startDate: '2025-11-12',
endDate: '2025-11-26',
},
},
{
...createBasePayroll('pending'),
processed: true,
Expand Down Expand Up @@ -399,9 +391,6 @@ export const Priority4_FallbackStatuses = () => {
const yesterday = new Date(now - 24 * 60 * 60 * 1000)

const payrolls: (Payroll & { payrollType: 'Regular' })[] = [
{
...createBasePayroll('unprocessed'),
},
{
...createBasePayroll('pending'),
processed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { normalizeToDate, getHoursUntil, getDaysUntil } from '@/helpers/dateForm
/** @internal */
export type PayrollStatusTranslationKey =
| 'processed'
| 'unprocessed'
| 'calculating'
| 'readyToSubmit'
| 'processing'
Expand Down Expand Up @@ -254,7 +253,7 @@ export const STATUS_CONFIG: StatusConfig[] = [
const daysDiff = getDaysUntil(payroll.payrollDeadline)
if (hoursDiff === null || daysDiff === null) return false

return hoursDiff > 0 && hoursDiff >= 24 && Math.ceil(daysDiff) <= 30
return hoursDiff > 0 && hoursDiff >= 24 && Math.ceil(daysDiff) <= 14
},
},
{
Expand All @@ -280,12 +279,4 @@ export const STATUS_CONFIG: StatusConfig[] = [
},
condition: payroll => !!payroll.processed,
},
{
name: 'unprocessed',
badge: {
variant: 'info',
translationKey: 'unprocessed',
},
condition: payroll => !payroll.processed && !payroll.processingRequest?.status,
},
]
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('usePayrollStatusBadges', () => {
const wireInRequest = { status: 'awaiting_funds', paymentUuid: 'payroll-1' }
const result = getPayrollStatusBadges(payroll, wireInRequest)

expect(result.badges[0]!.variant).toBe('info')
expect(result.badges).toHaveLength(0)
})
})

Expand Down Expand Up @@ -172,14 +172,6 @@ describe('usePayrollStatusBadges', () => {
})

describe('fallback statuses', () => {
it('returns Unprocessed for unprocessed payrolls without deadline', () => {
const payroll = { processed: false }
const result = getPayrollStatusBadges(payroll)

expect(result.badges[0]!.variant).toBe('info')
expect(result.badges[0]!.translationKey).toBe('unprocessed')
})

it('returns Complete for processed payrolls with past check date', () => {
const pastDate = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString()
const payroll = { processed: true, checkDate: pastDate }
Expand Down Expand Up @@ -241,7 +233,7 @@ describe('usePayrollStatusBadges', () => {
}
const result = getPayrollStatusBadges(payroll)

expect(result.badges[0]!.variant).toBe('info')
expect(result.badges).toHaveLength(0)
})

it('handles wire request with undefined status', () => {
Expand All @@ -262,15 +254,15 @@ describe('usePayrollStatusBadges', () => {
expect(result.badges[0]!.variant).toBe('info')
})

it('handles deadline beyond 30 days', () => {
it('handles deadline beyond 14 days', () => {
const futureTime = new Date(Date.now() + 45 * 24 * 60 * 60 * 1000)
const payroll = {
processed: false,
payrollDeadline: futureTime.toISOString(),
}
const result = getPayrollStatusBadges(payroll)

expect(result.badges[0]!.variant).toBe('info')
expect(result.badges).toHaveLength(0)
})

it('handles Date objects for checkDate', () => {
Expand Down
1 change: 0 additions & 1 deletion src/i18n/en/Payroll.Common.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"status": {
"processed": "Processed",
"unprocessed": "Unprocessed",
"calculating": "Calculating...",
"readyToSubmit": "Ready to submit",
"processing": "Processing",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5605,8 +5605,6 @@ export namespace Translations {
status: {
/** @defaultValue `"Processed"` */
processed: string
/** @defaultValue `"Unprocessed"` */
unprocessed: string
/** @defaultValue `"Calculating..."` */
calculating: string
/** @defaultValue `"Ready to submit"` */
Expand Down
Loading