Skip to content

Commit

Permalink
Merge pull request #89 from maykinmedia/feature/59-legacy-api
Browse files Browse the repository at this point in the history
🚚 [#59] moved the old api to legacy file
  • Loading branch information
joeribekker authored Oct 20, 2023
2 parents 70c0850 + d77f426 commit d368660
Show file tree
Hide file tree
Showing 88 changed files with 137 additions and 116 deletions.
1 change: 0 additions & 1 deletion src/openklant/components/contactmomenten/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/openklant/components/klanten/__init__.py

This file was deleted.

File renamed without changes.
3 changes: 3 additions & 0 deletions src/openklant/components/legacy/contactmomenten/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
default_app_config = (
"openklant.components.legacy.contactmomenten.apps.ContactmomentenConfig"
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from vng_api_common.filtersets import FilterSet
from vng_api_common.utils import get_help_text

from openklant.components.contactmomenten.models.contactmomenten import (
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
ContactMoment,
KlantContactMoment,
ObjectContactMoment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

from notifications_api_common.kanalen import Kanaal

from openklant.components.contactmomenten.models.contactmomenten import ContactMoment
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
ContactMoment,
)

KANAAL_CONTACTMOMENTEN = Kanaal(
settings.CONTACTMOMENTEN_NOTIFICATIONS_KANAAL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from vng_api_common.serializers import add_choice_values_help_text
from vng_api_common.validators import IsImmutableValidator, URLValidator

from openklant.components.contactmomenten.models.constants import ObjectTypes
from openklant.components.contactmomenten.models.contactmomenten import (
from openklant.components.legacy.contactmomenten.models.constants import ObjectTypes
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
ContactMoment,
KlantContactMoment,
Medewerker,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from rest_framework.test import APITestCase
from vng_api_common.tests import AuthCheckMixin, reverse

from openklant.components.contactmomenten.models.tests.factories import (
from openklant.components.legacy.contactmomenten.models.tests.factories import (
ContactMomentFactory,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
from vng_api_common.constants import ComponentTypes
from vng_api_common.tests import JWTAuthMixin, get_validation_errors, reverse

from openklant.components.contactmomenten.models.constants import InitiatiefNemer
from openklant.components.contactmomenten.models.contactmomenten import ContactMoment
from openklant.components.contactmomenten.models.tests.factories import (
from openklant.components.legacy.contactmomenten.models.constants import InitiatiefNemer
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
ContactMoment,
)
from openklant.components.legacy.contactmomenten.models.tests.factories import (
ContactMomentFactory,
KlantContactMomentFactory,
MedewerkerFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
from vng_api_common.models import APICredential
from vng_api_common.tests import JWTAuthMixin, get_validation_errors, reverse

from openklant.components.contactmomenten.models.constants import InitiatiefNemer, Rol
from openklant.components.contactmomenten.models.contactmomenten import (
from openklant.components.legacy.contactmomenten.models.constants import (
InitiatiefNemer,
Rol,
)
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
KlantContactMoment,
)
from openklant.components.contactmomenten.models.tests.factories import (
from openklant.components.legacy.contactmomenten.models.tests.factories import (
ContactMomentFactory,
KlantContactMomentFactory,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from vng_api_common.tests import JWTAuthMixin, get_validation_errors, reverse
from zds_client.tests.mocks import mock_client

from openklant.components.contactmomenten.models.constants import ObjectTypes
from openklant.components.contactmomenten.models.contactmomenten import (
from openklant.components.legacy.contactmomenten.models.constants import ObjectTypes
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
ObjectContactMoment,
)
from openklant.components.contactmomenten.models.tests.factories import (
from openklant.components.legacy.contactmomenten.models.tests.factories import (
ContactMomentFactory,
ObjectContactMomentFactory,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from vng_api_common.validators import ResourceValidator
from zds_client import ClientError

from openklant.components.contactmomenten.models.contactmomenten import (
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
ObjectContactMoment,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class ContactmomentenConfig(AppConfig):
name = "openklant.components.contactmomenten"
name = "openklant.components.legacy.contactmomenten"
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
from vng_api_common.audittrails.models import AuditTrail
from vng_api_common.tests import JWTAuthMixin, reverse

from openklant.components.contactmomenten.models.constants import InitiatiefNemer
from openklant.components.contactmomenten.models.contactmomenten import ContactMoment
from openklant.components.legacy.contactmomenten.models.constants import InitiatiefNemer
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
ContactMoment,
)

KLANT = "http://some.klanten.nl/api/v1/klanten/951e4660-3835-4643-8f9c-e523e364a30f"
MEDEWERKER = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
from rest_framework.test import APITestCase
from zgw_consumers.models import Service

from openklant.components.contactmomenten.models.contactmomenten import ContactMoment
from openklant.components.legacy.contactmomenten.models.contactmomenten import (
ContactMoment,
)


@override_settings(IS_HTTPS=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from rest_framework import status
from rest_framework.test import APITransactionTestCase

from openklant.components.contactmomenten.models.constants import InitiatiefNemer
from openklant.components.contactmomenten.models.tests.factories import (
from openklant.components.legacy.contactmomenten.models.constants import InitiatiefNemer
from openklant.components.legacy.contactmomenten.models.tests.factories import (
ContactMomentFactory,
)
from openklant.utils.tests.mixins import JWTAuthTransactionMixin
Expand Down
1 change: 1 addition & 0 deletions src/openklant/components/legacy/klanten/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default_app_config = "openklant.components.legacy.klanten.apps.KlantenConfig"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from notifications_api_common.kanalen import Kanaal

from openklant.components.klanten.models.klanten import Klant
from openklant.components.legacy.klanten.models.klanten import Klant

KANAAL_KLANTEN = Kanaal(
settings.KLANTEN_NOTIFICATIONS_KANAAL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
from vng_api_common.serializers import add_choice_values_help_text
from vng_api_common.validators import IsImmutableValidator, URLValidator

from openklant.components.klanten.models.constants import GeslachtsAanduiding, KlantType
from openklant.components.klanten.models.klanten import (
from openklant.components.legacy.klanten.models.constants import (
GeslachtsAanduiding,
KlantType,
)
from openklant.components.legacy.klanten.models.klanten import (
Klant,
KlantAdres,
NatuurlijkPersoon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from rest_framework.test import APITestCase
from vng_api_common.tests import AuthCheckMixin, JWTAuthMixin, reverse

from openklant.components.klanten.api.scopes import SCOPE_KLANTEN_ALLES_LEZEN
from openklant.components.klanten.models.constants import KlantType
from openklant.components.klanten.models.klanten import Klant
from openklant.components.klanten.models.tests.factories import KlantFactory
from openklant.components.legacy.klanten.api.scopes import SCOPE_KLANTEN_ALLES_LEZEN
from openklant.components.legacy.klanten.models.constants import KlantType
from openklant.components.legacy.klanten.models.klanten import Klant
from openklant.components.legacy.klanten.models.tests.factories import KlantFactory

SUBJECT = "http://example.com/subject/1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
from rest_framework.test import APITestCase
from vng_api_common.tests import JWTAuthMixin, get_validation_errors, reverse

from openklant.components.klanten.models.constants import KlantType, SoortRechtsvorm
from openklant.components.klanten.models.klanten import Klant
from openklant.components.klanten.models.tests.factories import (
from openklant.components.legacy.klanten.models.constants import (
KlantType,
SoortRechtsvorm,
)
from openklant.components.legacy.klanten.models.klanten import Klant
from openklant.components.legacy.klanten.models.tests.factories import (
KlantAdresFactory,
KlantFactory,
NatuurlijkPersoonFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)
from vng_api_common.permissions import AuthScopesRequired

from openklant.components.klanten.models.klanten import Klant
from openklant.components.legacy.klanten.models.klanten import Klant

from .audits import AUDIT_KLANTEN
from .filters import KlantFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class KlantenConfig(AppConfig):
name = "openklant.components.klanten"
name = "openklant.components.legacy.klanten"
Empty file.
3 changes: 1 addition & 2 deletions src/openklant/conf/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
REST_FRAMEWORK[
"DEFAULT_PAGINATION_CLASS"
] = "rest_framework.pagination.PageNumberPagination"

SECURITY_DEFINITION_NAME = "JWT-Claims"

SWAGGER_SETTINGS = BASE_SWAGGER_SETTINGS.copy()

SWAGGER_SETTINGS.update(
{
"DEFAULT_INFO": "openklant.components.klanten.api.schema.info",
"DEFAULT_INFO": "openklant.components.legacy.klanten.api.schema.info",
"SECURITY_DEFINITIONS": {
SECURITY_DEFINITION_NAME: {
# OAS 3.0
Expand Down
20 changes: 16 additions & 4 deletions src/openklant/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
"openklant",
"openklant.accounts",
"openklant.utils",
"openklant.components.klanten",
"openklant.components.contactmomenten",
"openklant.components.klantinteracties",
"openklant.components.legacy.klanten",
"openklant.components.legacy.contactmomenten",
]

MIDDLEWARE = [
Expand Down Expand Up @@ -363,10 +363,22 @@
# urls for OAS3 specifications
SPEC_URL = {
"klanten": os.path.join(
BASE_DIR, "src", "openklant", "components", "klanten", "openapi.yaml"
BASE_DIR,
"src",
"openklant",
"components",
"legacy",
"klanten",
"openapi.yaml",
),
"contactmomenten": os.path.join(
BASE_DIR, "src", "openklant", "components", "contactmomenten", "openapi.yaml"
BASE_DIR,
"src",
"openklant",
"components",
"legacy",
"contactmomenten",
"openapi.yaml",
),
}

Expand Down
Loading

0 comments on commit d368660

Please sign in to comment.