feat: complete remaining Go backend modules
This commit is contained in:
1 parent
cea2751dc5
commit
aef5a97165
145 files changed
+18376
-199
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("billing HTTP compatibility fixture", () => {
|
||||
it("freezes routes, refreshed-session scope, money, and admin mutation rules", async () => {
|
||||
const fixture = JSON.parse(await readFile("contracts/billing/http-v1.json", "utf8"));
|
||||
expect(fixture).toMatchObject({
|
||||
version: 1, currency: "CNY", moneyUnit: "fen",
|
||||
statuses: { insufficientBalance: 402, idempotencyConflict: 409, unboundOrganization: 422, infrastructure: 500 },
|
||||
pricePatch: { minimum: 1, maximum: 1000, precision: 4, tierPairRequired: true }
|
||||
});
|
||||
expect(fixture.routes).toEqual(expect.arrayContaining([
|
||||
expect.objectContaining({ method: "GET", path: "/api/billing", organizationSource: "refreshed_session" }),
|
||||
expect.objectContaining({ method: "PATCH", path: "/api/admin/billing/prices/{id}", requirement: "super_admin" })
|
||||
]));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user