Challenge 21
Big Ice Cream Co is the largest ice cream franchisor in the US. Each of their 100+ franchisees has between 1 and 25 locations. Each location tracks its customer satisfaction score which can be below average, average, or above average. The CEO of Big Ice Cream Co wants to see a report that shows the customer satisfaction scores for each location grouped by franchisee.
Example:
| franchiseeId | franchiseeName | belowAverage | average | aboveAverage | totalLocations |
|---------------------|---------------:|--------------|---------|--------------|----------------||
search | True | 1 | 10 | 14 | 25 ||
institutionCodes | False | 10 | 3 | 0 | 13 ||
aggregatorPartnerId | True | 0 | 3 | 0 | 3 |
This data is stored in the franchising MongoDB, there are two collections:
1. franchisee
2. locations
Franchisee schema
{ companyName: { type: String }, signedDate: { type: Date }, owner: { type: String } }
Locations Schema
{ franchiseeId: { type: ObjectId }, address: { state: { type: String }, city: { type: String }, zip: { type: String }, streetAddress: { type: String }, secondaryAddress: { type: String } }, customerSatisfactionScore: { type: String, enum : ['below average','average', 'above average'] } }