Skip to content

Instantly share code, notes, and snippets.

@isaacraja
Created February 21, 2018 08:59
Show Gist options
  • Save isaacraja/29b56cc4e3408daddfdafb0fb92f0845 to your computer and use it in GitHub Desktop.
Save isaacraja/29b56cc4e3408daddfdafb0fb92f0845 to your computer and use it in GitHub Desktop.
pld.md
- [PipelineDealService.php](#sec-1)
  - [getAllCustomFieldData() ->](#sec-1-1)
  - [sendCurlGetRequest($dealId) ->](#sec-1-2)
  - [getPrimaryGuestInfo($pldUserId) ->](#sec-1-3)
  - [getPeopleInfoById($pldUserId) ->](#sec-1-4)
  - [getDealInformation($dealId)->](#sec-1-5)
  - [updateNotes($pldId, $category<sub>id</sub>, $content) ->](#sec-1-6)
  - [getPersonByEmail($emailId)](#sec-1-7)
  - [createPerson($data)](#sec-1-8)
  - [updatePerson($id, $data)](#sec-1-9)
  - [setDealParam($pldId, $data)](#sec-1-10)
  - [getTcInformation($email)](#sec-1-11)
  - [getUserInformationByPldId($pldUserId)](#sec-1-12)
  - [getTCDeals($user<sub>id</sub>)](#sec-1-13)
  - [updatePldAmount($dealId, $amount)](#sec-1-14)
  - [pldUploadDocument($data)](#sec-1-15)

PipelineDealService.php

getAllCustomFieldData() ->

  • url: 'admin/dealcustomfieldlables.json?apikey='
  • Usage: one-time - to import custom pld fields into artemis database
  • Data migration from 0.5 to 2.0 used this (one time only)

sendCurlGetRequest($dealId) ->

  • url: 'deals/' . $dealId . '.json?apikey=' .

$this->apiKey . '&attrs=id,name,primarycontact,customfields'

  • Usage: Used to get deal information along with custom fields
  • Data migration did this (one time)
  • saving contact information of the guest did this
  • generateProposal did this

getPrimaryGuestInfo($pldUserId) ->

  • generateProposal did this
  • data migration did this (one time)

getPeopleInfoById($pldUserId) ->

  • url: 'people/' . $pldUserId . '.json/' . '?apikey=' . $this->apiKey
  • used to get people information(primary guests and other guests)
  • generateProposal did this
  • data migration did this (one time)
  • confirm proposal did this

getDealInformation($dealId)->

  • duplicate function
  • url: 'deals/' . $pldId . '.json/' . '?apikey=' . $this->apiKey
  • used to get deal information
  • used in data migration (one time)

updateNotes($pldId, $categoryid, $content) ->

  • url: 'notes.json/' . '?apikey=' . $this->apiKey
  • create/update notes against a deal
  • used when payment information is updated
  • used in generateProposal
  • used when proposal url need to be update in pld
  • used on email confirmation is send to the guest

getPersonByEmail($emailId)

  • url: 'people.json?conditions[personemail]='
  • get people information by email
  • used whenever guest contact info is updated

createPerson($data)

  • url: 'people.json'
  • create guests related to a dealid
  • Whenever flight info, passport infor, guest info is created

updatePerson($id, $data)

  • url: 'people.json'
  • update guests related to a dealid
  • Whenever flight info, passport infor, guest info is updated

setDealParam($pldId, $data)

  • url: 'deals/{$pldId}.json?';
  • updates a deal
  • updating a deals' guests' invokes this
  • whenever deal updated mail is sent

getTcInformation($email)

  • url:'users.json?apikey=' . $this->apiKey . '&conditions[email]=' . $email;
  • used to get TC details by email
  • Pld data migration from 0.5 to 2.0 used this (one time only)

getUserInformationByPldId($pldUserId)

  • url:'users/' . $pldUserId . '.json/' . '?apikey=' . $this->apiKey;
  • used to get TC details by pld user id
  • Pld data migration from 0.5 to 2.0 used this (one time only)

getTCDeals($userid)

  • url: 'deals.json?apikey=' . $this->apiKey . '&conditions[dealowner]=' . $userid . '&perpage=10';
  • used to get the deals owned by a TC
  • data migration from 0.5 to 2.0 required this (one time only)

updatePldAmount($dealId, $amount)

  • url:'deals/'.$dealId.'.json/'.'?apikey='.$this->apiKey;
  • update deal amount in euros
  • Confirm Proposal/Traveller details does this
  • generateProposal did this

pldUploadDocument($data)

  • url: 'documents.json?apikey=' . $this->apiKey . '&attr=id,publiclink';
  • uploads a document to PLD.
  • Passport upload invokes this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment