Skip to content

Installation Instructions

Preparations

  • Check that the requirements are met.
  • Ask the customer to contact EDP to provide us with the neccessary files.

Installation

1. Add Package Dependency

Add limepkg-edp-integration as a dependency to your solution.

poetry add limepkg-edp-integration

To avoid limepkg-edp-integration from updating by mistake when working with the solution it is recommended to lock down the version. If you do so, make sure to lock down all its dependencies as well.

After adding the package, you can list the installed version:

poetry show limepkg-edp-integration

Then update the pyproject.toml for the package, just edit it in the [tool.poetry.dependencies] section with the exact version number from the output. Below is an example what it might look like:

[tool.poetry.dependencies]
limepkg-edp-integration = '1.2.1'

Finally run poetry lock to make sure the new version locks work together in practice.

Remember, with this change it is no longer enough to just do poetry update to get the latest version of EDP Integration. You will have to update each of these version locked dependencies yourself.

2. Scheduled task

  1. In your solution, navigate to your tasks folder and open the init.py file that you find inside. If you don't have one, run the command lime-project generate scheduled-task to generate the structure that is needed. In the init.py file, import the edp tasks and register it as a scheduled task with the desired intervals.
  2. edp_customer_serviceplace: here once every 4 hours between 4am and 7pm (be careful and don't be too agressive in your scheduling... especially in cloud):
  3. edp_integration: here once a day at 11pm (see technical for a specification of each available task.):

        from lime_task.schedule import ScheduledTask, TaskSession, CronTab
        from limepkg_edp_integration.tasks import tasks as edp_tasks
        from limepkg_edp_integration.tasks import old_contracts as contract_tasks
    
    
        def get_task_modules():
            return []
    
    
        def register_scheduled_tasks():
            task_session = TaskSession(
                user_name='[email protected]',
                language='sv')
            return [
                ScheduledTask(
                    task=edp_tasks.edp_customer_serviceplace,
                    schedule=CronTab(hour="4-19/4", minute="0"),
                    args=[],
                    session=task_session
                ),
                ScheduledTask(
                    task=edp_tasks.edp_integration,
                    schedule=CronTab(hour="23", minute="0"),
                    args=[],
                    session=task_session
                ),
                # This is optional. Read more under technical
                ScheduledTask(
                    task=contract_tasks.inactivate_contracts,
                    schedule=CronTab(hour="6", minute="0"),
                    args=[],
                    session=task_session
                )
            ]
    

3. Set up Users and Groups

Perform these steps in LISA.

  1. Create a [email protected] user and give it admin permissions. This user is used by the scheduled task that creates runs the integration. Use the following settings:
    • Password: Type a really long nonsense password. Do not store it anywhere (it is not needed).
    • Active: No
    • Type: Integration
    • Login: LIME PRO Authentication (default in Cloud)

4. Set up Database Structure

Tables and fields contains all required and recommended fields. It is possible to set them up manually, or use the available LIP package.

  1. Download the following LIP package for EDP Integration from the latest release.
  2. Install the LIP packages through VBA by running lip.installfromzip
  3. In LISA:
    • Insert descriptives
    • Insert SQL on updates
    • Insert icons

5. Set up Web Client

To be able to use the new lime types and features from this package, they need to be configured in Lime Admin. For the quickest setup be sure to import the provided config files.

The things that need to be configured are:

6. Application Config

  1. In your a application_config.yaml, add a section called edp and specify path_type, path, sftp settings (optional) and fileprefixes to identify the files.

        Lime App: # <-- Change this to your Lime Application name.
          config:
            edp:
              path_type: osfs # or sftp
              path: "C:\\Integrations\\Future\\" # If it is a network path example: \\\\server2\\Folder1\\Import\\
              sftp: # optional, only required if path_type = sftp
                address: "edpftp.edp.se"
                port: "22"
                account: "MyUserName"
                password: "MYSECRET"
              customer_fileprefix: 'LimeKund' # Change these prefixes if neccessary.
              serviceplace_fileprefix: 'LimeAnlaggning'  # Change these prefixes if neccessary.
              service_fileprefix: 'LimeTjanst'  # Change these prefixes if neccessary.
              custom_columns: # The package contains a default. If the integration you are configuring has extra columns, the columns can be overwritten here. The files are delivered without column headers. 
                lime_customer: ["Kundnr", "Personnr1", "Personnr2", "Efternamn1", "Förnamn1", "Efternamn2", "Förnamn2", "Kundadress", "KundPostnr", "KundOrt", "KundLand", "TelefonBostad", "TelefonArbete", "TelefonMobil", "Epostadress", "Fax", "BetalningssättText", "AGMedgivandeFr¨nBGÅter", "EFakturaBanknamn", "KundkategoriText", "KundUpphördDatum", "KundStatus", "EpostOK", "SMSOK", "KundTyp", "KundSkapad", "SenastÄndrad", "CUSTOMER_SPECIFIC_FIELD1", "CUSTOMER_SPECIFIC_FIELD2"]
                lime_serviceplace: ["Kundnr", "Anlnr", "AnläggningAdress", "AnläggningPostnr", "AnläggningOrt", "Fastighetsbeteckning", "Fastighetsnyckel", "AnläggningKontakt", "AnläggningTelefon", "AvläsningsDistrikt", "LTA", "Populärnamn", "AnläggningNyckelNr", "AnläggningPortkod", "AnläggningUpphördDatum", "Anläggningskategori", "AnläggninUtskicksadress", "AnläggningSkapad", "SenastÄndrad"]
                lime_service: ["Kundnr", "Anlnr", "Tjänstnr", "Mätarnr", "SenastFaktureradTomDatum", "SenasteFakturanr", "TjänstStartDatum", "TjänstSlutDatum", "Taxa", "Mätarplacering", "TjänstNyckelNr", "Årsförbrukning", "Tömningsfrekvenskod", "RHDistriktkodText", "Slanglängd", "Brunnstyp", "Behållarestorlek", "Xkoordinat", "Ykoordinat", "Lägenhet", "Tomtyta", "ÖvrigtAntal", "AntalBehållare", "Bevakning", "Mätarstorlek", "Behållare", "Avfallstyp", "TjänstSkapad", "SenastÄndrad", "Taxebenämning", "Produkt", "Delprodukt"]
    

You should now be able to start configuring your EDP Integration. 🎉🎉🎉

Head to the configuration section if you want to tweak and tune your EDP Integration setup to your needs.