Skip to content

Instantly share code, notes, and snippets.

@meysammeisam
Last active February 26, 2017 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save meysammeisam/68957a19592490e62840 to your computer and use it in GitHub Desktop.
Save meysammeisam/68957a19592490e62840 to your computer and use it in GitHub Desktop.
SDM initialization

SDM initialization

  1. create ExternalServiceHost(also available on operation/en/external_service_hosts/new):
  ExternalServiceHost.new(
    host_type: ExternalServiceHost.host_types[:test],
    url: "http://127.0.0.1:1995/?wsdl",
    verification_attributes: {"tns:licenseCode"=>"CODE"},
    service_type: ExternalServiceHost.service_types[:sdm],
    enabled: true,
    name: "CHOOSE UNIQ NAME"
  ).save
  1. link restaurants to hosts from operation/en/external_service_hosts/XXX
  2. get(fetch) cities and districts form SDM:
  rake sdm_sdk:get_locations
  1. link HS cities to SDM host's cities from operation: operation/en/countries/1
  2. link HS locals to SDM host's districts from operation: operation/en/cities/XXX
  3. create ExternalServiceData for restaurants:
  the_RESTAURANT.create_external_service_data(
    external_attributes: {"concept_id" => 1},
    external_service_host_id: the_RESTAURANT.external_service_host_id
  )
  1. get(fetch) stores from SDM:
  rake sdm_sdk:get_stores
  1. link HS branches to SDM host's stores from operation: operation/en/restaurants/XXX
  2. sync branch's menu from operation: operation/en/branches/XXX/menu
  • choose the variables for syncing menu carefully: conceptID, menuTemplateId and menuID
  1. some flags must be set for sdm service:
  • Rails.application.secrets.sdm_national_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment