---
# System prepended metadata

title: Untitled

---

## FareLock (Thor)

### Outline
Provide user freedom from fluctuating price by locking the current fare for a time interval by paying small token.
![](https://i.imgur.com/Qb2E7LZ.png)

---
### Search Response:

We will add new FareLockInfo struct on each fare levels. (inside `f` and `al`) such as
`{"li":{"f":200, "e":3}}`
where
* li: FareLockInfo 
* f: FareLock price
* e: expiry

**Field Details**
* `li: <Type: Struct>` FareLockInfo is the root struct that contains details related to farelock
* `f: <Type: int>` Farelock initial price.
* `e: <Type: int>` index of expiry datetime (stored in "mv"). 

---
### FareLock Review API
A proto based API which accepts the following field in proto request:
![](https://i.imgur.com/fRrZUHt.png)

**Request Fields:**
* DeptTime
* FareKey
* RecommendationKey

**Response Fields:**
* IsAvailable
* Fare
* Expiry

**Field Details**
 * `DeptTime: <Type: string>` Departure Date in YYYY-MM-DD format.
 * `RecommendationKey:<Type: string>` RecommendationKey the unique key for the entire flight (*as passed by mmt search service*).
 * `FareKey: <Type: string>` FareKey is the unique for each fare of the flight. 
 * `IsAvailable: <Type: boolean>` IsAvailable is a boolean stating if FareLock is still available or not.
 * `Expiry <Type: string>` Expiry time till which farelock is valid. (in 2006-01-02 15:04 format)
 
---

## Additional Services

### Meta Cache
A aerospike cache to store meta deta for each flight.

**Cache Key:** Recommendation key (unique flight level identifier)

**Content:**
* FareDetails: map<FareKey, FareInfo>
* FareInfo:
    * PNR fare info 

**TTL:** 3 hours
**HostInfo:**
* Host:
* SetName:
* BinName:

**Field Details**
* `FareDetails: <Type: map<FareKey, FareInfo>`: Store details specific to each Fare
* `FareKey: <Type: string>` Unique identifiers for each fare.
*(preferably ProductClass + BookingClass+ FareBasis)*
* `FareInfo <type: struct>`: Store attribute of each fare.



---