All pages
Powered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

Adapter Service Documents

iFix Adapter Services

Overview

Ifix-Adapter is a system that works as a mediator between iFix and its clients. This system will receive requests from the client system and convert the data in the Ifix required format. This document contains the details about how to set up ifix-adapter service and describes the functionalities it provides.

Pre-requisites

Before you proceed with the configuration, make sure the following pre-requisites are met -

  • Java 8

  • Kafka server is up and running

  • PSQL server is running

  • Redis

Key Functionalities

  • IFIX client requests are pushed to IFIX

  • The authentication token is fetched from keycloak and cached. Token will be re-fetched 5 minutes before expiry

  • project id is fetched from IFIX and cached

  • COA id fetched from IFIX and cached

Deployment Details

Deploy the latest version of ifix-reference-adapter

Configuration Details

  1. Update Key cloak credentials in dev.yaml,qa.yaml,prod.yaml according to the environment The credentials are “keycloak.credentials.clientid and “keycloak.credentials.clientsecret” Example is given in and

  2. Map clientcode, ifixcoacode, ifixid in ifix_adapter_coa_map table

Interaction Diagram

Reference Docs

Doc Links

API List

All content on this page by is licensed under a .

Following services should be up and running:

  • Client Service Like mgramseva-ifix-adapter

  • Target service IFIX- fiscal-event-service

  • Target Service IFIX-keycloak

  • IFIX master-data-service

Every push to IFIX is recorded in the table with HTTP status

  • status series 200 considered success

  • status 400 are marked client error and reported back to the client

  • status 500 resubmitted by the scheduler

host name of IFIX server

ifix.event.url

IFIX post URL

spring.redis.host

Host name of the redis server

state.goverment.code

top level tenant id of the client

ifix.coa.search.url

url for COA search in IFIX

ifix.project.search.url

Url for the project code search in IFIX

spring.jpa.properties.hibernate.dialect

dialect for JPA. you can change this to oracle or my sql etc

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation

will generate the required tables in the respective database . This feature is used instead of flyway to get database in-dependency

“clientcode” is the tax head like “WATER_CHARGES” or ‘10011’ used in IFIX client like mgramseva
  • “ifixcoacode” is the 16 digit glcode in IFIX. 16 digit code is mapped then this can be ported to any environment like dev to qa ,or qa to uat or from uat to prod. Prefer mapping ifixcoacode

  • Another way is to map the IFIX COA ID itself. Since these are generated ids you cant port to other environments. ID mapping has to be done for every environment.

  • Preference is given to COA Code, if it is null ID will be used

  • example is INSERT INTO public.ifix_adapter_coa_map( id, clientcode, ifixcoacode, ifixid, tenantid) VALUES (1,'10101', '0215-01-102-00-00-01', '6cbcb4a1-2431-4f78-89d7-b4f0565aba37', 'pb');

  • If client “project code” and IFIX project code are the same then no need for mapping. If it is different then map clientprojectcode, ifixprojectid in ifix_adapter_project_map table. Ideally, you should keep both codes the same for getting meaningful data on the dashboard. This way you don't have to do any mapping for project code for any environment. But if for any reason you have different project codes in IFIX and its client or has multiple projects having the same project code then only go for this mapping. The adapter will first check in the IFIX for the supplied “projectCode”, If found it will use it and caches it. If multiple projects or not found it will look into this table for mapping

    1. example is INSERT INTO public.ifix_adapter_project_map( id, clientprojectcode, ifixprojectid, tenantid) VALUES (1, '7374', 'e42db9bb-8427-40a6-9939-4f2189d032bf','pb');

  • state.goverment.code set this value to the clients top level tenantid

  • Environment Variables

    Description

    kafka.topics.ifix.adaptor.mapper

    Topic in which client requests are put . From this further listen and posting happens

    keycloak.host

    Host name of the key cloak authentication token provider

    keycloak.token.url

    key cloak authentication token url

    keycloak.credentials.clientid

    userid of for authentication token

    keycloak.credentials.clientsecret

    password for authentication token

    Link

    Api Swagger document

    iFix-Dev/iFix-adapter-v1.0.yaml at adaptor-dev · egovernments/iFix-Dev

    Postman

    https://www.getpostman.com/collections/c3414cc054346e17aea2

    API

    Description

    events/v1/_push

    API for receiving data from the client (mgram). This is the only API present in the adapter

    here
    here
    ​
    eGov Foundation
    Creative Commons Attribution 4.0 International License

    ifix.host

    iFIX Adapter Master Data Setup

    Follow the steps below to create the Adapter Master Data. Individual Adapter Service documents can be accessed here.

    1. Enter valid details along with Tenant ID to create the Department. Once the tenant ID is created, the user receives a response with an ID and related details. This ID is the Department ID.

    2. Enter valid details along with Tenant ID to create the Expenditure. Once the tenant ID is created, the user receives a response with an ID and related details. This ID is the Expenditure ID.

    3. Enter valid hierarchy details of the Master Department to create Department Hierarchy. Check for more information.

    4. Provide valid details to create Department Entity. Check for more information.

    5. On successful completion of steps 1 to 4, enter valid details to create a project. Check for more information.

    All content on this page by is licensed under a .

    this document
    this document
    this document
    ​
    eGov Foundation
    Creative Commons Attribution 4.0 International License

    mGramSeva iFIX Adapter Service

    Overview

    Ifix-Adapter is a system that works as a mediator between iFIX and its clients. This system will receive requests from the client system and convert the data in the iFIX required format This document contains the details on how to set up the iFIX-adapter service and describes the functionalities it supports. It supports multiple events (Event Array) in a single request.

    Pre-requisites

    Before you proceed with the configuration, make sure the following pre-requisites are met -

    • Java 8

    • Kafka server is up and running

    • PSQL server is running

    • Redis

    Key Functionalities

    • IFIX client requests are pushed to IFIX.

    • The authentication token is fetched from keycloak and cached. Token is re-fetched 5 minutes before expiry.

    • project_id from request data is getting treated as Department Entity Code to fetch Department Entity.

    • COA Code fetched from COA Mapping table by client code and cached it in Redis Server.

    Deployment Details

    Deploy the latest version of the ifix-reference-adapter.

    Configuration Details

    1. Update Key cloak credentials in dev.yaml,qa.yaml,prod.yaml according to the environment The credentials are “keycloak.credentials.clientid and “keycloak.credentials.clientsecret” Example is given in and

    2. Map clientcode, ifixcoacode, ifixid in ifix_adapter_coa_map table

    Interaction Diagram

    Reference Docs

    Doc Links

    API List

    All content on this page by is licensed under a .

    iFIX Adapter Master Data Service

    Overview

    Adapter master data service maintains information on Department, Expenditure and Projects. We can create these details and search for the same details based on the given parameters/request data.

    Version

    Following services should be up and running:

    • Client Service Like mgramseva-ifix-adapter

    • Target service IFIX- fiscal-event-service

    • Target Service IFIX-keycloak

    • Adapter master data service

  • Every push to IFIX is recorded in the table with HTTP status

    • status series 200 considered success

    • status 400 are marked client error

  • It collects projectId form request data and treats it as department_entity_code and calls search API to Department Entity Service. It always expects it will receive only one Department Entity against a single department_entity_code, if it finds multiple raise an error message.

  • One project can have multiple department entities but vice-versa cannot be true. In case of multiple projects for one department entity - the system will raise an error message.

  • host name of IFIX server

    ifix.event.url

    IFIX post URL

    spring.redis.host

    Host name of the redis server

    state.goverment.code

    top level tenant id of the client

    spring.jpa.properties.hibernate.dialect

    dialect for JPA. you can change this to oracle or my sql etc

    spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation

    will generate the required tables in the respective database . This feature is used instead of flyway to get database in-dependency

    “clientcode” is the tax head like “WATER_CHARGES” or ‘10011’ used in IFIX client like mgramseva
  • “ifixcoacode” is the 16 digit glcode in IFIX. 16 digit code is mapped then this can be ported to any environment like dev to qa ,or qa to uat or from uat to prod. Prefer mapping ifixcoacode

  • example is INSERT INTO public.ifix_adapter_coa_map(id, clientcode, ifixcoacode, ifixid, tenantid) VALUES (1,'10101', '0215-01-102-00-00-01', '6cbcb4a1-2431-4f78-89d7-b4f0565aba37', 'pb');

  • state.goverment.code set this value to the clients top level tenant_id

  • Environment Variables

    Description

    kafka.topics.ifix.adaptor.mapper

    Topic in which client requests are put. From this further listen and posting happens

    keycloak.host

    Host name of the key cloak authentication token provider

    keycloak.token.url

    key cloak authentication token url

    keycloak.credentials.clientid

    userid of for authentication token

    keycloak.credentials.clientsecret

    password for authentication token

    Title

    Link

    Api Swagger document

    ReDoc Interactive Demo

    Postman

    https://www.getpostman.com/collections/6bac883e1965f298e96b

    API

    Description

    events/v1/_push

    Api for receiving data from client (mgram). This is the only api present in adapter

    here
    here
    ​
    eGov Foundation
    Creative Commons Attribution 4.0 International License

    ifix.host

    Current version : 1.0.0

    Pre-requisites

    Before we proceed with the configuration, make sure the following pre-requisites are met

    1. Java 8

    2. MongoDB instance

    3. Required service dependency - Department entity service

    Features

    It creates secure endpoints for the master data service. The access token is required to create any master data. The subsequent sections on this page discuss the service details maintained by the master data service.

    Department

    Maintains the create and search department details. The following information is passed while creating the department - the Government ID, department code, department name, parent department if any. Searching the department details is on given parameters like IDs, Government ID, department code, department name.

    API List

    Title

    Link

    /department/v1/_create

    /department/v1/_search

    Expenditure

    Maintains the expenditure details And provide create and search functionality. For creating the expenditure, the following details are required - the Government ID, the department ID, code, name, type (can be "SCHEME", "NON_SCHEME") details. While searching the expenditure details, pass the given parameters like IDs, Government IDs, names, code.

    API List

    Title

    Link

    /expenditure/v1/_create

    /expenditure/v1/_search

    Project

    Maintains the project details and provide create and search functionality. The following details are required to create the project - Government, name, code, expenditure ID, the department entity ID(s), location IDs. While searching, pass the IDs, Government ID, name, code, expenditure ID, location ID.

    API List

    Title

    Link

    /project/v1/_create

    /project/v1/_search

    Interaction Diagram

    Environment

    No environment-specific variables are required for the environment (migration).

    Configurations and Setup

    Update the DB and URI configurations in the dev.yaml, qa.yaml, prod.yaml file.

    References and Notes

    Title

    Link

    Swagger Yaml

    Postman collection

    Master Project API With Example

    Project Create API creates the project when the Master data details (COA, Government, Expenditure, Department) and Department Entity have been created. COA And Government have to be created in iFIX core Master data service.

    Project Create API takes the below attributes in request :

    1. tenantId: This is the Id that will be defined while creating the Ifix core Master Government Service.

    2. expenditureId: This is the Id that will be generated while creating the Adapter Master Expenditure Service.

    3. code: This is the project code that needs to be created.

    4. name: This is the project name that needs to be created.

    5. departmentEntityIds: This is the Department Entity Ids. If we have to create a project at hierarchy level 1 then we need to pass the Department Entity Id of that corresponding level. It depends on the Department hierarchy level on which the project has to be created and hence the same level Department Entity You can pass a list of departmentEntityIds and can create the same project.

    For reference, Below is a Dummy project create example:

    Request :

    Response:

    ​All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.

    {
      "requestHeader": {
        "ts": 1627193067,
        "version": "2.0.0",
        "msgId": "Unknown",
        "signature": "NON",
        "userInfo": {
            "uuid": "e4fd96e8-3b6b-4e36-9503-0f14a01af39d"
        }
      },
      "project": {
        "tenantId": "pb",
        "code": "7330_S557_DIV23SD02",
        "name": "DOLOWAL UPPER",
        "expenditureId": "13ef1c53-702d-43b5-9f97-43fa03c145c5",
        "departmentEntityIds":  ["295180a0-4d60-4805-a77f-92143bd115b4","901f76a8-1911-4960-b389-57b62bd4dcdb"
        ]
      }
    }
    
    
    {
        "responseHeader": {
            "ts": 1627193067,
            "correlationId": null,
            "msgId": "Unknown",
            "status": "successful",
            "signature": "NON",
            "version": "2.0.0"
        },
        "project": [
            {
                "id": "1fb13f0a-588f-476d-b839-afddae7980ef",
                "tenantId": "pb",
                "code": "7330_S557_DIV23SD02",
                "name": "DOLOWAL UPPER",
                "expenditureId": "13ef1c53-702d-43b5-9f97-43fa03c145c5",
                "departmentEntityIds": [
                    "295180a0-4d60-4805-a77f-92143bd115b4",
                    "901f76a8-1911-4960-b389-57b62bd4dcdb"
                ],
                "locationIds": null,
                "auditDetails": {
                    "createdBy": "e4fd96e8-3b6b-4e36-9503-0f14a01af39d",
                    "lastModifiedBy": "e4fd96e8-3b6b-4e36-9503-0f14a01af39d",
                    "createdTime": 1646726943845,
                    "lastModifiedTime": 1646726943845
                }
            }
        ]
    }
    Id.
    https://www.getpostman.com/collections/9891831cac4dad92a650
    https://www.getpostman.com/collections/9891831cac4dad92a650
    https://www.getpostman.com/collections/9891831cac4dad92a650
    https://www.getpostman.com/collections/9891831cac4dad92a650
    https://www.getpostman.com/collections/9891831cac4dad92a650
    https://www.getpostman.com/collections/9891831cac4dad92a650
    ReDoc Interactive Demo
    https://www.getpostman.com/collections/9891831cac4dad92a650
    Creative Commons License
    Creative Commons License
    Creative Commons License
    Creative Commons License