The remaining classes to be defined follow the same logic as described in the previous section. Again, the main challenge is to correctly define the fields that you plan to use. For this purpose, we simply refer back to the original data structures described earlier in the chapter. The key classes that we need include classes to represent the purchases and customers collections. Some example Python entity classes for these can be found as follows:
- The Purchases collection: /path/to/repo/chapters/04/src/sweetscomplete/entity/purchase.py
- The Customers collection: /path/to/repo/chapters/04/src/sweetscomplete/entity/customer.py
The common collection is a simple sequence of documents, each of which has a key and an associated list or dictionary. The Python class associated with this collection can be found in the purchases collection, at /path/to/repo/chapters/04/src/sweetscomplete/entity/common.py.