Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions backend/apps/tax_app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ def prepare_oss_return(period: str) -> None:

# Aggregate by buyer country (destination principle for OSS)
orders = Order.objects.filter(
created_at__gte=timezone.make_aware(
datetime.combine(start_date, datetime.min.time())
),
created_at__lt=timezone.make_aware(
datetime.combine(end_date, datetime.min.time())
),
created_at__gte=timezone.make_aware(datetime.combine(start_date, datetime.min.time())),
created_at__lt=timezone.make_aware(datetime.combine(end_date, datetime.min.time())),
status__in=["paid", "fulfilled", "completed"],
)

Expand Down
6 changes: 3 additions & 3 deletions backend/db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# PostgreSQL 16 + PostGIS + pgvector.
# PostgreSQL 17 + PostGIS 3.5 + pgvector.
# No public image ships both PostGIS and pgvector, so we extend the official
# PostGIS image with the pgvector extension from the PGDG repository.
FROM postgis/postgis:16-3.4
FROM postgis/postgis:17-3.5

RUN apt-get update \
&& apt-get install -y --no-install-recommends postgresql-16-pgvector \
&& apt-get install -y --no-install-recommends postgresql-17-pgvector \
&& rm -rf /var/lib/apt/lists/*

# Extensions are created here (not in Django migrations): CREATE EXTENSION
Expand Down
8 changes: 7 additions & 1 deletion backend/tests/contract/test_payments_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_event_id_unique(self):
payload={},
)
from django.db import IntegrityError

with pytest.raises(IntegrityError):
StripeWebhookEvent.objects.create(
event_id="evt_unique",
Expand All @@ -37,6 +38,7 @@ def test_event_id_unique(self):

def test_mark_as_processed(self):
from django.utils import timezone

event = StripeWebhookEvent.objects.create(
event_id="evt_proc",
event_type="payment_intent.succeeded",
Expand Down Expand Up @@ -70,6 +72,7 @@ def test_create_payment_record(self, order):

def test_payment_record_requires_order(self):
from django.db import IntegrityError

with pytest.raises(IntegrityError):
PaymentRecord.objects.create(
amount=Decimal("10.00"),
Expand All @@ -96,9 +99,12 @@ class TestStripeTestMode:
def test_no_live_keys_in_codebase(self):
"""Ensure no sk_live keys are hardcoded anywhere."""
import subprocess

result = subprocess.run(
["grep", "-rn", "sk_live", "apps/", "project/"],
capture_output=True, text=True, cwd="/opt/jolarca/repos/jolarca/backend",
capture_output=True,
text=True,
cwd="/opt/jolarca/repos/jolarca/backend",
)
# grep returns 1 if no matches found (which is what we want)
assert result.returncode == 1, f"Found sk_live in codebase: {result.stdout}"
12 changes: 8 additions & 4 deletions backend/tests/contract/test_shipping_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ def test_create_tracking_event(self, shipment):

def test_tracking_events_ordered_by_occurred_at(self, shipment):
TrackingEvent.objects.create(
shipment=shipment, carrier_status="delivered",
occurred_at="2026-09-02T12:00:00Z", raw={},
shipment=shipment,
carrier_status="delivered",
occurred_at="2026-09-02T12:00:00Z",
raw={},
)
TrackingEvent.objects.create(
shipment=shipment, carrier_status="in_transit",
occurred_at="2026-09-01T12:00:00Z", raw={},
shipment=shipment,
carrier_status="in_transit",
occurred_at="2026-09-01T12:00:00Z",
raw={},
)
events = list(shipment.events.order_by("occurred_at"))
assert events[0].carrier_status == "in_transit"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ services:
postgres:
# Same PostGIS+pgvector image as the dev stack (backend/db/Dockerfile):
# migrations require postgis, and the entrypoint init creates the
# extensions as superuser on first init. Stock postgres:16-alpine lacks
# extensions as superuser on first init. Stock postgres:17-alpine lacks
# them — verified by boot smoke (NotSupportedError on migrate).
build: ./backend/db
image: jol-marketplace/postgres:16-postgis
image: jol-marketplace/postgres:17-postgis
restart: unless-stopped
logging: *default-logging
env_file:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ services:

# --- Data tier (dev parity; production uses managed/external services) ----
postgres:
image: postgres:16-alpine
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-jol_marketplace}
Expand Down
Loading
Loading