Advise product based on customer profileIT

A customer can have whatever they want as long as it is Salame. At least for now...

Gioseppo selects the customer profile when offering products to his customers. See the details about this story here.
See also Show extra content to customerIT

Contents

Suggest to customer with magic profile the cheapest products

Specification

Given the available products are
A "(1st Cheapest) Salume" at "EUR 11,11" regarded as "NORMAL" with "49,99" percentage of fat
A "(2nd Cheapest) Salume" at "EUR 29,55" regarded as "NORMAL" with "31,00" percentage of fat
A "(Expensive) & Light" at "EUR 57,37" regarded as "NORMAL" with "33,50" percentage of fat
A "(3rd Cheapest) Salume" at "EUR 41,60" regarded as "TRADITIONAL" with "37,00" percentage of fat
And a "(Very Expensive) Premium" at "EUR 73,23" regarded as "TRADITIONAL" with "38,00" percentage of fat

When requesting best offer for a customer considered "Magic"

Then the first suggestion for customer is the "(1st Cheapest) Salume" at "EUR 11,11" regarded as "NORMAL" with "49,99" percentage of fat
And second suggested product is the "(2nd Cheapest) Salume" at "EUR 29,55" regarded as "NORMAL" with "31,00" percentage of fat
And third suggested product is the "(3rd Cheapest) Salume" at "EUR 41,60" regarded as "TRADITIONAL" with "37,00" percentage of fat

And number of advised products is 5
And the content type is APPLICATION_XML_CHARSET_UTF8

Test results:

Test passed

request from Customer to Supplier

http://localhost:8081/salume/supplier/advise/for/Magic

response from Supplier to Customer

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <product-advisor> <products> <product> <id>382</id> <name>(1st Cheapest) Salume</name> <price>EUR 11,11</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>49,99</fat-percentage> </product> <product> <id>383</id> <name>(2nd Cheapest) Salume</name> <price>EUR 29,55</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>31,00</fat-percentage> </product> <product> <id>385</id> <name>(3rd Cheapest) Salume</name> <price>EUR 41,60</price> <reputation>traditional</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>37,00</fat-percentage> </product> <product> <id>384</id> <name>(Expensive) &amp; Light</name> <price>EUR 57,37</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>33,50</fat-percentage> </product> <product> <id>386</id> <name>(Very Expensive) Premium</name> <price>EUR 73,23</price> <reputation>traditional</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>38,00</fat-percentage> </product> </products> </product-advisor>

Sequence Diagram

Customer Customer Supplier Supplier request response

Suggest to customer with healthy profile the products with less fat

Specification

Given the available products are
A "(Super Fat) Salume" at "EUR 11,11" regarded as "NORMAL" with "49,99" percentage of fat
A "(Lightest) Salume" at "EUR 29,55" regarded as "NORMAL" with "31,00" percentage of fat
A "(Light) Salume" at "EUR 57,37" regarded as "NORMAL" with "33,50" percentage of fat
A "(3rd Lightest) Salume" at "EUR 41,60" regarded as "TRADITIONAL" with "37,00" percentage of fat
And a "(Fat) Premium" at "EUR 73,23" regarded as "TRADITIONAL" with "38,00" percentage of fat

When requesting best offer for a customer considered "Healthy"

Then the first suggestion for customer is the "(Lightest) Salume" at "EUR 29,55" regarded as "NORMAL" with "31,00" percentage of fat
And second suggested product is the "(Light) Salume" at "EUR 57,37" regarded as "NORMAL" with "33,50" percentage of fat
And third suggested product is the "(3rd Lightest) Salume" at "EUR 41,60" regarded as "TRADITIONAL" with "37,00" percentage of fat

And number of advised products is 5
And the content type is APPLICATION_XML_CHARSET_UTF8

Test results:

Test passed

request from Customer to Supplier

http://localhost:8081/salume/supplier/advise/for/Healthy

response from Supplier to Customer

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <product-advisor> <products> <product> <id>393</id> <name>(Lightest) Salume</name> <price>EUR 29,55</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>31,00</fat-percentage> </product> <product> <id>394</id> <name>(Light) Salume</name> <price>EUR 57,37</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>33,50</fat-percentage> </product> <product> <id>395</id> <name>(3rd Lightest) Salume</name> <price>EUR 41,60</price> <reputation>traditional</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>37,00</fat-percentage> </product> <product> <id>396</id> <name>(Fat) Premium</name> <price>EUR 73,23</price> <reputation>traditional</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>38,00</fat-percentage> </product> <product> <id>392</id> <name>(Super Fat) Salume</name> <price>EUR 11,11</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>49,99</fat-percentage> </product> </products> </product-advisor>

Sequence Diagram

Customer Customer Supplier Supplier request response

Only suggest traditional products with cheapest ones first to experts

Expert clients are more demanding and won't accept anything that is not considered traditional long-honored products.

Specification

Given the available products are
A "(Normal) Cheap Salume" at "EUR 11,11" regarded as "NORMAL" with "49,99" percentage of fat
A "(Normal) Light Salume" at "EUR 29,55" regarded as "NORMAL" with "31,00" percentage of fat
A "(Normal) Salume" at "EUR 57,37" regarded as "NORMAL" with "33,50" percentage of fat
A "(Traditional Less Expensive) Salume" at "EUR 41,60" regarded as "TRADITIONAL" with "37,00" percentage of fat
And a "(Traditional More Expensive) Premium" at "EUR 73,23" regarded as "TRADITIONAL" with "38,00" percentage of fat

When requesting best offer for a customer considered "Expert"

Then the first suggestion for customer is the "(Traditional Less Expensive) Salume" at "EUR 41,60" regarded as "TRADITIONAL" with "37,00" percentage of fat
And second suggested product is the "(Traditional More Expensive) Premium" at "EUR 73,23" regarded as "TRADITIONAL" with "38,00" percentage of fat

And number of advised products is 2
And the content type is APPLICATION_XML_CHARSET_UTF8

Test results:

Test passed

request from Customer to Supplier

http://localhost:8081/salume/supplier/advise/for/Expert

response from Supplier to Customer

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <product-advisor> <products> <product> <id>390</id> <name>(Traditional Less Expensive) Salume</name> <price>EUR 41,60</price> <reputation>traditional</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>37,00</fat-percentage> </product> <product> <id>391</id> <name>(Traditional More Expensive) Premium</name> <price>EUR 73,23</price> <reputation>traditional</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>38,00</fat-percentage> </product> </products> </product-advisor>

Sequence Diagram

Customer Customer Supplier Supplier request response

Suggest to customer with gourmet profile the most expensive products

Specification

Given the available products are
A "(1st Cheapest) Salume" at "EUR 11,11" regarded as "NORMAL" with "49,99" percentage of fat
A "(2nd Cheapest) Salume" at "EUR 29,55" regarded as "NORMAL" with "31,00" percentage of fat
A "(Expensive) & Light" at "EUR 57,37" regarded as "NORMAL" with "33,50" percentage of fat
A "(3rd More Expensive) Salume" at "EUR 41,60" regarded as "TRADITIONAL" with "37,00" percentage of fat
And a "(Very Expensive) Premium" at "EUR 73,23" regarded as "TRADITIONAL" with "38,00" percentage of fat

When requesting best offer for a customer considered "Gourmet"

Then the first suggestion for customer is the "(Very Expensive) Premium" at "EUR 73,23" regarded as "TRADITIONAL" with "38,00" percentage of fat
And second suggested product is the "(Expensive) & Light" at "EUR 57,37" regarded as "NORMAL" with "33,50" percentage of fat
And third suggested product is the "(3rd More Expensive) Salume" at "EUR 41,60" regarded as "TRADITIONAL" with "37,00" percentage of fat

And number of advised products is 5
And the content type is APPLICATION_XML_CHARSET_UTF8

Test results:

Test passed

request from Customer to Supplier

http://localhost:8081/salume/supplier/advise/for/Gourmet

response from Supplier to Customer

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <product-advisor> <products> <product> <id>381</id> <name>(Very Expensive) Premium</name> <price>EUR 73,23</price> <reputation>traditional</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>38,00</fat-percentage> </product> <product> <id>379</id> <name>(Expensive) &amp; Light</name> <price>EUR 57,37</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>33,50</fat-percentage> </product> <product> <id>380</id> <name>(3rd More Expensive) Salume</name> <price>EUR 41,60</price> <reputation>traditional</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>37,00</fat-percentage> </product> <product> <id>378</id> <name>(2nd Cheapest) Salume</name> <price>EUR 29,55</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>31,00</fat-percentage> </product> <product> <id>377</id> <name>(1st Cheapest) Salume</name> <price>EUR 11,11</price> <reputation>special</reputation> <variety>Chorizo</variety> <image>https://upload.wikimedia.org/wikipedia/commons/3/3f/Palacioschorizo.jpg</image> <description>https://it.wikipedia.org/w/api.php?format=xml&amp;action=query&amp;prop=extracts&amp;exintro=&amp;explaintext=&amp;titles=Chorizo</description> <fat-percentage>49,99</fat-percentage> </product> </products> </product-advisor>

Sequence Diagram

Customer Customer Supplier Supplier request response