diff --git a/care/facility/migrations/0309_auto_20220820_1541.py b/care/facility/migrations/0309_auto_20220820_1541.py new file mode 100644 index 0000000000..2dd89bd60a --- /dev/null +++ b/care/facility/migrations/0309_auto_20220820_1541.py @@ -0,0 +1,33 @@ +# Generated by Django 2.2.11 on 2022-08-20 10:11 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('facility', '0308_auto_20220805_2247'), + ] + + operations = [ + migrations.AddField( + model_name='asset', + name='last_serviced_on', + field=models.DateField(blank=True, default=None, null=True), + ), + migrations.AddField( + model_name='asset', + name='manufacturer', + field=models.CharField(blank=True, max_length=1024, null=True), + ), + migrations.AddField( + model_name='asset', + name='notes', + field=models.TextField(blank=True, default='', null=True), + ), + migrations.AddField( + model_name='asset', + name='warranty_amc_end_of_validity', + field=models.DateField(blank=True, default=None, null=True), + ), + ] diff --git a/care/facility/models/asset.py b/care/facility/models/asset.py index c6257bad4d..6dbf697b92 100644 --- a/care/facility/models/asset.py +++ b/care/facility/models/asset.py @@ -32,12 +32,8 @@ class RoomType(enum.Enum): name = models.CharField(max_length=1024, blank=False, null=False) description = models.TextField(default="", null=True, blank=True) - location_type = models.IntegerField( - choices=RoomTypeChoices, default=RoomType.OTHER.value - ) - facility = models.ForeignKey( - Facility, on_delete=models.PROTECT, null=False, blank=False - ) + location_type = models.IntegerField(choices=RoomTypeChoices, default=RoomType.OTHER.value) + facility = models.ForeignKey(Facility, on_delete=models.PROTECT, null=False, blank=False) class Asset(BaseModel): @@ -57,15 +53,11 @@ class Status(enum.Enum): name = models.CharField(max_length=1024, blank=False, null=False) description = models.TextField(default="", null=True, blank=True) - asset_type = models.IntegerField( - choices=AssetTypeChoices, default=AssetType.INTERNAL.value - ) - asset_class = models.CharField( - choices=AssetClassChoices, default=None, null=True, blank=True, max_length=20 - ) + asset_type = models.IntegerField(choices=AssetTypeChoices, default=AssetType.INTERNAL.value) + asset_class = models.CharField(choices=AssetClassChoices, default=None, null=True, blank=True, max_length=20) status = models.IntegerField(choices=StatusChoices, default=Status.ACTIVE.value) current_location = models.ForeignKey(AssetLocation, on_delete=models.PROTECT, null=False, blank=False) - is_working = models.BooleanField(default=None, null=True, blank=True) + is_working = models.BooleanField(default=None, null=True, blank=True) not_working_reason = models.CharField(max_length=1024, blank=True, null=True) serial_number = models.CharField(max_length=1024, blank=True, null=True) warranty_details = models.TextField(null=True, blank=True, default="") @@ -73,11 +65,13 @@ class Status(enum.Enum): # Vendor Details vendor_name = models.CharField(max_length=1024, blank=True, null=True) support_name = models.CharField(max_length=1024, blank=True, null=True) - support_phone = models.CharField( - max_length=14, validators=[phone_number_regex], default="" - ) + support_phone = models.CharField(max_length=14, validators=[phone_number_regex], default="") support_email = models.EmailField(blank=True, null=True) qr_code_id = models.CharField(max_length=1024, blank=True, default=None, null=True) + manufacturer = models.CharField(max_length=1024, blank=True, null=True) + warranty_amc_end_of_validity = models.DateField(default=None, null=True, blank=True) + last_serviced_on = models.DateField(default=None, null=True, blank=True) + notes = models.TextField(default="", null=True, blank=True) class Meta: constraints = [ @@ -91,20 +85,15 @@ class Meta: def __str__(self): return self.name + class UserDefaultAssetLocation(BaseModel): user = models.ForeignKey(User, on_delete=models.PROTECT, null=False, blank=False) - location = models.ForeignKey( - AssetLocation, on_delete=models.PROTECT, null=False, blank=False - ) + location = models.ForeignKey(AssetLocation, on_delete=models.PROTECT, null=False, blank=False) class FacilityDefaultAssetLocation(BaseModel): - facility = models.ForeignKey( - Facility, on_delete=models.PROTECT, null=False, blank=False - ) - location = models.ForeignKey( - AssetLocation, on_delete=models.PROTECT, null=False, blank=False - ) + facility = models.ForeignKey(Facility, on_delete=models.PROTECT, null=False, blank=False) + location = models.ForeignKey(AssetLocation, on_delete=models.PROTECT, null=False, blank=False) class AssetTransaction(BaseModel): @@ -123,6 +112,4 @@ class AssetTransaction(BaseModel): null=False, blank=False, ) - performed_by = models.ForeignKey( - User, on_delete=models.PROTECT, null=False, blank=False - ) + performed_by = models.ForeignKey(User, on_delete=models.PROTECT, null=False, blank=False)