Skip to content
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 @@ -15,7 +15,7 @@ import {
import type { Engagement, EngagementAssignment } from '../../lib/models'
import {
formatCurrencyAmount,
formatStandardHoursPerWeek,
formatStandardHoursPerDay,
} from '../../lib/utils/currency.utils'
import { formatDate } from '../../lib/utils/date.utils'
import { formatLocation } from '../../lib/utils/api.utils'
Expand Down Expand Up @@ -168,9 +168,9 @@ const AssignmentCard: FC<AssignmentCardProps> = (props: AssignmentCardProps) =>
() => formatDurationMonths(assignment?.durationMonths),
[assignment?.durationMonths],
)
const standardHoursPerWeekLabel = useMemo(
() => formatStandardHoursPerWeek(assignment?.standardHoursPerWeek, FALLBACK_VALUE_LABEL),
[assignment?.standardHoursPerWeek],
const standardHoursPerDayLabel = useMemo(
() => formatStandardHoursPerDay(assignment?.standardHoursPerDay, FALLBACK_VALUE_LABEL),
[assignment?.standardHoursPerDay],
)
const assignmentStatus = assignment?.status?.toLowerCase()
const showAssignedActions = assignmentStatus === 'assigned'
Expand Down Expand Up @@ -253,7 +253,7 @@ const AssignmentCard: FC<AssignmentCardProps> = (props: AssignmentCardProps) =>
</div>
<div className={styles.metaItem}>
<IconSolid.ClockIcon className={styles.metaIcon} />
<span>{`Std hrs / week: ${standardHoursPerWeekLabel}`}</span>
<span>{`Std hrs / day: ${standardHoursPerDayLabel}`}</span>
</div>
<div className={styles.metaItem}>
<IconSolid.CurrencyDollarIcon className={styles.metaIcon} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BaseModal, Button } from '~/libs/ui'
import type { Engagement, EngagementAssignment } from '../../lib/models'
import {
formatCurrencyAmount,
formatStandardHoursPerWeek,
formatStandardHoursPerDay,
} from '../../lib/utils/currency.utils'
import { formatDate } from '../../lib/utils/date.utils'

Expand Down Expand Up @@ -63,9 +63,9 @@ const AssignmentOfferModal: FC<AssignmentOfferModalProps> = (
? 'Review the details below before rejecting this offer.'
: 'Review the details below before accepting this offer.'

const agreementRateLabel = useMemo(
() => formatCurrencyAmount(assignment.agreementRate, FALLBACK_LABEL),
[assignment.agreementRate],
const paymentCycleLabel = useMemo(
() => formatCurrencyAmount(assignment.paymentCycle, FALLBACK_LABEL),
[assignment.paymentCycle],
)
const startDateLabel = useMemo(
() => formatAssignmentDate(assignment.startDate),
Expand All @@ -79,9 +79,9 @@ const AssignmentOfferModal: FC<AssignmentOfferModalProps> = (
() => formatCurrencyAmount(assignment.ratePerHour, FALLBACK_LABEL),
[assignment.ratePerHour],
)
const standardHoursPerWeekLabel = useMemo(
() => formatStandardHoursPerWeek(assignment.standardHoursPerWeek, FALLBACK_LABEL),
[assignment.standardHoursPerWeek],
const standardHoursPerDayLabel = useMemo(
() => formatStandardHoursPerDay(assignment.standardHoursPerDay, FALLBACK_LABEL),
[assignment.standardHoursPerDay],
)
const otherRemarksLabel = useMemo(
() => formatRemarks(assignment.otherRemarks),
Expand Down Expand Up @@ -135,12 +135,12 @@ const AssignmentOfferModal: FC<AssignmentOfferModalProps> = (
<span className={styles.metaValue}>{ratePerHourLabel}</span>
</div>
<div className={styles.metaItem}>
<span className={styles.metaLabel}>Standard hours per week</span>
<span className={styles.metaValue}>{standardHoursPerWeekLabel}</span>
<span className={styles.metaLabel}>Standard hours per day</span>
<span className={styles.metaValue}>{standardHoursPerDayLabel}</span>
</div>
<div className={styles.metaItem}>
<span className={styles.metaLabel}>Assignment rate per week</span>
<span className={styles.metaValue}>{agreementRateLabel}</span>
<span className={styles.metaLabel}>Payment Cycle</span>
<span className={styles.metaValue}>{paymentCycleLabel}</span>
</div>
<div className={`${styles.metaItem} ${styles.metaItemWide}`}>
<span className={styles.metaLabel}>Other remarks</span>
Expand Down
2 changes: 2 additions & 0 deletions src/apps/engagements/src/lib/models/Engagement.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export interface EngagementAssignment {
status?: string
termsAccepted?: boolean
agreementRate?: string
paymentCycle?: string
ratePerHour?: string
standardHoursPerWeek?: number
standardHoursPerDay?: number
durationMonths?: number
otherRemarks?: string
startDate?: string
Expand Down
2 changes: 1 addition & 1 deletion src/apps/engagements/src/lib/utils/currency.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const formatCurrencyAmount = (
* @param fallback Label shown when the value is absent or invalid.
* @returns Human-readable weekly hours label.
*/
export const formatStandardHoursPerWeek = (
export const formatStandardHoursPerDay = (
value?: string | number | null,
fallback = 'TBD',
): string => {
Expand Down
2 changes: 1 addition & 1 deletion src/apps/engagements/src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export { formatLocation } from './api.utils'
export { truncateText } from './application.utils'
export {
formatCurrencyAmount,
formatStandardHoursPerWeek,
formatStandardHoursPerDay,
normalizePositiveNumericValue,
} from './currency.utils'
export { formatDate } from './date.utils'
Loading