Repository: cisagov/manage.get.gov

Issue:
Add expiration date to domain model
### Issue description

We have two tickets that both need expiration date on the domain model, to make it easier to work on, we are separating out this addition to the model into it's own ticket. This will allow that model to be updated without having migration conflicts between the two tickets

### Acceptance criteria

-expiration date is added to the domain model 
-change the current expiration date property (denoted with the @Cache tag), to be registry_expiration_date to avoid a conflict. Do this on both setter and getter for this property

### Additional context

see [slack thread](https://cisa-corp.slack.com/archives/C05BGB4L5NF/p1698177354573389)

### Links to other issues

_No response_


Discussion:

Resolving patch:
diff --git a/src/registrar/migrations/0043_domain_expiration_date.py b/src/registrar/migrations/0043_domain_expiration_date.py
new file mode 100644
--- /dev/null
+++ b/src/registrar/migrations/0043_domain_expiration_date.py
@@ -0,0 +1,20 @@
+# Generated by Django 4.2.6 on 2023-10-27 19:13
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+    dependencies = [
+        ("registrar", "0042_create_groups_v03"),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name="domain",
+            name="expiration_date",
+            field=models.DateField(
+                help_text="Duplication of registry's expiration date saved for ease of reporting",
+                null=True,
+            ),
+        ),
+    ]
diff --git a/src/registrar/models/domain.py b/src/registrar/models/domain.py
--- a/src/registrar/models/domain.py
+++ b/src/registrar/models/domain.py
@@ -5,6 +5,7 @@
 from datetime import date
 from string import digits
 from typing import Optional
+
 from django_fsm import FSMField, transition, TransitionNotAllowed  # type: ignore
 
 from django.db import models
@@ -29,6 +30,7 @@
 
 from registrar.models.utility.contact_error import ContactError, ContactErrorCodes
 
+from django.db.models import DateField
 from .utility.domain_field import DomainField
 from .utility.domain_helper import DomainHelper
 from .utility.time_stamped_model import TimeStampedModel
@@ -209,12 +211,12 @@ def last_updated_date(self) -> date:
         return self._get_property("up_date")
 
     @Cache
-    def expiration_date(self) -> date:
+    def registry_expiration_date(self) -> date:
         """Get or set the `ex_date` element from the registry."""
         return self._get_property("ex_date")
 
-    @expiration_date.setter  # type: ignore
-    def expiration_date(self, ex_date: date):
+    @registry_expiration_date.setter  # type: ignore
+    def registry_expiration_date(self, ex_date: date):
         pass
 
     @Cache
@@ -944,6 +946,13 @@ def __str__(self) -> str:
         help_text="Very basic info about the lifecycle of this domain object",
     )
 
+    expiration_date = DateField(
+        null=True,
+        help_text=(
+            "Duplication of registry's expiration" "date saved for ease of reporting"
+        ),
+    )
+
     def isActive(self):
         return self.state == Domain.State.CREATED
 


Test patch:
diff --git a/src/registrar/tests/test_models_domain.py b/src/registrar/tests/test_models_domain.py
--- a/src/registrar/tests/test_models_domain.py
+++ b/src/registrar/tests/test_models_domain.py
@@ -56,7 +56,7 @@ def test_cache_sets_resets(self):
         self.assertFalse("avail" in domain._cache.keys())
 
         # using a setter should clear the cache
-        domain.expiration_date = datetime.date.today()
+        domain.registry_expiration_date = datetime.date.today()
         self.assertEquals(domain._cache, {})
 
         # send should have been called only once