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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Unit tests (checkoutservice)
on:
pull_request:
branches: ["**"]
jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with: { go-version: "1.22" }
- name: Test checkoutservice
run: |
cd src/checkoutservice
go test ./... -coverprofile=cover.out
- uses: actions/upload-artifact@v4
with:
name: coverage-checkout
path: src/checkoutservice/cover.out
6 changes: 6 additions & 0 deletions docs/contracts/checkout/refund.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
endpoint: POST /api/refund
request:
fields: [order_id]
response:
fields: [eligible:boolean, reason?:string]
notes: "No PII in request or logs. Authorization context supplies customer_id."
8 changes: 8 additions & 0 deletions docs/requirements/req-eu-refund-30m.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
id: req://checkout/refund-window/v1
title: EU Refund Window – 30 minutes
tags: [domain:payments, region:EU, pii:false, nfr:latency-p95<=200ms]
owner: team-checkout
---
EU customers may cancel an order and receive a refund within 30 minutes of purchase.
Do not log PII (email/phone/card) during eligibility checks.
15 changes: 15 additions & 0 deletions src/checkoutservice/policy/capsule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
capsule_id: P-101
applies_to: ["service://boutique/checkoutservice"]
rules:
- id: sec.pii.logs
expr: "no_log_fields in ['email','phone','card_number']"
severity: critical
waiver_allowed: false
- id: test.coverage
expr: "statement>=0.80 && branch>=0.70"
severity: medium
waiver_allowed: true
- id: feature.refund_window
expr: "env['REFUND_WINDOW_MINUTES'] == '30' || feature_flag('CHECKOUT_EU_REFUND_ENABLED') == 'true'"
severity: high
waiver_allowed: true