svc-infra 0.1.578__py3-none-any.whl → 0.1.579__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of svc-infra might be problematic. Click here for more details.

@@ -26,6 +26,7 @@ from ..schemas import (
26
26
  SubscriptionOut,
27
27
  SubscriptionUpdateIn,
28
28
  UsageRecordIn,
29
+ UsageRecordOut,
29
30
  )
30
31
 
31
32
 
@@ -139,7 +140,7 @@ class ProviderAdapter(Protocol):
139
140
  ) -> InvoiceOut:
140
141
  pass
141
142
 
142
- async def create_usage_record(self, data: UsageRecordIn) -> dict[str, Any]:
143
+ async def create_usage_record(self, data: UsageRecordIn) -> UsageRecordOut:
143
144
  pass
144
145
 
145
146
  # --- Setup Intents ---
@@ -256,3 +256,15 @@ class SetupIntentCreateIn(BaseModel):
256
256
 
257
257
  class WebhookReplayOut(BaseModel):
258
258
  replayed: int
259
+
260
+
261
+ class WebhookAckOut(BaseModel):
262
+ ok: bool
263
+
264
+
265
+ class UsageRecordOut(BaseModel):
266
+ id: str
267
+ quantity: int
268
+ timestamp: Optional[int] = None
269
+ subscription_item: Optional[str] = None
270
+ provider_price_id: Optional[str] = None
@@ -48,6 +48,7 @@ from .schemas import (
48
48
  SubscriptionOut,
49
49
  SubscriptionUpdateIn,
50
50
  UsageRecordIn,
51
+ UsageRecordOut,
51
52
  )
52
53
  from .settings import get_payments_settings
53
54
 
@@ -459,7 +460,7 @@ class PaymentsService:
459
460
  )
460
461
 
461
462
  # ---- Metered usage ----
462
- async def create_usage_record(self, data: UsageRecordIn) -> dict:
463
+ async def create_usage_record(self, data: UsageRecordIn) -> UsageRecordOut:
463
464
  return await self._get_adapter().create_usage_record(data)
464
465
 
465
466
  # --- Setup Intents --------------------------------------------------------
@@ -34,6 +34,8 @@ from svc_infra.apf_payments.schemas import (
34
34
  SubscriptionUpdateIn,
35
35
  TransactionRow,
36
36
  UsageRecordIn,
37
+ UsageRecordOut,
38
+ WebhookAckOut,
37
39
  WebhookReplayOut,
38
40
  )
39
41
  from svc_infra.apf_payments.service import PaymentsService
@@ -183,7 +185,11 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
183
185
  # PUBLIC webhooks
184
186
  pub = public_router(prefix=prefix, tags=["payments"])
185
187
 
186
- @pub.post("/webhooks/{provider}", name="payments_webhook")
188
+ @pub.post(
189
+ "/webhooks/{provider}",
190
+ name="payments_webhook",
191
+ response_model=WebhookAckOut,
192
+ )
187
193
  async def webhooks(
188
194
  provider: str,
189
195
  request: Request,
@@ -507,6 +513,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
507
513
  name="payments_create_usage_record",
508
514
  status_code=status.HTTP_201_CREATED,
509
515
  dependencies=[Depends(require_idempotency_key)],
516
+ response_model=UsageRecordOut,
510
517
  )
511
518
  async def create_usage_record_endpoint(
512
519
  data: UsageRecordIn, svc: PaymentsService = Depends(get_service)
@@ -598,6 +605,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
598
605
  "/disputes/{provider_dispute_id}/submit_evidence",
599
606
  name="payments_submit_dispute_evidence",
600
607
  dependencies=[Depends(require_idempotency_key)],
608
+ response_model=DisputeOut,
601
609
  )
602
610
  async def submit_dispute_evidence(
603
611
  provider_dispute_id: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: svc-infra
3
- Version: 0.1.578
3
+ Version: 0.1.579
4
4
  Summary: Infrastructure for building and deploying prod-ready services
5
5
  License: MIT
6
6
  Keywords: fastapi,sqlalchemy,alembic,auth,infra,async,pydantic
@@ -3,16 +3,16 @@ svc_infra/apf_payments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
3
3
  svc_infra/apf_payments/alembic.py,sha256=XJIcCDOoaO1EeJbSx_qK9o4cBi430qyo5gECtjHIojw,299
4
4
  svc_infra/apf_payments/models.py,sha256=u4U5oszha5uulCIrNoajaFDIc5YmTlh2mtm-yJUvr9I,14251
5
5
  svc_infra/apf_payments/provider/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- svc_infra/apf_payments/provider/base.py,sha256=On2mN_0n5KGvnENbmEUrcM2DCt8xxpArrlvh0zeOauc,4996
6
+ svc_infra/apf_payments/provider/base.py,sha256=sibrBvfULNPCPldokj2f_kDjxJo5zP06YHB1z5i4s3E,5016
7
7
  svc_infra/apf_payments/provider/registry.py,sha256=NZ4pUkFcbXNtqWEpFeI3NwoKRYGWe9fVQakmlrVLTKE,878
8
8
  svc_infra/apf_payments/provider/stripe.py,sha256=rZlQe1BBLBF1aMOqw98aDRZkA7pOgTqkGvXzSG8qE5c,11298
9
- svc_infra/apf_payments/schemas.py,sha256=7WtDrZSEDRYe1o1rFI7fKiXFLgXJ9J_GoKKyXApHsXM,6511
10
- svc_infra/apf_payments/service.py,sha256=1OYmzkKI8tFUv34PLfcHBRA8h1nelvkzq4VTJevOwRs,23842
9
+ svc_infra/apf_payments/schemas.py,sha256=BKzaKQaU4iEdT3onpP0dPfh33nU3AieHZLs_79cMp4M,6747
10
+ svc_infra/apf_payments/service.py,sha256=325Y118HWULmXX62S1wSrA8Guabtoa7Um0lzvMPDQZM,23872
11
11
  svc_infra/apf_payments/settings.py,sha256=VnNQbajbv843buUisqa82xOQ-f5JA8JzHD8o01-yhPQ,1239
12
12
  svc_infra/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  svc_infra/api/fastapi/__init__.py,sha256=VVdQjak74_wTDqmvL05_C97vIFugQxPVU-3JQEFBgR8,747
14
14
  svc_infra/api/fastapi/apf_payments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- svc_infra/api/fastapi/apf_payments/router.py,sha256=QbSem_eKSkomdcSdCxNH_hWGj2AoH_FlMOHqQtspYho,22290
15
+ svc_infra/api/fastapi/apf_payments/router.py,sha256=ff2zYstk1XLSLDwXG0jBViZv624no5OPUSK1YLDJAH4,22464
16
16
  svc_infra/api/fastapi/apf_payments/setup.py,sha256=PX-LHDiyu2eDuaw2m98VPUkF6EmXXRkbjRqh_gL8Kls,2263
17
17
  svc_infra/api/fastapi/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  svc_infra/api/fastapi/auth/_cookies.py,sha256=U4heUmMnLezHx8U6ksuUEpSZ6sNMJcIO0gdLpmZ5FXw,1367
@@ -228,7 +228,7 @@ svc_infra/obs/templates/sidecars/railway/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
228
228
  svc_infra/obs/templates/sidecars/railway/agent.yaml,sha256=hYv35yG92XEP_4joMFmMcVTD-4fG_zHitmChjreUJh4,516
229
229
  svc_infra/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
230
230
  svc_infra/utils.py,sha256=VX1yjTx61-YvAymyRhGy18DhybiVdPddiYD_FlKTbJU,952
231
- svc_infra-0.1.578.dist-info/METADATA,sha256=8O6BepYxCTpiqaqJXltnBTWuUDd2dnDrqa1wzE6mAeQ,3487
232
- svc_infra-0.1.578.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
233
- svc_infra-0.1.578.dist-info/entry_points.txt,sha256=6x_nZOsjvn6hRZsMgZLgTasaCSKCgAjsGhACe_CiP0U,48
234
- svc_infra-0.1.578.dist-info/RECORD,,
231
+ svc_infra-0.1.579.dist-info/METADATA,sha256=j_kXai0eMsASVgOLCR3hYP0Op-b_Pk3bu5QR_7DMfmY,3487
232
+ svc_infra-0.1.579.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
233
+ svc_infra-0.1.579.dist-info/entry_points.txt,sha256=6x_nZOsjvn6hRZsMgZLgTasaCSKCgAjsGhACe_CiP0U,48
234
+ svc_infra-0.1.579.dist-info/RECORD,,