Skip to content

Commit

Permalink
chore:add contact flavour (#31)
Browse files Browse the repository at this point in the history
Signed-off-by: Kathurima Kimathi <kathurimakimathi415@gmail.com>
  • Loading branch information
KathurimaKimathi committed Nov 17, 2021
1 parent ffaf19b commit 7bd30e9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mycarehub/common/migrations/0009_contact_flavour.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.9 on 2021-11-17 17:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('common', '0008_rename_user_id_contact_user'),
]

operations = [
migrations.AddField(
model_name='contact',
name='flavour',
field=models.CharField(choices=[('PRO', 'PRO'), ('CONSUMER', 'CONSUMER')], max_length=32, null=True),
),
]
5 changes: 5 additions & 0 deletions mycarehub/common/models/common_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,14 @@ class ContactType(models.TextChoices):
PHONE = "PHONE", _("PHONE")
EMAIL = "EMAIL", _("EMAIL")

class FlavourChoices(models.TextChoices):
PRO = "PRO", _("PRO")
CONSUMER = "CONSUMER", _("CONSUMER")

contact_type = models.CharField(choices=ContactType.choices, max_length=16)
contact_value = models.TextField(unique=True)
opted_in = models.BooleanField(default=False)
flavour = models.CharField(choices=FlavourChoices.choices, max_length=32, null=True)
user = models.ForeignKey(User, on_delete=models.PROTECT, null=True)


Expand Down

0 comments on commit 7bd30e9

Please sign in to comment.