Skip to content

Instantly share code, notes, and snippets.

@KartikWatts
Last active February 19, 2023 13:43
Show Gist options
  • Save KartikWatts/0fe8dd94d6cd314025e0a3ef2b8ccf5c to your computer and use it in GitHub Desktop.
Save KartikWatts/0fe8dd94d6cd314025e0a3ef2b8ccf5c to your computer and use it in GitHub Desktop.
New API Response for /available-batches API endpoint
// API*******************************
// **********************************
// EndPoint: `/available-batches/{batchId}`
// RequestMethod: GET
// PayLoad: month={month}&year={year}
// **********************************
// Response**************************
// **********************************
// "specialTrekType" is the *new field
// 1. Normal Trek
{
"batchId": 7453,
"trekId": 64,
"familyTrek": false,
"parentTrekId": null,
"trekName": "Gaumukh Tapovan",
"startDate": "2023-02-22T00:00:00",
"endDate": "2023-02-28T00:00:00",
"privateBatch": false,
"status": "ACTIVE",
"trekFee": 1,
"taxPercentage": 5,
"availableSlots": 100,
"availableWaitingListSlots": 0,
"trekDifficulty": "MODERATE_DIFFICULT",
"specialTrekType": null
}
// 2. Special Trek ( General, Except in Family Trek `parentTrekId` is Not Null)
{
"batchId": 7454,
"trekId": 64,
"familyTrek": false,
"parentTrekId": null,
"trekName": "Gaumukh Tapovan",
"startDate": "2023-02-23T00:00:00",
"endDate": "2023-02-28T00:00:00",
"privateBatch": false,
"status": "ACTIVE",
"trekFee": 1,
"taxPercentage": 5,
"availableSlots": 100,
"availableWaitingListSlots": 0,
"trekDifficulty": "MODERATE_DIFFICULT",
"specialTrekType": {
"id": 2,
"name": "Stargazing"
}
}
// 3. Family Trek
{
"batchId": 7458,
"trekId": 64,
"familyTrek": true,
"parentTrekId": 64,
"trekName": "Gaumukh Tapovan",
"startDate": "2023-02-25T00:00:00",
"endDate": "2023-02-28T00:00:00",
"privateBatch": false,
"status": "ACTIVE",
"trekFee": 1,
"taxPercentage": 5,
"availableSlots": 100,
"availableWaitingListSlots": 0,
"trekDifficulty": "MODERATE_DIFFICULT",
"specialTrekType": {
"id": 1,
"name": "Family"
}
}
// **********************************
// List of Special Treks**************************
// **********************************
[
{
"id": 1,
"name": "Family"
},
{
"id": 2,
"name": "Stargazing"
},
{
"id": 3,
"name": "Assisted DIY"
},
{
"id": 4,
"name": "Birdwatching"
},
{
"id": 5,
"name": "Adventure Therapy"
},
{
"id": 6,
"name": "Seniors Only"
},
{
"id": 7,
"name": "Women Only"
},
{
"id": 8,
"name": "Photography"
}
]
// **********************************
@dharmoumita11
Copy link

I believe all special treks will have a parent trek id.
@KartikWatts please confirm once with Kabir or Nandana.

@kabir4691
Copy link

@dharmoumita11 Special treks won't have a parent trek id. In fact, we will be removing that column altogether in the future. I'll clarify the logic to you on call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment