#50 feat: add StoreSettings model and API for store address and map coordinates

This commit is contained in:
2026-08-08 13:50:43 -05:00
parent f65b85c7e7
commit 56bbc8f9b4
10 changed files with 260 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
from .store_settings import StoreSettings
__all__ = ["StoreSettings"]

View File

@@ -0,0 +1,20 @@
from django.db import models
class StoreSettings(models.Model):
address = models.TextField()
latitude = models.FloatField(null=True, blank=True)
longitude = models.FloatField(null=True, blank=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
verbose_name = "Configuración de la tienda"
verbose_name_plural = "Configuración de la tienda"
def __str__(self):
return f"StoreSettings (id={self.id})"
@classmethod
def get_singleton(cls):
instance, _ = cls.objects.get_or_create(pk=1)
return instance