{/* Licensed to the Apache Software Foundation (ASF) under one */}
{/* or more contributor license agreements. See the NOTICE file */}
{/* distributed with this work for additional information */}
{/* regarding copyright ownership. The ASF licenses this file */}
{/* to you under the Apache License, Version 2.0 (the */}
{/* "License"); you may not use this file except in compliance */}
{/* with the License. You may obtain a copy of the License at */}
{/*  */}
{/* http://www.apache.org/licenses/LICENSE-2.0 */}
{/*  */}
{/* Unless required by applicable law or agreed to in writing, */}
{/* software distributed under the License is distributed on an */}
{/* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY */}
{/* KIND, either express or implied. See the License for the */}
{/* specific language governing permissions and limitations */}
{/* under the License. */}

import { Meta, Story } from "@storybook/blocks";
import * as AffordabilityCalculation from "./AffordabilityCalculation.stories";

<Meta title="Use cases/Loan Originations/Functions/Affordability Calculation" of={AffordabilityCalculation} />

The **Affordability Calculation** Business Knowledge Model is a
[Boxed Function](/docs/boxed-expressions-function--overview) expression.
It has five parameters," Monthly Income", "Monthly Repayments", "Monthly Expenses",
"Risk Category", and "Required Monthly Installment". The function contains a
[Boxed Context](/docs/boxed-expressions-context--overview) on
its body with two entries. The "Disposable Income" entry is a [Boxed Literal](/docs/boxed-expressions-literal--overview)
which makes a calculation based on the monthly "Income", "Repayments"
and "Expenses". The "Credit Contingency Factor" entry has a
[Decision Table](/docs/boxed-expressions-decision-table--overview), which returns
the "Credit Contingency Factor" value based on the "Risk Category".
The result of the [Boxed Context](/docs/boxed-expressions-context--overview),
which is the return of the [Boxed Function](/docs/boxed-expressions-function--overview),
returns a boolean value based on the "Disposable Income", "Credit Contingency Factor"
and "Required Monthly Installment".

<Story of={AffordabilityCalculation.Expression} />
