OS2BOS - Beviling og Styring

Introduktion

BOS er en webapplikation til håndtering af foranstaltninger og bevillinger for kommunens socialrådgivere. Formålet med BOS er at give socialrådgiverne bedre redskaber til at benytte de bedste foranstaltninger og give kommunen som helhed bedre indblik og styringsmulighed i forhold til foranstaltninger, effekter, økonomi og budget.

Navnet BOS dækker over “Bevilling og Styring”.

Nedenstående figur viser et typisk eksempel på en side i systemets brugergrænseflade:

_images/bos_example.png

Indholdet er opdelt i følgende sektioner:

README

OS2BOS

pipeline status coverage report

Installation

TL;DR: To get a running development environment run:

git clone git@git.magenta.dk:bevillingsplatform/bevillingsplatform.git
cd bevillingsplatform
docker-compose up -d

You can now reach the frontend at http://localhost:8080. The frontend will proxy all request to the backend.

Run backend tests with:

docker-compose exec bev pytest
Docker

The repository contains a Dockerfile. This is the recommended way to install bevillingsplatform both as a developer and in production.

All releases are pushed to Docker Hub at magentaaps/bevillingsplatform under the latest tag.

To run bevillingsplatform in docker you need a running docker daemon. To install docker we refer you to the official documentation.

To configure the django inside the image, add your setting to /code/settings.ini. This is easiest done by binding a file from the host machine to this file.

The container requires a connection to a postgres database server. It is configured with the DATABASE_* settings. The database server must have a user and a database object. It can be created with the help of /docker/postgres-initdb.d/20-create-db-and-user.sh. This file can easily be mounted into /docker-entrypoint-initdb.d/ in the official postgres docker image.

You can start the container with:

docker run -p 8000:8000 -v $PWD/dev-settings.ini:/code/settings.ini magentaaps/bevillingsplatform:latest

This will pull the image from Docker Hub and starts a container in the foreground. The -p 8000:8000 binds port 8000 of the host machine to port 8000 on the container. The -v $PWD/dev-settings.ini:/code/settings.ini binds the dev-settings.ini file into the container at the location where django will pick it up.

If successful you should see the container migrating the database and finally

[2019-06-13 09:18:48 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)

when the gunicorn server starts up. You should now be able to reach the server from the host at http://localhost:8000.

If you continue to see 01/30 Unable to connect to database. your database configuration most likely wrong. Remember if you set DATABASE_HOST=localhost the container will try to connect to a database in the same container, not the host machine.

Static files

The docker image will serve the static files for the Vue frontend, Django REST framework and Django Admin from gunicorn both in development and in production. Normally it is not good practice to serve static files from gunicorn for security and performance reasons. We use whitenoise to address most of these concerns and generally don’t expect many users. If you still want to serve it from another service, all the files are copied to /static on container startup. This can easily be mounted to a webserver.

Logs

For logging we use the builtin logging module used by Django. Logs are written to the /log/ directory inside the container.

The /log/ folder is mapped to the host systems log/ folder in local development and /var/log/os2bos/ anywhere else.

We log the following:

  • Error log - the gunicorn error log is output on STDERR as well as in /log/error.log. It can be inspected with docker logs.

  • Access log - The gunicorn access log is output on STDOUT as well as in /log/access.log. It can be inspected with docker logs.

  • Django debug log - The django log is written to /log/django-debug.log.

  • Audit log - We log all non-idempotent requests (POST/PUT/PATCH/DELETE) in the audit log specifying the request endpoint and user making the request. The log is written to /log/audit.log.

  • Export to Prism log - Log related to the PRISM exports management command. The log is written to /log/export_to_prism.log.

  • Mark Payments Paid log - Log related to the marking payments paid management command. The log is written to mark_payments_paid.log.

  • Generate Payments Report log - Log related to generating the payment reports. The log is written to /log/generate_payments_report.log.

  • Cron mail logs - Logs related to the Django mailer app. The logs are written to cron_mail.log, cron_mail_deferred.log, cron_mail_purge.log.

User permissions

The Dockerfile creates and runs the application as the bev user. This user will own all the files generated by the application. This user has a UID and GID of 72050.

If you want to use another UID/GID, you can specify it as the --user=uid:gid overwrite flag. for the docker run command or in docker-compose. If you change the UID/GID, the /log and /static volumes may not have the right permissions. It is recommended to only use bind if you overwrite the user and set the same user as owner of the directory you bind.

If some process inside the container needs to write files to locations other than /static or /log, you need to mount a volume with the right permissions. An example is ./manage.py makemigrations trying to write to /code/backend/core/migrations. If you bind /code to your host system, make sure that the user with UID 72050 have write permissions to backend/core/migrations. This can be done with chmod o+w migrations on your host where you grant all user permission to write.

Test

All the requirements for tests included in the docker image. You can run the test from inside a container with pytest.

tox

tox is also installed, but it tries to create a virtual environments inside the container. This is messy and will fail because the application user does not have permission to write files. Don’t use tox inside the container.

Docker-compose

You can use docker-compose to start up bevillingsplatform and related services such as postgres and postfix.

A docker-compose.yml for development is included. It includes the settings to connect them. It starts the following services:

Normally the backend image also serves the frontend code, but to ease frontend development, we include a frontend service that run vue-cli-service serve. The frontend proxies requests to the backend. The exact list of proxied endpoints can be seen in frontend/vue.config.js.

docker-compose.yml also mounts the current directory in the container and automatically restarts the server on changes to the backend files. This enables you to edit the backend files and the server will be reloaded automatically.

To pull the images and start the services run:

docker-compose up -d --build

The -d flag move the services to the background. You can inspect the output of them with docker-compose logs <name> where <name> is the name of the service in docker-compose.yml. The --build flag builds the newest docker image for bevillingsplatform from the local Dockerfile.

To stop the service again run docker-compose stop. This will stop the services, but the data will persist. To completely remove the containers and data run docker-compose down -v.

Tests and shell access

To run the backend test, execute: docker-compose exec bev ./manage.py test. It will connect to the running docker container and execute the tests.

To get shell access to the backend run docker-compose exec bev bash.

If you want to write files from inside the container, make sure the bev user have permission to do so. See User permissions.

Tests can also be executed locally with tox:

tox -e test

Code coverage

We adhere to a code coverage of 100%.

After running the test-suite a coverage report can be generated locally with tox:

tox -e coverage

Documentation

The documentation exists at Read the Docs and can be generated locally with tox:

tox -e docs

When changes are introduced to the Django models, update and commit the database model graph for use in documentation:

tox -e graph

Code standards

The Python code is enforced with the following standards:

Adherence to these standards can be checked locally with tox:

tox -e lint

Licensing

Copyright (c) 2019 Magenta Aps

Bevillingsplatform is free software; you may use, study, modify and distribute it under the terms of version 2.0 of the Mozilla Public License. See the LICENSE file for details. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

All source code in this and the underlying directories is subject to the terms of the Mozilla Public License, v. 2.0.

The core version of the code is located here: https://github.com/OS2bos/os2bos/.

Technical Documentation

BOS frontenden er skrevet i Javascript frameworket Vue.js. Brugeren interagerer med denne og frontenden kommunikerer med backenden via. et REST API i JSON format.

BOS frontend documentation

The frontend GUI is a javascript single page application that uses the VueJS framework. It comprises the following components:

  • VueJS for templating and UI logic (view layer)

  • Vue Router for routing between views

  • Vuex for sharing data between Vue components

  • axios for communicating with the backend REST API

  • A modified version of Semstrap for basic CSS styling

  • Vue CLI for build process management

  • Testcafe for E2E testing

BOS backenden er skrevet i Python og benytter Django samt Django Rest Framework. Data bliver persisteret i en PostgreSQL-database og udstilles og manipuleres via et REST API.

Backend documentation

Authentication

Authentication in OS2BOS is based on SAML 2.0 single sign-on. Support for this is implemented through the module PySAML2.

Once a user has been authenticated, a session is created containing the attributes given to us from the IdP, e.g. the Active Directory groups the user belongs to.

SAML based single sign-on (SSO)

SAML SSO delegates the login process to the IdP, and as such, requires an IdP supporting SAML single sign-on.

Settings related to SAML SSO can be found in the SAML2_AUTH object in settings.py.

User setup

In local development and test, SAML SSO is used with SimpleSamlPHP as idP.

Users and user profiles are defined in dev-environment/authsources.php for local development. If you wish to add a new user, you need to add an entry to the file following this template:

'<brugernavn>:<password>' => array(
     'email' => '<email_adresse>',
     'username' => '<brugernavn>',
     'first_name' => '<fornavn>',
     'last_name' => '<efternavn>',
     'team' => '<team (navn)>',
     'bos_profile' => '<profil>'
),

A user that is not allowed to use OS2BOS, must have a SAML-token with an empty or missing bos_profile entry.

User profiles

There are five user profiles corresponding to five different levels of permissions.

  • “readonly” - the user can only read, not write.

  • “edit” - the user can both read and write, but cannot perform grant operations.

  • “grant” - the user can both read, write and perform grant operations, but cannot access Django admin.

  • “workflow_engine” - the user can both read, write and perform grant operations, and can access only classifications in Django admin.

  • “admin” - the user can read, write, perform grant operations and access Django admin.

Integrations
Serviceplatformen

We use Serviceplatformen to fetch information from the CPR register. Support for this is implemented through the module service_person_stamdata_udvidet.

Settings relevant to Serviceplatformen can be found in the SERVICEPLATFORM_UUIDS object and the SERVICEPLATFORM_CERTIFICATE_PATH, USE_SERVICEPLATFORM, USE_SERVICEPLATFORM_PROD keys in settings.py.

Virk.dk

We use Virk.dk to fetch information from their CVR register. Support for this is implemented through the module virk.dk.

Settings relevant to Virk.dk are the USE_VIRK, VIRK_USER, VIRK_PASS and VIRK_URL keys found in settings.py.

PRISME

OS2BOS can export daily payment files for import into the PRISME economy system. The format of the files are based on KMD’s interface specification GF200001Q for creditor records (transaction type G68).

Generating database documentation

The database documentation can be found in an online version here: os2bosdocs.

We generate database documentation using the tool SchemaSpy. The following commands are run from inside the container as root: docker-compose exec -u 0 bev bash

Install a JRE:

apt-get install default-jre

Install graphviz:

apt-get install graphviz

Download the latest schemaspy.jar

wget https://github.com/schemaspy/schemaspy/releases/download/v6.1.0/schemaspy-6.1.0.jar -O schemaspy.jar

Download the latest JDBC for Postgresql:

wget https://jdbc.postgresql.org/download/postgresql-42.2.8.jar -O postgresql.jar

Run SchemaSpy against the database:

java -jar schemaspy.jar -dp postgresql.jar -t pgsql -s public -db bev -host db -u bev -p bev -o er_html

The documentation is now found in the er_html folder.

Django debugging

To debug end-to-end you can set the breakpoint() you want and use docker attach:

docker attach bevillingsplatform_bev_1
Release procedure

We manage releases using the Gitflow model.

  • Create a release branch for the release, e.g. release/1.0.0.

  • Bump the version and changelog in NEWS.rst and VERSION according to Semantic Versioning.

  • Optional: Check our dependencies for new security bugfixes.

  • Optional: In case of API changes, save the OpenAPI schema openapi.yml from <OS2BOS URL>/api/openapi/?format=api for use in documentation.

  • Optional: In case of model changes, update the database model graph by running tox -e graph for use in documentation.

  • Test the release and verify that it doesn’t contain any breaking bugs or regressions.

  • Create an rc tag, e.g. 1.0.0-rc1 on the release branch to make it deployable on staging.

  • In case of further development, make pull requests against the release branch and create a new rc tag.

  • Proceed with development and rc-tagging on the release branch until the customer is happy.

  • Create a pull request from the release branch to master for review of VERSION and ǸEWS.rst bump.

  • Create a pull request from the release branch to develop.

  • Merge the pull requests.

  • Create a release tag, e.g. 1.0.0 from master.

  • Push develop, master and tags to the OS2BOS Github as the new core version.

  • Delete the release branch.

Code documentation
_images/OS2BOS_datamodel.png
core -the core Django app
Submodules
core.admin module

Customize django-admin interface.

class core.admin.AccountAliasMappingAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for AccountAlias.

change_list_template = 'core/admin/accountaliasmapping/change_list.html'
changelist_view(*args, **kwargs)

Override changelist_view adding form to context.

get_urls()

Override get_urls adding upload_url path.

list_display = ('main_account_number', 'activity_number', 'alias')
property media
upload_csv(request)

Handle the uploaded CSV file.

property urls

Override get_urls adding upload_url path.

class core.admin.AccountAliasMappingCSVFileUploadForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)

Bases: django.forms.forms.Form

CSV Upload form for AccountAliasMappingAdmin.

Form fields:

  • csv_file: vælg venligst en fil (FileField)

property media

Return all media required to render the widgets on this form.

class core.admin.ActivityAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

ModelAdmin for Activity.

account_alias(obj)

Get account alias.

account_number(obj)

Get account number.

property media
readonly_fields = ('account_number', 'account_alias')
class core.admin.ActivityCategoryAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for ActivityCategory.

inlines = [<class 'core.admin.SectionInfoActivityCategoryInline'>]
list_display = ('category_id', 'name')
property media
class core.admin.ActivityDetailsAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

Widgets: Filter_horizontal for many to many links, add search field.

exclude = ('supplementary_activity_for', 'main_activity_for', 'service_providers')
filter_horizontal = ('main_activities',)
inlines = (<class 'core.admin.SectionInfoInline'>, <class 'core.admin.SupplementaryActivityInline'>)
list_display = ('name', 'activity_id', 'active')
property media
search_fields = ('activity_id', 'name')
class core.admin.ActivityInline(parent_model, admin_site)

Bases: django.contrib.admin.options.TabularInline

ActivityInline for ServiceProviderAdmin.

extra = 0
has_add_permission(request, obj=None)

Override has_add_permission for InlineModelAdmin.

has_change_permission(request, obj=None)

Override has_change_permission for InlineModelAdmin.

has_delete_permission(request, obj=None)

Override has_delete_permission for InlineModelAdmin.

property media
model

alias of core.models.Activity

class core.admin.AppropriationAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

ModelAdmin for Appropriation.

property media
class core.admin.ApprovalLevelAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for ApprovalLevel.

list_display = ('name', 'active')
property media
class core.admin.CaseAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

ModelAdmin for Case.

property media
class core.admin.ClassificationAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

ModelAdmin for Classification models.

has_add_permission(request)

Override has_add_permission for ModelAdmin.

has_change_permission(request, obj=None)

Override has_change_permission for ModelAdmin.

has_delete_permission(request, obj=None)

Override has_delete_permission for ModelAdmin.

has_module_permission(request)

Override has_model_permission for ModelAdmin.

has_view_permission(request, obj=None)

Override has_view_permission for ModelAdmin.

property media
class core.admin.ClassificationInline(parent_model, admin_site)

Bases: django.contrib.admin.options.TabularInline

TabularInline for Classification inlines.

has_add_permission(request)

Override has_add_permission for InlineModelAdmin.

has_change_permission(request, obj=None)

Override has_change_permission for InlineModelAdmin.

has_delete_permission(request, obj=None)

Override has_delete_permission for InlineModelAdmin.

has_view_permission(request, obj=None)

Override has_view_permission for InlineModelAdmin.

property media
class core.admin.CustomUserAdmin(model, admin_site)

Bases: django.contrib.auth.admin.UserAdmin

Add team to user admin interface.

has_add_permission(request)

Override has_add_permission for ModelAdmin.

has_change_permission(request, obj=None)

Override has_change_permission for ModelAdmin.

has_delete_permission(request, obj=None)

Override has_delete_permission for ModelAdmin.

has_module_permission(request)

Override has_model_permission for ModelAdmin.

has_view_permission(request, obj=None)

Override has_view_permission for ModelAdmin.

property media
class core.admin.EffortAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for Effort.

filter_horizontal = ('allowed_for_target_groups',)
list_display = ('name', 'active')
property media
class core.admin.EffortStepAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for EffortStep.

inlines = (<class 'core.admin.SectionEffortStepProxyInline'>,)
list_display = ('name', 'list_sections', 'active')
list_sections(obj)

HTML list of sections for Django admin purposes.

property media
search_fields = ('name', 'number')
class core.admin.HistoricalRatePerDateInline(parent_model, admin_site)

Bases: core.admin.ClassificationInline

HistoricalRatePerDateInline for VariablerateAdmin.

can_delete = False
classes = ('collapse',)
exclude = ('history_change_reason',)
extra = 0
has_add_permission(request)

Override has_add_permission for HistoricalRatePerDateInline.

has_change_permission(request, obj=None)

Override has_change_permission for HistoricalRatePerDateInline.

property media
model

alias of core.proxies.HistoricalRatePerDateProxy

verbose_name = 'Historisk takst for datoer'
verbose_name_plural = 'Historiske takster for datoer'
class core.admin.InternalPaymentRecipientAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for InternalPaymentRecipient.

list_display = ('name',)
property media
class core.admin.MainActivityDetailsInline(parent_model, admin_site)

Bases: core.admin.ClassificationInline

MainActivityDetailsInline for SectionAdmin.

extra = 0
property media
model

alias of core.models.SectionInfo

ordering = ('activity_details__name',)
verbose_name = 'Tilladt hovedydelse'
verbose_name_plural = 'Tilladte hovedydelser'
class core.admin.MunicipalityAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for Municipality.

list_display = ('name', 'active')
property media
search_fields = ('name',)
class core.admin.PaymentAdmin(model, admin_site)

Bases: simple_history.admin.SimpleHistoryAdmin

ModelAdmin for Payment.

account_alias(obj)

Get account alias.

account_string(obj)

Get account string.

list_display = ('id', 'payment_id', 'account_string', 'date', 'paid', 'paid_date', 'payment_schedule_str')
list_filter = ('paid', 'payment_schedule__fictive', 'date', 'paid_date', 'payment_method', 'recipient_type')
property media
payment_id(obj)

Get payment ID from payment plan.

payment_schedule_str(obj)

Get related payment schedule link.

readonly_fields = ('payment_id', 'account_string', 'account_alias')
search_fields = ('payment_schedule__payment_id',)
class core.admin.PaymentDateExclusionAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for PaymentDateExclusion.

list_display = ('date', 'weekday')
list_filter = (('date', <class 'django.contrib.admin.filters.DateFieldListFilter'>),)
property media
search_fields = ('date',)
weekday(obj)

Return translated weekday of date.

class core.admin.PaymentMethodDetails(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

ModelAdmin for PaymentMethodDetails.

property media
class core.admin.PaymentScheduleAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

Display read only fields on payment schedule.

account_alias(obj)

Get account alias.

account_string(obj)

Get account string.

list_display = ('id', 'payment_id', 'recipient_type', 'recipient_id', 'recipient_name', 'payment_frequency', 'payment_method', 'payment_type', 'payment_amount', 'account_string', 'fictive')
list_filter = ('payment_method', 'payment_type', 'payment_frequency', 'fictive')
property media
readonly_fields = ('payment_id', 'account_string', 'account_alias', 'price_per_unit')
search_fields = ('payment_id',)
class core.admin.PriceAdmin(model, admin_site)

Bases: core.admin.VariableRateAdmin

ModelAdmin for Price.

form

alias of core.admin.PriceForm

list_display = ('payment_schedule',)
property media
readonly_fields = ('payment_schedule',)
class core.admin.PriceForm(*args, **kwargs)

Bases: core.admin.VariableRateAdminForm

PriceForm for PriceAdmin.

property media

Return all media required to render the widgets on this form.

class core.admin.RateAdmin(model, admin_site)

Bases: core.admin.VariableRateAdmin

ModelAdmin for Rate.

exclude = ('needs_recalculation',)
form

alias of core.admin.RateForm

list_display = ('name', 'description')
property media
class core.admin.RateForm(*args, **kwargs)

Bases: core.admin.VariableRateAdminForm

RateForm for RateAdmin.

property media

Return all media required to render the widgets on this form.

class core.admin.RatePerDateInline(parent_model, admin_site)

Bases: core.admin.ClassificationInline

RatePerDateInline for VariablerateAdmin.

can_delete = False
extra = 0
has_add_permission(request)

Override has_add_permission for RatePerDateInline.

property media
model

alias of core.models.RatePerDate

readonly_fields = ['rate', 'start_date', 'end_date']
class core.admin.RelatedPersonAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

ModelAdmin for RelatedPerson.

property media
class core.admin.SchoolDistrictAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for SchoolDistrict.

list_display = ('name', 'active')
property media
class core.admin.SectionAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

Add search field.

filter_horizontal = ('allowed_for_target_groups', 'allowed_for_steps')
inlines = (<class 'core.admin.MainActivityDetailsInline'>, <class 'core.admin.SupplementaryActivityDetailsInline'>)
list_display = ('paragraph', 'text', 'list_main_activity_for', 'list_supplementary_activity_for', 'active')
list_main_activity_for(obj)

HTML list of main activities for Django admin purposes.

list_supplementary_activity_for(obj)

HTML list of supplementary activities for Django admin purposes.

property media
search_fields = ('paragraph', 'text')
class core.admin.SectionEffortStepProxyInline(parent_model, admin_site)

Bases: core.admin.ClassificationInline

SectionEffortStepProxyInline for EffortStepAdmin.

extra = 0
property media
model

alias of core.proxies.SectionEffortStepProxy

verbose_name = 'Tilladt paragraf'
verbose_name_plural = 'Tilladte paragraffer'
class core.admin.SectionInfoActivityCategoryInline(parent_model, admin_site)

Bases: core.admin.ClassificationInline

SectionInfoInline for ActivityDetailsAdmin.

extra = 0
property media
model

alias of core.models.SectionInfo

class core.admin.SectionInfoAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for SectionInfo.

list_display = ('activity_details', 'section', 'kle_number', 'activity_category')
property media
class core.admin.SectionInfoInline(parent_model, admin_site)

Bases: core.admin.ClassificationInline

SectionInfoInline for ActivityDetailsAdmin.

extra = 0
property media
model

alias of core.models.SectionInfo

verbose_name = 'Tilladt paragraf (for hovedydelse)'
verbose_name_plural = 'Tilladte paragraffer (for hovedydelse)'
class core.admin.ServiceProviderAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

Add search fields.

inlines = [<class 'core.admin.ActivityInline'>]
list_display = ('name', 'cvr_number', 'active')
property media
search_fields = ('name', 'cvr_number')
class core.admin.SupplementaryActivityDetailsInline(parent_model, admin_site)

Bases: core.admin.ClassificationInline

SupplementaryActivityDetailsInline for SectionAdmin.

extra = 0
property media
model

alias of core.proxies.ActivityDetailsSectionProxy

ordering = ('activitydetails__name',)
verbose_name = 'Tilladt følgeudgift'
verbose_name_plural = 'Tilladte følgeudgifter'
class core.admin.SupplementaryActivityInline(parent_model, admin_site)

Bases: core.admin.ClassificationInline

SupplementaryActivityInline for ActivityDetailsAdmin.

extra = 0
property media
model

alias of core.proxies.ActivityDetailsSectionProxy

verbose_name = 'Tilladt paragraf (for følgeudgift)'
verbose_name_plural = 'Tilladte paragraffer (for følgeudgift)'
class core.admin.TargetGroupAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for TargetGroup with custom ModelForm.

fields = ('name', 'required_fields_for_case', 'active')
form

alias of core.admin.TargetGroupForm

list_display = ('name', 'active')
property media
class core.admin.TargetGroupForm(*args, **kwargs)

Bases: django.forms.models.ModelForm

Form for TargetGroup to set required_fields_for_case.

__init__(*args, **kwargs)

__init__ for TargetGroupForm.

Set initial value for required_fields_for_case.

clean_required_fields_for_case()

Clean required_fields_for_case as comma-separated string.

property media

Return all media required to render the widgets on this form.

required_fields_for_case_choices()

Define the choices for the required_fields_for_case field.

class core.admin.TeamAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for Team.

property media
class core.admin.VariableRateAdmin(model, admin_site)

Bases: core.admin.ClassificationAdmin

ModelAdmin for VariableRate subclasses.

form

alias of core.admin.VariableRateAdminForm

inlines = [<class 'core.admin.RatePerDateInline'>, <class 'core.admin.HistoricalRatePerDateInline'>]
property media
save_model(request, obj, form, change)

Override save_model to set rate after model save.

class core.admin.VariableRateAdminForm(*args, **kwargs)

Bases: django.forms.models.ModelForm

Form for handling the specifics of date dependency.

__init__(*args, **kwargs)

__init__ for VariableRateAdminForm.

Set initial value for rate and start_date.

property media

Return all media required to render the widgets on this form.

core.apps module

Core app configuration.

class core.apps.CoreConfig(app_name, app_module)

Bases: django.apps.config.AppConfig

The core Django app.

name = 'core'
ready()

Defer import of signals until ready.

core.authentication module

Classes for handling CSRF authentication.

class core.authentication.CsrfExemptSessionAuthentication

Bases: rest_framework.authentication.SessionAuthentication

Override standard session to exempt request from CSRF validation.

This is OK from a security perspective since a new SAML token is issued with each API request.

enforce_csrf(request)

Override this function to do nothing.

core.filters module

Filters and filtersets for filtering in REST API.

Filters allow us to do basic search for objects on allowed field without adding the complexity of an entire search engine nor of custom queries.

class core.filters.ActivityFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter activities on status.

auto_filters = {}
base_filters = {'status': <django_filters.filters.ChoiceFilter object>}
declared_filters = {}
related_filters = {}
class core.filters.AllowedForStepsFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter sections on allowed effort steps.

auto_filters = {}
base_filters = {'active': <django_filters.rest_framework.filters.BooleanFilter object>, 'allowed_for_steps': <django_filters.filters.NumberFilter object>, 'allowed_for_target_groups': <django_filters.filters.ModelMultipleChoiceFilter object>, 'law_text_name': <django_filters.filters.CharFilter object>, 'paragraph': <django_filters.filters.CharFilter object>, 'text': <django_filters.filters.CharFilter object>}
declared_filters = {'allowed_for_steps': <django_filters.filters.NumberFilter object>}
filter_allowed_for_steps(qs, name, value)

Filter on “allowed_for_steps” relation.

related_filters = {}
class core.filters.AppropriationFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter appropriation.

auto_filters = {}
base_filters = {'case': <rest_framework_filters.filters.RelatedFilter object>, 'created': <django_filters.filters.IsoDateTimeFilter object>, 'main_activity__details__id': <django_filters.filters.NumberFilter object>, 'modified': <django_filters.filters.IsoDateTimeFilter object>, 'note': <django_filters.filters.CharFilter object>, 'sbsys_id': <django_filters.filters.CharFilter object>, 'section': <django_filters.filters.ModelChoiceFilter object>, 'user_created': <django_filters.filters.CharFilter object>, 'user_modified': <django_filters.filters.CharFilter object>}
declared_filters = {'case': <rest_framework_filters.filters.RelatedFilter object>, 'main_activity__details__id': <django_filters.filters.NumberFilter object>}
related_filters = {'case': <rest_framework_filters.filters.RelatedFilter object>}
class core.filters.CaseFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter cases on the “expired” field.

auto_filters = {}
base_filters = {'acting_municipality': <django_filters.filters.ModelChoiceFilter object>, 'assessment_comment': <django_filters.filters.CharFilter object>, 'case_worker': <rest_framework_filters.filters.RelatedFilter object>, 'cpr_number': <django_filters.filters.CharFilter object>, 'created': <django_filters.filters.IsoDateTimeFilter object>, 'district': <django_filters.filters.ModelChoiceFilter object>, 'effort_step': <django_filters.filters.ModelChoiceFilter object>, 'efforts': <django_filters.filters.ModelMultipleChoiceFilter object>, 'expired': <django_filters.rest_framework.filters.BooleanFilter object>, 'modified': <django_filters.filters.IsoDateTimeFilter object>, 'name': <django_filters.filters.CharFilter object>, 'note': <django_filters.filters.CharFilter object>, 'paying_municipality': <django_filters.filters.ModelChoiceFilter object>, 'residence_municipality': <django_filters.filters.ModelChoiceFilter object>, 'sbsys_id': <django_filters.filters.CharFilter object>, 'scaling_step': <django_filters.filters.ChoiceFilter object>, 'target_group': <django_filters.filters.ModelChoiceFilter object>, 'user_created': <django_filters.filters.CharFilter object>, 'user_modified': <django_filters.filters.CharFilter object>}
declared_filters = {'case_worker': <rest_framework_filters.filters.RelatedFilter object>, 'expired': <django_filters.rest_framework.filters.BooleanFilter object>}
filter_expired(queryset, name, value)

Filter out cases according to value.

related_filters = {'case_worker': <rest_framework_filters.filters.RelatedFilter object>}
class core.filters.CaseForAppropriationFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter cases on CPR number, team and case_worker.

auto_filters = {}
base_filters = {'case_worker': <django_filters.filters.ModelChoiceFilter object>, 'case_worker__team': <django_filters.filters.ModelChoiceFilter object>, 'cpr_number': <django_filters.filters.CharFilter object>, 'sbsys_id': <django_filters.filters.CharFilter object>}
declared_filters = {}
related_filters = {}
class core.filters.CaseForPaymentFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter cases on CPR number.

auto_filters = {}
base_filters = {'cpr_number': <django_filters.filters.CharFilter object>}
declared_filters = {}
related_filters = {}
class core.filters.PaymentFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter payments on payment plan, activity, case, dates, etc.

auto_filters = {}
base_filters = {'activity': <rest_framework_filters.filters.RelatedFilter object>, 'amount': <django_filters.filters.NumberFilter object>, 'case': <rest_framework_filters.filters.RelatedFilter object>, 'date': <django_filters.filters.DateFilter object>, 'date__gte': <django_filters.filters.DateFilter object>, 'date__lte': <django_filters.filters.DateFilter object>, 'date_month': <django_filters.filters.ChoiceFilter object>, 'date_week': <django_filters.filters.ChoiceFilter object>, 'date_year': <django_filters.filters.ChoiceFilter object>, 'note': <django_filters.filters.CharFilter object>, 'paid': <django_filters.rest_framework.filters.BooleanFilter object>, 'paid_amount': <django_filters.filters.NumberFilter object>, 'paid_date': <django_filters.filters.DateFilter object>, 'paid_date__gte': <django_filters.filters.DateFilter object>, 'paid_date__lte': <django_filters.filters.DateFilter object>, 'paid_date_or_date__gte': <django_filters.filters.DateFilter object>, 'paid_date_or_date__lte': <django_filters.filters.DateFilter object>, 'paid_date_or_date_month': <django_filters.filters.ChoiceFilter object>, 'paid_date_or_date_week': <django_filters.filters.ChoiceFilter object>, 'paid_date_or_date_year': <django_filters.filters.ChoiceFilter object>, 'payment_method': <django_filters.filters.ChoiceFilter object>, 'payment_schedule': <rest_framework_filters.filters.RelatedFilter object>, 'recipient_id': <django_filters.filters.CharFilter object>, 'recipient_name': <django_filters.filters.CharFilter object>, 'recipient_type': <django_filters.filters.ChoiceFilter object>, 'saved_account_alias': <django_filters.filters.CharFilter object>, 'saved_account_string': <django_filters.filters.CharFilter object>}
declared_filters = {'activity': <rest_framework_filters.filters.RelatedFilter object>, 'case': <rest_framework_filters.filters.RelatedFilter object>, 'date__gte': <django_filters.filters.DateFilter object>, 'date__lte': <django_filters.filters.DateFilter object>, 'date_month': <django_filters.filters.ChoiceFilter object>, 'date_week': <django_filters.filters.ChoiceFilter object>, 'date_year': <django_filters.filters.ChoiceFilter object>, 'paid_date__gte': <django_filters.filters.DateFilter object>, 'paid_date__lte': <django_filters.filters.DateFilter object>, 'paid_date_or_date__gte': <django_filters.filters.DateFilter object>, 'paid_date_or_date__lte': <django_filters.filters.DateFilter object>, 'paid_date_or_date_month': <django_filters.filters.ChoiceFilter object>, 'paid_date_or_date_week': <django_filters.filters.ChoiceFilter object>, 'paid_date_or_date_year': <django_filters.filters.ChoiceFilter object>, 'payment_schedule': <rest_framework_filters.filters.RelatedFilter object>}
filter_date_month(queryset, name, value)

Filter date on previous, current, next month.

filter_date_week(queryset, name, value)

Filter date on previous, current, next week.

filter_date_year(queryset, name, value)

Filter date on previous, current, next year.

filter_paid_date_or_date_gte(queryset, name, value)

Filter on value <= “best known payment date”.

filter_paid_date_or_date_lte(queryset, name, value)

Filter on value >= “best known payment date”.

filter_paid_date_or_date_month(queryset, name, value)

Filter best known payment date on previous, current, next month.

filter_paid_date_or_date_week(queryset, name, value)

Filter best known payment date on previous, current, next week.

filter_paid_date_or_date_year(queryset, name, value)

Filter best known payment date on previous, current, next year.

generic_time_choices = (('previous', 'Forrige'), ('current', 'Nuværende'), ('next', 'Næste'))
related_filters = {'activity': <rest_framework_filters.filters.RelatedFilter object>, 'case': <rest_framework_filters.filters.RelatedFilter object>, 'payment_schedule': <rest_framework_filters.filters.RelatedFilter object>}
class core.filters.PaymentScheduleFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter payment plans on ID.

auto_filters = {}
base_filters = {'payment_id': <django_filters.filters.NumberFilter object>}
declared_filters = {}
related_filters = {}
class core.filters.UserForCaseFilter(data=None, queryset=None, *, relationship=None, **kwargs)

Bases: rest_framework_filters.filterset.FilterSet

Filter cases on case worker team.

auto_filters = {}
base_filters = {'team': <django_filters.filters.ModelChoiceFilter object>}
declared_filters = {}
related_filters = {}
core.managers module

Custom query set managers.

class core.managers.ActivityQuerySet(model=None, query=None, using=None, hints=None)

Bases: django.db.models.query.QuerySet

QuerySet and Manager for the Activity model.

expired()

Only include expired activities.

ongoing()

Only include ongoing, i.e. non-expired Activities.

class core.managers.AppropriationQuerySet(model=None, query=None, using=None, hints=None)

Bases: django.db.models.query.QuerySet

QuerySet and Manager for the Appropriation model.

annotate_main_activity_details_id()

Annotate the main_activity__details__id as a subquery.

expired()

Only include expired Appropriations.

ongoing()

Only include ongoing, i.e. non-expired Appropriations.

class core.managers.CaseQuerySet(model=None, query=None, using=None, hints=None)

Bases: django.db.models.query.QuerySet

Distinguish between expired and ongoing cases.

expected_cases_for_report_list()

Filter cases for a report of granted AND expected cases.

expired()

Only include expired Cases.

ongoing()

Only include ongoing, i.e. non-expired Cases.

class core.managers.PaymentQuerySet(model=None, query=None, using=None, hints=None)

Bases: django.db.models.query.QuerySet

Handle payments properly - some are paid and others are not.

In general we should use the scheduled day and amount for unpaid payments and the paid date and paid amount for paid ones.

amount_case = <Case: CASE WHEN <Q: (AND: ('paid_amount__isnull', False))> THEN F(paid_amount), WHEN <Q: (AND: ('amount__isnull', False))> THEN F(amount), ELSE F(amount)>
amount_sum()

Sum over Payments with paid_amount overruling amount.

annotate_paid_date_or_date()

Annotate all payments with paid date or payment date.

expected_payments_for_report_list()

Filter payments for a report of granted AND expected payments.

granted_payments_for_report_list()

Filter payments for a report of only granted payments.

group_by_monthly_amounts()

Group by monthly amounts.

The output will look like this:

[
    {'date_month': '2019-07', 'amount': Decimal('3000.00')},
    {'date_month': '2019-08', 'amount': Decimal('1500.00')}
]
in_year(year=None)

Filter payments for a year.

paid_date_or_date_case = <Case: CASE WHEN <Q: (AND: ('paid_date__isnull', False))> THEN F(paid_date), WHEN <Q: (AND: ('date__isnull', False))> THEN F(date), ELSE F(date)>
paid_date_or_date_gte(date)

Return all payments with paid date or payment date >= date.

paid_date_or_date_lte(date)

Return all payments with paid date or payment date <= date.

strict_amount_sum()

Sum over Payments amount.

core.mixins module

Mixins to use in view classes.

class core.mixins.AuditMixin

Bases: object

Allow audit logging by intercepting all API requests.

finalize_response(request, response, *args, **kwargs)

Perform logging and continue normal operations.

log_methods = ('post', 'put', 'patch', 'delete')
logger = <Logger bevillingsplatform.audit (INFO)>
class core.mixins.AuditModelMixin(*args, **kwargs)

Bases: django.db.models.base.Model

Mixin for tracking created/modified datetime and user.

Parameters
  • created (DateTimeField) – Oprettet

  • modified (DateTimeField) – Modificeret

  • user_created (CharField) – Bruger der har oprettet

  • user_modified (CharField) – Bruger der har modificeret

created

Model field: oprettet

modified

Model field: modificeret

user_created

Model field: bruger der har oprettet

user_modified

Model field: bruger der har modificeret

class core.mixins.AuditModelViewSetMixin

Bases: object

Mixin for AuditModel Viewsets.

perform_create(serializer)

Set user_created on creation.

perform_update(serializer)

Set user_modified on modification.

class core.mixins.ClassificationViewSetMixin

Bases: object

Superclass for Classification Viewsets only exposing the active.

get_queryset()

Only expose active objects if user is not workflow or admin.

core.models module

These are the Django models, defining the database layout.

class core.models.AccountAliasMapping(*args, **kwargs)

Bases: django.db.models.base.Model

New version of the AccountAlias model.

Works as a lookup between the main_account and activity dimension strings and an alias.

Parameters
  • id (AutoField) – Id

  • main_account_number (CharField) – Hovedkontonummer. dimensionen ‘Hovedkonto’ i kontostrengen

  • activity_number (CharField) – Aktivitetsnummer. dimensionen ‘Aktivitet’ i kontostrengen

  • alias (CharField) – Kontoalias

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

activity_number

Model field: aktivitetsnummer

alias

Model field: kontoalias

id

Model field: ID

main_account_number

Model field: hovedkontonummer

objects = <django.db.models.manager.Manager object>
class core.models.Activity(*args, **kwargs)

Bases: core.mixins.AuditModelMixin, django.db.models.base.Model

An activity is a specific service provided within an appropriation.

The details object contains the name, tolerance, etc. of the service.

Parameters
  • id (AutoField) – Id

  • created (DateTimeField) – Oprettet

  • modified (DateTimeField) – Modificeret

  • user_created (CharField) – Bruger der har oprettet

  • user_modified (CharField) – Bruger der har modificeret

  • details (ForeignKey to ActivityDetails) – Aktivitetsdetalje

  • status (CharField) – Status

  • approval_level (ForeignKey to ApprovalLevel) – Bevillingsniveau

  • approval_note (TextField) – Evt. bemærkning

  • approval_user (ForeignKey to User) – Bevilget af bruger

  • appropriation_date (DateField) – Bevillingsdato

  • start_date (DateField) – Startdato

  • end_date (DateField) – Slutdato

  • activity_type (CharField) – Type

  • modifies (ForeignKey to Activity) – Justeres af aktivitet

  • appropriation (ForeignKey to Appropriation) – Bevilling

  • service_provider (ForeignKey to ServiceProvider) – Leverandør

  • note (TextField) – Note

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

property account_alias

Calculate the new account_alias to use with this activity.

property account_number

Calculate the account_number_new to use with this activity.

property activity_category

Get the activity category of this activity.

activity_type

Model field: type

property applicable_payments

Return payments that are not overruled by expected payments.

appropriation

Model field: bevilling, accesses the Appropriation model.

appropriation_date

Model field: bevillingsdato

appropriation_id

Model field: bevilling

approval_level

Model field: bevillingsniveau, accesses the ApprovalLevel model.

approval_level_id

Model field: bevillingsniveau

approval_note

Model field: evt. bemærkning

approval_user

Model field: bevilget af bruger, accesses the User model.

approval_user_id

Model field: bevilget af bruger

details

Model field: aktivitetsdetalje, accesses the ActivityDetails model.

details_id

Model field: aktivitetsdetalje

end_date

Model field: slutdato

get_activity_type_display(*, field=<django.db.models.fields.CharField: activity_type>)

Autogenerated: Shows the label of the activity_type

get_all_modified_by_activities()

Retrieve all modified_by objects recursively.

As the Django ORM doesn’t handle recursive objects and Python is slow, we can use a “WITH RECURSIVE” query in SQL to fetch the objects: https://www.postgresql.org/docs/current/queries-with.html

get_status_display(*, field=<django.db.models.fields.CharField: status>)

Autogenerated: Shows the label of the status

grant(approval_level, approval_note, approval_user)

Grant this activity - update payment info as needed.

id

Model field: ID

is_valid_activity_start_date()

Determine if a date is valid for a activity start_date.

modified_by

Model field: justeres af aktivitet, accesses the M2M Activity model.

modifies

Model field: justeres af aktivitet, accesses the Activity model.

modifies_id

Model field: justeres af aktivitet

property monthly_payment_plan

Calculate the payment plan for this activity, grouped by months.

note

Model field: note

objects = <django.db.models.manager.ManagerFromActivityQuerySet object>
payment_plan

Model field: aktivitet, accesses the PaymentSchedule model.

save(*args, **kwargs)

Save activity.

Also updates “modified” field on appropriation and payment_plan payments.

service_provider

Model field: leverandør, accesses the ServiceProvider model.

service_provider_id

Model field: leverandør

start_date

Model field: startdato

status

Model field: status

property total_cost

Calculate the total cost of this activity at all times.

property total_cost_full_year

Retrieve total amount expected for this year.

Extrapolate for the full year (January 1 - December 31).

total_cost_in_year(year=None)

Calculate total cost for a year for this activity.

total_expected_in_year(year=None)

Calculate total amount expected for a year.

As may be noted, this is redundant and identical to “total cost this year”. Maybe one of these functions should be removed, the redundancy is due to a desire for clarity as to what is returned in different contexts.

total_granted_in_year(year=None)

Calculate total amount granted on this activity for a year.

property triggers_payment_email

Decide if this activity triggers an email when saved.

validate_expected()

Validate this is a correct expected activity.

property vat_factor

Calculate the VAT factor for this activity.

class core.models.ActivityCategory(*args, **kwargs)

Bases: core.models.Classification

ActivityCategory associated with a SectionInfo (main_activity).

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • category_id (CharField) – Kategori id

  • name (CharField) – Navn

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

category_id

Model field: kategori ID

id

Model field: ID

name

Model field: navn

objects = <django.db.models.manager.Manager object>
section_infos

Model field: aktivitetskategori, accesses the M2M SectionInfo model.

class core.models.ActivityDetails(*args, **kwargs)

Bases: core.models.Classification

Class containing all types of activities offered.

Each type is associated with the legal sections for which it is allowed as well as the allowed main activitydetails and service providers.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

  • description (TextField) – Beskrivelse

  • activity_id (CharField) – Aktivitets id

  • max_tolerance_in_percent (PositiveSmallIntegerField) – Max tolerance i procent

  • max_tolerance_in_dkk (PositiveIntegerField) – Max tolerance i dkk

  • main_activity_for (ManyToManyField) – Hovedaktivitet for paragraffer

  • supplementary_activity_for (ManyToManyField) – Følgeudgift for paragraffer

  • service_providers (ManyToManyField) – Leverandører

  • main_activities (ManyToManyField) – Hovedydelser. Denne aktivitetsdetalje kan være følgeudgift for disse hovedydelser.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

activity_id

Model field: aktivitets ID

activity_set

Model field: aktivitetsdetalje, accesses the M2M Activity model.

description

Model field: beskrivelse

id

Model field: ID

main_activities

Model field: hovedydelser, accesses the M2M ActivityDetails model.

main_activity_for

Model field: hovedaktivitet for paragraffer, accesses the M2M ActivityDetails model.

max_tolerance_in_dkk

Model field: max tolerance i DKK

max_tolerance_in_percent

Model field: max tolerance i procent

name

Model field: Navn

objects = <django.db.models.manager.Manager object>
sectioninfo_set

Model field: aktivitetsdetalje, accesses the M2M SectionInfo model.

service_providers

Model field: leverandører, accesses the M2M ActivityDetails model.

supplementary_activities

Model field: hovedydelser, accesses the M2M ActivityDetails model.

supplementary_activity_for

Model field: følgeudgift for paragraffer, accesses the M2M ActivityDetails model.

class core.models.Appropriation(*args, **kwargs)

Bases: core.mixins.AuditModelMixin, django.db.models.base.Model

An appropriation of funds in a Case - corresponds to a Sag in SBSYS.

Parameters
  • id (AutoField) – Id

  • created (DateTimeField) – Oprettet

  • modified (DateTimeField) – Modificeret

  • user_created (CharField) – Bruger der har oprettet

  • user_modified (CharField) – Bruger der har modificeret

  • sbsys_id (CharField) – Sbsys-id

  • section (ForeignKey to Section) – Paragraf

  • case (ForeignKey to Case) – Sag

  • note (TextField) – Supplerende oplysninger

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

activities

Model field: bevilling, accesses the M2M Activity model.

case

Model field: sag, accesses the Case model.

case_id

Model field: sag

grant(activities, approval_level, approval_note, approval_user)

Grant all the given Activities.

property granted_from_date

Retrieve the start date of the main activity, if granted.

property granted_to_date

Retrieve the end date of the main activity, if granted.

id

Model field: ID

property main_activity

Return main activity, if any.

note

Model field: supplerende oplysninger

objects = <django.db.models.manager.ManagerFromAppropriationQuerySet object>
sbsys_id

Model field: SBSYS-ID

section

Model field: paragraf, accesses the Section model.

section_id

Model field: paragraf

property section_info

Return info for law section justifying this appropriation.

property status

Calculate appropriation status from status of activities.

property supplementary_activities

Return supplementary activities, if any.

total_expected_in_year(year=None)

Retrieve total amount expected in year for this Appropriation.

We take into account granted payments but overrule with expected amounts if they modify another activity.

total_granted_in_year(year=None)

Retrieve total amount granted in year for this Appropriation.

This includes both main and supplementary activities.

class core.models.ApprovalLevel(*args, **kwargs)

Bases: core.models.Classification

Organizational level on which an appropriation was approved.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

approved_activities

Model field: bevillingsniveau, accesses the M2M Activity model.

id

Model field: ID

name

Model field: navn

objects = <django.db.models.manager.Manager object>
class core.models.Case(*args, **kwargs)

Bases: core.mixins.AuditModelMixin, django.db.models.base.Model

A Case, covering one child - corresponding to a Hovedsag in SBSYS.

Parameters
  • id (AutoField) – Id

  • created (DateTimeField) – Oprettet

  • modified (DateTimeField) – Modificeret

  • user_created (CharField) – Bruger der har oprettet

  • user_modified (CharField) – Bruger der har modificeret

  • sbsys_id (CharField) – Sbsys-id

  • cpr_number (CharField) – Cpr-nummer

  • name (CharField) – Navn

  • case_worker (ForeignKey to User) – Sagsbehandler

  • district (ForeignKey to SchoolDistrict) – Skoledistrikt

  • paying_municipality (ForeignKey to Municipality) – Betalingskommune

  • acting_municipality (ForeignKey to Municipality) – Handlekommune

  • residence_municipality (ForeignKey to Municipality) – Bopælskommune

  • target_group (ForeignKey to TargetGroup) – Målgruppe

  • effort_step (ForeignKey to EffortStep) – Indsatstrappe

  • scaling_step (PositiveSmallIntegerField) – Skaleringstrappe

  • assessment_comment (TextField) – Supplerende oplysninger til vurdering

  • note (TextField) – Note

  • efforts (ManyToManyField) – Indsatser

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

acting_municipality

Model field: handlekommune, accesses the Municipality model.

acting_municipality_id

Model field: handlekommune

appropriations

Model field: sag, accesses the M2M Appropriation model.

assessment_comment

Model field: supplerende oplysninger til vurdering

case_worker

Model field: sagsbehandler, accesses the User model.

case_worker_id

Model field: sagsbehandler

cpr_number

Model field: cpr-nummer

district

Model field: skoledistrikt, accesses the SchoolDistrict model.

district_id

Model field: skoledistrikt

effort_step

Model field: indsatstrappe, accesses the EffortStep model.

effort_step_id

Model field: indsatstrappe

efforts

Model field: indsatser, accesses the M2M Case model.

property expired

Determine if this case has expired.

A case is considered to be expired if all its associated activites have end date in the past. If it does not have any associated (non-deleted) activities, it is not considered to be expired.

get_scaling_step_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: scaling_step>)

Autogenerated: Shows the label of the scaling_step

history = <simple_history.manager.HistoryManager object>
id

Model field: ID

name

Model field: navn

note

Model field: note

objects = <django.db.models.manager.ManagerFromCaseQuerySet object>
paying_municipality

Model field: betalingskommune, accesses the Municipality model.

paying_municipality_id

Model field: betalingskommune

related_persons

Model field: hovedsag, accesses the M2M RelatedPerson model.

residence_municipality

Model field: bopælskommune, accesses the Municipality model.

residence_municipality_id

Model field: bopælskommune

save_without_historical_record(*args, **kwargs)

Save model without saving a historical record

Make sure you know what you’re doing before you use this method.

sbsys_id

Model field: SBSYS-ID

scaling_step

Model field: skaleringstrappe

target_group

Model field: målgruppe, accesses the TargetGroup model.

target_group_id

Model field: målgruppe

class core.models.Classification(*args, **kwargs)

Bases: django.db.models.base.Model

Abstract base class for Classifications.

Parameters

active (BooleanField) – Aktiv

active

Model field: aktiv

class core.models.Effort(*args, **kwargs)

Bases: core.models.Classification

Effort for a Case.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

  • description (CharField) – Beskrivelse

  • allowed_for_target_groups (ManyToManyField) – Målgrupper

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

allowed_for_target_groups

Model field: målgrupper, accesses the M2M Effort model.

cases

Model field: indsatser, accesses the M2M Case model.

description

Model field: beskrivelse

id

Model field: ID

name

Model field: navn

objects = <django.db.models.manager.Manager object>
class core.models.EffortStep(*args, **kwargs)

Bases: core.models.Classification

Evaluation step for grading the effort deemed necessary in a Case.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

  • number (PositiveIntegerField) – Nummer

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

case_set

Model field: indsatstrappe, accesses the M2M Case model.

id

Model field: ID

name

Model field: navn

number

Model field: Nummer

objects = <django.db.models.manager.Manager object>
sections

Model field: trin i indsatstrappen, accesses the M2M Section model.

class core.models.HistoricalCase(id, created, modified, user_created, user_modified, scaling_step, assessment_comment, case_worker, effort_step, history_id, history_date, history_change_reason, history_type, history_user)

Bases: simple_history.models.HistoricalChanges, django.db.models.base.Model

Parameters
  • id (IntegerField) – Id

  • created (DateTimeField) – Oprettet

  • modified (DateTimeField) – Modificeret

  • user_created (CharField) – Bruger der har oprettet

  • user_modified (CharField) – Bruger der har modificeret

  • scaling_step (PositiveSmallIntegerField) – Skaleringstrappe

  • assessment_comment (TextField) – Supplerende oplysninger til vurdering

  • case_worker (ForeignKey to User) – Sagsbehandler

  • effort_step (ForeignKey to EffortStep) – Indsatstrappe

  • history_id (AutoField) – History id

  • history_date (DateTimeField) – History date

  • history_change_reason (CharField) – History change reason

  • history_type (CharField) – History type

  • history_user (ForeignKey to User) – History user

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

assessment_comment

Model field: supplerende oplysninger til vurdering

case_worker

Model field: sagsbehandler, accesses the User model.

case_worker_id

Model field: sagsbehandler

created

Model field: oprettet

effort_step

Model field: indsatstrappe, accesses the EffortStep model.

effort_step_id

Model field: indsatstrappe

static get_default_history_user(instance)

Returns the user specified by get_user method for manually creating historical objects

get_history_type_display(*, field=<django.db.models.fields.CharField: history_type>)

Autogenerated: Shows the label of the history_type

get_next_by_history_date(*, field=<django.db.models.fields.DateTimeField: history_date>, is_next=True, **kwargs)

Autogenerated: Finds next instance based on history_date.

get_previous_by_history_date(*, field=<django.db.models.fields.DateTimeField: history_date>, is_next=False, **kwargs)

Autogenerated: Finds previous instance based on history_date.

get_scaling_step_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: scaling_step>)

Autogenerated: Shows the label of the scaling_step

history_change_reason

Model field: history change reason

history_date

Model field: history date

history_id

Model field: history id

history_object
history_type

Model field: history type

history_user

Model field: history user, accesses the User model.

history_user_id

Model field: history user

id

Model field: ID

property instance
instance_type

alias of core.models.Case

modified

Model field: modificeret

property next_record

Get the next history record for the instance. None if last.

objects = <django.db.models.manager.Manager object>
property prev_record

Get the previous history record for the instance. None if first.

revert_url()

URL for this change in the default admin site.

scaling_step

Model field: skaleringstrappe

user_created

Model field: bruger der har oprettet

user_modified

Model field: bruger der har modificeret

class core.models.HistoricalPayment(id, paid_amount, paid, paid_date, saved_account_alias, history_id, history_date, history_change_reason, history_type, history_user)

Bases: simple_history.models.HistoricalChanges, django.db.models.base.Model

Parameters
  • id (IntegerField) – Id

  • paid_amount (DecimalField) – Betalt beløb

  • paid (BooleanField) – Betalt

  • paid_date (DateField) – Betalt på dato

  • saved_account_alias (CharField) – Gemt kontoalias

  • history_id (AutoField) – History id

  • history_date (DateTimeField) – History date

  • history_change_reason (CharField) – History change reason

  • history_type (CharField) – History type

  • history_user (ForeignKey to User) – History user

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

static get_default_history_user(instance)

Returns the user specified by get_user method for manually creating historical objects

get_history_type_display(*, field=<django.db.models.fields.CharField: history_type>)

Autogenerated: Shows the label of the history_type

get_next_by_history_date(*, field=<django.db.models.fields.DateTimeField: history_date>, is_next=True, **kwargs)

Autogenerated: Finds next instance based on history_date.

get_previous_by_history_date(*, field=<django.db.models.fields.DateTimeField: history_date>, is_next=False, **kwargs)

Autogenerated: Finds previous instance based on history_date.

history_change_reason

Model field: history change reason

history_date

Model field: history date

history_id

Model field: history id

history_object
history_type

Model field: history type

history_user

Model field: history user, accesses the User model.

history_user_id

Model field: history user

id

Model field: ID

property instance
instance_type

alias of core.models.Payment

property next_record

Get the next history record for the instance. None if last.

objects = <django.db.models.manager.Manager object>
paid

Model field: betalt

paid_amount

Model field: betalt beløb

paid_date

Model field: betalt på dato

property prev_record

Get the previous history record for the instance. None if first.

revert_url()

URL for this change in the default admin site.

saved_account_alias

Model field: gemt kontoalias

class core.models.HistoricalRatePerDate(id, rate, start_date, end_date, changed_date, main_rate, changed_by, history_id, history_date, history_change_reason, history_type, history_user)

Bases: simple_history.models.HistoricalChanges, django.db.models.base.Model

Parameters
  • id (IntegerField) – Id

  • rate (DecimalField) – Takst

  • start_date (DateField) – Startdato

  • end_date (DateField) – Slutdato

  • changed_date (DateTimeField) – Changed date

  • main_rate (ForeignKey to VariableRate) – Main rate

  • changed_by (ForeignKey to User) – Ændret af

  • history_id (AutoField) – History id

  • history_date (DateTimeField) – Historik dato

  • history_change_reason (CharField) – History change reason

  • history_type (CharField) – Historik type

  • history_user (ForeignKey to User) – Historik bruger

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

changed_by

Model field: Ændret af, accesses the User model.

changed_by_id

Model field: Ændret af

changed_date

Model field: changed date

end_date

Model field: slutdato

static get_default_history_user(instance)

Returns the user specified by get_user method for manually creating historical objects

get_history_type_display(*, field=<django.db.models.fields.CharField: history_type>)

Autogenerated: Shows the label of the history_type

get_next_by_history_date(*, field=<django.db.models.fields.DateTimeField: history_date>, is_next=True, **kwargs)

Autogenerated: Finds next instance based on history_date.

get_previous_by_history_date(*, field=<django.db.models.fields.DateTimeField: history_date>, is_next=False, **kwargs)

Autogenerated: Finds previous instance based on history_date.

history_change_reason

Model field: history change reason

history_date

Model field: historik dato

history_id

Model field: history id

history_object
history_type

Model field: historik type

history_user

Model field: historik bruger, accesses the User model.

history_user_id

Model field: historik bruger

id

Model field: ID

property instance
instance_type

alias of core.models.RatePerDate

main_rate

Model field: main rate, accesses the VariableRate model.

main_rate_id

Model field: main rate

property next_record

Get the next history record for the instance. None if last.

objects = <django.db.models.manager.Manager object>
property prev_record

Get the previous history record for the instance. None if first.

rate

Model field: takst

revert_url()

URL for this change in the default admin site.

start_date

Model field: startdato

class core.models.InternalPaymentRecipient(*args, **kwargs)

Bases: core.models.Classification

Recipient model for INTERNAL payment activities.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

Model field: ID

name

Model field: navn

objects = <django.db.models.manager.Manager object>
class core.models.Municipality(*args, **kwargs)

Bases: core.models.Classification

Represents a Danish municipality.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

acts_on

Model field: handlekommune, accesses the M2M Case model.

id

Model field: ID

name

Model field: navn

objects = <django.db.models.manager.Manager object>
pays_for

Model field: betalingskommune, accesses the M2M Case model.

resident_clients

Model field: bopælskommune, accesses the M2M Case model.

class core.models.Payment(*args, **kwargs)

Bases: django.db.models.base.Model

Represent an amount paid to a supplier - amount, recipient, date.

These may be entered manually, but ideally they should be imported from an accounts payable system.

Parameters
  • id (AutoField) – Id

  • date (DateField) – Betalingsdato

  • recipient_type (CharField) – Betalingsmodtager

  • recipient_id (CharField) – Id

  • recipient_name (CharField) – Navn

  • payment_method (CharField) – Betalingsmåde

  • amount (DecimalField) – Beløb

  • paid_amount (DecimalField) – Betalt beløb

  • paid (BooleanField) – Betalt

  • paid_date (DateField) – Betalt på dato

  • note (TextField) – Note

  • saved_account_string (CharField) – Gemt kontostreng

  • saved_account_alias (CharField) – Gemt kontoalias

  • payment_schedule (ForeignKey to PaymentSchedule) – Betalingsplan

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

property account_alias

Return saved account alias if any, else calculate from schedule.

property account_string

Return saved account string if any, else calculate from schedule.

amount

Model field: beløb

date

Model field: betalingsdato

get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)

Autogenerated: Finds next instance based on date.

get_payment_method_display(*, field=<django.db.models.fields.CharField: payment_method>)

Autogenerated: Shows the label of the payment_method

get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)

Autogenerated: Finds previous instance based on date.

get_recipient_type_display(*, field=<django.db.models.fields.CharField: recipient_type>)

Autogenerated: Shows the label of the recipient_type

history = <simple_history.manager.HistoryManager object>
id

Model field: ID

property is_payable_manually

Determine whether it is payable manually (in the frontend).

note

Model field: note

objects = <django.db.models.manager.ManagerFromPaymentQuerySet object>
paid

Model field: betalt

paid_amount

Model field: betalt beløb

paid_date

Model field: betalt på dato

payment_method

Model field: betalingsmåde

payment_schedule

Model field: betalingsplan, accesses the PaymentSchedule model.

payment_schedule_id

Model field: betalingsplan

recipient_id

Model field: ID

recipient_name

Model field: Navn

recipient_type

Model field: betalingsmodtager

save(*args, **kwargs)

Save this payment - validate payment method and completeness.

save_without_historical_record(*args, **kwargs)

Save model without saving a historical record

Make sure you know what you’re doing before you use this method.

saved_account_alias

Model field: gemt kontoalias

saved_account_string

Model field: gemt kontostreng

class core.models.PaymentDateExclusion(*args, **kwargs)

Bases: django.db.models.base.Model

Model for Prism payment exclusion dates.

Parameters
  • id (AutoField) – Id

  • date (DateField) – Dato

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

date

Model field: dato

get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)

Autogenerated: Finds next instance based on date.

get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)

Autogenerated: Finds previous instance based on date.

id

Model field: ID

objects = <django.db.models.manager.Manager object>
class core.models.PaymentMethodDetails(*args, **kwargs)

Bases: core.models.Classification

Contains extra information about a payment method.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • tax_card (CharField) – Skattekort

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_tax_card_display(*, field=<django.db.models.fields.CharField: tax_card>)

Autogenerated: Shows the label of the tax_card

id

Model field: ID

objects = <django.db.models.manager.Manager object>
paymentschedule_set

Model field: betalingsmåde detalje, accesses the M2M PaymentSchedule model.

tax_card

Model field: skattekort

tax_card_choices = (('MAIN_CARD', 'Hovedkort'), ('SECONDARY_CARD', 'Bikort'))
class core.models.PaymentSchedule(*args, **kwargs)

Bases: django.db.models.base.Model

Schedule a payment for an Activity.

Parameters
  • id (AutoField) – Id

  • recipient_type (CharField) – Betalingsmodtager

  • recipient_id (CharField) – Id

  • recipient_name (CharField) – Navn

  • payment_method (CharField) – Betalingsmåde

  • payment_method_details (ForeignKey to PaymentMethodDetails) – Betalingsmåde detalje

  • activity (OneToOneField to Activity) – Aktivitet

  • payment_frequency (CharField) – Betalingsfrekvens

  • payment_date (DateField) – Betalingsdato. dette felt er obligatorisk for og angår kun engangsbetalinger

  • payment_day_of_month (IntegerField) – Betales d. dette felt er obligatorisk for og angår kun månedlige betalinger

  • payment_type (CharField) – Betalingstype

  • payment_units (DecimalField) – Betalingsenheder

  • payment_amount (DecimalField) – Beløb

  • fictive (BooleanField) – Fiktiv

  • payment_id (PositiveIntegerField) – Betalings-id

  • payment_cost_type (CharField) – Betalingspristype

  • payment_rate (ForeignKey to Rate) – Takst

BIWEEKLY = 'BIWEEKLY'
COMPANY = 'COMPANY'
DAILY = 'DAILY'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

FIXED_PRICE = 'FIXED'
GLOBAL_RATE_PRICE = 'GLOBAL_RATE'
INDIVIDUAL_PAYMENT = 'INDIVIDUAL_PAYMENT'
INTERNAL = 'INTERNAL'
MONTHLY = 'MONTHLY'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ONE_TIME_PAYMENT = 'ONE_TIME_PAYMENT'
PERSON = 'PERSON'
PER_UNIT_PRICE = 'PER_UNIT'
RUNNING_PAYMENT = 'RUNNING_PAYMENT'
WEEKLY = 'WEEKLY'
property account_alias

Calculate account alias from activity.

property account_string

Calculate account string from activity.

activity

Model field: aktivitet, accesses the Activity model.

activity_id

Model field: aktivitet

calculate_per_payment_amount(vat_factor, date)

Calculate amount from payment type and units.

property can_be_paid

Determine whether payments on this schedule can be paid.

It is only allowed to pay payments associated with an approved activity, i.e. status GRANTED.

create_rrule(start, **kwargs)

Create a dateutil.rrule for this schedule specifically.

fictive

Model field: fiktiv

generate_payments(start, end=None, vat_factor=Decimal('100'))

Generate payments with a start and end date.

get_payment_cost_type_display(*, field=<django.db.models.fields.CharField: payment_cost_type>)

Autogenerated: Shows the label of the payment_cost_type

get_payment_frequency_display(*, field=<django.db.models.fields.CharField: payment_frequency>)

Autogenerated: Shows the label of the payment_frequency

get_payment_method_display(*, field=<django.db.models.fields.CharField: payment_method>)

Autogenerated: Shows the label of the payment_method

get_payment_type_display(*, field=<django.db.models.fields.CharField: payment_type>)

Autogenerated: Shows the label of the payment_type

get_recipient_type_display(*, field=<django.db.models.fields.CharField: recipient_type>)

Autogenerated: Shows the label of the recipient_type

id

Model field: ID

static is_payment_and_recipient_allowed(payment_method, recipient_type)

Determine if this combination of method and recipient is allowed.

is_ready_to_generate_payments()

Don’t generate payments unless object is ready.

Note: This is not a validation. It’s necessary because Django Rest Framework can perform partial saves and the post-save logic needs to be able to cope with that.

property next_payment

Return the next payment due starting from today, if any.

objects = <django.db.models.manager.Manager object>
payment_amount

Model field: beløb

payment_cost_choices = (('FIXED', 'fast beløb'), ('PER_UNIT', 'pris pr. enhed'), ('GLOBAL_RATE', 'takst'))
payment_cost_type

Model field: betalingspristype

payment_date

Model field: betalingsdato

payment_day_of_month

Model field: betales d.

payment_frequency

Model field: betalingsfrekvens

payment_frequency_choices = (('DAILY', 'Dagligt'), ('WEEKLY', 'Ugentligt'), ('BIWEEKLY', 'Hver 2. uge'), ('MONTHLY', 'Månedligt'))
payment_id

Model field: betalings-ID

payment_method

Model field: betalingsmåde

payment_method_details

Model field: betalingsmåde detalje, accesses the PaymentMethodDetails model.

payment_method_details_id

Model field: betalingsmåde detalje

payment_rate

Model field: takst, accesses the Rate model.

payment_rate_id

Model field: takst

payment_type

Model field: betalingstype

payment_type_choices = (('ONE_TIME_PAYMENT', 'Engangsudgift'), ('RUNNING_PAYMENT', 'Fast beløb, løbende'), ('INDIVIDUAL_PAYMENT', 'Individuel'))
payment_units

Model field: betalingsenheder

payments

Model field: betalingsplan, accesses the M2M Payment model.

property per_payment_amount

Amount per payment calculated w/ payment cost type.

price_per_unit

Model field: betalingsplan, accesses the Price model.

property rate_or_price_amount

Fetch current rate or per unit price amounts.

recalculate_prices()

Recalculate price on all payments.

recipient_choices = (('INTERNAL', 'Intern'), ('PERSON', 'Person'), ('COMPANY', 'Firma'))
recipient_id

Model field: ID

recipient_name

Model field: navn

recipient_type

Model field: betalingsmodtager

save(*args, **kwargs)

Save this payment schedule after validating payment method.

synchronize_payments(start, end, vat_factor=Decimal('100'))

Synchronize the payments of an activity for a new end_date.

class core.models.Price(*args, **kwargs)

Bases: core.models.VariableRate

An individual price on a payment plan.

Parameters
  • id (AutoField) – Id

  • variablerate_ptr (OneToOneField to VariableRate) – Variablerate ptr

  • payment_schedule (OneToOneField to PaymentSchedule) – Betalingsplan

exception DoesNotExist

Bases: core.models.VariableRate.DoesNotExist

exception MultipleObjectsReturned

Bases: core.models.VariableRate.MultipleObjectsReturned

payment_schedule

Model field: betalingsplan, accesses the PaymentSchedule model.

payment_schedule_id

Model field: betalingsplan

variablerate_ptr

Model field: variablerate ptr, accesses the VariableRate model.

variablerate_ptr_id

Model field: variablerate ptr

class core.models.Rate(*args, **kwargs)

Bases: core.models.VariableRate, core.models.Classification

A centrally fixed rate.

Parameters
  • id (AutoField) – Id

  • variablerate_ptr (OneToOneField to VariableRate) – Variablerate ptr

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

  • description (TextField) – Beskrivelse

  • needs_recalculation (BooleanField) – Skal genberegnes. dette felt sættes automatisk når en takst ændres

exception DoesNotExist

Bases: core.models.VariableRate.DoesNotExist

exception MultipleObjectsReturned

Bases: core.models.VariableRate.MultipleObjectsReturned

description

Model field: beskrivelse

name

Model field: navn

needs_recalculation

Model field: skal genberegnes

paymentschedule_set

Model field: takst, accesses the M2M PaymentSchedule model.

variablerate_ptr

Model field: variablerate ptr, accesses the VariableRate model.

variablerate_ptr_id

Model field: variablerate ptr

class core.models.RatePerDate(*args, **kwargs)

Bases: django.db.models.base.Model

Handle the date variation of VariableRates.

Parameters
  • id (AutoField) – Id

  • rate (DecimalField) – Takst

  • start_date (DateField) – Startdato

  • end_date (DateField) – Slutdato

  • main_rate (ForeignKey to VariableRate) – Main rate

  • changed_date (DateTimeField) – Changed date

  • changed_by (ForeignKey to User) – Ændret af

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

changed_by

Model field: Ændret af, accesses the User model.

changed_by_id

Model field: Ændret af

changed_date

Model field: changed date

end_date

Model field: slutdato

history = <simple_history.manager.HistoryManager object>
id

Model field: ID

main_rate

Model field: main rate, accesses the VariableRate model.

main_rate_id

Model field: main rate

objects = <django.db.models.manager.Manager object>
rate

Model field: takst

save_without_historical_record(*args, **kwargs)

Save model without saving a historical record

Make sure you know what you’re doing before you use this method.

start_date

Model field: startdato

class core.models.RelatedPerson(*args, **kwargs)

Bases: core.mixins.AuditModelMixin, django.db.models.base.Model

A person related to a Case, e.g. as a parent or sibling.

Parameters
  • id (AutoField) – Id

  • created (DateTimeField) – Oprettet

  • modified (DateTimeField) – Modificeret

  • user_created (CharField) – Bruger der har oprettet

  • user_modified (CharField) – Bruger der har modificeret

  • relation_type (CharField) – Relation

  • cpr_number (CharField) – Cpr-nummer

  • name (CharField) – Navn

  • related_case (CharField) – Sbsys-sag

  • from_serviceplatformen (BooleanField) – Fra serviceplatformen

  • main_case (ForeignKey to Case) – Hovedsag

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

cpr_number

Model field: cpr-nummer

from_serviceplatformen

Model field: fra Serviceplatformen

id

Model field: ID

main_case

Model field: hovedsag, accesses the Case model.

main_case_id

Model field: hovedsag

name

Model field: navn

objects = <django.db.models.manager.Manager object>
related_case

Model field: SBSYS-sag

relation_type

Model field: relation

Convert data from Serviceplatformen to our RelatedPerson model.

class core.models.SchoolDistrict(*args, **kwargs)

Bases: core.models.Classification

Represents a Danish school district.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

cases

Model field: skoledistrikt, accesses the M2M Case model.

id

Model field: ID

name

Model field: navn

objects = <django.db.models.manager.Manager object>
class core.models.Section(*args, **kwargs)

Bases: core.models.Classification

Law sections and the corresponding KLE codes.

Each section is associated with the target group for which it is allowed as well as the action steps allowed.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • paragraph (CharField) – Paragraf

  • text (TextField) – Forklarende tekst

  • law_text_name (CharField) – Lov tekst navn

  • allowed_for_target_groups (ManyToManyField) – Målgrupper

  • allowed_for_steps (ManyToManyField) – Trin i indsatstrappen

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

allowed_for_steps

Model field: trin i indsatstrappen, accesses the M2M Section model.

allowed_for_target_groups

Model field: målgrupper, accesses the M2M Section model.

appropriations

Model field: paragraf, accesses the M2M Appropriation model.

id

Model field: ID

law_text_name

Model field: lov tekst navn

main_activities

Model field: hovedaktivitet for paragraffer, accesses the M2M ActivityDetails model.

objects = <django.db.models.manager.Manager object>
paragraph

Model field: paragraf

sectioninfo_set

Model field: paragraf, accesses the M2M SectionInfo model.

supplementary_activities

Model field: følgeudgift for paragraffer, accesses the M2M ActivityDetails model.

text

Model field: forklarende tekst

class core.models.SectionInfo(*args, **kwargs)

Bases: core.models.Classification

For a main activity, KLE no. and SBSYS ID for the relevant sections.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • activity_details (ForeignKey to ActivityDetails) – Aktivitetsdetalje

  • section (ForeignKey to Section) – Paragraf

  • activity_category (ForeignKey to ActivityCategory) – Aktivitetskategori

  • kle_number (CharField) – Kle-nummer

  • sbsys_template_id (CharField) – Sbsys skabelon-id

  • main_activity_main_account_number (CharField) – Hovedkontonummer for hovedaktivitet

  • supplementary_activity_main_account_number (CharField) – Hovedkontonummer for følgeudgift. Et hovedkontonummer der skal bruges, hvis en følgeudgift har denne aktivitetsdetalje som hovedydelse.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

activity_category

Model field: aktivitetskategori, accesses the ActivityCategory model.

activity_category_id

Model field: aktivitetskategori

activity_details

Model field: aktivitetsdetalje, accesses the ActivityDetails model.

activity_details_id

Model field: aktivitetsdetalje

get_main_activity_main_account_number()

Get the main activity main account number.

get_supplementary_activity_main_account_number()

Get the supplementary activity main account number.

If no such number exists, take the one for the main activity.

id

Model field: ID

kle_number

Model field: KLE-nummer

main_activity_main_account_number

Model field: hovedkontonummer for hovedaktivitet

objects = <django.db.models.manager.Manager object>
sbsys_template_id

Model field: SBSYS skabelon-id

section

Model field: paragraf, accesses the Section model.

section_id

Model field: paragraf

supplementary_activity_main_account_number

Model field: hovedkontonummer for følgeudgift

class core.models.ServiceProvider(*args, **kwargs)

Bases: core.models.Classification

Class containing information for a specific service provider.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • cvr_number (CharField) – Cvr-nummer

  • name (CharField) – Navn

  • business_code (CharField) – Branchekode

  • business_code_text (CharField) – Branchetekst

  • street (CharField) – Vejnavn

  • street_number (CharField) – Vejnummer

  • zip_code (CharField) – Postnummer

  • post_district (CharField) – Postdistrikt

  • status (CharField) – Status

  • vat_factor (DecimalField) – Momsfaktor

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

activities

Model field: leverandør, accesses the M2M Activity model.

business_code

Model field: branchekode

business_code_text

Model field: branchetekst

cvr_number

Model field: cvr-nummer

id

Model field: ID

name

Model field: navn

objects = <django.db.models.manager.Manager object>
post_district

Model field: postdistrikt

status

Model field: status

street

Model field: vejnavn

street_number

Model field: vejnummer

supplied_activities

Model field: leverandører, accesses the M2M ActivityDetails model.

vat_factor

Model field: momsfaktor

static virk_to_service_provider(data)

Convert data from virk to our ServiceProvider model.

zip_code

Model field: postnummer

class core.models.TargetGroup(*args, **kwargs)

Bases: core.models.Classification

Target group for a Case.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

  • required_fields_for_case (CharField) – Påkrævede felter på sag

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

cases

Model field: målgruppe, accesses the M2M Case model.

efforts

Model field: målgrupper, accesses the M2M Effort model.

get_required_fields_for_case()

Return required_fields_for_case from CSV to list.

id

Model field: ID

name

Model field: navn

objects = <django.db.models.manager.Manager object>
required_fields_for_case

Model field: påkrævede felter på sag

sections

Model field: målgrupper, accesses the M2M Section model.

class core.models.Team(*args, **kwargs)

Bases: core.models.Classification

Represents a team in the administration.

Parameters
  • id (AutoField) – Id

  • active (BooleanField) – Aktiv

  • name (CharField) – Navn

  • leader (ForeignKey to User) – Leder

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

Model field: ID

leader

Model field: leder, accesses the User model.

leader_id

Model field: leder

name

Model field: navn

objects = <django.db.models.manager.Manager object>
users

Model field: team, accesses the M2M User model.

class core.models.User(*args, **kwargs)

Bases: django.contrib.auth.models.AbstractUser

Customized user for handling login etc.

Parameters
  • id (AutoField) – Id

  • password (CharField) – Adgangskode

  • last_login (DateTimeField) – Sidst logget ind

  • is_superuser (BooleanField) – Superbrugerstatus. Bestemmer at denne bruger har alle rettigheder uden at tildele dem eksplicit.

  • username (CharField) – Brugernavn. Påkrævet. Højst 150 tegn. Kun bogstaver og cifre samt @/./+/-/_

  • first_name (CharField) – Fornavn

  • last_name (CharField) – Efternavn

  • email (EmailField) – E-mail-adresse

  • is_staff (BooleanField) – Admin-status. Bestemmer om brugeren kan logge ind på dette administrationswebsite.

  • is_active (BooleanField) – Aktiv. Bestemmer om brugeren skal behandles som aktiv. Fravælg dette frem for at slette en konto.

  • date_joined (DateTimeField) – Dato for registrering

  • team (ForeignKey to Team) – Team

  • profile (CharField) – Brugerprofil

  • groups (ManyToManyField) – Grupper. Grupperne som denne bruger hører til. En bruger får alle rettigheder givet til hver af hans/hendes grupper.

  • user_permissions (ManyToManyField) – Rettigheder. Specifikke rettigheder for denne bruger.

ADMIN = 'admin'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

EDIT = 'edit'
GRANT = 'grant'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

READONLY = 'readonly'
WORKFLOW_ENGINE = 'workflow_engine'
approved_activities

Model field: bevilget af bruger, accesses the M2M Activity model.

cases

Model field: sagsbehandler, accesses the M2M Case model.

get_next_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=True, **kwargs)

Autogenerated: Finds next instance based on date_joined.

get_previous_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=False, **kwargs)

Autogenerated: Finds previous instance based on date_joined.

get_profile_display(*, field=<django.db.models.fields.CharField: profile>)

Autogenerated: Shows the label of the profile

groups

Model field: grupper, accesses the M2M User model.

id

Model field: ID

is_workflow_engine_or_admin()

Return if user has workflow or admin permission.

logentry_set

Model field: bruger, accesses the M2M LogEntry model.

managed_teams

Model field: leder, accesses the M2M Team model.

classmethod max_profile(perms)

Return the profile (in “perms”) with the highest permissions.

IdPs can send more than one profile when using SAML. This function returns the “maximum” profile in the sense of the one with the most far-reaching permissions.

profile

Model field: brugerprofil

profile_choices = (('readonly', 'Kun læse'), ('edit', 'Læse og skrive'), ('grant', 'Bevilge'), ('workflow_engine', 'Redigere klassifikationer'), ('admin', 'Admin'))
rate_and_price_changes

Model field: Ændret af, accesses the M2M RatePerDate model.

team

Model field: team, accesses the Team model.

team_id

Model field: team

user_permissions

Model field: rettigheder, accesses the M2M User model.

class core.models.VariableRate(*args, **kwargs)

Bases: django.db.models.base.Model

Superclass for time-dependent rates and prices.

Parameters

id (AutoField) – Id

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

static create_interval(start_date, end_date)

Create new interval for rates.

get_rate_amount(rate_date=datetime.date(2021, 12, 8))

Look up period in RatesPerDate.

id

Model field: ID

objects = <django.db.models.manager.Manager object>
price

Model field: variablerate ptr, accesses the Price model.

rate

Model field: variablerate ptr, accesses the Rate model.

property rate_amount

Look up period in RatesPerDate.

rates_per_date

Model field: main rate, accesses the M2M RatePerDate model.

set_rate_amount(amount, start_date=None, end_date=None)

Set amount, merge with existing periods.

core.permissions module

Custom permissions used by this app.

class core.permissions.DeletePaymentPermission

Bases: rest_framework.permissions.BasePermission

Check if a payment can be deleted.

has_object_permission(request, view, obj)

Payments on granted activities may not be deleted.

class core.permissions.EditPaymentPermission

Bases: rest_framework.permissions.BasePermission

Check if this payment may be edited by the current user.

has_object_permission(request, view, obj)

Check that this user is allowed to apply these changes.

class core.permissions.IsUserAllowed

Bases: rest_framework.permissions.BasePermission

Determine user’s frontend permissions i.e., in all API operations.

has_permission(request, view)

Allow depending on operation and user’s profile.

class core.permissions.NewPaymentPermission

Bases: core.permissions.IsUserAllowed

Check if adding a new payment is allowed.

has_permission(request, view)

Allow for individual payment plan and appropriation not granted.

core.serializers module

Data serializers used by the REST API.

class core.serializers.ActivityCategorySerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the ActivityCategory model.

class core.serializers.ActivityDetailsSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the ActivityDetails model.

class core.serializers.ActivitySerializer(*args, **kwargs)

Bases: core.serializers.BaseActivitySerializer

Serializer for the Activity model.

class core.serializers.AppropriationSerializer(*args, **kwargs)

Bases: core.serializers.BaseAppropriationSerializer

Serializer for a single Appropriation model.

get_activities(appropriation)

Get activities on appropriation.

get_total_expected_next_year(obj)

Retrieve total expected amount for next year.

get_total_expected_previous_year(obj)

Retrieve total expected amount for previous year.

get_total_expected_this_year(obj)

Retrieve total expected amount for this year.

get_total_granted_next_year(obj)

Retrieve total granted amount for next year.

get_total_granted_previous_year(obj)

Retrieve total granted amount for previous year.

get_total_granted_this_year(obj)

Retrieve total granted amount for this year.

class core.serializers.ApprovalLevelSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the ApprovalLevel model.

class core.serializers.BaseActivitySerializer(*args, **kwargs)

Bases: drf_writable_nested.serializers.WritableNestedModelSerializer

Base Serializer for the Activity model.

create(validated_data)

Override create to handle existing service provider.

get_total_expected_next_year(obj)

Retrieve total expected amount for next year.

get_total_expected_previous_year(obj)

Retrieve total expected amount for previous year.

get_total_expected_this_year(obj)

Retrieve total expected amount for this year.

get_total_granted_next_year(obj)

Retrieve total granted amount for next year.

get_total_granted_previous_year(obj)

Retrieve total granted amount for previous year.

get_total_granted_this_year(obj)

Retrieve total granted amount for this year.

set_correct_service_provider_in_validated_data(validated_data)

Set the correct service provider in the validated_data.

If a service provider already exists with the CVR, we update it with the new data and assign it to the activity instead of creating a new one.

static setup_eager_loading(queryset)

Set up eager loading for improved performance.

update(instance, validated_data)

Override update to handle existing service provider.

validate(data)

Validate this activity - check end date is after start date, etc.

class core.serializers.BaseAppropriationSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Base Serializer for the Appropriation model.

get_num_ongoing_activities(appropriation)

Get number of ongoing activities.

get_num_ongoing_draft_or_expected_activities(appropriation)

Get number of ongoing related draft or expected activities.

static setup_eager_loading(queryset)

Set up eager loading for improved performance.

class core.serializers.BasePaymentScheduleSerializer(*args, **kwargs)

Bases: drf_writable_nested.serializers.WritableNestedModelSerializer

Base Serializer for the PaymentSchedule model.

static setup_eager_loading(queryset)

Set up eager loading for improved performance.

validate(data)

Validate this payment schedule.

As for Payment, payment method, recipient type and various other things need to fit together.

class core.serializers.CaseSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the Case model.

Note validation to ensure that cases are always valid according to required_fields_for_case

get_num_ongoing_appropriations(case)

Get number of related ongoing appropriations.

get_num_ongoing_draft_or_expected_appropriations(case)

Get number of related expected or draft ongoing appropriations.

static setup_eager_loading(queryset)

Set up eager loading for improved performance.

validate(data)

Check if required fields for case are present.

class core.serializers.EffortSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the Effort model.

class core.serializers.EffortStepSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the EffortStep model.

class core.serializers.HistoricalCaseSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the historic/temporal dimension of a Case.

class core.serializers.HistoricalPaymentSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the historic/temporal dimension of a Payment.

class core.serializers.InternalPaymentRecipientSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the InternalPaymentRecipient model.

class core.serializers.ListActivitySerializer(*args, **kwargs)

Bases: core.serializers.BaseActivitySerializer

Serializer for the Activity model for a list.

class core.serializers.ListAppropriationSerializer(*args, **kwargs)

Bases: core.serializers.BaseAppropriationSerializer

Serializer for the Appropriation model for a list.

class core.serializers.MunicipalitySerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the Municipality model.

class core.serializers.PaymentMethodDetailsSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the PaymentMethodDetails model.

class core.serializers.PaymentScheduleSerializer(*args, **kwargs)

Bases: core.serializers.BasePaymentScheduleSerializer

Serializer for the PaymentSchedule model.

class core.serializers.PaymentSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the Payment model.

Note the many options for filtering as well as the non-trivial validate function.

save()

Save instance, catch and sanitize ValidationError.

validate(data)

Validate this payment.

class core.serializers.PriceSerializer(*args, **kwargs)

Bases: drf_writable_nested.serializers.WritableNestedModelSerializer

Serializer for the Price model.

create(validated_data)

Set rate amount on Price.

update(instance, validated_data)

Update rate amount on Price for dates.

class core.serializers.RatePerDateSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the RatePerDate model.

class core.serializers.RateSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the Rate model.

class core.serializers.RelatedPersonSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the RelatedPerson model.

class core.serializers.SchoolDistrictSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the SchoolDistrict model.

class core.serializers.SectionInfoSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the SectionInfo model.

class core.serializers.SectionSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the Section model.

class core.serializers.ServiceProviderSerializer(*args, **kwargs)

Bases: drf_writable_nested.mixins.UniqueFieldsMixin, rest_framework.serializers.ModelSerializer

Serializer for the ServiceProvider model.

class core.serializers.TargetGroupSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the TargetGroup model.

to_representation(instance)

Convert required_fields_for_case to list.

class core.serializers.TeamSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the Team model.

class core.serializers.UserSerializer(*args, **kwargs)

Bases: rest_framework.serializers.ModelSerializer

Serializer for the User model.

core.signals module

Signals for acting on events occuring on model objects.

core.signals.generate_payments_on_post_save(sender, instance, created, **kwargs)

Generate payments for activity before saving.

core.signals.save_payment_schedule_on_save_price(sender, instance, created, **kwargs)

Save payment schedule too when saving price.

core.signals.send_activity_created_email_on_paymentschedule_create(sender, instance, created, **kwargs)

Send activity created email when PaymentSchedule is saved.

core.signals.send_activity_payment_email_on_delete(sender, instance, **kwargs)

Send payment email when Activity is deleted.

core.signals.send_activity_payment_email_on_save(sender, instance, created, **kwargs)

Send payment email when Activity is saved.

core.signals.set_needs_recalculation_on_save_rate(sender, instance, created, **kwargs)

Set “needs update” flag when changing a rate.

core.signals.set_payment_id_on_paymentschedule_save(sender, instance, created, **kwargs)

Set the payment_id as the PaymentSchedule ID on creation.

core.signals.set_saved_account_alias_on_payment_save(sender, instance, **kwargs)

Set the saved_account_alias on Payment save.

core.signals.set_saved_account_string_on_payment_save(sender, instance, **kwargs)

Set the saved_account_string on Payment save.

core.utils module

Utilities used by other parts of this app.

core.utils.create_rrule(payment_type, payment_frequency, payment_day_of_month, start, **kwargs)

Create a dateutil.rrule to generate dates for a payment schedule.

The rule should be based on payment_type/payment_frequency and start. Takes either “until” or “count” as kwargs.

core.utils.due_payments_for_prism(date)

Return payments which are due on date and should be sent to PRISM.

core.utils.due_payments_for_prism_with_exclusions(date)

Process payments with exclusions for PRISME.

We check the day after tomorrow for one or several payment date exclusions and include payments for those found.

core.utils.export_prism_payments_for_date(date=None)

Fetch due payments for prism and run the export functions.

core.utils.format_prism_financial_record(payment, line_no, record_no)

Format a single financial record for PRISM, on a single line.

This follows documentation provided by Ballerup Kommune based on KMD’s interface specification GQ311001Q for financial records (transaction type G69).

core.utils.format_prism_payment_record(payment, line_no, record_no)

Format a single payment record for PRISM, on a single line.

This follows documentation provided by Ballerup Kommune based on KMD’s interface specification GF200001Q for creditor records (transaction type G68).

core.utils.generate_cases_report()

Generate a cases report as CSV.

core.utils.generate_cases_report_list_v0(cases)

Generate a cases report list of cases dicts from cases.

core.utils.generate_payment_date_exclusion_dates(years=None)

Generate “default” dates for payment date exclusions for a number of years.

The default are danish holidays and weekends.

core.utils.generate_payments_report()

Generate a payments report as CSV.

core.utils.generate_payments_report_list_v0(payments, new_account_alias=False)

Generate a payments report list of payment dicts from payments.

core.utils.generate_payments_report_list_v1(payments)

Generate payments report list v1 (v0 with new_account_alias changes).

core.utils.generate_payments_report_list_v2(payments)

Generate payments report list v2 (v1 with note added).

core.utils.generate_payments_report_list_v3(payments)

Generate payments report list v3 (v2 with approval data added).

core.utils.generate_records_for_prism(due_payments)

Generate the list of records for writing to PRISM file.

core.utils.get_company_info_from_cvr(cvr_number)

Get CVR Data from Virk from a CVR number.

core.utils.get_company_info_from_search_term(search_term)

Get CVR Data from Virk from a generic search term.

core.utils.get_company_info_mock()

Use test data in place of the CVR Virk functions for develop/test.

core.utils.get_cpr_data(cpr)

Get CPR data from Serviceplatformen.

core.utils.get_cpr_data_mock(cpr)

Use test data in place of the real ‘get_cpr_data’ for develop/test.

core.utils.get_person_info(cpr)

Get CPR data on a person and his/her relations.

core.utils.parse_account_alias_mapping_data_from_csv_path(path)

Helper-function for parsing account alias mappings from a path.

core.utils.parse_account_alias_mapping_data_from_csv_string(string)

Parse account alias mapping data from a .csv StringIO.

Returns a list of (main_account_number, activity_number, alias) tuples for example: [ (645511002, 015035, BOS0000109), (528211011, 015038, BOS0000112) ]

core.utils.saml_before_login(user_data)

Hook called after userdata is received from IdP, before login.

core.utils.saml_create_user(user_data)

Hook called after user is created in DB, before login.

core.utils.send_activity_created_email(activity)

Send an email because an activity was created.

core.utils.send_activity_deleted_email(activity)

Send an email because an activity has been deleted.

core.utils.send_activity_email(subject, template, activity)

Send an email concerning an updated activity.

core.utils.send_activity_expired_email(activity)

Send an email because an activity has expired.

core.utils.send_activity_updated_email(activity)

Send an email because an activity was updated.

core.utils.send_appropriation(appropriation, included_activities=None)

Generate PDF and XML files from appropriation and send them to SBSYS.

Parameters
  • appropriation – the Appropriation from which to generate PDF and XML.

  • included_activities – Activities which should be explicitly included.

core.utils.validate_cvr(cvr)

Validate a cvr number string.

Note: this is merely a 8-digit number input validation and not a ‘real’ CVR validation

core.utils.write_prism_file_v0(filename, date, payments, tomorrow)

Write the actual PRISM file.

core.views module

Views and viewsets exposed by the REST interface.

class core.views.ActivityCategoryViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose activity categories in REST API.

queryset = QuerySet
serializer_class

alias of core.serializers.ActivityCategorySerializer

class core.views.ActivityDetailsViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose activity details in REST API.

basename = None
description = None
detail = None
filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.ActivityDetailsSerializer

suffix = None
class core.views.ActivityViewSet(**kwargs)

Bases: core.mixins.AuditModelViewSetMixin, core.views.AuditViewSet

Expose activities in REST API.

basename = None
description = None
destroy(request, *args, **kwargs)

Handle deletion according to their business logic.

Drafts are deleted, expectations are logically deleted, granted activities cannot be deleted.

detail = None
filterset_fields = '__all__'
get_queryset()

Avoid Django’s default lazy loading to improve performance.

get_serializer_class()

Use a different Serializer depending on the action.

name = None
serializer_action_classes = {'list': <class 'core.serializers.ListActivitySerializer'>, 'retrieve': <class 'core.serializers.ActivitySerializer'>}
suffix = None
class core.views.AppropriationViewSet(**kwargs)

Bases: core.mixins.AuditModelViewSetMixin, core.views.AuditViewSet

Expose appropriations in REST API.

Note the custom action grant for approving an appropriation and all its activities.

basename = None
description = None
detail = None
filterset_class

alias of core.filters.AppropriationFilter

get_queryset()

Avoid Django’s default lazy loading to improve performance.

get_serializer_class()

Use a different Serializer depending on the action.

grant(request, pk=None)

Grant the specified activities on this appropriation.

name = None
serializer_action_classes = {'list': <class 'core.serializers.ListAppropriationSerializer'>, 'retrieve': <class 'core.serializers.AppropriationSerializer'>}
suffix = None
class core.views.ApprovalLevelViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose approval levels in REST API.

basename = None
description = None
detail = None
filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.ApprovalLevelSerializer

suffix = None
class core.views.AuditViewSet(**kwargs)

Bases: core.mixins.AuditMixin, rest_framework.viewsets.ModelViewSet

Superclass for use by all model classes with audit fields.

All classes that can be written through the REST interface have audit fields.

authentication_classes = (<class 'core.authentication.CsrfExemptSessionAuthentication'>,)
permission_classes = (<class 'core.permissions.IsUserAllowed'>,)
class core.views.AuthenticatedGraphQLView(schema=None, executor=None, middleware=None, root_value=None, graphiql=False, pretty=False, batch=False, backend=None, subscription_path=None)

Bases: graphene_django.views.GraphQLView

GraphQLView with our Django Rest Framework authentication on top.

As found on: https://github.com/graphql-python/graphene/issues/249

classmethod as_view(*args, **kwargs)

Add the relevant DRF-view logic to the view.

parse_body(request)

Apparently graphene needs a body attribute.

class core.views.CaseViewSet(**kwargs)

Bases: core.mixins.AuditModelViewSetMixin, core.views.AuditViewSet

Viewset exposing Case in the REST API.

Note the custom actions history and change_case_worker.

basename = None
change_case_worker(request)

Change the case_worker of several Cases.

Parameters
  • case_pks – A list of case pks.

  • case_worker_pk – the case worker pk to change to.

description = None
detail = None
filterset_class

alias of core.filters.CaseFilter

get_queryset()

Avoid Django’s default lazy loading to improve performance.

history(request, pk=None)

Fetch history of HistoricalCases which we use as assessments.

name = None
perform_create(serializer)

Create new case - customized to set user.

queryset = CaseQuerySet
serializer_class

alias of core.serializers.CaseSerializer

suffix = None
class core.views.EffortStepViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose effort steps in REST API.

basename = None
description = None
detail = None
filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.EffortStepSerializer

suffix = None
class core.views.EffortViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose efforts in REST API.

basename = None
description = None
detail = None
filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.EffortSerializer

suffix = None
class core.views.FrontendSettingsView(**kwargs)

Bases: rest_framework.views.APIView

Expose a relevant selection of settings to the frontend.

authentication_classes = (<class 'core.authentication.CsrfExemptSessionAuthentication'>,)
get(request, format=None)

Expose the relevant settings.

class core.views.InternalPaymentRecipientViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose internal payment recipients in REST API.

basename = None
description = None
detail = None
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.InternalPaymentRecipientSerializer

suffix = None
class core.views.MunicipalityViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose municipalities in REST API.

basename = None
description = None
detail = None
filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.MunicipalitySerializer

suffix = None
class core.views.PaymentMethodDetailsViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.AuditViewSet

Expose payment method details in REST API.

basename = None
description = None
detail = None
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.PaymentMethodDetailsSerializer

suffix = None
class core.views.PaymentScheduleViewSet(**kwargs)

Bases: core.views.AuditViewSet

Expose payment schedules in REST API.

basename = None
description = None
detail = None
get_queryset()

Avoid Django’s default lazy loading to improve performance.

name = None
serializer_class

alias of core.serializers.PaymentScheduleSerializer

suffix = None
class core.views.PaymentViewSet(**kwargs)

Bases: core.views.AuditViewSet

Expose payments in REST API.

Note, this viewset supports pagination.

basename = None
description = None
detail = None
filterset_class

alias of core.filters.PaymentFilter

filterset_fields = '__all__'
history(request, pk=None)

Fetch history of Payment.

name = None
pagination_class

alias of rest_framework.pagination.PageNumberPagination

permission_classes = (<class 'core.permissions.EditPaymentPermission'>, <class 'core.permissions.DeletePaymentPermission'>, <class 'core.permissions.NewPaymentPermission'>)
queryset = PaymentQuerySet
serializer_class

alias of core.serializers.PaymentSerializer

suffix = None
class core.views.PriceViewSet(**kwargs)

Bases: core.views.AuditViewSet

Expose Price objects in REST API.

basename = None
description = None
detail = None
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.PriceSerializer

suffix = None
class core.views.RateViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose rates in REST API.

basename = None
description = None
detail = None
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.RateSerializer

suffix = None
class core.views.ReadOnlyViewset(**kwargs)

Bases: rest_framework.viewsets.ReadOnlyModelViewSet

Superclass for use model classes that are read only through REST.

permission_classes = (<class 'core.permissions.IsUserAllowed'>,)
class core.views.RelatedPersonViewSet(**kwargs)

Bases: core.mixins.AuditModelViewSetMixin, core.views.AuditViewSet

Expose related persons - typically family relations - in REST API.

basename = None
description = None
detail = None
fetch_from_serviceplatformen(request)

Fetch relations for a person using the CPR from Serviceplatformen.

Returns the data as serialized RelatedPersons data.

GET params: cpr

filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.RelatedPersonSerializer

suffix = None
class core.views.SchoolDistrictViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose school districts in REST API.

basename = None
description = None
detail = None
filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.SchoolDistrictSerializer

suffix = None
class core.views.SectionInfoViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose section infos in REST API.

basename = None
description = None
detail = None
filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.SectionInfoSerializer

suffix = None
class core.views.SectionViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose law sections in REST API.

basename = None
description = None
detail = None
filterset_class

alias of core.filters.AllowedForStepsFilter

name = None
queryset = QuerySet
serializer_class

alias of core.serializers.SectionSerializer

suffix = None
class core.views.ServiceProviderViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, rest_framework.viewsets.ModelViewSet

Expose service providers in REST API.

basename = None
description = None
detail = None
fetch_serviceproviders_from_virk(request)

Fetch serviceproviders using a generic search term from Virk.

Returns the data as serialized ServiceProvider data.

GET params: search_term

filterset_fields = '__all__'
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.ServiceProviderSerializer

suffix = None
class core.views.TargetGroupViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose target groups in REST API.

basename = None
description = None
detail = None
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.TargetGroupSerializer

suffix = None
class core.views.TeamViewSet(**kwargs)

Bases: core.mixins.ClassificationViewSetMixin, core.views.ReadOnlyViewset

Expose teams in REST API.

basename = None
description = None
detail = None
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.TeamSerializer

suffix = None
class core.views.UserViewSet(**kwargs)

Bases: core.views.ReadOnlyViewset

Expose users in REST API.

basename = None
description = None
detail = None
name = None
queryset = QuerySet
serializer_class

alias of core.serializers.UserSerializer

suffix = None
Module contents

‘core’ package containing all functionality.

The bevillingsplatform package - settings and configuration
Submodules
bevillingsplatform.initialize module

Functions for populating the database with initial data.

bevillingsplatform.initialize.initialize()

Initialize all the basic data we want at start.

Should be able to be run multiple times over without generating duplicates.

bevillingsplatform.initialize.initialize_account_alias_mappings()

Initialize the account alias mappings.

bevillingsplatform.initialize.initialize_activity_categories()

Initialize all the relevant activity categories.

Data should be the output of “manage.py dumpdata core.activitycategory

bevillingsplatform.initialize.initialize_activity_details()

Initialize all the relevant activity details.

Data should be the output of “manage.py dumpdata core.activitydetails”.

bevillingsplatform.initialize.initialize_approval_levels()

Initialize all the initial approval levels.

Data should be the output of “manage.py dumpdata core.approvallevels”.

bevillingsplatform.initialize.initialize_municipalities()

Initialize all the danish municipalities.

bevillingsplatform.initialize.initialize_payment_method_details()

Initialize all the relevant payment method details.

bevillingsplatform.initialize.initialize_rates()

Initialize the variable rates, rates and rates per date for Ballerup.

bevillingsplatform.initialize.initialize_school_districts()

Initialize all the school districts for Ballerup.

bevillingsplatform.initialize.initialize_section_infos()

Initialize all the relevant section infos.

Data should be the output of “manage.py dumpdata core.sectioninfos”.

bevillingsplatform.initialize.initialize_sections()

Initialize all the relevant law sections.

Data should be the output of “manage.py dumpdata core.section”.

bevillingsplatform.initialize.initialize_service_providers()

Initialize all the relevant service providers.

Data should be the output of “manage.py dumpdata core.serviceprovider”.

bevillingsplatform.initialize.initialize_target_groups()

Initialize the initial target groups.

Data should be output of “manage.py dumpdata core.targetgroups”.

bevillingsplatform.initialize.initialize_teams()

Initialize all the school districts for Ballerup.

bevillingsplatform.initialize.initialize_users()

Prime the system with some users to get started.

Data should be the output of “manage.py dumpdata core.User”.

bevillingsplatform.settings module

Django settings for bevillingsplatform project.

Generated by “django-admin startproject” using Django 2.2.1.

For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/

For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/

bevillingsplatform.urls module

bevillingsplatform URL Configuration.

The urlpatterns list routes URLs to views. For more information please see:

https://docs.djangoproject.com/en/2.2/topics/http/urls/

Examples
Function views
  1. Add an import: from my_app import views

  2. Add a URL to urlpatterns: path(‘’, views.home, name=’home’)

Class-based views
  1. Add an import: from other_app.views import Home

  2. Add a URL to urlpatterns: path(‘’, Home.as_view(), name=’home’)

Including another URLconf
  1. Import the include() function: from django.urls import include, path

  2. Add a URL to urlpatterns: path(‘blog/’, include(‘blog.urls’))

bevillingsplatform.wsgi module

WSGI config for bevillingsplatform project.

It exposes the WSGI callable as a module-level variable named application.

For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/

Module contents

‘bevillingsplatform’ package created by Django.

manage module

Django’s command-line utility for administrative tasks.

manage.main()

Run main function.

Indices and tables
API documentation
GET /api/cases/

Viewset exposing Case in the REST API.

Note the custom actions history and change_case_worker.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • cpr_number (string) – cpr_number

  • name (string) – name

  • case_worker (string) – Sagsbehandler

  • district (string) – district

  • paying_municipality (string) – paying_municipality

  • acting_municipality (string) – acting_municipality

  • residence_municipality (string) – residence_municipality

  • target_group (string) – target_group

  • effort_step (string) – effort_step

  • scaling_step (string) – scaling_step

  • assessment_comment (string) – assessment_comment

  • efforts (string) – efforts

  • note (string) – note

  • expired (string) – Udgået

Example request:

GET /api/cases/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "expired": "string",
            "num_ongoing_appropriations": "string",
            "num_ongoing_draft_or_expected_appropriations": "string",
            "team": "string",
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "sbsys_id": "string",
            "cpr_number": "string",
            "name": "string",
            "scaling_step": 1,
            "assessment_comment": "string",
            "note": "string",
            "case_worker": 1,
            "district": 1,
            "paying_municipality": 1,
            "acting_municipality": 1,
            "residence_municipality": 1,
            "target_group": 1,
            "effort_step": 1,
            "efforts": [
                1
            ]
        }
    ]
    

POST /api/cases/

Viewset exposing Case in the REST API.

Note the custom actions history and change_case_worker.

Example request:

POST /api/cases/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "sbsys_id": "string",
    "cpr_number": "string",
    "name": "string",
    "scaling_step": 1,
    "assessment_comment": "string",
    "note": "string",
    "case_worker": 1,
    "district": 1,
    "paying_municipality": 1,
    "acting_municipality": 1,
    "residence_municipality": 1,
    "target_group": 1,
    "effort_step": 1,
    "efforts": [
        1
    ]
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "expired": "string",
        "num_ongoing_appropriations": "string",
        "num_ongoing_draft_or_expected_appropriations": "string",
        "team": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "cpr_number": "string",
        "name": "string",
        "scaling_step": 1,
        "assessment_comment": "string",
        "note": "string",
        "case_worker": 1,
        "district": 1,
        "paying_municipality": 1,
        "acting_municipality": 1,
        "residence_municipality": 1,
        "target_group": 1,
        "effort_step": 1,
        "efforts": [
            1
        ]
    }
    

GET /api/cases/{id}/

Viewset exposing Case in the REST API.

Note the custom actions history and change_case_worker.

Parameters
  • id (string) – A unique integer value identifying this sag.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • cpr_number (string) – cpr_number

  • name (string) – name

  • case_worker (string) – Sagsbehandler

  • district (string) – district

  • paying_municipality (string) – paying_municipality

  • acting_municipality (string) – acting_municipality

  • residence_municipality (string) – residence_municipality

  • target_group (string) – target_group

  • effort_step (string) – effort_step

  • scaling_step (string) – scaling_step

  • assessment_comment (string) – assessment_comment

  • efforts (string) – efforts

  • note (string) – note

  • expired (string) – Udgået

Example request:

GET /api/cases/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "expired": "string",
        "num_ongoing_appropriations": "string",
        "num_ongoing_draft_or_expected_appropriations": "string",
        "team": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "cpr_number": "string",
        "name": "string",
        "scaling_step": 1,
        "assessment_comment": "string",
        "note": "string",
        "case_worker": 1,
        "district": 1,
        "paying_municipality": 1,
        "acting_municipality": 1,
        "residence_municipality": 1,
        "target_group": 1,
        "effort_step": 1,
        "efforts": [
            1
        ]
    }
    

PUT /api/cases/{id}/

Viewset exposing Case in the REST API.

Note the custom actions history and change_case_worker.

Parameters
  • id (string) – A unique integer value identifying this sag.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • cpr_number (string) – cpr_number

  • name (string) – name

  • case_worker (string) – Sagsbehandler

  • district (string) – district

  • paying_municipality (string) – paying_municipality

  • acting_municipality (string) – acting_municipality

  • residence_municipality (string) – residence_municipality

  • target_group (string) – target_group

  • effort_step (string) – effort_step

  • scaling_step (string) – scaling_step

  • assessment_comment (string) – assessment_comment

  • efforts (string) – efforts

  • note (string) – note

  • expired (string) – Udgået

Example request:

PUT /api/cases/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "sbsys_id": "string",
    "cpr_number": "string",
    "name": "string",
    "scaling_step": 1,
    "assessment_comment": "string",
    "note": "string",
    "case_worker": 1,
    "district": 1,
    "paying_municipality": 1,
    "acting_municipality": 1,
    "residence_municipality": 1,
    "target_group": 1,
    "effort_step": 1,
    "efforts": [
        1
    ]
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "expired": "string",
        "num_ongoing_appropriations": "string",
        "num_ongoing_draft_or_expected_appropriations": "string",
        "team": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "cpr_number": "string",
        "name": "string",
        "scaling_step": 1,
        "assessment_comment": "string",
        "note": "string",
        "case_worker": 1,
        "district": 1,
        "paying_municipality": 1,
        "acting_municipality": 1,
        "residence_municipality": 1,
        "target_group": 1,
        "effort_step": 1,
        "efforts": [
            1
        ]
    }
    

PATCH /api/cases/{id}/

Viewset exposing Case in the REST API.

Note the custom actions history and change_case_worker.

Parameters
  • id (string) – A unique integer value identifying this sag.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • cpr_number (string) – cpr_number

  • name (string) – name

  • case_worker (string) – Sagsbehandler

  • district (string) – district

  • paying_municipality (string) – paying_municipality

  • acting_municipality (string) – acting_municipality

  • residence_municipality (string) – residence_municipality

  • target_group (string) – target_group

  • effort_step (string) – effort_step

  • scaling_step (string) – scaling_step

  • assessment_comment (string) – assessment_comment

  • efforts (string) – efforts

  • note (string) – note

  • expired (string) – Udgået

Example request:

PATCH /api/cases/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "sbsys_id": "string",
    "cpr_number": "string",
    "name": "string",
    "scaling_step": 1,
    "assessment_comment": "string",
    "note": "string",
    "case_worker": 1,
    "district": 1,
    "paying_municipality": 1,
    "acting_municipality": 1,
    "residence_municipality": 1,
    "target_group": 1,
    "effort_step": 1,
    "efforts": [
        1
    ]
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "expired": "string",
        "num_ongoing_appropriations": "string",
        "num_ongoing_draft_or_expected_appropriations": "string",
        "team": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "cpr_number": "string",
        "name": "string",
        "scaling_step": 1,
        "assessment_comment": "string",
        "note": "string",
        "case_worker": 1,
        "district": 1,
        "paying_municipality": 1,
        "acting_municipality": 1,
        "residence_municipality": 1,
        "target_group": 1,
        "effort_step": 1,
        "efforts": [
            1
        ]
    }
    

DELETE /api/cases/{id}/

Viewset exposing Case in the REST API.

Note the custom actions history and change_case_worker.

Parameters
  • id (string) – A unique integer value identifying this sag.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • cpr_number (string) – cpr_number

  • name (string) – name

  • case_worker (string) – Sagsbehandler

  • district (string) – district

  • paying_municipality (string) – paying_municipality

  • acting_municipality (string) – acting_municipality

  • residence_municipality (string) – residence_municipality

  • target_group (string) – target_group

  • effort_step (string) – effort_step

  • scaling_step (string) – scaling_step

  • assessment_comment (string) – assessment_comment

  • efforts (string) – efforts

  • note (string) – note

  • expired (string) – Udgået

Status Codes
GET /api/cases/{id}/history/

Fetch history of HistoricalCases which we use as assessments.

Parameters
  • id (string) – A unique integer value identifying this sag.

Example request:

GET /api/cases/{id}/history/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "expired": "string",
        "num_ongoing_appropriations": "string",
        "num_ongoing_draft_or_expected_appropriations": "string",
        "team": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "cpr_number": "string",
        "name": "string",
        "scaling_step": 1,
        "assessment_comment": "string",
        "note": "string",
        "case_worker": 1,
        "district": 1,
        "paying_municipality": 1,
        "acting_municipality": 1,
        "residence_municipality": 1,
        "target_group": 1,
        "effort_step": 1,
        "efforts": [
            1
        ]
    }
    

GET /api/appropriations/

Expose appropriations in REST API.

Note the custom action grant for approving an appropriation and all its activities.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • section (string) – section

  • case (string) – Sag

  • note (string) – note

  • main_activity__details__id (string) – Aktivitetsdetalje for hovedaktivitet

Example request:

GET /api/appropriations/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "status": "string",
            "granted_from_date": "string",
            "granted_to_date": "string",
            "case__cpr_number": "string",
            "case__name": "string",
            "case__sbsys_id": "string",
            "num_ongoing_draft_or_expected_activities": "string",
            "num_ongoing_activities": "string",
            "main_activity__details__id": "string",
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "sbsys_id": "string",
            "note": "string",
            "section": 1,
            "case": 1
        }
    ]
    

POST /api/appropriations/

Expose appropriations in REST API.

Note the custom action grant for approving an appropriation and all its activities.

Example request:

POST /api/appropriations/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "sbsys_id": "string",
    "note": "string",
    "section": 1,
    "case": 1
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "status": "string",
        "granted_from_date": "string",
        "granted_to_date": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "case__sbsys_id": "string",
        "num_ongoing_draft_or_expected_activities": "string",
        "num_ongoing_activities": "string",
        "main_activity": {
            "id": 1,
            "monthly_payment_plan": "string",
            "total_cost": "string",
            "total_cost_this_year": "string",
            "total_cost_full_year": "string",
            "total_granted_this_year": "string",
            "total_expected_this_year": "string",
            "payment_plan": {
                "id": 1,
                "payments": [
                    {
                        "id": 1,
                        "account_string": "string",
                        "account_alias": "string",
                        "payment_schedule__payment_id": "string",
                        "case__cpr_number": "string",
                        "case__name": "string",
                        "activity__id": "string",
                        "activity__status": "string",
                        "activity__details__id": "string",
                        "payment_schedule__fictive": "string",
                        "is_payable_manually": "string",
                        "date": "2021-12-08",
                        "recipient_type": "INTERNAL",
                        "recipient_id": "string",
                        "recipient_name": "string",
                        "payment_method": "CASH",
                        "amount": "string",
                        "paid_amount": "string",
                        "paid": true,
                        "paid_date": "2021-12-08",
                        "note": "string",
                        "payment_schedule": 1
                    }
                ],
                "price_per_unit": {
                    "id": 1,
                    "rates_per_date": [
                        {
                            "rate": "string",
                            "start_date": "2021-12-08",
                            "end_date": "2021-12-08",
                            "changed_date": "2021-12-08T10:56:29.857540",
                            "changed_by": 1
                        }
                    ],
                    "current_amount": "string",
                    "amount": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08"
                },
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "payment_frequency": "DAILY",
                "payment_date": "2021-12-08",
                "payment_day_of_month": 1,
                "payment_type": "ONE_TIME_PAYMENT",
                "payment_units": "string",
                "payment_amount": "string",
                "fictive": true,
                "payment_id": 1,
                "payment_cost_type": "FIXED",
                "payment_method_details": 1,
                "payment_rate": "string"
            },
            "details__name": "string",
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "status": "DRAFT",
            "approval_note": "string",
            "appropriation_date": "2021-12-08",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08",
            "activity_type": "MAIN_ACTIVITY",
            "note": "string",
            "details": 1,
            "approval_level": 1,
            "approval_user": 1,
            "modifies": 1,
            "appropriation": 1,
            "service_provider": 1
        },
        "activities": "string",
        "total_granted_this_year": "string",
        "total_granted_full_year": "string",
        "total_expected_this_year": "string",
        "total_expected_full_year": "string",
        "total_cost_expected": "string",
        "total_cost_granted": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "note": "string",
        "section": 1,
        "case": 1
    }
    

GET /api/appropriations/{id}/

Expose appropriations in REST API.

Note the custom action grant for approving an appropriation and all its activities.

Parameters
  • id (string) –

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • section (string) – section

  • case (string) – Sag

  • note (string) – note

  • main_activity__details__id (string) – Aktivitetsdetalje for hovedaktivitet

Example request:

GET /api/appropriations/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "status": "string",
        "granted_from_date": "string",
        "granted_to_date": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "case__sbsys_id": "string",
        "num_ongoing_draft_or_expected_activities": "string",
        "num_ongoing_activities": "string",
        "main_activity": {
            "id": 1,
            "monthly_payment_plan": "string",
            "total_cost": "string",
            "total_cost_this_year": "string",
            "total_cost_full_year": "string",
            "total_granted_this_year": "string",
            "total_expected_this_year": "string",
            "payment_plan": {
                "id": 1,
                "payments": [
                    {
                        "id": 1,
                        "account_string": "string",
                        "account_alias": "string",
                        "payment_schedule__payment_id": "string",
                        "case__cpr_number": "string",
                        "case__name": "string",
                        "activity__id": "string",
                        "activity__status": "string",
                        "activity__details__id": "string",
                        "payment_schedule__fictive": "string",
                        "is_payable_manually": "string",
                        "date": "2021-12-08",
                        "recipient_type": "INTERNAL",
                        "recipient_id": "string",
                        "recipient_name": "string",
                        "payment_method": "CASH",
                        "amount": "string",
                        "paid_amount": "string",
                        "paid": true,
                        "paid_date": "2021-12-08",
                        "note": "string",
                        "payment_schedule": 1
                    }
                ],
                "price_per_unit": {
                    "id": 1,
                    "rates_per_date": [
                        {
                            "rate": "string",
                            "start_date": "2021-12-08",
                            "end_date": "2021-12-08",
                            "changed_date": "2021-12-08T10:56:29.857540",
                            "changed_by": 1
                        }
                    ],
                    "current_amount": "string",
                    "amount": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08"
                },
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "payment_frequency": "DAILY",
                "payment_date": "2021-12-08",
                "payment_day_of_month": 1,
                "payment_type": "ONE_TIME_PAYMENT",
                "payment_units": "string",
                "payment_amount": "string",
                "fictive": true,
                "payment_id": 1,
                "payment_cost_type": "FIXED",
                "payment_method_details": 1,
                "payment_rate": "string"
            },
            "details__name": "string",
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "status": "DRAFT",
            "approval_note": "string",
            "appropriation_date": "2021-12-08",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08",
            "activity_type": "MAIN_ACTIVITY",
            "note": "string",
            "details": 1,
            "approval_level": 1,
            "approval_user": 1,
            "modifies": 1,
            "appropriation": 1,
            "service_provider": 1
        },
        "activities": "string",
        "total_granted_this_year": "string",
        "total_granted_full_year": "string",
        "total_expected_this_year": "string",
        "total_expected_full_year": "string",
        "total_cost_expected": "string",
        "total_cost_granted": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "note": "string",
        "section": 1,
        "case": 1
    }
    

PUT /api/appropriations/{id}/

Expose appropriations in REST API.

Note the custom action grant for approving an appropriation and all its activities.

Parameters
  • id (string) –

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • section (string) – section

  • case (string) – Sag

  • note (string) – note

  • main_activity__details__id (string) – Aktivitetsdetalje for hovedaktivitet

Example request:

PUT /api/appropriations/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "sbsys_id": "string",
    "note": "string",
    "section": 1,
    "case": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "status": "string",
        "granted_from_date": "string",
        "granted_to_date": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "case__sbsys_id": "string",
        "num_ongoing_draft_or_expected_activities": "string",
        "num_ongoing_activities": "string",
        "main_activity": {
            "id": 1,
            "monthly_payment_plan": "string",
            "total_cost": "string",
            "total_cost_this_year": "string",
            "total_cost_full_year": "string",
            "total_granted_this_year": "string",
            "total_expected_this_year": "string",
            "payment_plan": {
                "id": 1,
                "payments": [
                    {
                        "id": 1,
                        "account_string": "string",
                        "account_alias": "string",
                        "payment_schedule__payment_id": "string",
                        "case__cpr_number": "string",
                        "case__name": "string",
                        "activity__id": "string",
                        "activity__status": "string",
                        "activity__details__id": "string",
                        "payment_schedule__fictive": "string",
                        "is_payable_manually": "string",
                        "date": "2021-12-08",
                        "recipient_type": "INTERNAL",
                        "recipient_id": "string",
                        "recipient_name": "string",
                        "payment_method": "CASH",
                        "amount": "string",
                        "paid_amount": "string",
                        "paid": true,
                        "paid_date": "2021-12-08",
                        "note": "string",
                        "payment_schedule": 1
                    }
                ],
                "price_per_unit": {
                    "id": 1,
                    "rates_per_date": [
                        {
                            "rate": "string",
                            "start_date": "2021-12-08",
                            "end_date": "2021-12-08",
                            "changed_date": "2021-12-08T10:56:29.857540",
                            "changed_by": 1
                        }
                    ],
                    "current_amount": "string",
                    "amount": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08"
                },
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "payment_frequency": "DAILY",
                "payment_date": "2021-12-08",
                "payment_day_of_month": 1,
                "payment_type": "ONE_TIME_PAYMENT",
                "payment_units": "string",
                "payment_amount": "string",
                "fictive": true,
                "payment_id": 1,
                "payment_cost_type": "FIXED",
                "payment_method_details": 1,
                "payment_rate": "string"
            },
            "details__name": "string",
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "status": "DRAFT",
            "approval_note": "string",
            "appropriation_date": "2021-12-08",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08",
            "activity_type": "MAIN_ACTIVITY",
            "note": "string",
            "details": 1,
            "approval_level": 1,
            "approval_user": 1,
            "modifies": 1,
            "appropriation": 1,
            "service_provider": 1
        },
        "activities": "string",
        "total_granted_this_year": "string",
        "total_granted_full_year": "string",
        "total_expected_this_year": "string",
        "total_expected_full_year": "string",
        "total_cost_expected": "string",
        "total_cost_granted": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "note": "string",
        "section": 1,
        "case": 1
    }
    

PATCH /api/appropriations/{id}/

Expose appropriations in REST API.

Note the custom action grant for approving an appropriation and all its activities.

Parameters
  • id (string) –

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • section (string) – section

  • case (string) – Sag

  • note (string) – note

  • main_activity__details__id (string) – Aktivitetsdetalje for hovedaktivitet

Example request:

PATCH /api/appropriations/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "sbsys_id": "string",
    "note": "string",
    "section": 1,
    "case": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "status": "string",
        "granted_from_date": "string",
        "granted_to_date": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "case__sbsys_id": "string",
        "num_ongoing_draft_or_expected_activities": "string",
        "num_ongoing_activities": "string",
        "main_activity": {
            "id": 1,
            "monthly_payment_plan": "string",
            "total_cost": "string",
            "total_cost_this_year": "string",
            "total_cost_full_year": "string",
            "total_granted_this_year": "string",
            "total_expected_this_year": "string",
            "payment_plan": {
                "id": 1,
                "payments": [
                    {
                        "id": 1,
                        "account_string": "string",
                        "account_alias": "string",
                        "payment_schedule__payment_id": "string",
                        "case__cpr_number": "string",
                        "case__name": "string",
                        "activity__id": "string",
                        "activity__status": "string",
                        "activity__details__id": "string",
                        "payment_schedule__fictive": "string",
                        "is_payable_manually": "string",
                        "date": "2021-12-08",
                        "recipient_type": "INTERNAL",
                        "recipient_id": "string",
                        "recipient_name": "string",
                        "payment_method": "CASH",
                        "amount": "string",
                        "paid_amount": "string",
                        "paid": true,
                        "paid_date": "2021-12-08",
                        "note": "string",
                        "payment_schedule": 1
                    }
                ],
                "price_per_unit": {
                    "id": 1,
                    "rates_per_date": [
                        {
                            "rate": "string",
                            "start_date": "2021-12-08",
                            "end_date": "2021-12-08",
                            "changed_date": "2021-12-08T10:56:29.857540",
                            "changed_by": 1
                        }
                    ],
                    "current_amount": "string",
                    "amount": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08"
                },
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "payment_frequency": "DAILY",
                "payment_date": "2021-12-08",
                "payment_day_of_month": 1,
                "payment_type": "ONE_TIME_PAYMENT",
                "payment_units": "string",
                "payment_amount": "string",
                "fictive": true,
                "payment_id": 1,
                "payment_cost_type": "FIXED",
                "payment_method_details": 1,
                "payment_rate": "string"
            },
            "details__name": "string",
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "status": "DRAFT",
            "approval_note": "string",
            "appropriation_date": "2021-12-08",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08",
            "activity_type": "MAIN_ACTIVITY",
            "note": "string",
            "details": 1,
            "approval_level": 1,
            "approval_user": 1,
            "modifies": 1,
            "appropriation": 1,
            "service_provider": 1
        },
        "activities": "string",
        "total_granted_this_year": "string",
        "total_granted_full_year": "string",
        "total_expected_this_year": "string",
        "total_expected_full_year": "string",
        "total_cost_expected": "string",
        "total_cost_granted": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "note": "string",
        "section": 1,
        "case": 1
    }
    

DELETE /api/appropriations/{id}/

Expose appropriations in REST API.

Note the custom action grant for approving an appropriation and all its activities.

Parameters
  • id (string) –

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • sbsys_id (string) – sbsys_id

  • section (string) – section

  • case (string) – Sag

  • note (string) – note

  • main_activity__details__id (string) – Aktivitetsdetalje for hovedaktivitet

Status Codes
GET /api/activities/

Expose activities in REST API.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • details (string) – details

  • status (string) – status

  • approval_level (string) – approval_level

  • approval_note (string) – approval_note

  • approval_user (string) – approval_user

  • appropriation_date (string) – appropriation_date

  • start_date (string) – start_date

  • end_date (string) – end_date

  • activity_type (string) – activity_type

  • modifies (string) – modifies

  • appropriation (string) – appropriation

  • service_provider (string) – service_provider

  • note (string) – note

Example request:

GET /api/activities/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "monthly_payment_plan": "string",
            "total_cost": "string",
            "total_cost_this_year": "string",
            "total_cost_full_year": "string",
            "total_granted_this_year": "string",
            "total_expected_this_year": "string",
            "payment_plan": {
                "id": 1,
                "payments": [
                    {
                        "id": 1,
                        "account_string": "string",
                        "account_alias": "string",
                        "payment_schedule__payment_id": "string",
                        "case__cpr_number": "string",
                        "case__name": "string",
                        "activity__id": "string",
                        "activity__status": "string",
                        "activity__details__id": "string",
                        "payment_schedule__fictive": "string",
                        "is_payable_manually": "string",
                        "date": "2021-12-08",
                        "recipient_type": "INTERNAL",
                        "recipient_id": "string",
                        "recipient_name": "string",
                        "payment_method": "CASH",
                        "amount": "string",
                        "paid_amount": "string",
                        "paid": true,
                        "paid_date": "2021-12-08",
                        "note": "string",
                        "payment_schedule": 1
                    }
                ],
                "price_per_unit": {
                    "id": 1,
                    "rates_per_date": [
                        {
                            "rate": "string",
                            "start_date": "2021-12-08",
                            "end_date": "2021-12-08",
                            "changed_date": "2021-12-08T10:56:29.857540",
                            "changed_by": 1
                        }
                    ],
                    "current_amount": "string",
                    "amount": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08"
                },
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "payment_frequency": "DAILY",
                "payment_date": "2021-12-08",
                "payment_day_of_month": 1,
                "payment_type": "ONE_TIME_PAYMENT",
                "payment_units": "string",
                "payment_amount": "string",
                "fictive": true,
                "payment_id": 1,
                "payment_cost_type": "FIXED",
                "payment_method_details": 1,
                "payment_rate": "string"
            },
            "details__name": "string",
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "status": "DRAFT",
            "approval_note": "string",
            "appropriation_date": "2021-12-08",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08",
            "activity_type": "MAIN_ACTIVITY",
            "note": "string",
            "details": 1,
            "approval_level": 1,
            "approval_user": 1,
            "modifies": 1,
            "appropriation": 1,
            "service_provider": 1
        }
    ]
    

POST /api/activities/

Expose activities in REST API.

Example request:

POST /api/activities/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "payment_plan": {
        "price_per_unit": {
            "amount": "string",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08"
        },
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "payment_frequency": "DAILY",
        "payment_date": "2021-12-08",
        "payment_day_of_month": 1,
        "payment_type": "ONE_TIME_PAYMENT",
        "payment_units": "string",
        "payment_amount": "string",
        "fictive": true,
        "payment_cost_type": "FIXED",
        "payment_method_details": 1,
        "payment_rate": "string"
    },
    "user_created": "string",
    "user_modified": "string",
    "status": "DRAFT",
    "approval_note": "string",
    "appropriation_date": "2021-12-08",
    "start_date": "2021-12-08",
    "end_date": "2021-12-08",
    "activity_type": "MAIN_ACTIVITY",
    "note": "string",
    "details": 1,
    "approval_level": 1,
    "approval_user": 1,
    "modifies": 1,
    "appropriation": 1,
    "service_provider": 1
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "monthly_payment_plan": "string",
        "total_cost": "string",
        "total_cost_this_year": "string",
        "total_cost_full_year": "string",
        "total_granted_this_year": "string",
        "total_expected_this_year": "string",
        "payment_plan": {
            "id": 1,
            "payments": [
                {
                    "id": 1,
                    "account_string": "string",
                    "account_alias": "string",
                    "payment_schedule__payment_id": "string",
                    "case__cpr_number": "string",
                    "case__name": "string",
                    "activity__id": "string",
                    "activity__status": "string",
                    "activity__details__id": "string",
                    "payment_schedule__fictive": "string",
                    "is_payable_manually": "string",
                    "date": "2021-12-08",
                    "recipient_type": "INTERNAL",
                    "recipient_id": "string",
                    "recipient_name": "string",
                    "payment_method": "CASH",
                    "amount": "string",
                    "paid_amount": "string",
                    "paid": true,
                    "paid_date": "2021-12-08",
                    "note": "string",
                    "payment_schedule": 1
                }
            ],
            "price_per_unit": {
                "id": 1,
                "rates_per_date": [
                    {
                        "rate": "string",
                        "start_date": "2021-12-08",
                        "end_date": "2021-12-08",
                        "changed_date": "2021-12-08T10:56:29.857540",
                        "changed_by": 1
                    }
                ],
                "current_amount": "string",
                "amount": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08"
            },
            "recipient_type": "INTERNAL",
            "recipient_id": "string",
            "recipient_name": "string",
            "payment_method": "CASH",
            "payment_frequency": "DAILY",
            "payment_date": "2021-12-08",
            "payment_day_of_month": 1,
            "payment_type": "ONE_TIME_PAYMENT",
            "payment_units": "string",
            "payment_amount": "string",
            "fictive": true,
            "payment_id": 1,
            "payment_cost_type": "FIXED",
            "payment_method_details": 1,
            "payment_rate": "string"
        },
        "details__name": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "status": "DRAFT",
        "approval_note": "string",
        "appropriation_date": "2021-12-08",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08",
        "activity_type": "MAIN_ACTIVITY",
        "note": "string",
        "details": 1,
        "approval_level": 1,
        "approval_user": 1,
        "modifies": 1,
        "appropriation": 1,
        "service_provider": 1
    }
    

GET /api/activities/{id}/

Expose activities in REST API.

Parameters
  • id (string) –

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • details (string) – details

  • status (string) – status

  • approval_level (string) – approval_level

  • approval_note (string) – approval_note

  • approval_user (string) – approval_user

  • appropriation_date (string) – appropriation_date

  • start_date (string) – start_date

  • end_date (string) – end_date

  • activity_type (string) – activity_type

  • modifies (string) – modifies

  • appropriation (string) – appropriation

  • service_provider (string) – service_provider

  • note (string) – note

Example request:

GET /api/activities/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "monthly_payment_plan": "string",
        "total_cost": "string",
        "total_cost_this_year": "string",
        "total_cost_full_year": "string",
        "total_granted_this_year": "string",
        "total_expected_this_year": "string",
        "payment_plan": {
            "id": 1,
            "payments": [
                {
                    "id": 1,
                    "account_string": "string",
                    "account_alias": "string",
                    "payment_schedule__payment_id": "string",
                    "case__cpr_number": "string",
                    "case__name": "string",
                    "activity__id": "string",
                    "activity__status": "string",
                    "activity__details__id": "string",
                    "payment_schedule__fictive": "string",
                    "is_payable_manually": "string",
                    "date": "2021-12-08",
                    "recipient_type": "INTERNAL",
                    "recipient_id": "string",
                    "recipient_name": "string",
                    "payment_method": "CASH",
                    "amount": "string",
                    "paid_amount": "string",
                    "paid": true,
                    "paid_date": "2021-12-08",
                    "note": "string",
                    "payment_schedule": 1
                }
            ],
            "price_per_unit": {
                "id": 1,
                "rates_per_date": [
                    {
                        "rate": "string",
                        "start_date": "2021-12-08",
                        "end_date": "2021-12-08",
                        "changed_date": "2021-12-08T10:56:29.857540",
                        "changed_by": 1
                    }
                ],
                "current_amount": "string",
                "amount": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08"
            },
            "recipient_type": "INTERNAL",
            "recipient_id": "string",
            "recipient_name": "string",
            "payment_method": "CASH",
            "payment_frequency": "DAILY",
            "payment_date": "2021-12-08",
            "payment_day_of_month": 1,
            "payment_type": "ONE_TIME_PAYMENT",
            "payment_units": "string",
            "payment_amount": "string",
            "fictive": true,
            "payment_id": 1,
            "payment_cost_type": "FIXED",
            "payment_method_details": 1,
            "payment_rate": "string"
        },
        "details__name": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "status": "DRAFT",
        "approval_note": "string",
        "appropriation_date": "2021-12-08",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08",
        "activity_type": "MAIN_ACTIVITY",
        "note": "string",
        "details": 1,
        "approval_level": 1,
        "approval_user": 1,
        "modifies": 1,
        "appropriation": 1,
        "service_provider": 1
    }
    

PUT /api/activities/{id}/

Expose activities in REST API.

Parameters
  • id (string) –

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • details (string) – details

  • status (string) – status

  • approval_level (string) – approval_level

  • approval_note (string) – approval_note

  • approval_user (string) – approval_user

  • appropriation_date (string) – appropriation_date

  • start_date (string) – start_date

  • end_date (string) – end_date

  • activity_type (string) – activity_type

  • modifies (string) – modifies

  • appropriation (string) – appropriation

  • service_provider (string) – service_provider

  • note (string) – note

Example request:

PUT /api/activities/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "payment_plan": {
        "price_per_unit": {
            "amount": "string",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08"
        },
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "payment_frequency": "DAILY",
        "payment_date": "2021-12-08",
        "payment_day_of_month": 1,
        "payment_type": "ONE_TIME_PAYMENT",
        "payment_units": "string",
        "payment_amount": "string",
        "fictive": true,
        "payment_cost_type": "FIXED",
        "payment_method_details": 1,
        "payment_rate": "string"
    },
    "user_created": "string",
    "user_modified": "string",
    "status": "DRAFT",
    "approval_note": "string",
    "appropriation_date": "2021-12-08",
    "start_date": "2021-12-08",
    "end_date": "2021-12-08",
    "activity_type": "MAIN_ACTIVITY",
    "note": "string",
    "details": 1,
    "approval_level": 1,
    "approval_user": 1,
    "modifies": 1,
    "appropriation": 1,
    "service_provider": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "monthly_payment_plan": "string",
        "total_cost": "string",
        "total_cost_this_year": "string",
        "total_cost_full_year": "string",
        "total_granted_this_year": "string",
        "total_expected_this_year": "string",
        "payment_plan": {
            "id": 1,
            "payments": [
                {
                    "id": 1,
                    "account_string": "string",
                    "account_alias": "string",
                    "payment_schedule__payment_id": "string",
                    "case__cpr_number": "string",
                    "case__name": "string",
                    "activity__id": "string",
                    "activity__status": "string",
                    "activity__details__id": "string",
                    "payment_schedule__fictive": "string",
                    "is_payable_manually": "string",
                    "date": "2021-12-08",
                    "recipient_type": "INTERNAL",
                    "recipient_id": "string",
                    "recipient_name": "string",
                    "payment_method": "CASH",
                    "amount": "string",
                    "paid_amount": "string",
                    "paid": true,
                    "paid_date": "2021-12-08",
                    "note": "string",
                    "payment_schedule": 1
                }
            ],
            "price_per_unit": {
                "id": 1,
                "rates_per_date": [
                    {
                        "rate": "string",
                        "start_date": "2021-12-08",
                        "end_date": "2021-12-08",
                        "changed_date": "2021-12-08T10:56:29.857540",
                        "changed_by": 1
                    }
                ],
                "current_amount": "string",
                "amount": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08"
            },
            "recipient_type": "INTERNAL",
            "recipient_id": "string",
            "recipient_name": "string",
            "payment_method": "CASH",
            "payment_frequency": "DAILY",
            "payment_date": "2021-12-08",
            "payment_day_of_month": 1,
            "payment_type": "ONE_TIME_PAYMENT",
            "payment_units": "string",
            "payment_amount": "string",
            "fictive": true,
            "payment_id": 1,
            "payment_cost_type": "FIXED",
            "payment_method_details": 1,
            "payment_rate": "string"
        },
        "details__name": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "status": "DRAFT",
        "approval_note": "string",
        "appropriation_date": "2021-12-08",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08",
        "activity_type": "MAIN_ACTIVITY",
        "note": "string",
        "details": 1,
        "approval_level": 1,
        "approval_user": 1,
        "modifies": 1,
        "appropriation": 1,
        "service_provider": 1
    }
    

PATCH /api/activities/{id}/

Expose activities in REST API.

Parameters
  • id (string) –

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • details (string) – details

  • status (string) – status

  • approval_level (string) – approval_level

  • approval_note (string) – approval_note

  • approval_user (string) – approval_user

  • appropriation_date (string) – appropriation_date

  • start_date (string) – start_date

  • end_date (string) – end_date

  • activity_type (string) – activity_type

  • modifies (string) – modifies

  • appropriation (string) – appropriation

  • service_provider (string) – service_provider

  • note (string) – note

Example request:

PATCH /api/activities/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "payment_plan": {
        "price_per_unit": {
            "amount": "string",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08"
        },
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "payment_frequency": "DAILY",
        "payment_date": "2021-12-08",
        "payment_day_of_month": 1,
        "payment_type": "ONE_TIME_PAYMENT",
        "payment_units": "string",
        "payment_amount": "string",
        "fictive": true,
        "payment_cost_type": "FIXED",
        "payment_method_details": 1,
        "payment_rate": "string"
    },
    "user_created": "string",
    "user_modified": "string",
    "status": "DRAFT",
    "approval_note": "string",
    "appropriation_date": "2021-12-08",
    "start_date": "2021-12-08",
    "end_date": "2021-12-08",
    "activity_type": "MAIN_ACTIVITY",
    "note": "string",
    "details": 1,
    "approval_level": 1,
    "approval_user": 1,
    "modifies": 1,
    "appropriation": 1,
    "service_provider": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "monthly_payment_plan": "string",
        "total_cost": "string",
        "total_cost_this_year": "string",
        "total_cost_full_year": "string",
        "total_granted_this_year": "string",
        "total_expected_this_year": "string",
        "payment_plan": {
            "id": 1,
            "payments": [
                {
                    "id": 1,
                    "account_string": "string",
                    "account_alias": "string",
                    "payment_schedule__payment_id": "string",
                    "case__cpr_number": "string",
                    "case__name": "string",
                    "activity__id": "string",
                    "activity__status": "string",
                    "activity__details__id": "string",
                    "payment_schedule__fictive": "string",
                    "is_payable_manually": "string",
                    "date": "2021-12-08",
                    "recipient_type": "INTERNAL",
                    "recipient_id": "string",
                    "recipient_name": "string",
                    "payment_method": "CASH",
                    "amount": "string",
                    "paid_amount": "string",
                    "paid": true,
                    "paid_date": "2021-12-08",
                    "note": "string",
                    "payment_schedule": 1
                }
            ],
            "price_per_unit": {
                "id": 1,
                "rates_per_date": [
                    {
                        "rate": "string",
                        "start_date": "2021-12-08",
                        "end_date": "2021-12-08",
                        "changed_date": "2021-12-08T10:56:29.857540",
                        "changed_by": 1
                    }
                ],
                "current_amount": "string",
                "amount": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08"
            },
            "recipient_type": "INTERNAL",
            "recipient_id": "string",
            "recipient_name": "string",
            "payment_method": "CASH",
            "payment_frequency": "DAILY",
            "payment_date": "2021-12-08",
            "payment_day_of_month": 1,
            "payment_type": "ONE_TIME_PAYMENT",
            "payment_units": "string",
            "payment_amount": "string",
            "fictive": true,
            "payment_id": 1,
            "payment_cost_type": "FIXED",
            "payment_method_details": 1,
            "payment_rate": "string"
        },
        "details__name": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "status": "DRAFT",
        "approval_note": "string",
        "appropriation_date": "2021-12-08",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08",
        "activity_type": "MAIN_ACTIVITY",
        "note": "string",
        "details": 1,
        "approval_level": 1,
        "approval_user": 1,
        "modifies": 1,
        "appropriation": 1,
        "service_provider": 1
    }
    

DELETE /api/activities/{id}/

Handle deletion according to their business logic.

Drafts are deleted, expectations are logically deleted, granted activities cannot be deleted.

Parameters
  • id (string) –

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • details (string) – details

  • status (string) – status

  • approval_level (string) – approval_level

  • approval_note (string) – approval_note

  • approval_user (string) – approval_user

  • appropriation_date (string) – appropriation_date

  • start_date (string) – start_date

  • end_date (string) – end_date

  • activity_type (string) – activity_type

  • modifies (string) – modifies

  • appropriation (string) – appropriation

  • service_provider (string) – service_provider

  • note (string) – note

Status Codes
GET /api/payment_schedules/

Expose payment schedules in REST API.

Example request:

GET /api/payment_schedules/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "payments": [
                {
                    "id": 1,
                    "account_string": "string",
                    "account_alias": "string",
                    "payment_schedule__payment_id": "string",
                    "case__cpr_number": "string",
                    "case__name": "string",
                    "activity__id": "string",
                    "activity__status": "string",
                    "activity__details__id": "string",
                    "payment_schedule__fictive": "string",
                    "is_payable_manually": "string",
                    "date": "2021-12-08",
                    "recipient_type": "INTERNAL",
                    "recipient_id": "string",
                    "recipient_name": "string",
                    "payment_method": "CASH",
                    "amount": "string",
                    "paid_amount": "string",
                    "paid": true,
                    "paid_date": "2021-12-08",
                    "note": "string",
                    "payment_schedule": 1
                }
            ],
            "price_per_unit": {
                "id": 1,
                "rates_per_date": [
                    {
                        "rate": "string",
                        "start_date": "2021-12-08",
                        "end_date": "2021-12-08",
                        "changed_date": "2021-12-08T10:56:29.857540",
                        "changed_by": 1
                    }
                ],
                "current_amount": "string",
                "amount": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08"
            },
            "recipient_type": "INTERNAL",
            "recipient_id": "string",
            "recipient_name": "string",
            "payment_method": "CASH",
            "payment_frequency": "DAILY",
            "payment_date": "2021-12-08",
            "payment_day_of_month": 1,
            "payment_type": "ONE_TIME_PAYMENT",
            "payment_units": "string",
            "payment_amount": "string",
            "fictive": true,
            "payment_id": 1,
            "payment_cost_type": "FIXED",
            "payment_method_details": 1,
            "payment_rate": "string"
        }
    ]
    

POST /api/payment_schedules/

Expose payment schedules in REST API.

Example request:

POST /api/payment_schedules/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "price_per_unit": {
        "amount": "string",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08"
    },
    "recipient_type": "INTERNAL",
    "recipient_id": "string",
    "recipient_name": "string",
    "payment_method": "CASH",
    "payment_frequency": "DAILY",
    "payment_date": "2021-12-08",
    "payment_day_of_month": 1,
    "payment_type": "ONE_TIME_PAYMENT",
    "payment_units": "string",
    "payment_amount": "string",
    "fictive": true,
    "payment_cost_type": "FIXED",
    "payment_method_details": 1,
    "payment_rate": "string"
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "payments": [
            {
                "id": 1,
                "account_string": "string",
                "account_alias": "string",
                "payment_schedule__payment_id": "string",
                "case__cpr_number": "string",
                "case__name": "string",
                "activity__id": "string",
                "activity__status": "string",
                "activity__details__id": "string",
                "payment_schedule__fictive": "string",
                "is_payable_manually": "string",
                "date": "2021-12-08",
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "amount": "string",
                "paid_amount": "string",
                "paid": true,
                "paid_date": "2021-12-08",
                "note": "string",
                "payment_schedule": 1
            }
        ],
        "price_per_unit": {
            "id": 1,
            "rates_per_date": [
                {
                    "rate": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08",
                    "changed_date": "2021-12-08T10:56:29.857540",
                    "changed_by": 1
                }
            ],
            "current_amount": "string",
            "amount": "string",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08"
        },
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "payment_frequency": "DAILY",
        "payment_date": "2021-12-08",
        "payment_day_of_month": 1,
        "payment_type": "ONE_TIME_PAYMENT",
        "payment_units": "string",
        "payment_amount": "string",
        "fictive": true,
        "payment_id": 1,
        "payment_cost_type": "FIXED",
        "payment_method_details": 1,
        "payment_rate": "string"
    }
    

GET /api/payment_schedules/{id}/

Expose payment schedules in REST API.

Parameters
  • id (string) –

Example request:

GET /api/payment_schedules/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "payments": [
            {
                "id": 1,
                "account_string": "string",
                "account_alias": "string",
                "payment_schedule__payment_id": "string",
                "case__cpr_number": "string",
                "case__name": "string",
                "activity__id": "string",
                "activity__status": "string",
                "activity__details__id": "string",
                "payment_schedule__fictive": "string",
                "is_payable_manually": "string",
                "date": "2021-12-08",
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "amount": "string",
                "paid_amount": "string",
                "paid": true,
                "paid_date": "2021-12-08",
                "note": "string",
                "payment_schedule": 1
            }
        ],
        "price_per_unit": {
            "id": 1,
            "rates_per_date": [
                {
                    "rate": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08",
                    "changed_date": "2021-12-08T10:56:29.857540",
                    "changed_by": 1
                }
            ],
            "current_amount": "string",
            "amount": "string",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08"
        },
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "payment_frequency": "DAILY",
        "payment_date": "2021-12-08",
        "payment_day_of_month": 1,
        "payment_type": "ONE_TIME_PAYMENT",
        "payment_units": "string",
        "payment_amount": "string",
        "fictive": true,
        "payment_id": 1,
        "payment_cost_type": "FIXED",
        "payment_method_details": 1,
        "payment_rate": "string"
    }
    

PUT /api/payment_schedules/{id}/

Expose payment schedules in REST API.

Parameters
  • id (string) –

Example request:

PUT /api/payment_schedules/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "price_per_unit": {
        "amount": "string",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08"
    },
    "recipient_type": "INTERNAL",
    "recipient_id": "string",
    "recipient_name": "string",
    "payment_method": "CASH",
    "payment_frequency": "DAILY",
    "payment_date": "2021-12-08",
    "payment_day_of_month": 1,
    "payment_type": "ONE_TIME_PAYMENT",
    "payment_units": "string",
    "payment_amount": "string",
    "fictive": true,
    "payment_cost_type": "FIXED",
    "payment_method_details": 1,
    "payment_rate": "string"
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "payments": [
            {
                "id": 1,
                "account_string": "string",
                "account_alias": "string",
                "payment_schedule__payment_id": "string",
                "case__cpr_number": "string",
                "case__name": "string",
                "activity__id": "string",
                "activity__status": "string",
                "activity__details__id": "string",
                "payment_schedule__fictive": "string",
                "is_payable_manually": "string",
                "date": "2021-12-08",
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "amount": "string",
                "paid_amount": "string",
                "paid": true,
                "paid_date": "2021-12-08",
                "note": "string",
                "payment_schedule": 1
            }
        ],
        "price_per_unit": {
            "id": 1,
            "rates_per_date": [
                {
                    "rate": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08",
                    "changed_date": "2021-12-08T10:56:29.857540",
                    "changed_by": 1
                }
            ],
            "current_amount": "string",
            "amount": "string",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08"
        },
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "payment_frequency": "DAILY",
        "payment_date": "2021-12-08",
        "payment_day_of_month": 1,
        "payment_type": "ONE_TIME_PAYMENT",
        "payment_units": "string",
        "payment_amount": "string",
        "fictive": true,
        "payment_id": 1,
        "payment_cost_type": "FIXED",
        "payment_method_details": 1,
        "payment_rate": "string"
    }
    

PATCH /api/payment_schedules/{id}/

Expose payment schedules in REST API.

Parameters
  • id (string) –

Example request:

PATCH /api/payment_schedules/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "price_per_unit": {
        "amount": "string",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08"
    },
    "recipient_type": "INTERNAL",
    "recipient_id": "string",
    "recipient_name": "string",
    "payment_method": "CASH",
    "payment_frequency": "DAILY",
    "payment_date": "2021-12-08",
    "payment_day_of_month": 1,
    "payment_type": "ONE_TIME_PAYMENT",
    "payment_units": "string",
    "payment_amount": "string",
    "fictive": true,
    "payment_cost_type": "FIXED",
    "payment_method_details": 1,
    "payment_rate": "string"
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "payments": [
            {
                "id": 1,
                "account_string": "string",
                "account_alias": "string",
                "payment_schedule__payment_id": "string",
                "case__cpr_number": "string",
                "case__name": "string",
                "activity__id": "string",
                "activity__status": "string",
                "activity__details__id": "string",
                "payment_schedule__fictive": "string",
                "is_payable_manually": "string",
                "date": "2021-12-08",
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "amount": "string",
                "paid_amount": "string",
                "paid": true,
                "paid_date": "2021-12-08",
                "note": "string",
                "payment_schedule": 1
            }
        ],
        "price_per_unit": {
            "id": 1,
            "rates_per_date": [
                {
                    "rate": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08",
                    "changed_date": "2021-12-08T10:56:29.857540",
                    "changed_by": 1
                }
            ],
            "current_amount": "string",
            "amount": "string",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08"
        },
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "payment_frequency": "DAILY",
        "payment_date": "2021-12-08",
        "payment_day_of_month": 1,
        "payment_type": "ONE_TIME_PAYMENT",
        "payment_units": "string",
        "payment_amount": "string",
        "fictive": true,
        "payment_id": 1,
        "payment_cost_type": "FIXED",
        "payment_method_details": 1,
        "payment_rate": "string"
    }
    

DELETE /api/payment_schedules/{id}/

Expose payment schedules in REST API.

Parameters
  • id (string) –

Status Codes
GET /api/rates/

Expose rates in REST API.

Example request:

GET /api/rates/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "rates_per_date": [
                {
                    "rate": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08",
                    "changed_date": "2021-12-08T10:56:29.857540",
                    "changed_by": 1
                }
            ],
            "active": true,
            "name": "string",
            "description": "string",
            "needs_recalculation": true
        }
    ]
    

GET /api/rates/{id}/

Expose rates in REST API.

Parameters
  • id (string) – A unique integer value identifying this takst.

Example request:

GET /api/rates/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "rates_per_date": [
            {
                "rate": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08",
                "changed_date": "2021-12-08T10:56:29.857540",
                "changed_by": 1
            }
        ],
        "active": true,
        "name": "string",
        "description": "string",
        "needs_recalculation": true
    }
    

GET /api/prices/

Expose Price objects in REST API.

Example request:

GET /api/prices/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "rates_per_date": [
                {
                    "rate": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08",
                    "changed_date": "2021-12-08T10:56:29.857540",
                    "changed_by": 1
                }
            ],
            "current_amount": "string",
            "amount": "string",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08"
        }
    ]
    

POST /api/prices/

Expose Price objects in REST API.

Example request:

POST /api/prices/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "amount": "string",
    "start_date": "2021-12-08",
    "end_date": "2021-12-08"
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "rates_per_date": [
            {
                "rate": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08",
                "changed_date": "2021-12-08T10:56:29.857540",
                "changed_by": 1
            }
        ],
        "current_amount": "string",
        "amount": "string",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08"
    }
    

GET /api/prices/{id}/

Expose Price objects in REST API.

Parameters
  • id (string) – A unique integer value identifying this pris.

Example request:

GET /api/prices/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "rates_per_date": [
            {
                "rate": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08",
                "changed_date": "2021-12-08T10:56:29.857540",
                "changed_by": 1
            }
        ],
        "current_amount": "string",
        "amount": "string",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08"
    }
    

PUT /api/prices/{id}/

Expose Price objects in REST API.

Parameters
  • id (string) – A unique integer value identifying this pris.

Example request:

PUT /api/prices/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "amount": "string",
    "start_date": "2021-12-08",
    "end_date": "2021-12-08"
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "rates_per_date": [
            {
                "rate": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08",
                "changed_date": "2021-12-08T10:56:29.857540",
                "changed_by": 1
            }
        ],
        "current_amount": "string",
        "amount": "string",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08"
    }
    

PATCH /api/prices/{id}/

Expose Price objects in REST API.

Parameters
  • id (string) – A unique integer value identifying this pris.

Example request:

PATCH /api/prices/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "amount": "string",
    "start_date": "2021-12-08",
    "end_date": "2021-12-08"
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "rates_per_date": [
            {
                "rate": "string",
                "start_date": "2021-12-08",
                "end_date": "2021-12-08",
                "changed_date": "2021-12-08T10:56:29.857540",
                "changed_by": 1
            }
        ],
        "current_amount": "string",
        "amount": "string",
        "start_date": "2021-12-08",
        "end_date": "2021-12-08"
    }
    

DELETE /api/prices/{id}/

Expose Price objects in REST API.

Parameters
  • id (string) – A unique integer value identifying this pris.

Status Codes
GET /api/payment_method_details/

Expose payment method details in REST API.

Example request:

GET /api/payment_method_details/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "tax_card": "MAIN_CARD"
        }
    ]
    

POST /api/payment_method_details/

Expose payment method details in REST API.

Example request:

POST /api/payment_method_details/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "tax_card": "MAIN_CARD"
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "tax_card": "MAIN_CARD"
    }
    

GET /api/payment_method_details/{id}/

Expose payment method details in REST API.

Parameters
  • id (string) – A unique integer value identifying this betalingsmåde detalje.

Example request:

GET /api/payment_method_details/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "tax_card": "MAIN_CARD"
    }
    

PUT /api/payment_method_details/{id}/

Expose payment method details in REST API.

Parameters
  • id (string) – A unique integer value identifying this betalingsmåde detalje.

Example request:

PUT /api/payment_method_details/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "tax_card": "MAIN_CARD"
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "tax_card": "MAIN_CARD"
    }
    

PATCH /api/payment_method_details/{id}/

Expose payment method details in REST API.

Parameters
  • id (string) – A unique integer value identifying this betalingsmåde detalje.

Example request:

PATCH /api/payment_method_details/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "tax_card": "MAIN_CARD"
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "tax_card": "MAIN_CARD"
    }
    

DELETE /api/payment_method_details/{id}/

Expose payment method details in REST API.

Parameters
  • id (string) – A unique integer value identifying this betalingsmåde detalje.

Status Codes
GET /api/payments/

Expose payments in REST API.

Note, this viewset supports pagination.

Query Parameters
  • page (integer) – A page number within the paginated result set.

  • date (string) – date

  • recipient_type (string) – recipient_type

  • recipient_id (string) – recipient_id

  • recipient_name (string) – recipient_name

  • payment_method (string) – payment_method

  • amount (string) – amount

  • paid_amount (string) – paid_amount

  • paid (string) – paid

  • paid_date (string) – paid_date

  • note (string) – note

  • saved_account_string (string) – saved_account_string

  • saved_account_alias (string) – saved_account_alias

  • payment_schedule (string) – payment_schedule

  • case (string) – Sag

  • activity (string) – Aktivitet

  • paid_date__gte (string) – Betalingsdato større eller lig med

  • paid_date__lte (string) – Betalingsdato mindre eller lig med

  • date__gte (string) – Dato større eller lig med

  • date__lte (string) – Dato mindre eller lig med

  • paid_date_or_date__gte (string) – Betalingsdato eller Dato større eller lig med

  • paid_date_or_date__lte (string) – Betalingsdato eller Dato mindre eller lig med

  • paid_date_or_date_week (string) – Betalingsdato eller Dato for uge

  • paid_date_or_date_month (string) – Betalingsdato eller Dato for måned

  • paid_date_or_date_year (string) – Betalingsdato eller Dato for år

Example request:

GET /api/payments/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "count": 1,
        "next": "https://example.com",
        "previous": "https://example.com",
        "results": [
            {
                "id": 1,
                "account_string": "string",
                "account_alias": "string",
                "payment_schedule__payment_id": "string",
                "case__cpr_number": "string",
                "case__name": "string",
                "activity__id": "string",
                "activity__status": "string",
                "activity__details__id": "string",
                "payment_schedule__fictive": "string",
                "is_payable_manually": "string",
                "date": "2021-12-08",
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "amount": "string",
                "paid_amount": "string",
                "paid": true,
                "paid_date": "2021-12-08",
                "note": "string",
                "payment_schedule": 1
            }
        ]
    }
    

POST /api/payments/

Expose payments in REST API.

Note, this viewset supports pagination.

Example request:

POST /api/payments/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "date": "2021-12-08",
    "recipient_type": "INTERNAL",
    "recipient_id": "string",
    "recipient_name": "string",
    "payment_method": "CASH",
    "amount": "string",
    "paid_amount": "string",
    "paid": true,
    "paid_date": "2021-12-08",
    "note": "string",
    "payment_schedule": 1
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "account_string": "string",
        "account_alias": "string",
        "payment_schedule__payment_id": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "activity__id": "string",
        "activity__status": "string",
        "activity__details__id": "string",
        "payment_schedule__fictive": "string",
        "is_payable_manually": "string",
        "date": "2021-12-08",
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "amount": "string",
        "paid_amount": "string",
        "paid": true,
        "paid_date": "2021-12-08",
        "note": "string",
        "payment_schedule": 1
    }
    

GET /api/payments/{id}/

Expose payments in REST API.

Note, this viewset supports pagination.

Parameters
  • id (string) – A unique integer value identifying this betaling.

Query Parameters
  • date (string) – date

  • recipient_type (string) – recipient_type

  • recipient_id (string) – recipient_id

  • recipient_name (string) – recipient_name

  • payment_method (string) – payment_method

  • amount (string) – amount

  • paid_amount (string) – paid_amount

  • paid (string) – paid

  • paid_date (string) – paid_date

  • note (string) – note

  • saved_account_string (string) – saved_account_string

  • saved_account_alias (string) – saved_account_alias

  • payment_schedule (string) – payment_schedule

  • case (string) – Sag

  • activity (string) – Aktivitet

  • paid_date__gte (string) – Betalingsdato større eller lig med

  • paid_date__lte (string) – Betalingsdato mindre eller lig med

  • date__gte (string) – Dato større eller lig med

  • date__lte (string) – Dato mindre eller lig med

  • paid_date_or_date__gte (string) – Betalingsdato eller Dato større eller lig med

  • paid_date_or_date__lte (string) – Betalingsdato eller Dato mindre eller lig med

  • paid_date_or_date_week (string) – Betalingsdato eller Dato for uge

  • paid_date_or_date_month (string) – Betalingsdato eller Dato for måned

  • paid_date_or_date_year (string) – Betalingsdato eller Dato for år

Example request:

GET /api/payments/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "account_string": "string",
        "account_alias": "string",
        "payment_schedule__payment_id": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "activity__id": "string",
        "activity__status": "string",
        "activity__details__id": "string",
        "payment_schedule__fictive": "string",
        "is_payable_manually": "string",
        "date": "2021-12-08",
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "amount": "string",
        "paid_amount": "string",
        "paid": true,
        "paid_date": "2021-12-08",
        "note": "string",
        "payment_schedule": 1
    }
    

PUT /api/payments/{id}/

Expose payments in REST API.

Note, this viewset supports pagination.

Parameters
  • id (string) – A unique integer value identifying this betaling.

Query Parameters
  • date (string) – date

  • recipient_type (string) – recipient_type

  • recipient_id (string) – recipient_id

  • recipient_name (string) – recipient_name

  • payment_method (string) – payment_method

  • amount (string) – amount

  • paid_amount (string) – paid_amount

  • paid (string) – paid

  • paid_date (string) – paid_date

  • note (string) – note

  • saved_account_string (string) – saved_account_string

  • saved_account_alias (string) – saved_account_alias

  • payment_schedule (string) – payment_schedule

  • case (string) – Sag

  • activity (string) – Aktivitet

  • paid_date__gte (string) – Betalingsdato større eller lig med

  • paid_date__lte (string) – Betalingsdato mindre eller lig med

  • date__gte (string) – Dato større eller lig med

  • date__lte (string) – Dato mindre eller lig med

  • paid_date_or_date__gte (string) – Betalingsdato eller Dato større eller lig med

  • paid_date_or_date__lte (string) – Betalingsdato eller Dato mindre eller lig med

  • paid_date_or_date_week (string) – Betalingsdato eller Dato for uge

  • paid_date_or_date_month (string) – Betalingsdato eller Dato for måned

  • paid_date_or_date_year (string) – Betalingsdato eller Dato for år

Example request:

PUT /api/payments/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "date": "2021-12-08",
    "recipient_type": "INTERNAL",
    "recipient_id": "string",
    "recipient_name": "string",
    "payment_method": "CASH",
    "amount": "string",
    "paid_amount": "string",
    "paid": true,
    "paid_date": "2021-12-08",
    "note": "string",
    "payment_schedule": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "account_string": "string",
        "account_alias": "string",
        "payment_schedule__payment_id": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "activity__id": "string",
        "activity__status": "string",
        "activity__details__id": "string",
        "payment_schedule__fictive": "string",
        "is_payable_manually": "string",
        "date": "2021-12-08",
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "amount": "string",
        "paid_amount": "string",
        "paid": true,
        "paid_date": "2021-12-08",
        "note": "string",
        "payment_schedule": 1
    }
    

PATCH /api/payments/{id}/

Expose payments in REST API.

Note, this viewset supports pagination.

Parameters
  • id (string) – A unique integer value identifying this betaling.

Query Parameters
  • date (string) – date

  • recipient_type (string) – recipient_type

  • recipient_id (string) – recipient_id

  • recipient_name (string) – recipient_name

  • payment_method (string) – payment_method

  • amount (string) – amount

  • paid_amount (string) – paid_amount

  • paid (string) – paid

  • paid_date (string) – paid_date

  • note (string) – note

  • saved_account_string (string) – saved_account_string

  • saved_account_alias (string) – saved_account_alias

  • payment_schedule (string) – payment_schedule

  • case (string) – Sag

  • activity (string) – Aktivitet

  • paid_date__gte (string) – Betalingsdato større eller lig med

  • paid_date__lte (string) – Betalingsdato mindre eller lig med

  • date__gte (string) – Dato større eller lig med

  • date__lte (string) – Dato mindre eller lig med

  • paid_date_or_date__gte (string) – Betalingsdato eller Dato større eller lig med

  • paid_date_or_date__lte (string) – Betalingsdato eller Dato mindre eller lig med

  • paid_date_or_date_week (string) – Betalingsdato eller Dato for uge

  • paid_date_or_date_month (string) – Betalingsdato eller Dato for måned

  • paid_date_or_date_year (string) – Betalingsdato eller Dato for år

Example request:

PATCH /api/payments/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "date": "2021-12-08",
    "recipient_type": "INTERNAL",
    "recipient_id": "string",
    "recipient_name": "string",
    "payment_method": "CASH",
    "amount": "string",
    "paid_amount": "string",
    "paid": true,
    "paid_date": "2021-12-08",
    "note": "string",
    "payment_schedule": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "account_string": "string",
        "account_alias": "string",
        "payment_schedule__payment_id": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "activity__id": "string",
        "activity__status": "string",
        "activity__details__id": "string",
        "payment_schedule__fictive": "string",
        "is_payable_manually": "string",
        "date": "2021-12-08",
        "recipient_type": "INTERNAL",
        "recipient_id": "string",
        "recipient_name": "string",
        "payment_method": "CASH",
        "amount": "string",
        "paid_amount": "string",
        "paid": true,
        "paid_date": "2021-12-08",
        "note": "string",
        "payment_schedule": 1
    }
    

DELETE /api/payments/{id}/

Expose payments in REST API.

Note, this viewset supports pagination.

Parameters
  • id (string) – A unique integer value identifying this betaling.

Query Parameters
  • date (string) – date

  • recipient_type (string) – recipient_type

  • recipient_id (string) – recipient_id

  • recipient_name (string) – recipient_name

  • payment_method (string) – payment_method

  • amount (string) – amount

  • paid_amount (string) – paid_amount

  • paid (string) – paid

  • paid_date (string) – paid_date

  • note (string) – note

  • saved_account_string (string) – saved_account_string

  • saved_account_alias (string) – saved_account_alias

  • payment_schedule (string) – payment_schedule

  • case (string) – Sag

  • activity (string) – Aktivitet

  • paid_date__gte (string) – Betalingsdato større eller lig med

  • paid_date__lte (string) – Betalingsdato mindre eller lig med

  • date__gte (string) – Dato større eller lig med

  • date__lte (string) – Dato mindre eller lig med

  • paid_date_or_date__gte (string) – Betalingsdato eller Dato større eller lig med

  • paid_date_or_date__lte (string) – Betalingsdato eller Dato mindre eller lig med

  • paid_date_or_date_week (string) – Betalingsdato eller Dato for uge

  • paid_date_or_date_month (string) – Betalingsdato eller Dato for måned

  • paid_date_or_date_year (string) – Betalingsdato eller Dato for år

Status Codes

Expose related persons - typically family relations - in REST API.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • relation_type (string) – relation_type

  • cpr_number (string) – cpr_number

  • name (string) – name

  • related_case (string) – related_case

  • from_serviceplatformen (string) – from_serviceplatformen

  • main_case (string) – main_case

Example request:

GET /api/related_persons/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "relation_type": "string",
            "cpr_number": "string",
            "name": "string",
            "related_case": "string",
            "from_serviceplatformen": true,
            "main_case": 1
        }
    ]
    

POST /api/related_persons/

Expose related persons - typically family relations - in REST API.

Example request:

POST /api/related_persons/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "relation_type": "string",
    "cpr_number": "string",
    "name": "string",
    "related_case": "string",
    "from_serviceplatformen": true,
    "main_case": 1
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "relation_type": "string",
        "cpr_number": "string",
        "name": "string",
        "related_case": "string",
        "from_serviceplatformen": true,
        "main_case": 1
    }
    

Fetch relations for a person using the CPR from Serviceplatformen.

Returns the data as serialized RelatedPersons data.

GET params: cpr

Example request:

GET /api/related_persons/fetch_from_serviceplatformen/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "relation_type": "string",
        "cpr_number": "string",
        "name": "string",
        "related_case": "string",
        "from_serviceplatformen": true,
        "main_case": 1
    }
    

Expose related persons - typically family relations - in REST API.

Parameters
  • id (string) – A unique integer value identifying this relateret person.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • relation_type (string) – relation_type

  • cpr_number (string) – cpr_number

  • name (string) – name

  • related_case (string) – related_case

  • from_serviceplatformen (string) – from_serviceplatformen

  • main_case (string) – main_case

Example request:

GET /api/related_persons/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "relation_type": "string",
        "cpr_number": "string",
        "name": "string",
        "related_case": "string",
        "from_serviceplatformen": true,
        "main_case": 1
    }
    

Expose related persons - typically family relations - in REST API.

Parameters
  • id (string) – A unique integer value identifying this relateret person.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • relation_type (string) – relation_type

  • cpr_number (string) – cpr_number

  • name (string) – name

  • related_case (string) – related_case

  • from_serviceplatformen (string) – from_serviceplatformen

  • main_case (string) – main_case

Example request:

PUT /api/related_persons/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "relation_type": "string",
    "cpr_number": "string",
    "name": "string",
    "related_case": "string",
    "from_serviceplatformen": true,
    "main_case": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "relation_type": "string",
        "cpr_number": "string",
        "name": "string",
        "related_case": "string",
        "from_serviceplatformen": true,
        "main_case": 1
    }
    

Expose related persons - typically family relations - in REST API.

Parameters
  • id (string) – A unique integer value identifying this relateret person.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • relation_type (string) – relation_type

  • cpr_number (string) – cpr_number

  • name (string) – name

  • related_case (string) – related_case

  • from_serviceplatformen (string) – from_serviceplatformen

  • main_case (string) – main_case

Example request:

PATCH /api/related_persons/{id}/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "relation_type": "string",
    "cpr_number": "string",
    "name": "string",
    "related_case": "string",
    "from_serviceplatformen": true,
    "main_case": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "relation_type": "string",
        "cpr_number": "string",
        "name": "string",
        "related_case": "string",
        "from_serviceplatformen": true,
        "main_case": 1
    }
    

Expose related persons - typically family relations - in REST API.

Parameters
  • id (string) – A unique integer value identifying this relateret person.

Query Parameters
  • created (string) – created

  • modified (string) – modified

  • user_created (string) – user_created

  • user_modified (string) – user_modified

  • relation_type (string) – relation_type

  • cpr_number (string) – cpr_number

  • name (string) – name

  • related_case (string) – related_case

  • from_serviceplatformen (string) – from_serviceplatformen

  • main_case (string) – main_case

Status Codes
GET /api/municipalities/

Expose municipalities in REST API.

Query Parameters
  • active (string) – active

  • name (string) – name

Example request:

GET /api/municipalities/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "name": "string"
        }
    ]
    

GET /api/municipalities/{id}/

Expose municipalities in REST API.

Parameters
  • id (string) – A unique integer value identifying this kommune.

Query Parameters
  • active (string) – active

  • name (string) – name

Example request:

GET /api/municipalities/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "name": "string"
    }
    

GET /api/school_districts/

Expose school districts in REST API.

Query Parameters
  • active (string) – active

  • name (string) – name

Example request:

GET /api/school_districts/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "name": "string"
        }
    ]
    

GET /api/school_districts/{id}/

Expose school districts in REST API.

Parameters
  • id (string) – A unique integer value identifying this distrikt.

Query Parameters
  • active (string) – active

  • name (string) – name

Example request:

GET /api/school_districts/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "name": "string"
    }
    

GET /api/teams/

Expose teams in REST API.

Example request:

GET /api/teams/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "name": "string",
            "leader": 1
        }
    ]
    

GET /api/teams/{id}/

Expose teams in REST API.

Parameters
  • id (string) – A unique integer value identifying this team.

Example request:

GET /api/teams/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "name": "string",
        "leader": 1
    }
    

GET /api/sections/

Expose law sections in REST API.

Query Parameters
  • active (string) – active

  • paragraph (string) – paragraph

  • text (string) – text

  • allowed_for_target_groups (string) – allowed_for_target_groups

  • allowed_for_steps (string) – allowed_for_steps

  • law_text_name (string) – law_text_name

Example request:

GET /api/sections/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "paragraph": "string",
            "text": "string",
            "law_text_name": "string",
            "allowed_for_target_groups": [
                1
            ],
            "allowed_for_steps": [
                1
            ]
        }
    ]
    

GET /api/sections/{id}/

Expose law sections in REST API.

Parameters
  • id (string) – A unique integer value identifying this paragraf.

Query Parameters
  • active (string) – active

  • paragraph (string) – paragraph

  • text (string) – text

  • allowed_for_target_groups (string) – allowed_for_target_groups

  • allowed_for_steps (string) – allowed_for_steps

  • law_text_name (string) – law_text_name

Example request:

GET /api/sections/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "paragraph": "string",
        "text": "string",
        "law_text_name": "string",
        "allowed_for_target_groups": [
            1
        ],
        "allowed_for_steps": [
            1
        ]
    }
    

GET /api/sectioninfos/

Expose section infos in REST API.

Query Parameters
  • activity_details (string) – activity_details

  • section (string) – section

  • activity_category (string) – activity_category

  • kle_number (string) – kle_number

  • sbsys_template_id (string) – sbsys_template_id

  • main_activity_main_account_number (string) – main_activity_main_account_number

  • supplementary_activity_main_account_number (string) – supplementary_activity_main_account_number

Example request:

GET /api/sectioninfos/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "kle_number": "string",
            "sbsys_template_id": "string",
            "main_activity_main_account_number": "string",
            "supplementary_activity_main_account_number": "string",
            "activity_details": 1,
            "section": 1,
            "activity_category": 1
        }
    ]
    

GET /api/sectioninfos/{id}/

Expose section infos in REST API.

Parameters
  • id (string) – A unique integer value identifying this paragraf-info.

Query Parameters
  • activity_details (string) – activity_details

  • section (string) – section

  • activity_category (string) – activity_category

  • kle_number (string) – kle_number

  • sbsys_template_id (string) – sbsys_template_id

  • main_activity_main_account_number (string) – main_activity_main_account_number

  • supplementary_activity_main_account_number (string) – supplementary_activity_main_account_number

Example request:

GET /api/sectioninfos/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "kle_number": "string",
        "sbsys_template_id": "string",
        "main_activity_main_account_number": "string",
        "supplementary_activity_main_account_number": "string",
        "activity_details": 1,
        "section": 1,
        "activity_category": 1
    }
    

GET /api/activity_details/

Expose activity details in REST API.

Query Parameters
  • active (string) – active

  • name (string) – name

  • description (string) – description

  • activity_id (string) – activity_id

  • max_tolerance_in_percent (string) – max_tolerance_in_percent

  • max_tolerance_in_dkk (string) – max_tolerance_in_dkk

  • main_activity_for (string) – main_activity_for

  • supplementary_activity_for (string) – supplementary_activity_for

  • service_providers (string) – service_providers

  • main_activities (string) – main_activities

Example request:

GET /api/activity_details/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "name": "string",
            "description": "string",
            "activity_id": "string",
            "max_tolerance_in_percent": 1,
            "max_tolerance_in_dkk": 1,
            "main_activity_for": [
                "string"
            ],
            "supplementary_activity_for": [
                1
            ],
            "service_providers": [
                1
            ],
            "main_activities": [
                1
            ]
        }
    ]
    

GET /api/activity_details/{id}/

Expose activity details in REST API.

Parameters
  • id (string) – A unique integer value identifying this aktivitetsdetalje.

Query Parameters
  • active (string) – active

  • name (string) – name

  • description (string) – description

  • activity_id (string) – activity_id

  • max_tolerance_in_percent (string) – max_tolerance_in_percent

  • max_tolerance_in_dkk (string) – max_tolerance_in_dkk

  • main_activity_for (string) – main_activity_for

  • supplementary_activity_for (string) – supplementary_activity_for

  • service_providers (string) – service_providers

  • main_activities (string) – main_activities

Example request:

GET /api/activity_details/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "name": "string",
        "description": "string",
        "activity_id": "string",
        "max_tolerance_in_percent": 1,
        "max_tolerance_in_dkk": 1,
        "main_activity_for": [
            "string"
        ],
        "supplementary_activity_for": [
            1
        ],
        "service_providers": [
            1
        ],
        "main_activities": [
            1
        ]
    }
    

GET /api/service_providers/

Expose service providers in REST API.

Query Parameters
  • active (string) – active

  • cvr_number (string) – cvr_number

  • name (string) – name

  • vat_factor (string) – vat_factor

Example request:

GET /api/service_providers/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "cvr_number": "string",
            "name": "string",
            "vat_factor": "string"
        }
    ]
    

GET /api/service_providers/{id}/

Expose service providers in REST API.

Parameters
  • id (string) – A unique integer value identifying this leverandør.

Query Parameters
  • active (string) – active

  • cvr_number (string) – cvr_number

  • name (string) – name

  • vat_factor (string) – vat_factor

Example request:

GET /api/service_providers/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "cvr_number": "string",
        "name": "string",
        "vat_factor": "string"
    }
    

GET /api/approval_levels/

Expose approval levels in REST API.

Query Parameters
  • active (string) – active

  • name (string) – name

Example request:

GET /api/approval_levels/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "name": "string"
        }
    ]
    

GET /api/approval_levels/{id}/

Expose approval levels in REST API.

Parameters
  • id (string) – A unique integer value identifying this bevillingsniveau.

Query Parameters
  • active (string) – active

  • name (string) – name

Example request:

GET /api/approval_levels/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "name": "string"
    }
    

GET /api/users/

Expose users in REST API.

Example request:

GET /api/users/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "username": "string",
            "first_name": "string",
            "last_name": "string",
            "cases": [
                1
            ],
            "team": 1,
            "profile": "readonly"
        }
    ]
    

GET /api/users/{id}/

Expose users in REST API.

Parameters
  • id (string) – A unique integer value identifying this bruger.

Example request:

GET /api/users/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "username": "string",
        "first_name": "string",
        "last_name": "string",
        "cases": [
            1
        ],
        "team": 1,
        "profile": "readonly"
    }
    

GET /api/effort_steps/

Expose effort steps in REST API.

Query Parameters
  • active (string) – active

  • name (string) – name

  • number (string) – number

Example request:

GET /api/effort_steps/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "name": "string",
            "number": 1
        }
    ]
    

GET /api/effort_steps/{id}/

Expose effort steps in REST API.

Parameters
  • id (string) – A unique integer value identifying this indsatstrappetrin.

Query Parameters
  • active (string) – active

  • name (string) – name

  • number (string) – number

Example request:

GET /api/effort_steps/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "name": "string",
        "number": 1
    }
    

GET /api/target_groups/

Expose target groups in REST API.

Example request:

GET /api/target_groups/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "name": "string",
            "required_fields_for_case": "string"
        }
    ]
    

GET /api/target_groups/{id}/

Expose target groups in REST API.

Parameters
  • id (string) – A unique integer value identifying this målgruppe.

Example request:

GET /api/target_groups/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "name": "string",
        "required_fields_for_case": "string"
    }
    

GET /api/internal_payment_recipients/

Expose internal payment recipients in REST API.

Example request:

GET /api/internal_payment_recipients/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "name": "string"
        }
    ]
    

GET /api/internal_payment_recipients/{id}/

Expose internal payment recipients in REST API.

Parameters
  • id (string) – A unique integer value identifying this intern betalingsmodtager.

Example request:

GET /api/internal_payment_recipients/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "name": "string"
    }
    

GET /api/efforts/

Expose efforts in REST API.

Query Parameters
  • active (string) – active

  • name (string) – name

  • description (string) – description

  • allowed_for_target_groups (string) – allowed_for_target_groups

Example request:

GET /api/efforts/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "active": true,
            "name": "string",
            "description": "string",
            "allowed_for_target_groups": [
                1
            ]
        }
    ]
    

GET /api/efforts/{id}/

Expose efforts in REST API.

Parameters
  • id (string) – A unique integer value identifying this indsats.

Query Parameters
  • active (string) – active

  • name (string) – name

  • description (string) – description

  • allowed_for_target_groups (string) – allowed_for_target_groups

Example request:

GET /api/efforts/{id}/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "active": true,
        "name": "string",
        "description": "string",
        "allowed_for_target_groups": [
            1
        ]
    }
    

GET /api/editing_past_payments_allowed/

Return the Django setting allowing changes to the past.

Example request:

GET /api/editing_past_payments_allowed/ HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {}
    ]
    

POST /api/token/

Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials.

Example request:

POST /api/token/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "username": "string",
    "password": "string"
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "username": "string",
        "password": "string"
    }
    

POST /api/token/refresh/

Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.

Example request:

POST /api/token/refresh/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "refresh": "string"
}
Status Codes
  • 201 Created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "refresh": "string"
    }
    

PATCH /api/cases/change_case_worker/

Change the case_worker of several Cases.

Parameters
  • case_pks – A list of case pks.

  • case_worker_pk – the case worker pk to change to.

Example request:

PATCH /api/cases/change_case_worker/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "sbsys_id": "string",
    "cpr_number": "string",
    "name": "string",
    "scaling_step": 1,
    "assessment_comment": "string",
    "note": "string",
    "case_worker": 1,
    "district": 1,
    "paying_municipality": 1,
    "acting_municipality": 1,
    "residence_municipality": 1,
    "target_group": 1,
    "effort_step": 1,
    "efforts": [
        1
    ]
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "expired": "string",
        "num_ongoing_appropriations": "string",
        "num_ongoing_draft_or_expected_appropriations": "string",
        "team": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "cpr_number": "string",
        "name": "string",
        "scaling_step": 1,
        "assessment_comment": "string",
        "note": "string",
        "case_worker": 1,
        "district": 1,
        "paying_municipality": 1,
        "acting_municipality": 1,
        "residence_municipality": 1,
        "target_group": 1,
        "effort_step": 1,
        "efforts": [
            1
        ]
    }
    

PATCH /api/appropriations/{id}/grant/

Grant the specified activities on this appropriation.

Parameters
  • id (string) –

Example request:

PATCH /api/appropriations/{id}/grant/ HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "user_created": "string",
    "user_modified": "string",
    "sbsys_id": "string",
    "note": "string",
    "section": 1,
    "case": 1
}
Status Codes
  • 200 OK

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "status": "string",
        "granted_from_date": "string",
        "granted_to_date": "string",
        "case__cpr_number": "string",
        "case__name": "string",
        "case__sbsys_id": "string",
        "num_ongoing_draft_or_expected_activities": "string",
        "num_ongoing_activities": "string",
        "main_activity": {
            "id": 1,
            "monthly_payment_plan": "string",
            "total_cost": "string",
            "total_cost_this_year": "string",
            "total_cost_full_year": "string",
            "total_granted_this_year": "string",
            "total_expected_this_year": "string",
            "payment_plan": {
                "id": 1,
                "payments": [
                    {
                        "id": 1,
                        "account_string": "string",
                        "account_alias": "string",
                        "payment_schedule__payment_id": "string",
                        "case__cpr_number": "string",
                        "case__name": "string",
                        "activity__id": "string",
                        "activity__status": "string",
                        "activity__details__id": "string",
                        "payment_schedule__fictive": "string",
                        "is_payable_manually": "string",
                        "date": "2021-12-08",
                        "recipient_type": "INTERNAL",
                        "recipient_id": "string",
                        "recipient_name": "string",
                        "payment_method": "CASH",
                        "amount": "string",
                        "paid_amount": "string",
                        "paid": true,
                        "paid_date": "2021-12-08",
                        "note": "string",
                        "payment_schedule": 1
                    }
                ],
                "price_per_unit": {
                    "id": 1,
                    "rates_per_date": [
                        {
                            "rate": "string",
                            "start_date": "2021-12-08",
                            "end_date": "2021-12-08",
                            "changed_date": "2021-12-08T10:56:29.857540",
                            "changed_by": 1
                        }
                    ],
                    "current_amount": "string",
                    "amount": "string",
                    "start_date": "2021-12-08",
                    "end_date": "2021-12-08"
                },
                "recipient_type": "INTERNAL",
                "recipient_id": "string",
                "recipient_name": "string",
                "payment_method": "CASH",
                "payment_frequency": "DAILY",
                "payment_date": "2021-12-08",
                "payment_day_of_month": 1,
                "payment_type": "ONE_TIME_PAYMENT",
                "payment_units": "string",
                "payment_amount": "string",
                "fictive": true,
                "payment_id": 1,
                "payment_cost_type": "FIXED",
                "payment_method_details": 1,
                "payment_rate": "string"
            },
            "details__name": "string",
            "created": "2021-12-08T10:56:29.857540",
            "modified": "2021-12-08T10:56:29.857540",
            "user_created": "string",
            "user_modified": "string",
            "status": "DRAFT",
            "approval_note": "string",
            "appropriation_date": "2021-12-08",
            "start_date": "2021-12-08",
            "end_date": "2021-12-08",
            "activity_type": "MAIN_ACTIVITY",
            "note": "string",
            "details": 1,
            "approval_level": 1,
            "approval_user": 1,
            "modifies": 1,
            "appropriation": 1,
            "service_provider": 1
        },
        "activities": "string",
        "total_granted_this_year": "string",
        "total_granted_full_year": "string",
        "total_expected_this_year": "string",
        "total_expected_full_year": "string",
        "total_cost_expected": "string",
        "total_cost_granted": "string",
        "created": "2021-12-08T10:56:29.857540",
        "modified": "2021-12-08T10:56:29.857540",
        "user_created": "string",
        "user_modified": "string",
        "sbsys_id": "string",
        "note": "string",
        "section": 1,
        "case": 1
    }
    

Release History

Version 3.6.2, 2021-11-30

Hotfix release

Bug fixes
  • Correct end modified activities with no end date.

  • Correct setting main activities for an appropriation.

Version 3.6.1, 2021-11-25

Hotfix release

Bug fixes
  • Correctly exclude deleted activities from graphql endpoint.

Version 3.6.0, 2021-11-17

New in this version:

Features
  • Add preliminary GraphQL API.

  • Disallow one-time payment frequency for main activities (in the frontend for now).

  • Add support for comma-separated values in SECURE_PROXY_SSL_HEADER.

  • Upgrade the Virk CVR third-party library.

Version 3.5.0, 2021-09-27

New in this version:

Features
  • Add CVR integration to the Virk CVR API.

  • Replace the old account string and account alias fields with the new.

  • Add previous, current, next year expected/granted cost-calculations for Activity and Appropriation.

  • Allow main activities to be “revived”.

  • Add information modal for a individual payment.

  • Add a new version of the payments report list containing approval information.

  • Re-add the granted payments report.

  • Add cases report.

  • Convert more backend models to classifications.

  • Various backend performance optimizations.

  • Fix and simplify payment update operations in the frontend.

  • Add a version number in the frontend.

  • Update frontend dependencies.

Version 3.4.3, 2021-03-23

New in this version:

Features
  • Restrict editing activity type for expected activities modifying another.

  • Update OS2Forms.xml with new KLE, OS2FormsID and SbsysCaseFileNumber.

  • Add Payment note to payments report.

  • Update thirdparty dependencies.

Version 3.4.2, 2021-03-12

Hotfix release

Bug fixes
  • Correctly use activity-component of account_alias_new.

Version 3.4.1, 2021-03-11

New in this version:

Features
  • Persist the new account_string and account_alias when paying payments.

  • Fix the calculation of payment sums by excluding deleted activities.

  • Consolidate prometheus logging to a single setting.

  • Update third party dependencies.

Version 3.4.0, 2021-02-11

New in this version:

Features
  • Add parallel account_string using the new activity category models.

  • Add parallel account_alias using the new account alias mapping models.

  • Update payment list when a payment is changed (for example paid).

  • Publish database documentation on build.

  • Update third party dependencies.

Version 3.3.1, 2021-01-25

Hotfix release

Bug fixes
  • Run PRISM export also on Fridays

Version 3.3.0, 2020-12-17

New in this version:

Features
  • Add redirect after SSO login.

  • Save filters across page transitions.

  • Save filters in URL to make them bookmarkable.

  • Change “reset” functionality of overview pages.

  • Remove unneeded Team on Case and instead display and filter on Team of the case worker.

  • Validate CVR number for recipient_id on PaymentSchedule when recipient is “Firma”.

  • Add generic time intervals for payments (previous, current, next - week, month, year).

  • Added fields to payments report.

  • Changed the flow of emails when manipulating activities.

  • Add child name to CPR number of Payments overview.

  • Add Users and Teams to workflow users Admin page.

  • Update third party dependencies.

Bug fixes
  • Fix a bug where updating a payment caused a PATCH twice.

  • Various fixes to frontend tests.

Version 3.2.5, 2020-12-02

Hotfix release

Bug fixes
  • Use correct date limits for supplementary activity creation.

Version 3.2.4, 2020-11-24

New in this version:

Bug fixes
  • Remove upper time limit for generated payment reports.

  • Fix calculation of earliest start date when creating an activity.

  • Remove redundant PRISM file generation so only one is generated.

  • Don’t automatically mark fictive invoice payments as paid.

  • Add a warning on the supplementary activities when shortening a main activity.

  • Update various dependencies.

Version 3.2.3, 2020-11-16

Hotfix release

Bug fixes
  • Correctly initialize SAML in settings.py

  • Update SAML dependencies to allow POST SingleSignOnService binding

Version 3.2.2, 2020-10-22

New in this version:

Bug fixes
  • When generating payments report, catch exception if payment date is before case was created.

Version 3.2.1, 2020-10-13

New in this version:

Bug fixes
  • Allow granting activities with no payments.

  • Fix generating payments for activities that started with no payments.

  • Disallow editing payments for a payment plan that is not individual.

  • Update various dependencies.

Version 3.2.0, 2020-09-30

New in this version:

Bug fixes
  • Don’t send payment emails to internal recipients.

  • Allow payments of 0 kroner.

  • One time payment activities should not have main acticity end date set when granting.

  • Proper data cleanup in GUI when user changes payment method or type.

  • Allow display of Prices with no start date.

  • Don’t allow individual payments outside of main activity’s period.

  • Layout/hyphenation issue fixed.

  • Date dependent price per unit must be valid at least from activity’s start date.

Features
  • Individual payment plans.

  • Stop using Postgres-specific DB field for “required fields for target group”.

  • Python packages are upgraded to include the latest security fixes.

  • Warn users that future changes to SD and Cash payments will be overwritten.

  • Allow relevant users to edit payments of type Cash and SD Løn.

  • Only allow creation of new payments for individual payment plan and only on drafts or expectations.

  • UX for Activity creation updated - user goes to the activity in read only mode after creating, not to the appropriation.

  • Account alias and account string are shown in the same column.

  • Delete button is not shown for granted payments and deleting granted payments is prevented by the backend.

  • Appropriation PDF is updated to include individual payments.

  • Audit information, responsible user and time stamp is added to rates and prices.

  • Price history in fronted is updated to include audit fields.

  • Payment per kilometer etc. are cleaned up and replaced by “running payment” in the database.

  • Handle expectations for activities with individual payment plan.

  • Update recipient on future payments when saving drafts and expectations.

  • Backend restrictions on editing payments: Admin and workflow users can edit SD or Cash - other users can only mark non-paid payments (of the other types) as paid. Nobody can edit the amount of granted payments.

  • CSV export files are modified to support the changes introduced in Phase 3.

  • PRISME export will output to files, one with account alias, one without.

  • Don’t allow granting an activity with no payments.

  • Don’t allow user to add new payments if activity is in edit mode.

Version 3.1.1, 2020-08-31

New in this version:

Bug fixes
  • Fix instance of prices being displayed with non-Danish decimal separator.

  • Approximate payment calculator now uses current rate if rates are used.

  • Enable input field validation in browser when creating activities.

  • Updates list of service providers in UI based on current activity detail.

  • Include global rate and price per unit information in payment email and PDF.

Version 3.1.0, 2020-07-09

New in this version:

Features
  • Add Prices and Rates.

  • Add counts for draft, expected and ongoing activities.

  • Don’t send activity emails for one time payments.

  • Prism payments account for holidays and weekends with PaymentDateExclusions.

  • Main account refactoring, use new account string and remove old Account model.

  • Emphasize new activities in appropriation email.

  • Add pagination for Appropriation PDF.

  • Add notes for Activity.

  • Make Appropriation drafts deleteable.

  • Display payment method when recipient is internal or company.

  • Add child name, and case worker fields to activity emails.

  • Set creation and modification user correctly for Case, Appropriation, Activity, RelatedPerson.

  • Remove Service Providers from ActivityDetails Admin.

  • Numerous styling fixes.

  • Add labels to Docker files.

  • Update dependencies to new versions.

Version 3.0.0, 2020-06-03

New in this version:

Features
  • New Django Admin user interface and permission profile for handling classifications.

  • Frontend overviews have been improved.

  • Account number have been refactored.

  • Classifications can be marked active on/off.

  • Efforts are now a classification.

  • Target groups are now a classification.

  • ActivityDetails now have a description.

  • Related persons are now editable and can be marked ‘manual’ or ‘from Serviceplatformen’.

  • Allow hiding expired activities in the frontend.

  • Improved search for payments.

  • Fixed dropdown menus with only one choice.

  • Frontend and Appropriation endpoint performance improvements.

  • Many smaller fixes to texts.

  • Update dependencies to new versions.

Version 2.6.1, 2020-04-03

Hotfix release

Bug fixes
  • Use correct dates for PRISM exports for Sunday and Monday.

Version 2.6.0, 2020-03-31

New in this version:

Features
  • Delete payment schedules and payments when an activity is deleted.

  • Send an email when an activity is expired.

  • Change subject on activity deleted email.

  • Change text string in frontend for closed cases.

  • Add status in payments report.

  • Change prism payment for Saturday, Sunday and Monday to be exported Friday.

  • Add coverage and tests for management commands.

  • Update dependencies to new versions.

Bug fixes
  • Remove validation for monthly expected adjustments.

Version 2.5.0, 2020-03-06

New in this version:

Features
  • Add section, section_text, payment_schedule__payment_id and main_activity_name to CSV Payments report.

  • Return a validation error when trying to create an invalid monthly payment schedule.

  • Use create_rrule for all the places we check generated payments.

  • Add tests for the frontend.

  • Update README with logging documentation.

  • Update documentation for generating database documentation.

  • Add shell linting and docker file linting and lint fixes.

  • Add automatic deployment for develop branch.

  • Allow the docker backend service to be debuggable with docker attach.

  • Update dependencies to new versions.

Version 2.4.2, 2020-02-24

Hotfix release

Bug fixes
  • Fix fonts urlpattern for loading fonts as assets.

Version 2.4.1, 2020-02-24

New in this version:

Features
  • Store google fonts as assets instead of fetching them from google servers.

Bug fixes
  • Fix duplicate payments generation.

  • Remove duplicate payments in a migration.

  • Add database constraint which prevents duplicate payments on date.

Version 2.4.0, 2020-01-24

New in this version:

Features
  • Add warning in GUI if a payment date is earlier than two days from today.

  • Add restriction in GUI so an Activity can only have one expected Activity.

  • Add Actual-state CSV generation for Payments.

  • Improve documentation all-around.

  • Change payment file default date to tomorrow.

  • Update Django from 2.2.4 to 2.2.9

Bug fixes
  • Fix CPR search for “Find sager”.

  • Change field 17 of PRISM file to the unique Payment pk.

  • Handle missing effort steps gracefully in GUI.

Version 2.3.0, 2020-01-09

New in this version:

Features
  • Modify the URL for the rate tabel (taksttabel) to a more general one.

  • Nice-ify django admin for Payments and PaymentSchedules and allow search on payment id.

  • Add pydocstyle compliance.

  • Add sphinx docs generation.

Bug fixes
  • Fix incorrect tests dependent on current year.

Version 2.2.3, 2019-12-12

New in this version:

  • Changes to PRISM file generation.

  • Enforce rules for activities on grant.

  • Disable edit for appropriation fields on granted activities.

  • Enable date validation for activities.

  • Add filtering on payment type.

  • Fix payment CPR filtering.

  • Small improvements to logging.

  • Make tox work locally.

  • Add frontend documentation.

  • Add cronjobs for docker.

  • Fix date filtering.

  • Fix failing tests.

  • Fix paths in settings.

  • Update Django from 2.2.1 to 2.2.4

Version 2.2.2, 2019-11-28

Hotfix
  • Fix broken migration.

Version 2.2.1, 2019-11-25

New in this version:

Features
  • Mark payments for SD Løn along with fictive ones.

Bug fixes
  • Fix hover text.

  • Display of Indsatstrappen fixed.

  • Fix ordering of Indsatstrappen.

  • Recipient info stayed in GUI even though payment method was changed to “internal”.

  • Empty “not found” text when displaying “Mine sager”.

Version 2.2.0, 2019-11-21

New in this version:

Features
  • It is now possible to find payments from a payment ID.

  • Case worker can now be changed on several cases in one action.

  • A log of all pending and sent emails is now kept and accessible in the Django admin interface.

  • Payment ID and account string is displayed in the Django admin interface.

  • Generally improved interface for searching and displaying cases.

  • Fictive payments are clearly marked as fictive in payment plans.

  • Fictive payments are marked as paid in the database on the day they are due.

  • Field added in API to indicate whether a payment can be paid manually or not.

  • Payments that are paid as Salary (through SD-Løn) or cash or are fictive may not be edited manually.

  • Payments are paginated to avoid too long loading times.

  • Payments are now sorted by payment date.

  • Payments are sorted by ascending payment date.

  • Indsatstrappen is now a classification to be maintained in the Django Admin interface.

  • Section (of the law, from the appropriation) is added to the payment emails.

  • Emails are sent for all approved payments, for all combinations of payment and recipient types.

  • Complex logic for generation of account string.

  • Payment dialog improved.

  • Integration to KMD PRISME accounting system.

  • Information about citizen included in display of appropriation.

Bug fixes
  • Don’t throw an exception if users attempt to access the API without logging in, just deny access.

  • If more than one user profile is sent from SAML IdP, don’t crash - choose the highest one.

  • “Mixed content error” on some pages (on internal test server).

  • Many small and big improvements to styling and usability.

  • Function deciding if case is expired also looked at DELETED activities.

Version 2.0.1, 2019-11-11

New in this version:

  • Add support for Service Provider certificates through PySaml2.

Version 2.0.0, 2019-11-06

New in this version:

  • Implement SAML SSO login.

  • Implement user rights levels.

  • Add preliminary Prism file generation.

  • Implement GUI for editing payments.

  • Add support for “fictive” payments.

  • Add support for negative and zero payments.

  • Add support for paid amounts and paid date for payments.

  • Update payment summation to include paid amounts when able.

  • Add new payment ID for payment plans.

  • Add account strings for payments.

  • Add API filtering for several endpoints.

  • Remove the “udbetaling til firma” payment option.

  • Fix a bug when creating an activity.

  • Fix redirect when setting a payment paid.

  • Add missing verbose names in Django admin.

Version 1.1.1, 2019-10-30

Hotfix release.

New in this version:

  • Deleted main activity no longer blocks for creating a new main activity.

  • Granted activities are now explicitly included in the appropration PDF.

  • Fix activities still being checked for granting when closing the grant dialog.

  • Fix not being able to grant an expected main activity.

  • Fix invalid XML in OS2forms.xml.

  • Add missing constraint for creating supplementary activities based on allowed main activities.

Version 1.1.0, 2019-10-04

New in this version:

  • Fixed approval button when there’s nothing to approve.

  • Fixed missing activities from appropriation PDF.

  • Fix spelling error in logout message.

  • For payment to a person with SDLøn, tax card is mandatory.

  • Use user first_name and last_name instead of initials for Sagsbehandler dropdown.

  • Fix stop dates on supplementary activities.

  • Fix link to rates document.

  • Correctly calculate the expected amount for expected activities.

  • Correct forms for modifying effort steps (Indsatstrappe) in Djang Admin.

  • Clear frontend errors correctly.

  • Rearrange autologin scripts in frontend.

  • Change recommended browser text.

  • Suppress not writeable warning from ipython.

Version 1.0.0, 2019-09-27

First production release. New in this version:

  • KLE number and SBYS template info moved from Section to new SectionInfo class in the ManyToMany relation.

  • Activities are granted individually, not all at once for each appropriation.

  • Missing logo fixed/supplied.

  • Various GUI and UX improvements.

  • Prevent expected changes from starting in the past.

  • Make user supply day of month for monthly payments - handle month end correctly.

  • Browser compatibility fixes.

  • Fix missing update of family relations.

  • Improved handling of backend error messages.

  • New API fields for expected and granted totals for activities.

  • Appropriation PDF nicified and adapted to the new approval scheme.

  • SBSYS integration (os2forms.xml) fixed.

  • Cases must have a team, this field is now non-nullable.

  • Activities with status EXPECTED are now soft-deleted.

  • Status label for appropriations fixed.

  • Wrong validation of KLE numbers fixed.

  • Stop date of supplementary activities must be no later than stop date of main activity.

  • End-to-end tests for accessibility added.

  • Classifications updated, now production ready.

  • Bad validation that expectation must be after next payment date removed.

  • Allow units to be charged, e.g. dates, to be a decimal number.

  • Gunicorn is now run single-threaded.

  • Updates to Docker configuration.

  • It is now possible to make expectations for the entire appropriation period even though the main activity is split.

  • DB representation of effort steps (Indsatstrappe) changed to integer.

Version 0.5.0, 2019-09-05

New in this version:

  • initial release