Skip to content

Commit

Permalink
Update logic for if a SAM.gov entity has exclusion status or has debt…
Browse files Browse the repository at this point in the history
… subject to offset, and only display ineligible entities text if there are at least one
  • Loading branch information
courtneymyers committed Jul 23, 2024
1 parent 0dce073 commit d5cad21
Showing 1 changed file with 52 additions and 44 deletions.
96 changes: 52 additions & 44 deletions app/client/src/routes/frfNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ export function FRFNew() {
} = entity;

const isActive = ENTITY_STATUS__c === "Active";
const isEligible =
!EXCLUSION_STATUS_FLAG__c && !DEBT_SUBJECT_TO_OFFSET_FLAG__c;
const hasExclusionStatus = EXCLUSION_STATUS_FLAG__c !== null;
const hasDebtSubjectToOffset = DEBT_SUBJECT_TO_OFFSET_FLAG__c === "Y";

const isEligible = !hasExclusionStatus && !hasDebtSubjectToOffset;

if (isActive && isEligible) object.eligible.push(entity);
if (isActive && !isEligible) object.ineligible.push(entity);
Expand Down Expand Up @@ -397,51 +399,57 @@ export function FRFNew() {
);
})}

<tr>
<td
colSpan={4}
className="font-sans-2xs !tw-whitespace-normal"
>
<strong>Ineligible SAM.gov Entities:</strong>
<br />
The following SAM.gov entities are ineligible
due to their exclusion status or a debt subject
to offset. Please visit SAM.gov to resolve these
issues.
</td>
</tr>

{samEntities.ineligible.map((entity) => {
const {
ENTITY_COMBO_KEY__c,
UNIQUE_ENTITY_ID__c,
ENTITY_EFT_INDICATOR__c,
LEGAL_BUSINESS_NAME__c,
} = entity;

return (
<tr key={ENTITY_COMBO_KEY__c}>
<th
scope="row"
className="width-15 font-sans-2xs"
{samEntities.ineligible.length > 0 && (
<>
<tr>
<td
colSpan={4}
className="font-sans-2xs !tw-whitespace-normal"
>
<TextWithTooltip
text=" "
tooltip="Ineligible SAM.gov entity"
/>
</th>
<td className="font-sans-2xs">
{UNIQUE_ENTITY_ID__c}
</td>
<td className="font-sans-2xs">
{ENTITY_EFT_INDICATOR__c || "0000"}
</td>
<td className="font-sans-2xs">
{LEGAL_BUSINESS_NAME__c}
<strong>
Ineligible SAM.gov Entities:
</strong>
<br />
The following SAM.gov entities are
ineligible due to their exclusion status or
a debt subject to offset. Please visit
SAM.gov to resolve these issues.
</td>
</tr>
);
})}

{samEntities.ineligible.map((entity) => {
const {
ENTITY_COMBO_KEY__c,
UNIQUE_ENTITY_ID__c,
ENTITY_EFT_INDICATOR__c,
LEGAL_BUSINESS_NAME__c,
} = entity;

return (
<tr key={ENTITY_COMBO_KEY__c}>
<th
scope="row"
className="width-15 font-sans-2xs"
>
<TextWithTooltip
text=" "
tooltip="Ineligible SAM.gov entity"
/>
</th>
<td className="font-sans-2xs">
{UNIQUE_ENTITY_ID__c}
</td>
<td className="font-sans-2xs">
{ENTITY_EFT_INDICATOR__c || "0000"}
</td>
<td className="font-sans-2xs">
{LEGAL_BUSINESS_NAME__c}
</td>
</tr>
);
})}
</>
)}
</tbody>
</table>
</div>
Expand Down

0 comments on commit d5cad21

Please sign in to comment.