Skip to content

Commit

Permalink
add a few more fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mogii committed Dec 21, 2024
1 parent b7a913f commit d75b7dd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
8 changes: 7 additions & 1 deletion __snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3299,10 +3299,13 @@ Object {
"agentRef": "2356674/1",
"bookingId": "316559",
"bookingStatus": "Quotation",
"canEdit": true,
"enteredDate": "2024-09-12",
"name": "2356674/1 Sean Conta",
"ref": "ALFI393706",
"serviceLines": Array [
Object {
"linePrice": "187795",
"optionId": "LONHOSANLONBFBDLX",
"optionName": "Bed and Full Buffet Breakfast",
"paxConfigs": Array [
Expand All @@ -3320,7 +3323,7 @@ Object {
"personId": "628199",
},
],
"roomType": "DB",
"roomType": "Double",
},
],
"paxList": Array [
Expand All @@ -3333,8 +3336,11 @@ Object {
"personId": "628199",
},
],
"quantity": 4,
"serviceLineId": "745684",
"startDate": "2025-08-13",
"supplierId": null,
"supplierName": "Sanderson",
},
],
"totalPrice": "187795",
Expand Down
6 changes: 2 additions & 4 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ const axios = require('axios');
const path = require('path');
const xml2js = require('xml2js');
const R = require('ramda');
// const { typeDefs: itineraryProductTypeDefs, query: itineraryProductQuery } = require('./node_modules/ti2/controllers/graphql-schemas/itinerary-product');
// const { typeDefs: itineraryBookingTypeDefs, query: itineraryBookingQuery } = require('./node_modules/ti2/controllers/graphql-schemas/itinerary-booking');
const { typeDefs: itineraryProductTypeDefs, query: itineraryProductQuery } = require('../ti2/controllers/graphql-schemas/itinerary-product');
const { typeDefs: itineraryBookingTypeDefs, query: itineraryBookingQuery } = require('../ti2/controllers/graphql-schemas/itinerary-booking');
const { typeDefs: itineraryProductTypeDefs, query: itineraryProductQuery } = require('./node_modules/ti2/controllers/graphql-schemas/itinerary-product');
const { typeDefs: itineraryBookingTypeDefs, query: itineraryBookingQuery } = require('./node_modules/ti2/controllers/graphql-schemas/itinerary-booking');

const xmlParser = new xml2js.Parser();
const hash = require('object-hash');
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"jsonwebtoken": "^8.5.1",
"moment": "^2.29.1",
"ramda": "^0.27.1",
"ti2": "^1.0.80",
"ti2": "^1.0.82",
"underscore": "^1.13.4",
"xml-js": "^1.6.11",
"xml2js": "^0.4.23"
Expand Down
5 changes: 5 additions & 0 deletions resolvers/itinerary.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const resolvers = {
totalPrice: R.path(['TotalPrice']),
travelDate: R.path(['TravelDate']),
enteredDate: R.path(['EnteredDate']),
canEdit: root => root.ReadOnly === 'N' && root.CanAddServices === 'Y',
serviceLines: booking => {
let Services = R.pathOr([], ['Services', 'Service'], booking);
if (!Array.isArray(Services)) Services = [Services];
Expand All @@ -35,11 +36,15 @@ const resolvers = {
},
ServiceLine: {
serviceLineId: R.path(['ServiceLineId']),
supplierId: R.path(['ProductId']),
supplierName: R.path(['SupplierName']),
optionId: R.path(['Opt']),
optionName: R.path(['Description']),
startDate: R.path(['Date']),
paxList: R.path(['paxList']),
paxConfigs: R.path(['paxConfigs']),
linePrice: R.path(['LinePrice']),
quantity: R.path(['SCUqty']),
},
PaxConfig: {
roomType: px => {
Expand Down

0 comments on commit d75b7dd

Please sign in to comment.