/heimv

Primary LanguageRubyOtherNOASSERTION

HeimV Heimverwaltung

HeimV Logo

Development

git clone git@github.com:diegosteiner/heimv.git
cd heimv
docker-compose up app

or with VS Code: [Reopen in Container] with Remote Containers Extension

Development servers

Then inside the container you may run:

  • bin/rails-dev-server to start rails server
  • bin/vite dev to start vite dev server
  • bin/sidekiq-job-worker to start the sidekiq worker process

To visit the automatically created default organization, visit http://heimv.localhost:3000/.

Login

After starting the development servers, open the browser http://heimv.localhost:3000/ and log in with:

Commands

  • Setup DB: bin/rails db:prepare
  • Run migrations: bin/rails db:migrate
  • Run checks: bin/check
  • Run e2e Tests: bin/e2e

Configuration

Copy env.example to .env and change configuration there

Embed Calendar for an Occupiable

<iframe
  sandbox="allow-same-origin allow-scripts allow-top-navigation-by-user-activation allow-top-navigation"
  src="https://app.heimv.ch/{{organisation.slug}}/occupiables/{{occupiables.id}}/calendar/embed?display_months=9"
  style="width: 100%; overflow-x: hidden; overflow-y: scroll; height: 960px; border: none;">
  border="0"
</iframe>

Embed Calendar for a Home

<iframe
  sandbox="allow-same-origin allow-scripts allow-top-navigation-by-user-activation allow-top-navigation"
  src="https://app.heimv.ch/{{organisation.slug}}/homes/{{home.id}}/occupancies/embed?display_months=9"
  border="0"
  style="width: 100%; overflow-x: hidden; overflow-y: scroll; height: 960px; border: none;">
</iframe>

Embed via ICAL

Use this feed in a ICAL compatible calendar app:

https://app.heimv.ch/{{organisation.slug}}/occupiables/{{occupiable.id}}/calendar.ics

Use this feed to get more info (token required)

https://app.heimv.ch/{{organisation.slug}}/occupiables/{{occupiable.id}}/calendar/private_ical_feed.ics?token={{token}}

The token can be generated with user.regenerate_token

Add Organisation

Create a organisation with richtext templates and a user:

onboarding = OnboardingService.create(name: <name>, email: <email>, slug: <slug>)
onboarding.create_missing_rich_text_templates!(include_optional: true)
onboarding.add_or_invite_user!

Translations

Translations are driven by translation.io and their free service for opensource projects.

Cronjobs

Automatically change after some time has passed:

bin/rails r TransitionBookingStatesJob.perform_now

Resend failed Notification attemps:

bin/rails r RetryFailedNotificationsJob.perform_now

Import data

Bookings

Prepare a csv with these columns, including a header, as utf-8:

  • begins_at (as ISO8601)
  • ends_at (as ISO8601)
  • email (optional)
  • ref (which will set the reference, optional)
  • remarks (optional)
  • organisation (which refers to the tenants organisation, optional)
  • category (which corresponds to the booking category keys set for the organisation, optional)
  • phone

Options:

  • initial_state: State to which the booking shall be transitioned
  • default_category:
  • headers: Header map e.g. for import from pfadiheime.ch
headers = "
ignore.id,ignore.cottage_id,ignore.user_id,booking.begins_at,booking.ends_at,booking.remarks,booking.occupancy_type,ignore.created_at,ignore.updated_at,tenant.email,ignore.occupancy_type,booking.remarks,ignore.slug,booking.headcount,tenant.birth_date,booking.tenant_organisation,tenant.name,tenant.street_address,tenant.street_address_2,tenant.zipcode,tenant.city,tenant.phone"

Then import data with:

cat data.csv | bin/rails r "Import::Csv::BookingImporter.new(home).parse(ARGF, **options)"

or with heroku:

cat data.csv | heroku run --no-tty -- 'bin/rails r "Import::Csv::BookingImporter.new(home).parse"'

Tenants

Prepare a csv with these columns, including a header, as utf-8:

  • tenant.first_name
  • tenant.last_name
  • tenant.nickname
  • tenant.street
  • tenant.zipcode
  • tenant.city
  • tenant.phone
  • tenant.email
  • tenant.remarks

Then import data with:

cat data.csv | bin/rails r "Import::Csv::TenantImporter.new(organisation).parse"

Tarifs

Prepare a csv with these columns, including a header, as utf-8:

  • ordinal
  • label
  • type
  • tarif_group
  • unit
  • price
  • associated_types

Then import data with:

cat data.csv | bin/rails r Import::Csv::TarifImporter.new(home).read

Backup & Restore

cat ./path/to/backup.dump | docker exec -i $(docker ps -q --filter name=heimv-db-)  pg_restore -U postgres -d heimv_development --host=localhost --no-privileges --no-owner

Copyright & License

🎂 1000th commit 🎂

Copyright 2017-2023 Diego P. Steiner & contributors

If you want to use HeimV in a commercial setting, a commercial licence is required. For a commercial licence please get in touch: license@heimv.ch. Other than that, the project is licensed under the AGPLv3 License. See LICENCE for details.