Skip to content

Sync data from SpeelotheekSoftware Access to Lend Engine

License

Notifications You must be signed in to change notification settings

lode/access-sync-lendengine

Repository files navigation

Access <> Lend Engine

Sync data from SpeelotheekSoftware's Access to Lend Engine.

Install

  • Install: Docker Desktop on Mac, Docker Engine is enough for Linux

    • Mac: no need to sign in with a Docker account when the installer asks you to.
    • Mac: under 'Settings' -> 'General' disable 'SBOM indexing'.
    • Mac: use ./script/* for managing docker instead of the control panel of Docker Desktop for Mac.
    • Linux: follow Docker post-installation to manage docker without root.
  • Run ./script/setup

  • Run ./script/server

Usage

1. Export data from SpeelotheekSoftware's Access

  • Export website CSVs
    • Artikelen_<timestamp>
    • ArtikelTypes_<timestamp>
    • Merken_<timestamp>
  • Export Access tables
    • Artikel
    • Lid
    • LidStatus
    • LidType
    • Melding
    • MeldingSoort
    • Onderdeel
    • Plaats
    • Straat
    • Verantwoordelijke
  • Place all exported files in data/.

2. Run scripts

Run each command with ./script/console ./script/command <commandName> <optionalExtraArguments>.

You can run ./script/console ./script/command <commandName> --help to get more information about any extra arguments.

Data Command Contents
Get insight insight Contacts without email address and contacts which share an email address
Contacts convert-contacts Contact basics: name, email, phone, address, membership number, etc.
Items convert-website-csvs + csvTimestamp Item basics: name, code, category, brand, price, etc.
Parts gather-extra-data-item-parts Count, description
Memberships gather-extra-data-memberships + membershipId + membershipPrice Contact <> Subscription, period
Contact notes gather-extra-data-contact-notes Messages ("meldingen")
Item custom fields gather-extra-data-item-custom-fields + customFieldId Messages ("meldingen")
Contacts extras gather-extra-data-contacts Contact created
Items extras gather-extra-data-items Item created

Output files LendEngine*.csv & LendEngine*.sql will be added in data/.

3. Import CSVs in Lend Engine admin

The CSVs from the above scripts (LendEngine*.csv for items & contacts) can be imported via Lend Engine's CSV import admin.

  • Import items via Admin > Items > Bulk update (/admin/import/items/)
    • Copy the contents of the output of the convert-website-csvs command
    • Copy quotes along (copy raw content, not the selection when opening in a spreadsheet program) to support newlines
    • Enable "Create new items where code is not found"
  • Import contacts via Admin > Settings > Import contacts (/admin/import/contacts/)
    • Copy the contents of the output of the convert-contacts command

4. Import SQLs via Lend Engine support

The SQLs from the above scripts (LendEngine*.sql) can't be imported via Lend Engine admin. Contact Lend Engine support and ask to import the SQLs for you.

To Do

  • Make non-reservable category configurable
  • Improve item text fields
  • Part mutations (waiting for LE implementation)
  • Maintenance
  • Loan history
  • Convert staff contacts to get admin access

Development

Usage after first setup

Connect to the database

Connect to the database from outside Docker:

  • hostname: localhost
  • port: see SQL_PORT_EXTERNAL in docker.env
  • username/password: see values in docker.env

For managing databases:

  • username: root
  • password: root-secret

About

Sync data from SpeelotheekSoftware Access to Lend Engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages