From 0e3775b395e2a107161d4383563cc1c18cdcccac Mon Sep 17 00:00:00 2001 From: Mathias Fredriksen Date: Fri, 12 Jan 2024 13:34:25 +0100 Subject: [PATCH 1/3] First test --- domain-model.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/domain-model.md b/domain-model.md index 653f474..631169b 100644 --- a/domain-model.md +++ b/domain-model.md @@ -1 +1,24 @@ -#Domain Models In Here \ No newline at end of file +#Domain Models In Here +# Custom Domain Model + +### Excercise 1 + +``` +As a supermarket shopper, +So that I can pay for products at checkout, +I'd like to be able to know the total cost of items in my basket. +``` + +| Classes | Methods | Scenario | Outputs | +|-----------------|---------------------------------------------|------------------------|---------| +| | `Checkout(List products)` | If name is in list | int cost | +| | | If name is not in list | false | + + + +``` +As an organised individual, +So that I can evaluate my shopping habits, +I'd like to see an itemised receipt that includes the name and price of the products +I bought as well as the quantity, and a total cost of my basket. +``` From b9a3e318af5a12a6c91504a953f4c0f79ba77515 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksen <70567658+KonWritesCode@users.noreply.github.com> Date: Mon, 15 Jan 2024 08:08:21 +0100 Subject: [PATCH 2/3] Update domain-model.md --- domain-model.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/domain-model.md b/domain-model.md index 631169b..4a1b50c 100644 --- a/domain-model.md +++ b/domain-model.md @@ -1,8 +1,8 @@ #Domain Models In Here # Custom Domain Model -### Excercise 1 - +### Scenario Excercise +# Purchasing products ``` As a supermarket shopper, So that I can pay for products at checkout, @@ -11,10 +11,13 @@ I'd like to be able to know the total cost of items in my basket. | Classes | Methods | Scenario | Outputs | |-----------------|---------------------------------------------|------------------------|---------| -| | `Checkout(List products)` | If name is in list | int cost | -| | | If name is not in list | false | - +| `Checkout` | `public double CalculateCost(List products)` | If there are products in list | (double) Total sum of products | +| | | If no products in list | 0 | +| | | If a product has invalid cost | -1 | +| | `bool Pay(Customer customer, double cost)` | If customer can pay | true | +| | | If customer can't pay | false | +# Receipt ``` As an organised individual, @@ -22,3 +25,7 @@ So that I can evaluate my shopping habits, I'd like to see an itemised receipt that includes the name and price of the products I bought as well as the quantity, and a total cost of my basket. ``` +| Classes | Methods | Scenario | Outputs | +|-----------------|---------------------------------------------|------------------------|---------| +| `Receipt` | `double CalculateCost(List products)` | | | +| | | If list is empty | 0 | From 01b40ac98c4bf9b074f5bbb2e34f233322dd7be9 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksen <70567658+KonWritesCode@users.noreply.github.com> Date: Mon, 15 Jan 2024 08:15:28 +0100 Subject: [PATCH 3/3] Update domain-model.md --- domain-model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain-model.md b/domain-model.md index 4a1b50c..8b6640c 100644 --- a/domain-model.md +++ b/domain-model.md @@ -28,4 +28,4 @@ I bought as well as the quantity, and a total cost of my basket. | Classes | Methods | Scenario | Outputs | |-----------------|---------------------------------------------|------------------------|---------| | `Receipt` | `double CalculateCost(List products)` | | | -| | | If list is empty | 0 | +| | 'string PrintReciept()' | | | If list is empty | 0 |