Skip to content

Latest commit

 

History

History
73 lines (47 loc) · 3.77 KB

main.md

File metadata and controls

73 lines (47 loc) · 3.77 KB

Mobiles App - Technical Document

Note: Each section in this document is linked to a separate page that provides detailed explanations for each view, model, and serializer. By clicking on the respective links, you can explore each section in detail.

Table of Contents

Views

The Mobiles app comprises six different views, each serving a specific functionality and accessible through different routes. Below is a brief overview of each view:

  1. Nationality Views: This section covers views responsible for managing nationalities. It includes functionality for creating, updating, retrieving, and deleting nationalities.

  2. Brand Views: This section covers views responsible for managing mobile brands. It includes functionality for creating, updating, retrieving, and deleting brands.

  3. Mobile Views: This section covers views responsible for managing mobile models. It includes functionality for creating, updating, retrieving, and deleting mobile models.

  4. Variant Views: This section covers views responsible for managing mobile variants. It includes functionality for creating, updating, retrieving, and deleting variants with different colors and sizes.

  5. PriceHistory Views: This section covers views responsible for managing price histories of mobile variants. It includes functionality for creating, updating, retrieving, and deleting price histories.

  6. All Views: This section covers views that provide an overview of all mobile information at once.

Models

The Mobiles app consists of a Base model and five different models , representing essential entities within the mobile storage system. Below is an overview of each model:

  1. Base Model: Base model.

  2. Nationality: This model represents the nationality. It includes fields for storing nationality names.

  3. Brand: This model represents mobile brands, including their names and associated nationalities.

  4. Mobile: This model represents specific mobile models associated with a brand and a country.

  5. Variant: This model represents different variants of a mobile model, including color and size.

  6. PriceHistory: This model represents the price history of a mobile variant. It includes fields for storing variant prices and a status indicator.

Serializers

The Mobiles app utilizes four different serializers to convert complex data types into Python data types that can be rendered into JSON for API responses. Below is an overview of each serializer:

Note: You can find the implementation of these serializers in the serializers.py file.

  1. BrandSerializer: This serializer handles the serialization of Brand model data for API responses. It includes the name and nationality fields of the brand and also nests related Mobile objects.

  2. MobileSerializer: This serializer handles the serialization of Mobile model data for API responses. It includes the brand, model, country, and variants fields of the mobile. The serializer also nests related Variant objects.

  3. VariantSerializer: This serializer handles the serialization of Variant model data for API responses. It includes the mobile, color, size, prices, and image fields of the variant. The serializer also nests related PriceHistory objects.

  4. PriceHistorySerializer: This serializer handles the serialization of PriceHistory model data for API responses. It includes the variant, price, status, and date fields of the price history.