From 29c43b0b0210c1dc808834ac7b9afd1811f86218 Mon Sep 17 00:00:00 2001 From: Abdul Redd <104014874+abdulredd@users.noreply.github.com> Date: Mon, 27 Jan 2025 18:14:23 -0500 Subject: [PATCH] mod 2 bulk discounts update --- .../bulk_discounts/back_end_requirements.md | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/module2/projects/bulk_discounts/back_end_requirements.md b/module2/projects/bulk_discounts/back_end_requirements.md index df9cb7f..3745235 100644 --- a/module2/projects/bulk_discounts/back_end_requirements.md +++ b/module2/projects/bulk_discounts/back_end_requirements.md @@ -50,9 +50,9 @@ body: "id": "1", "type": "bulk_discount", "attributes": { - "percentage": 20, + "name": "Buy 10 Get 20% Off", "quantity_threshold": 10, - "merchant_id": 3 + ... remaining attributes go here ... } } } @@ -76,20 +76,21 @@ body: "id": "1", "type": "bulk_discount", "attributes": { - "percentage": 20, + "name": "Buy 10 Get 20% Off", "quantity_threshold": 10, - "merchant_id": 3 + ... remaining attributes go here ... } }, { "id": "2", "type": "bulk_discount", "attributes": { - "percentage": 30, + "name": "Buy 15 Get $15 Off", "quantity_threshold": 15, - "merchant_id": 3 + ... remaining attributes go here ... } } + ... remaining merchant discounts go here ... ] } ``` @@ -111,9 +112,9 @@ body: "id": "1", "type": "bulk_discount", "attributes": { - "percentage": 25, - "quantity_threshold": 12, - "merchant_id": 3 + "name": "Buy 10 Get 20% Off", + "quantity_threshold": 10, + ... remaining attributes go here ... } } } @@ -122,7 +123,9 @@ body: **Sad Paths to consider**: * The percentage exceeds 100 or is below 0. -* The quantity threshold is invalid (e.g., less than 1). +* The quantity threshold is invalid (i.e., less than 1). +* Merchant already has 5 active discounts +* Discount code entered is NOT unique @@ -135,10 +138,12 @@ Deletes a bulk discount, if eligible. ```json status: 204 +body: *No Content* ``` **Sad Paths to consider**: -- The bulk discount cannot be deleted if it is tied to pending invoices. + +* The bulk discount cannot be deleted if it is tied to pending invoices. @@ -147,14 +152,14 @@ status: 204 @@ -236,7 +257,12 @@ body: