---
# System prepended metadata

title: Moto GP and Whilter
tags: [Moto GP]

---

# :stadium: Moto GP

###### tags: `customer`

> Event is used in two context. Business context refer event as sporting event, musical event and movie show. In technical context it refere to kafka event.
> To distiguish the two concepts we will use work **message** for technical context where as **event** for business context.

## TODO
1. Text support to microservices
2. Get csv dump from Bookmyshow


## Sample ticket

![](https://hackmd.io/_uploads/HJPS5HKn2.jpg)

### Movie

| Fields          | Value               |
| ----------------- |:----------------------- |
| Event  Name     | Movie (Mission Impossible: Dead Reckoning - Part 1)  |
| Venue       | PVR: Pacific, Subhash Nagar(4DX), Delhi  |
| Seating Zone | Screen 6     |
| Seating Area         | Prime     |
| Seats        | G7,G8,G9,G10,G11,G12    | 
| Booking Id or QR Code      | WTH4FML    | 


### MotoGP

#### Fixed Seats
| Fields          | Value               |
| ----------------- |:----------------------- |
| Event  Name     | MotoGp  |
| Venue       | Gautam Buddga Circuit, Greater Noida  |
| Seating Zone | Main Grand Stand Upper Tier     |
| Seating Area         | Box 4     |
| Seats        | G7,G8,G9,G10,G11,G12    | 
| Booking Id or QR Code      | WTH4FML    | 

#### Flexible Seats
| Fields          | Value               |
| ----------------- |:----------------------- |
| Event  Name     | MotoGp  |
| Venue       | Gautam Buddga Circuit, Greater Noida  |
| Seating Zone | Classic Stand 1 West     |
| Seating Area         |      |
| Seats        |    | 
| Booking Id or QR Code      | WTH4FML    | 

## Knowldege
### Collections
1. **/collection/entertainment/ticket_type**
    a. One Time Ticket (Movie)	
    b. Multiple Day One Ticket (Moto GP)	
    c. Multiple Day Multiple Ticket (test match)
2. **/collection/entertainment/venue_type**
    a. Cinema	
    b. Auditorium	
    c. Stadium
3. **/collection/entertainment/seating_type**
    a. Fixed	
    b. Flexible
4. **/collection/entertainment/city**
    a. Greater Noida
    b. Delhi
    c. Gurgaon
    d. ...
### Entities
1. **/entity/entertainment/venue**
    a. /biz_id/entertainment/venue
    b. /name/entertainment/venue
    c. __/attribute/entertainment/venue/city__ (symbolic quantity)
    d. __/attribute/entertainment/venue/type__ (symbolic quantity)
    e. __/attribute/entertainment/venue/location__ : /quantity/entertainment/spatial/lat_long (Optional)
    f. __/predicate/entertainment/venue_has_seating_zone__

2. **/entity/entertainment/seating_zone**
    a. __/predicate/entertainment/seating_zone_in_venue__
    b. __/attribute/entertainment/seating_zone/seating_type__ (symbolic quantity)(/collection/entertainment/seating_type)
    c. __/attribute/entertainment/seating_zone/view_video_url__ (reference quantity)
    d. __/attribute/entertainment/seating_zone/navigation_video_url__ (reference quantity)
    e. __/name/entertainment/seating_zone__
    f. __/predicate/entertainment/seating_area_in_seating_zone__

3. **/entity/entertainment/seating_area** 
    a. __/predicate/entertainment/seating_area_has_seats__ 
    b. __/predicate/entertainment/seating_area_is_in_zone__
    c. __/name/entertainment/seating_area__
    d. __/attribute/entertainment/seating_area/seating_map_image_url__ (reference quantity)

4. **/entity/entertainment/seat**
    a. __/name/entertainment/seat_label__
    b. __/predicate/entertainment/seat_is_in_seating_area__
    c. __/attribute/entertainment/seat/is_corner__ (binary quantity)
    d. __/attribute/entertainment/seat/row_index__ (numeric quantity)
    e. __/attribute/entertainment/seat/column_index__ (numeric quantity)
    
5. **/entity/entertainment/event**
    a. __/attribute/entertainment/event/ticket_type__ > /collection/entertainment/ticket_type (symbolic quantity)
    b. __/predicate/entertainment/event_at_venue__
    c. __/predicate/entertainment/event_has_presentation__
    d. __/attribute/entertainment/event/start_time__ (temporal quantity)
    e. __/attribute/entertainment/event/duration__ (temporal quantity)
    f. __/predicate/entertainment/event_has_template__ (how to manage many)
6. **/entity/entertainment/presentation** (movie, moto gp)
    a. __/name/entertainment/presentation__
    b. __/predicate/entertainment/presentation_has_event__ (how to manage many)

7. **/entity/common/template**
    a. __/biz_id/common/template
    b. __/attribute/common/template_url__ (reference quantity)
    c. __/predicate/entertainment/template_belong_to_event__
    
    
### Message
**/event/entertainment/video_ticket**
| Template Id	| /biz_id/entertainment/template |
| ----------------- |----------------------- |
| Template Uri	| /quantity/entertainment/reference| 
| Promotion Uri	| /quantity/entertainment/reference| 
| Seating Navigation Video Uri| 	/quantity/entertainment/reference| 
| Seating Zone View Uri| 	/quantity/entertainment/reference| 
| Seating Image Uri| 	/quantity/entertainment/reference| 
| QR Code Image Uri| 	/quantity/entertainment/reference| 
| Booking Id	| /quantity/entertainment/atomic/text| 
| Seats	| /quantity/entertainment/compound/bag | 
| Customer Name	| /quantity/entertainment/atomic/text| 
| Mobile	| /quantity/entertainment/atomic/text| 

#### Start Message
1. Booking Id (Same as QR Code)
2. Customer Name
3. Mobile
4. Seats - /quantity/entertainment/compound/bag
5. EventId
6. Template biz id
#### Final Message
1. Booking Id (Same as QR Code)
2. Name
3. Mobile
4. Seats - /quantity/entertainment/compound/bag
5. Seating Area - entity
6. Seating zone - entity
7. Event name
8. Template Uri
9. Promotion Uri
10. Seating Navigation Video Uri
11. Seating Zone View Uri
12. QR Code Image Uri

## :floppy_disk: Database Infrastructure
1. Mongo DB
2. Redis
3. ArangoDB
4. Kafka
5. S3 Bucket

## :computer: Microservices
### Reusable Services
1. UI (need to add simple support for text and new services)
2. Schema services (multiple)
3. Bootstrap (need to support topics for new services. see below)
4. Kubernetes (need to support deployment of new services. see below)
5. File Listener Service (need support for S3)
6. Ingestion 
7. Filter
8. Enrich
9. Knowledge services 
10. API Gateway

### New Services
1. S3 Listener
2. QR Code image generator
3. Image service (java + node)
4. MLT Service
5. Notification service - (it also save mobile to video url mapping)
6. Additional enrichment ??


## :fountain: Workflow

> Runtime view of pipeline.

### Step 1: Ingestion
Pipeline will be initiated by file ingestion. There will be listener on bucket that will send a message.

#### Sub Step 1.1: S3 Listener
Capture an message (s3 event) that file is added to bucket. Only important field in messages is S3 url. A kafka message will be generated and put in topic name **bucket-topic**.

**bucket-topic** will be manually created as we all as **S3-listener** will be manually deployed. It will not be part of DAG.

_Naming convenetions for file_ : eventId_event-stage.csv

#### Sub Step 1.2: Ingestion
Following are properties in transaction event
1. Booking Id (Same as QR Code) - text quantity
2. Customer Name - text quantity
3. Mobile - text quantity
4. Seats /quantity/entertainment/compound/bag
5. Event id - bizId
6. Template id - biz Id

### Step 2: Filter
Filter events if event date is post event date

### Step 3: Enrich
1. Event Instance
2. Template Instance
3. Seating Area
4. Seating Zone



