Coverage for benefits / enrollment_switchio / migrations / 0001_initial.py: 100%
8 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-01 15:39 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-01 15:39 +0000
1# Generated by Django 5.2.11 on 2026-02-26 22:39
2# This is a migration reset encompassing 5 prior migrations.
3# flake8: noqa
5import django.db.models.deletion
6from django.db import migrations, models
8import benefits.core.models.common
9import benefits.secrets
12class Migration(migrations.Migration):
14 initial = True
16 dependencies = [
17 ("core", "0001_initial"),
18 ]
20 operations = [
21 migrations.CreateModel(
22 name="SwitchioGroup",
23 fields=[
24 (
25 "enrollmentgroup_ptr",
26 models.OneToOneField(
27 auto_created=True,
28 on_delete=django.db.models.deletion.CASCADE,
29 parent_link=True,
30 primary_key=True,
31 serialize=False,
32 to="core.enrollmentgroup",
33 ),
34 ),
35 (
36 "group_id",
37 models.TextField(blank=True, default=None, help_text="The ID of the Switchio group for user enrollment."),
38 ),
39 ],
40 bases=("core.enrollmentgroup",),
41 ),
42 migrations.CreateModel(
43 name="SwitchioConfig",
44 fields=[
45 (
46 "transitprocessorconfig_ptr",
47 models.OneToOneField(
48 auto_created=True,
49 on_delete=django.db.models.deletion.CASCADE,
50 parent_link=True,
51 primary_key=True,
52 serialize=False,
53 to="core.transitprocessorconfig",
54 ),
55 ),
56 (
57 "tokenization_api_key",
58 models.TextField(
59 blank=True, default="", help_text="The API key used to access the Switchio API for tokenization."
60 ),
61 ),
62 (
63 "tokenization_api_secret_name",
64 benefits.core.models.common.SecretNameField(
65 blank=True,
66 default="",
67 help_text="The name of the secret containing the api_secret value used to access the Switchio API for tokenization.",
68 max_length=127,
69 validators=[benefits.secrets.SecretNameValidator()],
70 ),
71 ),
72 (
73 "enrollment_api_authorization_header",
74 models.TextField(
75 blank=True,
76 default="",
77 help_text="The value to use for the 'Authorization' header when accessing the Switchio API for enrollment.",
78 ),
79 ),
80 (
81 "pto_id",
82 models.PositiveIntegerField(
83 blank=True,
84 default=0,
85 help_text="The Public Transport Operator ID to use with the Switchio API for enrollment.",
86 ),
87 ),
88 (
89 "ca_certificate",
90 models.ForeignKey(
91 blank=True,
92 default=None,
93 help_text="The CA certificate chain 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 "client_certificate",
102 models.ForeignKey(
103 blank=True,
104 default=None,
105 help_text="The client certificate for accessing the Switchio API.",
106 null=True,
107 on_delete=django.db.models.deletion.PROTECT,
108 related_name="+",
109 to="core.pemdata",
110 ),
111 ),
112 (
113 "private_key",
114 models.ForeignKey(
115 blank=True,
116 default=None,
117 help_text="The private key for accessing the Switchio API.",
118 null=True,
119 on_delete=django.db.models.deletion.PROTECT,
120 related_name="+",
121 to="core.pemdata",
122 ),
123 ),
124 ],
125 bases=("core.transitprocessorconfig",),
126 ),
127 ]