From 088dca5a11b9d85dbbd7c76878f5555b6ec49a0c Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Thu, 6 Feb 2020 07:53:56 +0000 Subject: [PATCH] Create two separate services.yaml for resq and cmb. #329 --- config/cmb.services.yaml | 221 ++++++++++++++++++++++++++++++++++++++ config/resq.services.yaml | 215 ++++++++++++++++++++++++++++++++++++ 2 files changed, 436 insertions(+) create mode 100644 config/cmb.services.yaml create mode 100644 config/resq.services.yaml diff --git a/config/cmb.services.yaml b/config/cmb.services.yaml new file mode 100644 index 00000000..4ea4926c --- /dev/null +++ b/config/cmb.services.yaml @@ -0,0 +1,221 @@ +# Put parameters here that don't need to change on each machine where the app is deployed +# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration +parameters: + map_default: + latitude: 14.6091 + longitude: 121.0223 + image_upload_directory: '%kernel.project_dir%/public/uploads' + job_order_refresh_interval: 300000 + api_acl_file: 'api_acl.yaml' + api_access_key: 'api_access_keys' + app_acl_file: 'acl.yaml' + app_access_key: 'access_keys' + cvu_brand_id: "%env(CVU_BRAND_ID)%" + country_code: "%env(COUNTRY_CODE)%" + +services: + # default configuration for services in *this* file + _defaults: + autowire: true # Automatically injects dependencies in your services. + autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. + public: false # Allows optimizing the container by removing unused services; this also means + # fetching services directly from the container via $container->get() won't work. + # The best practice is to be explicit about your dependencies anyway. + + # makes classes in src/ available to be used as services + # this creates a service per class whose id is the fully-qualified class name + App\: + resource: '../src/*' + exclude: '../src/{Entity,Migrations,Tests,Menu,Access}' + + # controllers are imported separately to make sure services can be injected + # as action arguments even if you don't extend any base controller class + App\Controller\: + resource: '../src/Controller' + tags: ['controller.service_arguments'] + + # add more service definitions when explicit configuration is needed + # please note that last definitions always *replace* previous ones + App\Menu\Generator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + + Catalyst\AuthBundle\Service\ACLGenerator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + $acl_file: "%app_acl_file%" + + Catalyst\AuthBundle\Service\ACLVoter: + arguments: + $user_class: "App\\Entity\\User" + tags: ['security.voter'] + + Catalyst\AuthBundle\Service\UserChecker: + + App\Service\FileUploader: + arguments: + $target_dir: '%image_upload_directory%' + + App\Service\MapTools: + arguments: + $em: "@doctrine.orm.entity_manager" + $gmaps_api_key: "%env(GMAPS_API_KEY)%" + + App\Service\RisingTideGateway: + arguments: + $em: "@doctrine.orm.entity_manager" + $user: "%env(RT_USER)%" + $pass: "%env(RT_PASS)%" + $usage_type: "%env(RT_USAGE_TYPE)%" + $shortcode: "%env(RT_SHORTCODE)%" + + App\Service\MQTTClient: + arguments: + $redis_client: "@App\\Service\\RedisClientProvider" + $key: "mqtt_events" + + App\Service\APNSClient: + arguments: + $redis_client: "@App\\Service\\RedisClientProvider" + + App\Service\RedisClientProvider: + arguments: + $scheme: "%env(REDIS_CLIENT_SCHEME)%" + $host: "%env(REDIS_CLIENT_HOST)%" + $port: "%env(REDIS_CLIENT_PORT)%" + $password: "%env(REDIS_CLIENT_PASSWORD)%" + + App\Service\GeofenceTracker: + arguments: + $geofence_flag: "%env(GEOFENCE_ENABLE)%" + + App\Service\WarrantyHandler: + arguments: + $em: "@doctrine.orm.entity_manager" + + App\Command\SetCustomerPrivacyPolicyCommand: + arguments: + $policy_promo: "%env(POLICY_PROMO)%" + $policy_third_party: "%env(POLICY_THIRD_PARTY)%" + $policy_mobile: "%env(POLICY_MOBILE)%" + + App\Command\CreateCustomerFromWarrantyCommand: + arguments: + $cvu_mfg_id: "%env(CVU_MFG_ID)%" + $cvu_brand_id: "%env(CVU_BRAND_ID)%" + + # rider tracker service + App\Service\RiderTracker: + arguments: + $redis_client: "@App\\Service\\RedisClientProvider" + + Catalyst\APIBundle\Security\APIKeyUserProvider: + arguments: + $em: "@doctrine.orm.entity_manager" + + Catalyst\APIBundle\Security\APIKeyAuthenticator: + arguments: + $em: "@doctrine.orm.entity_manager" + + Catalyst\APIBundle\Command\UserCreateCommand: + arguments: + $em: "@doctrine.orm.entity_manager" + tags: ['console.command'] + + Catalyst\APIBundle\Command\TestCommand: + tags: ['console.command'] + + Catalyst\APIBundle\Command\TestAPICommand: + tags: ['console.command'] + + Catalyst\APIBundle\Access\Voter: + arguments: + $acl_gen: "@Catalyst\\APIBundle\\Access\\Generator" + $user_class: "Catalyst\\APIBundle\\Entity\\User" + tags: ['security.voter'] + + Catalyst\APIBundle\Access\Generator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + $acl_file: "%api_acl_file%" + + Catalyst\MenuBundle\Menu\Generator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + + Catalyst\MenuBundle\Listener\MenuAnnotationListener: + arguments: + $menu_name: "main_menu" + tags: + - { name: kernel.event_listener, event: kernel.controller, method: onKernelController } + + # invoice generator + App\Service\InvoiceGenerator\CMBInvoiceGenerator: ~ + + # invoice generator interface + App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\CMBInvoiceGenerator" + + # job order generator + App\Service\JobOrderHandler\CMBJobOrderHandler: + arguments: + $country_code: "%env(COUNTRY_CODE)%" + + #job order generator interface + App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\CMBJobOrderHandler" + + # customer generator + App\Service\CustomerHandler\CMBCustomerHandler: + arguments: + $country_code: "%env(COUNTRY_CODE)%" + + # customer generator interface + App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\CMBCustomerHandler" + + # rider assignment + App\Service\RiderAssignmentHandler\CMBRiderAssignmentHandler: ~ + + # rider assignment interface + App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\CMBRiderAssignmentHandler" + + # map manager + #App\Service\GISManager\Bing: ~ + App\Service\GISManager\OpenStreet: ~ + #App\Service\GISManager\Google: ~ + + #App\Service\GISManagerInterface: "@App\\Service\\GISManager\\Bing" + App\Service\GISManagerInterface: "@App\\Service\\GISManager\\OpenStreet" + #App\Service\GISManagerInterface: "@App\\Service\\GISManager\\Google" + + App\EventListener\JobOrderActiveCacheListener: + arguments: + $jo_cache: "@App\\Service\\JobOrderCache" + $mqtt: "@App\\Service\\MQTTClient" + tags: + - name: 'doctrine.orm.entity_listener' + event: 'postUpdate' + entity: 'App\Entity\JobOrder' + - name: 'doctrine.orm.entity_listener' + event: 'postRemove' + entity: 'App\Entity\JobOrder' + - name: 'doctrine.orm.entity_listener' + event: 'postPersist' + entity: 'App\Entity\JobOrder' + + App\Service\JobOrderCache: + arguments: + $redis_prov: "@App\\Service\\RedisClientProvider" + $active_jo_key: "%env(LOCATION_JO_ACTIVE_KEY)%" + + App\Service\RiderCache: + arguments: + $redis_prov: "@App\\Service\\RedisClientProvider" + $loc_key: "%env(LOCATION_RIDER_ACTIVE_KEY)%" + $status_key: "%env(STATUS_RIDER_KEY)%" diff --git a/config/resq.services.yaml b/config/resq.services.yaml new file mode 100644 index 00000000..ee948f38 --- /dev/null +++ b/config/resq.services.yaml @@ -0,0 +1,215 @@ +# Put parameters here that don't need to change on each machine where the app is deployed +# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration +parameters: + map_default: + latitude: 14.6091 + longitude: 121.0223 + image_upload_directory: '%kernel.project_dir%/public/uploads' + job_order_refresh_interval: 300000 + api_acl_file: 'api_acl.yaml' + api_access_key: 'api_access_keys' + app_acl_file: 'acl.yaml' + app_access_key: 'access_keys' + cvu_brand_id: "%env(CVU_BRAND_ID)%" + country_code: "%env(COUNTRY_CODE)%" + +services: + # default configuration for services in *this* file + _defaults: + autowire: true # Automatically injects dependencies in your services. + autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. + public: false # Allows optimizing the container by removing unused services; this also means + # fetching services directly from the container via $container->get() won't work. + # The best practice is to be explicit about your dependencies anyway. + + # makes classes in src/ available to be used as services + # this creates a service per class whose id is the fully-qualified class name + App\: + resource: '../src/*' + exclude: '../src/{Entity,Migrations,Tests,Menu,Access}' + + # controllers are imported separately to make sure services can be injected + # as action arguments even if you don't extend any base controller class + App\Controller\: + resource: '../src/Controller' + tags: ['controller.service_arguments'] + + # add more service definitions when explicit configuration is needed + # please note that last definitions always *replace* previous ones + App\Menu\Generator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + + Catalyst\AuthBundle\Service\ACLGenerator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + $acl_file: "%app_acl_file%" + + Catalyst\AuthBundle\Service\ACLVoter: + arguments: + $user_class: "App\\Entity\\User" + tags: ['security.voter'] + + Catalyst\AuthBundle\Service\UserChecker: + + App\Service\FileUploader: + arguments: + $target_dir: '%image_upload_directory%' + + App\Service\MapTools: + arguments: + $em: "@doctrine.orm.entity_manager" + $gmaps_api_key: "%env(GMAPS_API_KEY)%" + + App\Service\RisingTideGateway: + arguments: + $em: "@doctrine.orm.entity_manager" + $user: "%env(RT_USER)%" + $pass: "%env(RT_PASS)%" + $usage_type: "%env(RT_USAGE_TYPE)%" + $shortcode: "%env(RT_SHORTCODE)%" + + App\Service\MQTTClient: + arguments: + $redis_client: "@App\\Service\\RedisClientProvider" + $key: "mqtt_events" + + App\Service\APNSClient: + arguments: + $redis_client: "@App\\Service\\RedisClientProvider" + + App\Service\RedisClientProvider: + arguments: + $scheme: "%env(REDIS_CLIENT_SCHEME)%" + $host: "%env(REDIS_CLIENT_HOST)%" + $port: "%env(REDIS_CLIENT_PORT)%" + $password: "%env(REDIS_CLIENT_PASSWORD)%" + + App\Service\GeofenceTracker: + arguments: + $geofence_flag: "%env(GEOFENCE_ENABLE)%" + + App\Service\WarrantyHandler: + arguments: + $em: "@doctrine.orm.entity_manager" + + App\Command\SetCustomerPrivacyPolicyCommand: + arguments: + $policy_promo: "%env(POLICY_PROMO)%" + $policy_third_party: "%env(POLICY_THIRD_PARTY)%" + $policy_mobile: "%env(POLICY_MOBILE)%" + + App\Command\CreateCustomerFromWarrantyCommand: + arguments: + $cvu_mfg_id: "%env(CVU_MFG_ID)%" + $cvu_brand_id: "%env(CVU_BRAND_ID)%" + + # rider tracker service + App\Service\RiderTracker: + arguments: + $redis_client: "@App\\Service\\RedisClientProvider" + + Catalyst\APIBundle\Security\APIKeyUserProvider: + arguments: + $em: "@doctrine.orm.entity_manager" + + Catalyst\APIBundle\Security\APIKeyAuthenticator: + arguments: + $em: "@doctrine.orm.entity_manager" + + Catalyst\APIBundle\Command\UserCreateCommand: + arguments: + $em: "@doctrine.orm.entity_manager" + tags: ['console.command'] + + Catalyst\APIBundle\Command\TestCommand: + tags: ['console.command'] + + Catalyst\APIBundle\Command\TestAPICommand: + tags: ['console.command'] + + Catalyst\APIBundle\Access\Voter: + arguments: + $acl_gen: "@Catalyst\\APIBundle\\Access\\Generator" + $user_class: "Catalyst\\APIBundle\\Entity\\User" + tags: ['security.voter'] + + Catalyst\APIBundle\Access\Generator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + $acl_file: "%api_acl_file%" + + Catalyst\MenuBundle\Menu\Generator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + + Catalyst\MenuBundle\Listener\MenuAnnotationListener: + arguments: + $menu_name: "main_menu" + tags: + - { name: kernel.event_listener, event: kernel.controller, method: onKernelController } + + # invoice generator + App\Service\InvoiceGenerator\ResqInvoiceGenerator: ~ + + # invoice generator interface + App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\ResqInvoiceGenerator" + + # job order generator + App\Service\JobOrderHandler\ResqJobOrderHandler: + arguments: + $country_code: "%env(COUNTRY_CODE)%" + + #job order generator interface + App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\ResqJobOrderHandler" + + # customer generator + App\Service\CustomerHandler\ResqCustomerHandler: + arguments: + $country_code: "%env(COUNTRY_CODE)%" + + # customer generator interface + App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\ResqCustomerHandler" + + # map manager + #App\Service\GISManager\Bing: ~ + App\Service\GISManager\OpenStreet: ~ + #App\Service\GISManager\Google: ~ + + #App\Service\GISManagerInterface: "@App\\Service\\GISManager\\Bing" + App\Service\GISManagerInterface: "@App\\Service\\GISManager\\OpenStreet" + #App\Service\GISManagerInterface: "@App\\Service\\GISManager\\Google" + + App\EventListener\JobOrderActiveCacheListener: + arguments: + $jo_cache: "@App\\Service\\JobOrderCache" + $mqtt: "@App\\Service\\MQTTClient" + tags: + - name: 'doctrine.orm.entity_listener' + event: 'postUpdate' + entity: 'App\Entity\JobOrder' + - name: 'doctrine.orm.entity_listener' + event: 'postRemove' + entity: 'App\Entity\JobOrder' + - name: 'doctrine.orm.entity_listener' + event: 'postPersist' + entity: 'App\Entity\JobOrder' + + App\Service\JobOrderCache: + arguments: + $redis_prov: "@App\\Service\\RedisClientProvider" + $active_jo_key: "%env(LOCATION_JO_ACTIVE_KEY)%" + + App\Service\RiderCache: + arguments: + $redis_prov: "@App\\Service\\RedisClientProvider" + $loc_key: "%env(LOCATION_RIDER_ACTIVE_KEY)%" + $status_key: "%env(STATUS_RIDER_KEY)%"