# talkback_session_state

session_key: ea2cb230c0ea3fa8f451cf992f86f1302b443a174389d43141fcdc2d09d3df2f
user_id: 1
agent_scope: ["1"]
created_at: 2026-06-02 15:16:26
updated_at: 2026-06-02 15:16:31.559998
history_json:
  [{"question": "claims", "answer": "This query may take longer to process due to its broad scope. Do you want to mention the time period or proceed with the current query?", "ts": "2026-06-02T15:16:31.558307", "request_id": "eb6ea7d6dcb7a19ce1129cef50ec349bc6475a875715246f672ef36421a8e880", "answer_meta": {"turn_type": "clarification", "needs_clarification": true, "consent_type": "broad_scope_processing", "intent": "ambiguous"}}]

clarification_prompt:
  This query may take longer to process due to its broad scope. Do you want to mention the time period or proceed with the current query?

clarification_context_json:
  {"intent": "ambiguous", "suggested_agent_ids": ["1"], "needs_clarification": false, "clarification_message": null, "prior_df_followup": "none", "misrouted_web": false, "clarification_agent_ids": ["1"], "consent_type": "broad_scope_processing", "captured_question": "claims"}


session_key: 66ce12ace36a0ffd8de173d1600aefdc4b6357d3c4202fa99014393de593c61d
user_id: 1
agent_scope: ["1"]
clarification_prompt: Choose how to proceed with the file search. Please select one option to continue.
created_at: 2026-06-03 07:48:14
updated_at: 2026-06-03 07:49:23.038165
history_json:
  [{"question": "24 foundation", "answer": "Could you please clarify what you're looking for with '24 foundation'? I'd be happy to help once I understand what data or information you need.", "ts": "2026-06-03T07:48:19.242321", "request_id": "af7c62716296282399cc8170e8964a44d4ae20fc62dfbd919a6e848b66b4c6e5", "answer_meta": {"turn_type": "clarification", "needs_clarification": true, "intent": "ambiguous"}}, {"question": "Clarification response: 24 foundation", "answer": "", "ts": "2026-06-03T07:48:38", "request_id": "af7c62716296282399cc8170e8964a44d4ae20fc62dfbd919a6e848b66b4c6e5"}, {"question": "Clarification response: 24 foundation", "answer": "", "ts": "2026-06-03T07:48:49", "request_id": "af7c62716296282399cc8170e8964a44d4ae20fc62dfbd919a6e848b66b4c6e5"}]

clarification_context_json:
  {"intent": "document", "suggested_agent_ids": ["1"], "needs_clarification": true, "clarification_message": "Choose how to proceed with the file search. Please select one option to continue.", "prior_df_followup": "none", "misrouted_web": false, "is_custom_file_clarification": true, "consent_type": "file_search_action", "clarification_type": "file_search_action_selection", "clarification_options": [{"id": "exact", "label": "Find the exact file", "action": "exact"}, {"id": "similar", "label": "Find similar files", "action": "similar"}], "file_cmd_parse": null}


# agents_access

agent_id: 1
agent_name: finddocuments
license_number: LICAVALON1001
license_count: 20
remain_license_count: 14
start_date: 2026-06-03
end_date: 2028-01-01
created_at: 2026-06-03 10:02:35
updated_at: 2026-06-03 11:30:25
access_key:
  Z0FBQUFBQnFIX3VzOXFJU3E2ZVEzdGIyVmN5Y2dkNmRCYm4tdlZBSm9vWTJTOXAya0JfeWtONjR6Z2dibkhJUVVEQXhjUFRsWG81SzFsMjVfT2ZKRlRRS1EwS3hfeVp6ODZhRUplV0pCc3FEWDFzUGJXT3FEWDRYcWUtVzRLRmV3dFQ5akxIX2owUHVZNWp2YXRGQUt1a0o2TGFkeG1QbnNQTkwwcXdBLThMdlIzOFBQelM4cDRVTnZ5Wkh5QmFKbkl4ZWliN19xd2o3VDBEUTNwSWdRLTNabVNwNVBBY3U4Z1ZfblhDN2EybGhPV002cUt0czNZQT0=


# agent_management

agent_id: 1
agent_name: finddocuments
agent_access: 1
endpoint: https://askme360.com/?access=1
max_row_count: 1000
extra1: {}
file: Y
data_source_type: Custom Data Source Type
default_data_source_type: Files
db_type: SQL
host: 52.4.215.148
port: 62142
username: sysadmin
password: tess360mysql
db_name: ta_US000316000245
description: This agent looks into Employee Expenses
created_at: 2026-05-11 15:19:58
updated_at: 2026-06-02 15:27:57
init_training_data:
  SELECT 
      EMPLOYEENAME,
      BRANCH,
      CITY,
      DIVISION,
      MONTH,
      YEAR,
      INPUT_MODE,
      EXPENSE_NUMBER,
      EXPENSE_SUBMISSION_DATE,
      CURRENCY_CODE_HEADER,
      STATUS,
      AMOUNT,
      TAX,
      TIP,
      TOTAL_AMOUNT,
      OTHERCHARGES,
      APPROVED_AMOUNT,
      PAYMENT_BATCH_REQUEST_ID,
      PAYMENT_COMPLETE,
      BALANCE_AMOUNT,
      PAYMENT_COMMENTS,
      PAYMENT_DATE,
      PAYMENT_AMOUNT,
      APPROVAL_MESSAGE_HEADER,
      PAYMENT_MODE,
      MERCHANT,
      CARD_NUMBER,
      CURRENCY,
      EXPENSE_LOCATION,
      EXPENSE_DATE,
      CATEGORY,
      EXPENSETYPE,
      EXPENSENOTES,
      RECEIPT,
      WITHIN_ENTITLEMENT,
      APPROVAL_MESSAGE
  FROM TR_EXPENSE_ANALYSYS_V
   


agent_id: 2
agent_name: AccidentDetails
agent_access: 2
endpoint: https://askme360.com/?access=2
max_row_count: 1000
extra1: {}
database: Y
data_source_type: Custom Data Source Type
default_data_source_type: Database
db_type: SQL
host: 52.4.215.148
port: 62142
username: sysadmin
password: tess360mysql
db_name: ta_US000316000245
description: Show all accident details of Vehicles
created_at: 2026-05-12 09:43:56
updated_at: 2026-05-12 10:34:56
init_training_data:
  SELECT
      a.VEHICLE_ACCIDENT_ID,
      wp.WORK_PLACE_NAME,
      wp.`WORK_PLACE_ABRV` AS CITY,
      t.TEAM_NAME AS ENTITY,

      -- Vehicle
      a.VEHICLE_ID,
      COALESCE(a.VEHICLE_NO, v.VEHICLE_NO) AS VEHICLE_NO,
      COALESCE(a.VIN, v.VIN) AS VIN,
      v.PLATE,
      v.YEAR AS VEHICLE_YEAR,
      mk.MAKE AS VEHICLE_MAKE,
      mdl.MODEL AS VEHICLE_MODEL,
      v.PAX AS VEHICLE_CAPACITY,

      -- Accident
      a.TRIP_DATE,
      a.ACCIDENT_DATE,
      a.ACCIDENT_LOCATION,
      a.ACCIDENT_LOCATION_GEO_CODE,
      a.ACCIDENT_REPORTED_BY,
      a.STATUS,
      a.NOTES,
      a.AREA_OF_DAMAGE,

      -- Lookup decoded fields
      a.ACCIDENT_INCIDENT_TYPE,
      accident_type.LOOKUP_MEANING AS ACCIDENT_INCIDENT_TYPE_NAME,
      a.ROAD_CONDITION,
      road_condition.LOOKUP_MEANING AS ROAD_CONDITION_NAME,
      a.ROAD_TYPE,
      road_type.LOOKUP_MEANING AS ROAD_TYPE_NAME,
      a.SEVERITY,
      severity.LOOKUP_MEANING AS SEVERITY_NAME,
      a.WEATHER_CONDITION,
      weather.LOOKUP_MEANING AS WEATHER_CONDITION_NAME,
      a.DAY_LIGHT_CONDITION,
      daylight.LOOKUP_MEANING AS DAY_LIGHT_CONDITION_NAME,
      a.VEHICLE_DIRECTION,
      direction_lkp.LOOKUP_MEANING AS VEHICLE_DIRECTION_NAME,

      -- Driver
      a.DRIVER_ID,
      a.DRIVER_NAME,
      a.DRIVER_ADDRESS,
      a.DRIVER_EMAIL,
      a.DRIVER_BUSINESS_PHONE,
      a.DRIVER_HOME_PHONE,
      a.DRIVER_LICENSE_NO,
      a.DRIVER_LICENSE_ISSUED_STATE,
      a.DRIVER_LICENSE_EXP_DATE,
      a.DRIVER_INJURED,

      -- Flags
      a.CARGO_DAMAGED,
      a.HAZARDOUS,
      a.OTHER_DRIVERS_INVOLCED,
      a.PROPERTY_DAMAGED,
      a.INJURED,
      a.OTHER_VEHICLES_INVOLVED,
      a.PASSENGER_INVOLVED,
      a.POLICE_INVOLVED,
      a.POLICE_AREA,
      a.VEHICLE_DRIVABLE,
      a.TOW_COMPANY,
      a.TOW_COMPANY_PHONE,
      a.PREVENTABLE,
      a.DOT_REPORTABLE,
      a.SCHOOL_ZONE,
      a.CONSTRUCTION_ZONE,
      a.ON_PREMISE,
      a.TELEMATICS,
      a.EVENT_RECORDER,
      a.AVOIDANCE_SYSTEM,
      a.TOTAL_LOSS,
      a.FUEL_SPILL,
      a.CARGO_SPILL,
      a.HAZMAT_SPILL,
      a.FATALITIES,

      -- Passenger / injury counts
      a.TOTAL_PAX,
      a.TOTAL_INJURED_PAX,

      -- Insurance / statements
      a.LOSS_CLAIM_FILED,
      a.REPORT_TO_INSURANCE,
      a.SEND_TO_INSURANCE,
      a.INSURANCE_REPORT_DATE,
      a.DRIVER_STATEMENT_DATE,
      a.DRIVER_STATEMENT,

      -- Cost fields
      a.OUR_DAMAGE_COSTS,
      a.PAID_TO_OTHER_VEHICLE,
      a.RECIEVED_PAYMENT,
      a.LOST_REVENUE,

      -- Related counts
      COALESCE(ov.other_vehicle_count, 0) AS OTHER_VEHICLE_COUNT,
      COALESCE(op.other_property_count, 0) AS OTHER_PROPERTY_COUNT,
      COALESCE(p.passenger_count, 0) AS PASSENGER_COUNT,
      COALESCE(p.injured_passenger_count, 0) AS INJURED_PASSENGER_COUNT,
      COALESCE(w.witness_count, 0) AS WITNESS_COUNT,

      -- Related summaries
      ov.other_vehicle_summary,
      op.other_property_summary,
      p.passenger_summary,
      w.witness_summary,

  	(
          SELECT JSON_ARRAYAGG(
              JSON_OBJECT(
                  'vehicle_image_id', img.VEHICLE_IMAGE_ID,
                  'file_type', img.FILE_TYPE,
                  'doc_type', img.DOC_TYPE,
                  'image_type', img.VEHICLE_IMAGE_TYPE,
                  'image_name', img.IMAGE_NAME,
                  'image_path', img.VEHICLE_IMAGE_PATH
              )
          )
          FROM FM_VEHICLE_IMAGES img
          WHERE img.VEHICLE_ACCIDENT_ID = a.VEHICLE_ACCIDENT_ID
            AND img.DEL = 'N'
      ) AS ACCIDENT_IMAGES,
      
      -- Audit
      a.INSERTED_DATE,
      a.UPDATED_DATE,
      a.INSERTED_BY,
      a.UPDATED_BY,
      a.IS_DEFAULT,
      a.DEL

  FROM FM_VEHICLES_ACCIDENT a

  LEFT JOIN FM_VEHICLES v
      ON v.VEHICLE_ID = a.VEHICLE_ID
     AND v.DEL = 'N'

  LEFT JOIN FM_VEHICLE_MAKE mk
      ON mk.MAKE_ID = v.MAKE_ID
     AND mk.DEL = 'N'

  LEFT JOIN FM_VEHICLE_MODEL mdl
      ON mdl.MODEL_ID = v.MODEL_ID
     AND mdl.DEL = 'N'

  LEFT JOIN ADMIN_WORK_PLACE wp
      ON wp.WORK_PLACE_ID = a.WORK_PLACE_ID
     AND wp.DEL = 'N'

  LEFT JOIN ADMIN_TEAMS t
      ON t.TEAM_ID = a.TEAM_ID
     AND t.DEL = 'N'

  -- Lookup joins
  LEFT JOIN ADMIN_LOOKUPS accident_type
      ON accident_type.LOOKUP_ID = a.ACCIDENT_INCIDENT_TYPE
     AND accident_type.DEL = 'N'
     AND accident_type.VALID = 'Y'

  LEFT JOIN ADMIN_LOOKUPS road_condition
      ON road_condition.LOOKUP_ID = a.ROAD_CONDITION
     AND road_condition.DEL = 'N'
     AND road_condition.VALID = 'Y'

  LEFT JOIN ADMIN_LOOKUPS road_type
      ON road_type.LOOKUP_ID = a.ROAD_TYPE
     AND road_type.DEL = 'N'
     AND road_type.VALID = 'Y'

  LEFT JOIN ADMIN_LOOKUPS severity
      ON severity.LOOKUP_ID = a.SEVERITY
     AND severity.DEL = 'N'
     AND severity.VALID = 'Y'

  LEFT JOIN ADMIN_LOOKUPS weather
      ON weather.LOOKUP_ID = a.WEATHER_CONDITION
     AND weather.DEL = 'N'
     AND weather.VALID = 'Y'

  LEFT JOIN ADMIN_LOOKUPS daylight
      ON daylight.LOOKUP_ID = a.DAY_LIGHT_CONDITION
     AND daylight.DEL = 'N'
     AND daylight.VALID = 'Y'

  LEFT JOIN ADMIN_LOOKUPS direction_lkp
      ON direction_lkp.LOOKUP_ID = a.VEHICLE_DIRECTION
     AND direction_lkp.DEL = 'N'
     AND direction_lkp.VALID = 'Y'

  -- Other vehicles summary
  LEFT JOIN (
      SELECT
          VEHICLE_ACCIDENT_ID,
          COUNT(*) AS other_vehicle_count,
          GROUP_CONCAT(
              CONCAT_WS(
                  ' | ',
                  CONCAT('Owner: ', OWNER_NAME),
                  CONCAT('Driver: ', DRIVER_NAME),
                  CONCAT('Plate: ', VEHICLE_PLATE),
                  CONCAT('Vehicle: ', VEHICLE_MAKE_MODEL),
                  CONCAT('Injured: ', INJURED)
              )
              SEPARATOR ' || '
          ) AS other_vehicle_summary
      FROM FM_VEHICLES_ACCIDENT_OTHER_VEHICLES
      WHERE DEL = 'N'
      GROUP BY VEHICLE_ACCIDENT_ID
  ) ov
      ON ov.VEHICLE_ACCIDENT_ID = a.VEHICLE_ACCIDENT_ID

  -- Other property summary
  LEFT JOIN (
      SELECT
          VEHICLE_ACCIDENT_ID,
          COUNT(*) AS other_property_count,
          GROUP_CONCAT(
              CONCAT_WS(
                  ' | ',
                  CONCAT('Owner: ', OWNER_NAME),
                  CONCAT('Address: ', PROPERTY_EXACT_ADDRESS),
                  CONCAT('Damage: ', AREA_OF_DAMAGE),
                  CONCAT('Cost: ', DAMAGED_COST)
              )
              SEPARATOR ' || '
          ) AS other_property_summary
      FROM FM_VEHICLES_ACCIDENT_OTHER_PROPERTY
      WHERE DEL = 'N'
      GROUP BY VEHICLE_ACCIDENT_ID
  ) op
      ON op.VEHICLE_ACCIDENT_ID = a.VEHICLE_ACCIDENT_ID

  -- Passenger summary
  LEFT JOIN (
      SELECT
          VEHICLE_ACCIDENT_ID,
          COUNT(*) AS passenger_count,
          SUM(CASE WHEN INJURED = 'Y' THEN 1 ELSE 0 END) AS injured_passenger_count,
          GROUP_CONCAT(
              CONCAT_WS(
                  ' | ',
                  CONCAT('Name: ', PASSENGER_NAME),
                  CONCAT('Phone: ', PASSENGER_PHONE),
                  CONCAT('Injured: ', INJURED),
                  CONCAT('Injury Details: ', INJURY_DETAILS)
              )
              SEPARATOR ' || '
          ) AS passenger_summary
      FROM FM_VEHICLES_ACCIDENT_PASSENGER_DETAILS
      WHERE DEL = 'N'
      GROUP BY VEHICLE_ACCIDENT_ID
  ) p
      ON p.VEHICLE_ACCIDENT_ID = a.VEHICLE_ACCIDENT_ID

  -- Witness summary
  LEFT JOIN (
      SELECT
          VEHICLE_ACCIDENT_ID,
          COUNT(*) AS witness_count,
          GROUP_CONCAT(
              CONCAT_WS(
                  ' | ',
                  CONCAT('Name: ', WITNESS_NAME),
                  CONCAT('Phone: ', WITNESS_PHONE),
                  CONCAT('Address: ', WITNESS_ADDRESS)
              )
              SEPARATOR ' || '
          ) AS witness_summary
      FROM FM_VEHICLES_ACCIDENT_WITNESS
      WHERE DEL = 'N'
      GROUP BY VEHICLE_ACCIDENT_ID
  ) w
      ON w.VEHICLE_ACCIDENT_ID = a.VEHICLE_ACCIDENT_ID

  WHERE a.DEL = 'N';


agent_id: 3
agent_name: Santacruz Agent
agent_access: 3
endpoint: https://askme360.com/?access=3
max_row_count: 10000
database: Y
data_source_type: Custom Data Source Type
default_data_source_type: Database
db_type: MSSQL
host: 10.150.100.25
port: 1433
username: Dataload
password: *GC4mXjDlkpEDU33
db_name: SantaCruz
created_at: 2026-05-13 12:43:32
updated_at: 2026-05-13 12:43:32
init_training_data:
  DECLARE @IsExcludeAffiliate BIT=0
                                  DECLARE @IsExcludeDiscount BIT=0
                              	SELECT 
                              		DCost.DriverPaymentBatchId,
                              		--E.EntityCode,
                              		R.ResNumber + '*' + CONVERT(VARCHAR,RS.SegmentSequenceId) 'ResNumber' ,
                              		RS.SegmentRowId,
                              		RS.SegmentSequenceId,
                              		I.InvoiceTotal 'InvoiceTotal',
                              		I.InvoiceNumber 'InvoiceNumber',	
                              		I.InvoiceDate 'InvoiceDate',
                              		LEFT(CONVERT(varchar, RS.PickupDateTime,112),6) 'FiscalPeriod',
                              		RS.PickupDateTime 'PickupDateTime',	
                              		RS.DropoffDateTime AS 'DropoffDateTime',
                                      RS.SegmentStartDateTime AS 'SegmentStartDateTime',
                                      RS.SegmentEndDateTime AS 'SegmentEndDateTime',
                              		AF.AffiliateId As 'AffiliateId',					
                              		AF.AffiliateCode As 'AffiliateCode',
                              		AF.AffiliateName AS 'AffiliateName',
                              		S.ServiceAreaCode AS 'ServiceArea',
                              		ISNULL(LVT.VehicleTypeCode,'') 'VehicleType',
                              		ISNULL(RS.PassengerFirstName,'') 'PassengerFirstName',
                              		ISNULL(RS.PassengerLastName,'') 'PassengerLastName',		
                              		ISNULL(C.CustomerCode,'') 'CustomerAccount',
                              		ISNULL(C.CustomerName,'') 'CustomerName', --Name: Divyaesh Battu | Date: 24/08/2016 | Description: TFS# 3725
                              		ISNULL(C.CustomerType,'') 'CustomerType',
                              		ISNULL(LPO.PaymentOptionCode,'') 'PaidBy',
                              		ISNULL(DSS.Meaning,'') 'SegmentStatus',
                              		ISNULL(DSS.SegementStatusCode,'') 'StatusCode',
                              		ISNULL(RSP.SegmentTotal,'0.0') 'SegmentTotal',
                              		ISNULL(DR.DriverCode,'') 'DriverCode',
                              		ISNULL(DR.FullName,'') 'DriverName',
                              		ISNULL(V.VehicleCode,'') 'VehicleCode',          
                              		CASE 
                              				WHEN PU.PlaceType = 2 THEN (ISNULL(PU.FlightAssociatedAirport,'') ) 
                              				ELSE  ISNULL(PU.City,'')  
                              		END     'PickupAddress',
                                         
                              		CASE 
                              				WHEN DO.PlaceType = 2 THEN (ISNULL(DO.FlightAssociatedAirport,'') ) 
                              				ELSE  ISNULL(DO.City,'') 
                              		END  'DropoffAddress',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN (ISNULL(RSP.BaseChargeTotal,0) + ISNULL(RSP.SurchargeBaseTotal,0)) ELSE 0 END 'BaseChargeTotal',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN ISNULL(RSP.StopChargesTotal,0) ELSE 0 END 'StopChargesTotal',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN ISNULL(RSP.WaitChargesTotal,0) ELSE 0 END 'WaitChargesTotal',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN ISNULL(RSP.TollsTotal,0) ELSE 0 END 'TollsTotal',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN ISNULL(RSP.ParkingTotal,0) ELSE 0 END 'ParkingTotal',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN ISNULL(RSP.GratuityTotal,0) ELSE 0 END 'GratuityTotal',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN ISNULL(RSP.TaxesTotal,0) ELSE 0 END 'TaxesTotal',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN ISNULL(RSP.ServiceChargesTotal,0) ELSE 0 END 'ServiceChargesTotal',
                              		CASE WHEN ISNULL(DCost.CostOrder, 1) = 1 
                              		THEN
                              		(
                              			(
                              				(	ISNULL(RSP.SegmentTotal,0) + (CASE @IsExcludeDiscount WHEN 1 THEN 0 ELSE (ISNULL(RSP.DiscountTotal,0) + ISNULL(RSP.PromotionTotal, 0)) END)) 
                              				- 
                              				(  
                              					ISNULL(RSP.BaseChargeTotal,0) + ISNULL(RSP.SurchargeBaseTotal,0) + ISNULL(RSP.StopChargesTotal,0)  + 
                              					ISNULL(RSP.TollsTotal,0) + ISNULL(RSP.ParkingTotal,0)+ ISNULL(RSP.ServiceChargesTotal,0) + ISNULL(RSP.GratuityTotal,0) + 
                              					ISNULL(RSP.WaitChargesTotal,0) + ISNULL(RSP.TaxesTotal,0)
                              				)
                              			)
                              			+  
                              			(
                              				CASE @IsExcludeDiscount WHEN 0 THEN 0 ELSE (ISNULL(RSP.DiscountTotal,0) + ISNULL(RSP.PromotionTotal, 0)) END
                              			)  
                              		) 
                              		ELSE 0 END 'Other',
                              
                              		CASE 
                              			WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN(ISNULL(RSP.SegmentTotal,0) + (CASE @IsExcludeDiscount WHEN 1 THEN 0 ELSE (ISNULL(RSP.DiscountTotal,0) + ISNULL(RSP.PromotionTotal, 0)) END))
                              			ELSE 0
                              		END 'Total',
                              			
                              		ISNULL(I.InvoiceNumber,ISNULL(IP.InvoiceNumber,ISNULL(IPA.InvoiceNumber,(CASE WHEN ISNULL(RSP.CCBatchNumber,'') = '' THEN '' ELSE 'CC' + RSP.CCBatchNumber END)))) 'InvoiceNumber',	--- TFS #4372
                              		ISNULL(I.InvoiceDate,ISNULL(IP.InvoiceDate,ISNULL(IPA.InvoiceDate, RSP.CCBatchDate))) 'InvoiceDate',	--- TFS #4372
                              		ISNULL(DPB.PaymentStatementDate,NULL) AS 'PayStmt',
                              		
                              		ISNULL(DPT.Meaning,'') 'PricingMethod',
                              		CASE 
                              			WHEN ISNULL(DCost.CostOrder, 1) = 1 THEN ((ISNULL(RSP.DiscountTotal,0) + ISNULL(RSP.PromotionTotal, 0)) * (-1)) 
                              			ELSE 0 
                              		END 'DiscountTotal',
                              		AF.AffiliateCode,
                              		LST.SegmentTypeCode 'RunType',
                              		E.EventCode,
                              		DCost.TotalCost   --KrutiC TFS: 3749
                              	FROM
                              		ResSegments RS 
                              		INNER JOIN ResMain R ON (R.ResRowId = RS.ResRowId)
                              		INNER JOIN ResSegmentLocations PU ON (RS.SegmentRowId = PU.SegmentRowId AND PU.LocationPhaseType =0)
                              		INNER JOIN ResSegmentLocations DO ON (RS.SegmentRowId = DO.SegmentRowId AND DO.LocationPhaseType =1)   
                              		LEFT OUTER JOIN ListVehicleTypes LVT ON ( LVT.VehicleTypeId = RS.RequestedVehicleTypeId)
                              		LEFT OUTER JOIN Customers C ON (R.CustomerId = C.CustomerId)
                              		LEFT OUTER JOIN ServiceAreas S ON (RS.ServiceAreaId = S.ServiceAreaId)
                              		LEFT OUTER JOIN Passengers P ON (RS.PassengerId = P.PassengerId)        
                              		LEFT OUTER JOIN ListPaymentOptions LPO ON (RS.PaymentOptionId =LPO.PaymentOptionId)              
                              		LEFT OUTER JOIN Drivers DR ON (DR.DriverId = (ISNULL(RS.DispatchDriverId,ISNULL(RS.AssignDriverId, ISNULL(RS.RequestedDriverId,0)))))		
                              		LEFT OUTER JOIN Vehicles V ON (V.VehicleId = (ISNULL(RS.DispatchVehicleId,ISNULL(RS.AssignVehicleId, ISNULL(RS.RequestedVehicleId,0)))))			
                              		LEFT OUTER JOIN DomainSegmentStatuses DSS ON (RS.SegmentStatusId= DSS.SegmentStatus)
                              		LEFT OUTER JOIN ResSegmentPricing RSP ON (RS.SegmentRowId = RSP.SegmentRowId)
                              		LEFT OUTER JOIN ResSegmentBillingTxns RBT ON (RBT.SegmentRowId = RS.SegmentRowId AND ISNULL(RBT.InvoiceRowId,0) != 0)
                              		LEFT OUTER JOIN ResSegmentDispatchInfo RSD ON (RS.SegmentRowId = RSD.SegmentRowId)
                              		LEFT OUTER JOIN InvoicesLink IL ON (RBT.InvoiceRowId =IL.InvoiceRowId)
                              		LEFT OUTER JOIN Invoices I ON (IL.InvoiceRowId =I.InvoiceRowId)
                              		LEFT OUTER JOIN InvoicesPosted IP ON (IL.InvoiceRowId =IP.InvoiceRowId)
                              		LEFT OUTER JOIN InvoicesPaid IPA ON (IL.InvoiceRowId =IPA.InvoiceRowId)
                              		/****KrutiC JIRA# 1574: Changed the below condition to dispaly cost for rides dispatched to Affiliate**/
                              		LEFT OUTER JOIN ResSegmentCost DCost ON (DCost.SegmentRowId = RS.SegmentRowId AND (DCost.DriverId = RS.DispatchDriverId OR (@IsExcludeAffiliate =0 and Dcost.AffiliateId=rs.DispatchAffiliateId)))-- AND ISNULL(DCost.DriverPaymentBatchId,0) != 0)
                              		LEFT OUTER JOIN DriverPaymentBatches DPB ON (DPB.DriverPaymentBatchId = DCost.DriverPaymentBatchId)
                              		LEFT OUTER JOIN Affiliates AF ON (AF.AffiliateId =  (ISNULL(RS.DispatchAffiliateId,ISNULL(RS.AssignAffiliateId, ISNULL(RS.RequestedAffiliateId,0)))))	
                              		LEFT OUTER JOIN DomainPricingTypes DPT ON DPT.PricingTypeValue =  RSP.PricingType
                              		LEFT OUTER JOIN [EVENTS] E ON (E.EventCode =  ISNULL(R.EventCode, RSP.PricingEventCode))
                              		LEFT OUTER JOIN ListSegmentTypes LST ON ( LST.SegmentType = RS.SegmentTypeId);

extra1:
  {"primaryColor": "#000000", "backgroundColor": "#ffffff", "secondaryBackgroundColor": "#f3f4f6", "textColor": "#111827", "font": "sans serif"}

description:
  Displays all available trip details originating from Santa Cruz; specific trip types, data sources, and time frames are not specified.


agent_id: 4
agent_name: CoachManager Agent
agent_access: 4
endpoint: https://askme360.com/?access=4
max_row_count: 10000
extra1: {}
database: Y
data_source_type: Custom Data Source Type
default_data_source_type: Database
db_type: MSSQL
host: 10.150.100.25
port: 1433
username: Dataload
password: *GC4mXjDlkpEDU33
db_name: PHCS
created_at: 2026-05-14 06:24:40
updated_at: 2026-05-14 06:26:17
init_training_data:
  Select [StartDate]
                                        ,[SortDateTime]
                                        ,[StartDateTime]
                                        ,[StartBase]
                                        ,[StartPoint]
                                        ,[PositionDateTime]
                                        ,[PositionTime]
                                        ,[PickupDateTime]
                                        ,[PickupTime]
                                        ,[PickupPoint]
                                        ,[PickupPointLatitude]
                                        ,[PickupPointLongitude]
                                        ,[PickupInstructions]
                                        ,[SingleJourney]
                                        ,[VehicleToStay]
                                        ,[Destination]
                                        ,[DestinationLatitude]
                                        ,[DestinationLongitude]
                                        ,[DestinationInstructions]
                                        ,[ArrivalDateTime]
                                        ,[ArrivalTime]
                                        ,[LeaveDateTime]
                                        ,[LeaveTime]
                                        ,[BackDateTime]
                                        ,[BackTime]
                                        ,[FinishDateTime]
                                        ,[FinishTime]
                                        ,[EndDateTime]
                                        ,[EndTime]
                                        ,[FinishBase]
                                        ,[FinishPoint]
                                        ,[Description]
                                        ,[ServiceID]
                                        ,[Passengers]
                                        ,[Distance]
                                        ,[EmptyDistance]
                                        ,[ClientReference1]
                                        ,[ClientReference2]
                                        ,[Route]
                                        ,[PHCVehicleID]
                                        ,[Seats]
                                        ,[VehicleType]
                                        ,[VehicleTypeDescription]
                                        ,[VehicleID]
                                        ,[ActualSeats]
                                        ,[ActualVehicleType]
                                        ,[ActualVehicleTypeDescription]
                                        ,[RegistrationMark]
                                        ,[FleetNo]
                                        ,[MobileTelNo]
                                        ,[VehicleBase]
                                        ,[VehicleCompanyID]
                                        ,[VehicleLivery]
                                        ,[PHCDriverID]
                                        ,[DriverType]
                                        ,[DriverTypeDescription]
                                        ,[WorkTicket]
                                        ,[DriverSerialNo]
                                        ,[DriverID]
                                        ,[ActualDriverType]
                                        ,[ActualDriverTypeDescription]
                                        ,[DriverName]
                                        ,[DriverTelNo1]
                                        ,[DriverTelNo2]
                                        ,[DriverTelNo3]
                                        ,[DriverEMail]
                                        ,[DriverBase]
                                        ,[DriverCompanyID]
                                        ,[LicenceNumber]
                                        ,[WorkTicketNote]
                                        ,[DriverNotified]
                                        ,[BookingType]
                                        ,[BookingID]
                                        ,[PrivateHireID]
                                        ,[PrivateHireMovementID]
                                        ,[ContractID]
                                        ,[ContractMovementID]
                                        ,[CompanyID]
                                        ,[BookingBase]
                                        ,[BookingBaseCompanyID]
                                        ,[Code1]
                                        ,[Code2]
                                        ,[Code3]
                                        ,[Code4]
                                        ,[Code5]
                                        ,[Notes]
                                        ,[Contact]
                                        ,[ContactIncClientID]
                                        ,[ClientID]
                                        ,[Title]
                                        ,[Initials]
                                        ,[Surname]
                                        ,[Salutation]
                                        ,[Department]
                                        ,[Company]
                                        ,[Address1]
                                        ,[Address2]
                                        ,[Address3]
                                        ,[Address4]
                                        ,[PostCode]
                                        ,[TelNo1]
                                        ,[TelNo1Comment]
                                        ,[TelNo2]
                                        ,[TelNo2Comment]
                                        ,[TelNo3]
                                        ,[TelNo3Comment]
                                        ,[FaxNo]
                                        ,[FaxNoComment]
                                        ,[EMail]
                                        ,[Livery]
                                        ,[Paid]
                                        ,[TotalNoExtras]
                                        ,[ExtrasTotal]
                                        ,[Price]
                                        ,[VAT]
                                        ,[Total]
                                        ,[DurationHoursMinutes]
                                        ,[DurationHours]
                                        ,[DurationMinutes]
                                        ,[DurationDecimalHours]
                                        ,[Days]
                                        ,[DefaultVehicleID]
                                        ,[DefaultDriverID]
                                        ,[TrackingReference]
                                        ,[MobileWorkTicketStatus]
                                        ,[BookingDateCreated]
                                        ,[MovementDateCreated]
                                        FROM vwAllocations01;

description:
  Provides booking and trip data sourced from Coach Manager. Scope unclear: no details on data fields, time range, or user audience. All charter division booking and trip details are available


agent_id: 5
agent_name: Paychex Agent
agent_access: 5
endpoint: https://askme360.com/?access=5
max_row_count: 10000
database: Y
data_source_type: Custom Data Source Type
default_data_source_type: Database
db_type: MSSQL
host: 10.150.100.25
port: 1433
username: Dataload
password: *GC4mXjDlkpEDU33
db_name: AvalonReporting
created_at: 2026-05-14 09:26:29
updated_at: 2026-05-14 09:26:29
init_training_data:
  SELECT TOP (1000) [payPeriodId]
        ,[paycheckId]
        ,[workerId]
        ,[checkDate]
        ,[netPay]
        ,[checkType]
        ,[checkNumber]
        ,[componentId]
        ,[checkComponentId]
        ,[componentName]
        ,[classificationType]
        ,[effectOnPay]
        ,[memoed]
        ,[organizationId]
        ,[organizationName]
        ,[amount]
        ,[rate]
        ,[hours]
        ,[EmployeeDivision]
        ,[LoadDate]
        ,[SourceSystem]
    FROM [AvalonReporting].[dbo].[tbl_Payroll_Checks_Earnings]

extra1:
  {"primaryColor": "#000000", "backgroundColor": "#ffffff", "secondaryBackgroundColor": "#f3f4f6", "textColor": "#111827", "font": "sans serif"}

description:
  Retrieves employee payroll and hours data. Scope unclear: specific data sources, systems, and organizational coverage not specified.


# admin_configuration

configuration_name: OPEN_API_KEY
type: C
created_at: 2026-05-09 11:13:19
updated_at: 2026-05-09 11:13:19
value:
  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


configuration_name: CLAUDE_API_KEY
type: C
created_at: 2026-05-09 11:13:19
updated_at: 2026-05-09 11:13:19
value:
  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


