Skip to content

Commit

Permalink
Post workshop updates to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiruhayel committed Jun 25, 2024
1 parent 5472c85 commit ed0282f
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/docs/borrower-profile/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"collapsed": false,
"link": {
"type": "generated-index",
"title": "Borrowing Capacity"
"title": "Borrower Profile"
}
}
2 changes: 1 addition & 1 deletion docs/docs/borrower-profile/explore-api.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 1
sidebar_position: 3
tags:
- explore-borrower-profile-api
---
Expand Down
5 changes: 4 additions & 1 deletion docs/docs/borrower-profile/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 3
sidebar_position: 1
tags:
- borrower-profile
---
Expand All @@ -26,9 +26,12 @@ sequenceDiagram
participant PrimaryAdaptor as API GW: Create Borrower Profile
participant CreateBorrowerProfileUseCase as Create Borrower Profile Use Case
participant PutBorrowerProfileSecondaryAdapter as DynamoDB: Put Borrower Profile
participant GetBorrowerProfileSecondaryAdapter as DynamoDB: Get Borrower Profile
User->>+PrimaryAdaptor: Submit Borrower Profile Data
PrimaryAdaptor->>+CreateBorrowerProfileUseCase: Validate & Forward Data
CreateBorrowerProfileUseCase->>+GetBorrowerProfileSecondaryAdapter: Get Borrower Profile
GetBorrowerProfileSecondaryAdapter-->>-CreateBorrowerProfileUseCase: undefined
CreateBorrowerProfileUseCase->>+PutBorrowerProfileSecondaryAdapter: Store Borrower Profile Information
PutBorrowerProfileSecondaryAdapter-->>-CreateBorrowerProfileUseCase: Confirmation
CreateBorrowerProfileUseCase-->>-PrimaryAdaptor: Confirmation
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/borrowing-capacity/explore-api.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 1
sidebar_position: 3
tags:
- borrowing-capacity overview
---
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/borrowing-capacity/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
sidebar_position: 3
sidebar_position: 1
tags:
- borrowing-capacity overview
---

# Borrowing Capacity
# Overview

![Calculate Borrower's Borrowing Capacity](/img/borrowing-capacity/calculate-borrowers-borrowing-capacity.svg)

Expand Down Expand Up @@ -111,7 +111,7 @@ sequenceDiagram
CalculateBorrowingCapacityUseCase-->>CalculateBorrowingCapacityUseCase: Calculate Borrowing Capacity
CalculateBorrowingCapacityUseCase->>+PutBorrowingCapacityCalculationSecondaryAdaptor: Put Borrowing Capacity Calculation
PutBorrowingCapacityCalculationSecondaryAdaptor-->>-CalculateBorrowingCapacityUseCase: throws InternalError
CalculateBorrowingCapacityUseCase-->>-PrimaryAdaptor: throws InternalServerError
CalculateBorrowingCapacityUseCase-->>-PrimaryAdaptor: throws InternalError
PrimaryAdaptor-->>-User: {statusCode: 500, message: "Internal Server Error"}
```
### Borrower Profile Could Not Be Retrieved (500)
Expand Down
10 changes: 9 additions & 1 deletion docs/docs/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ tags:

# Deployment

## Install dependencies
## Checkout the workshop branch

1. Open a __new__ terminal

2. In the __new__ terminal, run the following:

```shell
git checkout workshop-start
```

## Install dependencies

1. In the same terminal, run the following:

```shell
pnpm i
```
Expand Down
22 changes: 6 additions & 16 deletions docs/docs/loan-application/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,14 @@ tags:

## Stories

## Create a profile
## Create a borrower profile

```mermaid
timeline
Collect Borrower Details: D.O.B, Name, Credit Score, Email Address
Create Borrower Profile: Borrower Profile Persisted
```
![Create a borrower profile story](/img/borrower/create-borrower-profile-story.svg)

## Apply for a loan

```mermaid
timeline
Get Borrower Profile : Look up Borrower Profile w/ Email Address
Collect Additional Information: Employment Status, Gross Annual Income, Monthly Expenses
Calculate Borrower's Age: Use D.O.B. from Borrower's profile.
Asses Loan Application: Uses Age,Employment Status, Gross Annual Income, Monthly E
Create Loan Application: Loan Application Persisted
```
![Apply for a loan story](/img/loan-application/apply-for-loan-story.svg)


1. User initiates a request to apply for a loan through a client application.
2. The request is received by the primary adaptor: `api-gw-apply-for-loan`.
Expand Down Expand Up @@ -124,7 +114,7 @@ sequenceDiagram
ApplyForLoanUseCase-->>ApplyForLoanUseCase: Assess Loan Application
ApplyForLoanUseCase->>+PutLoanApplicationSecondaryAdaptor: Put Loan Application
PutLoanApplicationSecondaryAdaptor-->>-ApplyForLoanUseCase: throws InternalError
ApplyForLoanUseCase-->>-PrimaryAdaptor: throws InternalServerError
ApplyForLoanUseCase-->>-PrimaryAdaptor: throws InternalError
PrimaryAdaptor-->>-User: {statusCode: 500, message: Internal Server Error}
```

Expand All @@ -142,6 +132,6 @@ sequenceDiagram
PrimaryAdaptor->>+ApplyForLoanUseCase: Validate & Forward Request
ApplyForLoanUseCase->>+GetBorrowerProfileSecondaryAdapter: Get Borrower Profile
GetBorrowerProfileSecondaryAdapter-->>-ApplyForLoanUseCase: throws BorrowerProfileDoesNotExistError
ApplyForLoanUseCase-->>-PrimaryAdaptor: throws InternalServerError
ApplyForLoanUseCase-->>-PrimaryAdaptor: throws InternalError
PrimaryAdaptor-->>-User: {statusCode: 400, message: 'Borrower with the provided email does not exist'}
```
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe.concurrent('api-aw-apply-for-loan', () => {
});
```

## Scenario 3
## New Loan Application Created (201)

Finally we want to test the successful case. To do this we create a borrower using another api and then POST the loan api with a borrower with the same email address

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ describe('ddb-put-loan-application', () => {
sk:
`LOAN_APPLICATION#${loanApplication.loanApplicationId}` +
`#TIMESTAMP#${loanApplication.timestamp}`,
borrowerEmail: loanApplication.borrowerEmail,
loanApplicationId: loanApplication.loanApplicationId,
timestamp: loanApplication.timestamp,
creditScore: loanApplication.creditScore,
Expand Down Expand Up @@ -290,6 +291,7 @@ export const putLoanApplication: PutLoanApplicationPort = async ({
Item: marshall({
pk: borrowerEmail,
sk: `LOAN_APPLICATION#${loanApplicationId}#TIMESTAMP#${timestamp}`,
borrowerEmail,
loanApplicationId,
timestamp,
creditScore,
Expand Down
7 changes: 3 additions & 4 deletions docs/docs/stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ tags:

# Stories

## Create a profile
## Create a borrower profile

![Borrower Stories](/img/borrower/create-a-borrower-profile-story.svg)
![Create a borrower profile story](/img/borrower/create-borrower-profile-story.svg)

## Get an indication of my borrowing capacity


![Borrowing Capacity Stories](/img/borrowing-capacity/borrowing-capacity-story.svg)
![Get an indication of my borrowing capacity story](/img/borrowing-capacity/borrowing-capacity-story.svg)
3 changes: 0 additions & 3 deletions docs/static/img/borrower/create-a-borrower-profile-story.svg

This file was deleted.

Loading

0 comments on commit ed0282f

Please sign in to comment.