feat(api): generate models for patched products, refunds, site configurations, payments, and user registration

- Added PatchedProduct, PatchedProductImage, PatchedRefund, and related models.
- Introduced Payment, PaymentBody, PaymentCreate, and PaymentRead models.
- Created enums for payment methods, reasons for refunds, roles, and shipping methods.
- Implemented models for site configurations and their opening hours.
- Added ZasilkovnaPacket and ZasilkovnaShipment models for handling shipping data.
- Generated user registration model with validation rules.
- Updated public API functions to support new models and queries.
This commit is contained in:
2025-12-21 04:42:15 +01:00
parent 0346180d01
commit 9c48aee522
203 changed files with 21447 additions and 22 deletions

View File

@@ -12,55 +12,63 @@ if (SKIP_ORVAL) {
}
export default defineConfig({
// Public endpoints (all endpoints tagged with "public")
public: {
input: {
target: `${backendUrl}/api/schema/`,
filters: {
mode: "include",
tags: ["public"],
},
},
output: {
target: "api/generated/public.ts",
target: "api/generated/public/index.ts",
schemas: "api/generated/public/models",
mode: "tags",
clean: true,
client: "react-query",
httpClient: "axios",
override: {
mutator: {
path: "api/publicClient.ts", //IMPORTANTE
path: "api/publicClient.ts",
name: "publicMutator",
},
formUrlEncoded: true,
useDates: true,
},
},
hooks: {
afterAllFilesWrite: 'prettier --write',
}
},
// All private endpoints (organized by tags, shared models folder)
private: {
input: {
target: `${backendUrl}/api/schema/`,
filters: {
mode: "exclude",
tags: ["public"], // Exclude public endpoints, include everything else
},
},
output: {
target: "api/generated/private.ts", //IMPORTANTE
target: "api/generated/private",
schemas: "api/generated/private/models",
mode: "tags",
mode: "tags-split", // Split by tag into separate files
clean: true,
client: "react-query",
httpClient: "axios",
override: {
mutator: {
path: "api/privateClient.ts",
name: "privateMutator",
},
formUrlEncoded: true,
useDates: true,
query: {
useQuery: true,
useInfinite: false, // Disable infinite queries to avoid page param errors
},
},
},
hooks: {