Coverage for benefits / enrollment_switchio / migrations / 0005_switchioconfig_delete_oldswitchioconfig.py: 100%
7 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-02-13 19:35 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-02-13 19:35 +0000
1# Generated by Django 5.1.7 on 2025-07-14 10:20
3import django.db.models.deletion
4from django.db import migrations, models
6import benefits.core.models.common
7import benefits.secrets
10class Migration(migrations.Migration):
12 dependencies = [
13 ("core", "0056_remove_transitagency_switchio_config"),
14 ("enrollment_switchio", "0004_rename_switchioconfig_oldswitchioconfig"),
15 ]
17 operations = [
18 migrations.CreateModel(
19 name="SwitchioConfig",
20 fields=[
21 (
22 "transitprocessorconfig_ptr",
23 models.OneToOneField(
24 auto_created=True,
25 on_delete=django.db.models.deletion.CASCADE,
26 parent_link=True,
27 primary_key=True,
28 serialize=False,
29 to="core.transitprocessorconfig",
30 ),
31 ),
32 (
33 "tokenization_api_key",
34 models.TextField(
35 blank=True, default="", help_text="The API key used to access the Switchio API for tokenization."
36 ),
37 ),
38 (
39 "tokenization_api_secret_name",
40 benefits.core.models.common.SecretNameField(
41 blank=True,
42 default="",
43 help_text="The name of the secret containing the api_secret value used to access the Switchio API for tokenization.", # noqa
44 max_length=127,
45 validators=[benefits.secrets.SecretNameValidator()],
46 ),
47 ),
48 (
49 "enrollment_api_authorization_header",
50 models.TextField(
51 blank=True,
52 default="",
53 help_text="The value to use for the 'Authorization' header when accessing the Switchio API for enrollment.", # noqa
54 ),
55 ),
56 (
57 "pto_id",
58 models.PositiveIntegerField(
59 blank=True,
60 default=0,
61 help_text="The Public Transport Operator ID to use with the Switchio API for enrollment.",
62 ),
63 ),
64 (
65 "ca_certificate",
66 models.ForeignKey(
67 blank=True,
68 default=None,
69 help_text="The CA certificate chain for accessing the Switchio API.",
70 null=True,
71 on_delete=django.db.models.deletion.PROTECT,
72 related_name="+",
73 to="core.pemdata",
74 ),
75 ),
76 (
77 "client_certificate",
78 models.ForeignKey(
79 blank=True,
80 default=None,
81 help_text="The client certificate for accessing the Switchio API.",
82 null=True,
83 on_delete=django.db.models.deletion.PROTECT,
84 related_name="+",
85 to="core.pemdata",
86 ),
87 ),
88 (
89 "private_key",
90 models.ForeignKey(
91 blank=True,
92 default=None,
93 help_text="The private key for accessing the Switchio API.",
94 null=True,
95 on_delete=django.db.models.deletion.PROTECT,
96 related_name="+",
97 to="core.pemdata",
98 ),
99 ),
100 ],
101 bases=("core.transitprocessorconfig",),
102 ),
103 migrations.DeleteModel(
104 name="OldSwitchioConfig",
105 ),
106 ]