Files
ozon-mock/AGENTS.md
Rinat 57cf3acb49
Some checks failed
test / test (push) Failing after 2s
add AGENTS.md — shared context for AI coding agents
2026-07-17 22:10:36 +03:00

3.0 KiB

AGENTS.md — Ozon Mock Server — Project Context

Read this first. Append what you did at the end under Session Log.

1. What this is

Mock server emulating Ozon Seller API for integration testing. Returns hardcoded fixture data.

Layer Tech
Language Go 1.25, net/http stdlib
Deployment Docker + systemd on ioffe
Auth Optional Client-Id / Api-Key validation
Config Env vars: PORT, OZON_CLIENT_ID, OZON_API_KEY

2. Endpoints (20 total)

Method Path Description
GET /health Health check
POST /v1/product/import/prices Import prices
GET /v1/product/list List products
POST /v3/product/info/list Product info (filter by offer_id / product_id)
POST /v3/product/info/stocks Stock levels
POST /v4/product/info/prices Price info
POST /v3/product/import Create/update product cards
POST /v1/product/info/description Product description/status
POST /v1/product/info/attributes Product attributes
POST /v2/posting/fbs/list FBS postings (since, status, analytics)
POST /v2/posting/fbs/get Single posting
POST /v1/posting/fbs/cancel Cancel posting
POST /v1/finance/transaction/list Transactions
POST /v1/finance/payout/list Payouts
POST /v1/returns/list Returns
POST /v1/analytics/data Analytics
POST /v1/analytics/turnover/stocks Turnover
POST /v2/category/tree Category tree (3 root, 7 total)
POST /v3/category/attribute Category attributes
POST /v3/category/attribute/values Attribute values

3. Test Data

Entity Count
Products 104
Stocks 104
Prices 104
Postings 41
Returns 20
Payouts 20
Transactions 25
Companies 3 (TechGiant TG-, FashionLine FL-, HomeStyle HS-*)

4. Deploy

cd /Users/rinat/projects/ozon-mock
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ozon-mock ./cmd/server
scp ozon-mock ioffe:/opt/ozon-mock/ozon-mock
ssh ioffe "sudo systemctl restart ozon-mock"
curl https://ozon-mock.px.kinrin.ru/health  # expect {"status":"ok"}

5. Key Commands

make build         # binary
make test          # go test -race ./... (31 tests)
make docker        # Docker build
go run ./cmd/server # local on :8080

6. Session Log

Append your summary below. Latest first.

2026-07-17 — v2.0 massive test data + product card endpoints

  • Generated 104 products/stocks/prices across 3 companies
  • 41 postings, 20 returns, 20 payouts, 25 transactions
  • Added Phase 2 endpoints: v3/product/import, v1/product/info/description, v1/product/info/attributes, v2/category/tree, v3/category/attribute, v3/category/attribute/values
  • Sanitary fixes: removed gin dependency, credential logging, dead code, incomplete filters
  • 31 tests (all PASS with race detector)
  • Deployed to production