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

105
frontend/src/api/README.md Normal file
View File

@@ -0,0 +1,105 @@
# API Documentation
## Quick Start
All API hooks are available from `@/api`:
```typescript
import { useApiCommerceOrdersList, OrderRead } from '@/api';
```
## Navigation Tips
### Finding Hooks
**Pattern**: `useApi[Tag][Path][Method]`
| What you want | Hook name |
|---------------|-----------|
| List orders | `useApiCommerceOrdersList` |
| Get order by ID | `useApiCommerceOrdersRetrieve` |
| Create order | `useApiCommerceOrdersCreate` |
| Update order | `useApiCommerceOrdersPartialUpdate` |
| Delete order | `useApiCommerceOrdersDestroy` |
### VS Code Shortcuts
- `Ctrl/Cmd + P` → Quick file search (type "commerce")
- `Ctrl/Cmd + Shift + O` → Symbol search (type "useApi")
- `F12` → Go to definition
- `Shift + F12` → Find all usages
## Common Patterns
### Query (GET)
```typescript
const { data, isLoading, error } = useApiCommerceOrdersList({
page: 1,
limit: 10,
});
```
### Mutation (POST/PUT/PATCH/DELETE)
```typescript
const mutation = useApiCommerceOrdersCreate({
mutation: {
onSuccess: (data) => console.log('Created!', data),
onError: (error) => console.error('Failed:', error),
}
});
mutation.mutate({ data: orderData });
```
### With Infinite Scroll
```typescript
const {
data,
fetchNextPage,
hasNextPage
} = useApiCommerceOrdersListInfinite({
limit: 20,
});
```
## File Organization
```
api/
├── index.ts ← Import everything from here
├── publicClient.ts ← Public API client (no auth)
├── privateClient.ts ← Private API client (with auth)
└── generated/
├── public/ ← Public endpoints
│ ├── public.ts
│ └── models/
└── private/ ← Private endpoints (organized by tag)
├── account/account.ts
├── commerce/commerce.ts
├── downloader/downloader.ts
├── gopay/gopay.ts
├── stripe/stripe.ts
├── trading212/trading212.ts
├── zasilkovna/zasilkovna.ts
├── core/core.ts
└── models/ ← Shared TypeScript types
```
## Tips
1. **Use TypeScript autocomplete**: Type `useApi` and let IntelliSense show you options
2. **Hover for docs**: Hover over any hook to see endpoint details
3. **Check models folder**: All response types are in `models/`
4. **Use React Query DevTools**: Add `<ReactQueryDevtools />` to see cache state
## Regenerating
```bash
npm run api:gen
```
This will:
1. Fetch OpenAPI schema from backend
2. Generate TypeScript hooks
3. Format with Prettier
4. Update all types

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,525 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import { useInfiniteQuery, useMutation, useQuery } from "@tanstack/react-query";
import type {
DataTag,
DefinedInitialDataOptions,
DefinedUseInfiniteQueryResult,
DefinedUseQueryResult,
InfiniteData,
MutationFunction,
QueryClient,
QueryFunction,
QueryKey,
UndefinedInitialDataOptions,
UseInfiniteQueryOptions,
UseInfiniteQueryResult,
UseMutationOptions,
UseMutationResult,
UseQueryOptions,
UseQueryResult,
} from "@tanstack/react-query";
import type {
GopayCreatePayment201,
GopayGetStatus200,
GopayRefundPayment200,
PaymentCreate,
Refund,
} from ".././models";
import { privateMutator } from "../../../privateClient";
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
type IfEquals<X, Y, A = X, B = never> =
(<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B;
type WritableKeys<T> = {
[P in keyof T]-?: IfEquals<
{ [Q in P]: T[P] },
{ -readonly [Q in P]: T[P] },
P
>;
}[keyof T];
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
k: infer I,
) => void
? I
: never;
type DistributeReadOnlyOverUnions<T> = T extends any ? NonReadonly<T> : never;
type Writable<T> = Pick<T, WritableKeys<T>>;
type NonReadonly<T> = [T] extends [UnionToIntersection<T>]
? {
[P in keyof Writable<T>]: T[P] extends object
? NonReadonly<NonNullable<T[P]>>
: T[P];
}
: DistributeReadOnlyOverUnions<T>;
/**
* Provede refundaci platby v GoPay a uloží záznam refundace.
* @summary Refundovat platbu
*/
export const gopayRefundPayment = (
paymentId: string,
refund: NonReadonly<Refund>,
signal?: AbortSignal,
) => {
return privateMutator<GopayRefundPayment200>({
url: `/api/payments/gopay/${paymentId}/refund/`,
method: "POST",
headers: { "Content-Type": "application/json" },
data: refund,
signal,
});
};
export const getGopayRefundPaymentMutationOptions = <
TError = void,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof gopayRefundPayment>>,
TError,
{ paymentId: string; data: NonReadonly<Refund> },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof gopayRefundPayment>>,
TError,
{ paymentId: string; data: NonReadonly<Refund> },
TContext
> => {
const mutationKey = ["gopayRefundPayment"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof gopayRefundPayment>>,
{ paymentId: string; data: NonReadonly<Refund> }
> = (props) => {
const { paymentId, data } = props ?? {};
return gopayRefundPayment(paymentId, data);
};
return { mutationFn, ...mutationOptions };
};
export type GopayRefundPaymentMutationResult = NonNullable<
Awaited<ReturnType<typeof gopayRefundPayment>>
>;
export type GopayRefundPaymentMutationBody = NonReadonly<Refund>;
export type GopayRefundPaymentMutationError = void;
/**
* @summary Refundovat platbu
*/
export const useGopayRefundPayment = <TError = void, TContext = unknown>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof gopayRefundPayment>>,
TError,
{ paymentId: string; data: NonReadonly<Refund> },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof gopayRefundPayment>>,
TError,
{ paymentId: string; data: NonReadonly<Refund> },
TContext
> => {
const mutationOptions = getGopayRefundPaymentMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Načte aktuální stav platby GoPay a případně synchronizuje lokální záznam.
* @summary Získat stav platby
*/
export const gopayGetStatus = (paymentId: string, signal?: AbortSignal) => {
return privateMutator<GopayGetStatus200>({
url: `/api/payments/gopay/${paymentId}/status/`,
method: "GET",
signal,
});
};
export const getGopayGetStatusInfiniteQueryKey = (paymentId?: string) => {
return ["infinite", `/api/payments/gopay/${paymentId}/status/`] as const;
};
export const getGopayGetStatusQueryKey = (paymentId?: string) => {
return [`/api/payments/gopay/${paymentId}/status/`] as const;
};
export const getGopayGetStatusInfiniteQueryOptions = <
TData = InfiniteData<Awaited<ReturnType<typeof gopayGetStatus>>>,
TError = void,
>(
paymentId: string,
options?: {
query?: Partial<
UseInfiniteQueryOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
TData
>
>;
},
) => {
const { query: queryOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGopayGetStatusInfiniteQueryKey(paymentId);
const queryFn: QueryFunction<Awaited<ReturnType<typeof gopayGetStatus>>> = ({
signal,
}) => gopayGetStatus(paymentId, signal);
return {
queryKey,
queryFn,
enabled: !!paymentId,
...queryOptions,
} as UseInfiniteQueryOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GopayGetStatusInfiniteQueryResult = NonNullable<
Awaited<ReturnType<typeof gopayGetStatus>>
>;
export type GopayGetStatusInfiniteQueryError = void;
export function useGopayGetStatusInfinite<
TData = InfiniteData<Awaited<ReturnType<typeof gopayGetStatus>>>,
TError = void,
>(
paymentId: string,
options: {
query: Partial<
UseInfiniteQueryOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
Awaited<ReturnType<typeof gopayGetStatus>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): DefinedUseInfiniteQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGopayGetStatusInfinite<
TData = InfiniteData<Awaited<ReturnType<typeof gopayGetStatus>>>,
TError = void,
>(
paymentId: string,
options?: {
query?: Partial<
UseInfiniteQueryOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
Awaited<ReturnType<typeof gopayGetStatus>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): UseInfiniteQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGopayGetStatusInfinite<
TData = InfiniteData<Awaited<ReturnType<typeof gopayGetStatus>>>,
TError = void,
>(
paymentId: string,
options?: {
query?: Partial<
UseInfiniteQueryOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
TData
>
>;
},
queryClient?: QueryClient,
): UseInfiniteQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Získat stav platby
*/
export function useGopayGetStatusInfinite<
TData = InfiniteData<Awaited<ReturnType<typeof gopayGetStatus>>>,
TError = void,
>(
paymentId: string,
options?: {
query?: Partial<
UseInfiniteQueryOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
TData
>
>;
},
queryClient?: QueryClient,
): UseInfiniteQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGopayGetStatusInfiniteQueryOptions(
paymentId,
options,
);
const query = useInfiniteQuery(
queryOptions,
queryClient,
) as UseInfiniteQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
query.queryKey = queryOptions.queryKey;
return query;
}
export const getGopayGetStatusQueryOptions = <
TData = Awaited<ReturnType<typeof gopayGetStatus>>,
TError = void,
>(
paymentId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof gopayGetStatus>>, TError, TData>
>;
},
) => {
const { query: queryOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getGopayGetStatusQueryKey(paymentId);
const queryFn: QueryFunction<Awaited<ReturnType<typeof gopayGetStatus>>> = ({
signal,
}) => gopayGetStatus(paymentId, signal);
return {
queryKey,
queryFn,
enabled: !!paymentId,
...queryOptions,
} as UseQueryOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type GopayGetStatusQueryResult = NonNullable<
Awaited<ReturnType<typeof gopayGetStatus>>
>;
export type GopayGetStatusQueryError = void;
export function useGopayGetStatus<
TData = Awaited<ReturnType<typeof gopayGetStatus>>,
TError = void,
>(
paymentId: string,
options: {
query: Partial<
UseQueryOptions<Awaited<ReturnType<typeof gopayGetStatus>>, TError, TData>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
Awaited<ReturnType<typeof gopayGetStatus>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGopayGetStatus<
TData = Awaited<ReturnType<typeof gopayGetStatus>>,
TError = void,
>(
paymentId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof gopayGetStatus>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof gopayGetStatus>>,
TError,
Awaited<ReturnType<typeof gopayGetStatus>>
>,
"initialData"
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGopayGetStatus<
TData = Awaited<ReturnType<typeof gopayGetStatus>>,
TError = void,
>(
paymentId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof gopayGetStatus>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary Získat stav platby
*/
export function useGopayGetStatus<
TData = Awaited<ReturnType<typeof gopayGetStatus>>,
TError = void,
>(
paymentId: string,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof gopayGetStatus>>, TError, TData>
>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getGopayGetStatusQueryOptions(paymentId, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* Vytvoří platbu v GoPay s minimálními povinnými poli. Citlivé údaje o kartě se neposílají, platbu obslouží GoPay stránka (gw_url). Pokud není zadán notification_url, použije se hodnota ze settings.GOPAY_NOTIFICATION_URL.
* @summary Vytvořit platbu (minimální vstup)
*/
export const gopayCreatePayment = (
paymentCreate: PaymentCreate,
signal?: AbortSignal,
) => {
return privateMutator<GopayCreatePayment201>({
url: `/api/payments/gopay/create/`,
method: "POST",
headers: { "Content-Type": "application/json" },
data: paymentCreate,
signal,
});
};
export const getGopayCreatePaymentMutationOptions = <
TError = void,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof gopayCreatePayment>>,
TError,
{ data: PaymentCreate },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof gopayCreatePayment>>,
TError,
{ data: PaymentCreate },
TContext
> => {
const mutationKey = ["gopayCreatePayment"];
const { mutation: mutationOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof gopayCreatePayment>>,
{ data: PaymentCreate }
> = (props) => {
const { data } = props ?? {};
return gopayCreatePayment(data);
};
return { mutationFn, ...mutationOptions };
};
export type GopayCreatePaymentMutationResult = NonNullable<
Awaited<ReturnType<typeof gopayCreatePayment>>
>;
export type GopayCreatePaymentMutationBody = PaymentCreate;
export type GopayCreatePaymentMutationError = void;
/**
* @summary Vytvořit platbu (minimální vstup)
*/
export const useGopayCreatePayment = <TError = void, TContext = unknown>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof gopayCreatePayment>>,
TError,
{ data: PaymentCreate },
TContext
>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof gopayCreatePayment>>,
TError,
{ data: PaymentCreate },
TContext
> => {
const mutationOptions = getGopayCreatePaymentMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface AdditionalParam {
name: string;
value: string;
}

View File

@@ -0,0 +1,23 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiAccountUsersListParams = {
city?: string;
create_time_after?: Date;
create_time_before?: Date;
email?: string;
email_verified?: boolean;
gdpr?: boolean;
is_active?: boolean;
/**
* A page number within the paginated result set.
*/
page?: number;
phone_number?: string;
postal_code?: string;
role?: string;
street?: string;
};

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiAdvertisementContactMessagesListParams = {
/**
* A page number within the paginated result set.
*/
page?: number;
};

View File

@@ -0,0 +1,20 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiCommerceCategoriesListParams = {
/**
* Which field to use when ordering the results.
*/
ordering?: string;
/**
* A page number within the paginated result set.
*/
page?: number;
/**
* A search term.
*/
search?: string;
};

View File

@@ -0,0 +1,20 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiCommerceDiscountCodesListParams = {
/**
* Which field to use when ordering the results.
*/
ordering?: string;
/**
* A page number within the paginated result set.
*/
page?: number;
/**
* A search term.
*/
search?: string;
};

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiCommerceOrdersListParams = {
/**
* A page number within the paginated result set.
*/
page?: number;
};

View File

@@ -0,0 +1,20 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiCommerceProductImagesListParams = {
/**
* Which field to use when ordering the results.
*/
ordering?: string;
/**
* A page number within the paginated result set.
*/
page?: number;
/**
* A search term.
*/
search?: string;
};

View File

@@ -0,0 +1,20 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiCommerceProductsListParams = {
/**
* Which field to use when ordering the results.
*/
ordering?: string;
/**
* A page number within the paginated result set.
*/
page?: number;
/**
* A search term.
*/
search?: string;
};

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiCommerceRefundsListParams = {
/**
* A page number within the paginated result set.
*/
page?: number;
};

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiConfigurationAdminShopConfigurationListParams = {
/**
* A page number within the paginated result set.
*/
page?: number;
};

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiConfigurationPublicShopConfigurationListParams = {
/**
* A page number within the paginated result set.
*/
page?: number;
};

View File

@@ -0,0 +1,7 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiSchemaRetrieve200Four = { [key: string]: unknown };

View File

@@ -0,0 +1,7 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiSchemaRetrieve200One = { [key: string]: unknown };

View File

@@ -0,0 +1,7 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiSchemaRetrieve200Three = { [key: string]: unknown };

View File

@@ -0,0 +1,7 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiSchemaRetrieve200Two = { [key: string]: unknown };

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiSchemaRetrieveFormat =
(typeof ApiSchemaRetrieveFormat)[keyof typeof ApiSchemaRetrieveFormat];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ApiSchemaRetrieveFormat = {
json: "json",
yaml: "yaml",
} as const;

View File

@@ -0,0 +1,111 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiSchemaRetrieveLang =
(typeof ApiSchemaRetrieveLang)[keyof typeof ApiSchemaRetrieveLang];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ApiSchemaRetrieveLang = {
af: "af",
ar: "ar",
"ar-dz": "ar-dz",
ast: "ast",
az: "az",
be: "be",
bg: "bg",
bn: "bn",
br: "br",
bs: "bs",
ca: "ca",
ckb: "ckb",
cs: "cs",
cy: "cy",
da: "da",
de: "de",
dsb: "dsb",
el: "el",
en: "en",
"en-au": "en-au",
"en-gb": "en-gb",
eo: "eo",
es: "es",
"es-ar": "es-ar",
"es-co": "es-co",
"es-mx": "es-mx",
"es-ni": "es-ni",
"es-ve": "es-ve",
et: "et",
eu: "eu",
fa: "fa",
fi: "fi",
fr: "fr",
fy: "fy",
ga: "ga",
gd: "gd",
gl: "gl",
he: "he",
hi: "hi",
hr: "hr",
hsb: "hsb",
hu: "hu",
hy: "hy",
ia: "ia",
id: "id",
ig: "ig",
io: "io",
is: "is",
it: "it",
ja: "ja",
ka: "ka",
kab: "kab",
kk: "kk",
km: "km",
kn: "kn",
ko: "ko",
ky: "ky",
lb: "lb",
lt: "lt",
lv: "lv",
mk: "mk",
ml: "ml",
mn: "mn",
mr: "mr",
ms: "ms",
my: "my",
nb: "nb",
ne: "ne",
nl: "nl",
nn: "nn",
os: "os",
pa: "pa",
pl: "pl",
pt: "pt",
"pt-br": "pt-br",
ro: "ro",
ru: "ru",
sk: "sk",
sl: "sl",
sq: "sq",
sr: "sr",
"sr-latn": "sr-latn",
sv: "sv",
sw: "sw",
ta: "ta",
te: "te",
tg: "tg",
th: "th",
tk: "tk",
tr: "tr",
tt: "tt",
udm: "udm",
ug: "ug",
uk: "uk",
ur: "ur",
uz: "uz",
vi: "vi",
"zh-hans": "zh-hans",
"zh-hant": "zh-hant",
} as const;

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ApiSchemaRetrieveFormat } from "./apiSchemaRetrieveFormat";
import type { ApiSchemaRetrieveLang } from "./apiSchemaRetrieveLang";
export type ApiSchemaRetrieveParams = {
format?: ApiSchemaRetrieveFormat;
lang?: ApiSchemaRetrieveLang;
};

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type ApiZasilkovnaShipmentsListParams = {
/**
* A page number within the paginated result set.
*/
page?: number;
};

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface Callback {
return_url: string;
notification_url?: string;
}

View File

@@ -0,0 +1,16 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ShippingMethodEnum } from "./shippingMethodEnum";
import type { StateFdaEnum } from "./stateFdaEnum";
import type { ZasilkovnaPacketRead } from "./zasilkovnaPacketRead";
export interface CarrierRead {
readonly shipping_method: ShippingMethodEnum;
readonly state: StateFdaEnum;
readonly zasilkovna: readonly ZasilkovnaPacketRead[];
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
readonly shipping_price: string;
}

View File

@@ -0,0 +1,20 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface Category {
readonly id: number;
/** @maxLength 100 */
name: string;
/**
* @maxLength 50
* @pattern ^[-a-zA-Z0-9_]+$
*/
url: string;
/** @nullable */
parent?: number | null;
description?: string;
image?: string;
}

View File

@@ -0,0 +1,16 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface Contact {
email: string;
first_name?: string;
last_name?: string;
phone_number?: string;
city?: string;
street?: string;
postal_code?: string;
country_code?: string;
}

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface ContactMe {
readonly id: number;
/** @maxLength 254 */
client_email: string;
content: string;
readonly sent_at: Date;
}

View File

@@ -0,0 +1,17 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `CZK` - cz#Czech Koruna
* `EUR` - cz#Euro
*/
export type CurrencyEnum = (typeof CurrencyEnum)[keyof typeof CurrencyEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CurrencyEnum = {
CZK: "CZK",
EUR: "EUR",
} as const;

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface CustomTokenObtainPair {
username: string;
password: string;
}

View File

@@ -0,0 +1,45 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { RoleEnum } from "./roleEnum";
export interface CustomUser {
readonly id: number;
/** Požadováno. 150 znaků nebo méně. Pouze písmena, číslice a znaky @/./+/-/_. */
readonly username: string;
/** @maxLength 150 */
first_name?: string;
/** @maxLength 150 */
last_name?: string;
/** @maxLength 254 */
email: string;
role?: RoleEnum;
email_verified?: boolean;
/**
* @maxLength 16
* @nullable
* @pattern ^\+?\d{9,15}$
*/
phone_number?: string | null;
readonly create_time: Date;
/**
* @maxLength 100
* @nullable
*/
city?: string | null;
/**
* @maxLength 200
* @nullable
*/
street?: string | null;
/**
* @maxLength 5
* @nullable
* @pattern ^\d{5}$
*/
postal_code?: string | null;
readonly gdpr: boolean;
is_active?: boolean;
}

View File

@@ -0,0 +1,39 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface DiscountCode {
readonly id: number;
/** @maxLength 50 */
code: string;
/** @maxLength 255 */
description?: string;
/**
* Procento sleva 0-100
* @minimum 0
* @maximum 100
* @nullable
*/
percent?: number | null;
/**
* Fixní sleva v CZK
* @nullable
* @pattern ^-?\d{0,8}(?:\.\d{0,2})?$
*/
amount?: string | null;
valid_from?: Date;
/** @nullable */
valid_to?: Date | null;
active?: boolean;
/**
* @minimum 0
* @maximum 9223372036854776000
* @nullable
*/
usage_limit?: number | null;
readonly used_count: number;
specific_products?: number[];
specific_categories?: number[];
}

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface DownloadErrorResponse {
error: string;
allowed?: string[];
}

View File

@@ -0,0 +1,36 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ExtEnum } from "./extEnum";
import type { FormatEnum } from "./formatEnum";
export interface DownloadRequest {
/** Video URL to download */
url: string;
/** Choose container format: mp4 (H.264 + AAC, most compatible), mkv (flexible, lossless container), webm (VP9/AV1 + Opus), flv (legacy), mov (Apple-friendly), avi (older), ogg (mostly obsolete).
* `mp4` - mp4
* `mkv` - mkv
* `webm` - webm
* `flv` - flv
* `mov` - mov
* `avi` - avi
* `ogg` - ogg */
ext?: ExtEnum;
/** Alias of 'ext' (deprecated).
* `mp4` - mp4
* `mkv` - mkv
* `webm` - webm
* `flv` - flv
* `mov` - mov
* `avi` - avi
* `ogg` - ogg */
format?: FormatEnum;
/** Target max video height (e.g. 1080). */
video_quality: number;
/** Target max audio bitrate in kbps (e.g. 160). */
audio_quality: number;
}

View File

@@ -0,0 +1,19 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface DownloaderStats {
total_downloads: number;
/** @nullable */
avg_length_of_media: number | null;
/** @nullable */
avg_file_size: number | null;
/** @nullable */
total_length_of_media: number | null;
/** @nullable */
total_file_size: number | null;
/** @nullable */
most_common_format: string | null;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface ErrorResponse {
error: string;
}

View File

@@ -0,0 +1,27 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `mp4` - mp4
* `mkv` - mkv
* `webm` - webm
* `flv` - flv
* `mov` - mov
* `avi` - avi
* `ogg` - ogg
*/
export type ExtEnum = (typeof ExtEnum)[keyof typeof ExtEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ExtEnum = {
mp4: "mp4",
mkv: "mkv",
webm: "webm",
flv: "flv",
mov: "mov",
avi: "avi",
ogg: "ogg",
} as const;

View File

@@ -0,0 +1,27 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `mp4` - mp4
* `mkv` - mkv
* `webm` - webm
* `flv` - flv
* `mov` - mov
* `avi` - avi
* `ogg` - ogg
*/
export type FormatEnum = (typeof FormatEnum)[keyof typeof FormatEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const FormatEnum = {
mp4: "mp4",
mkv: "mkv",
webm: "webm",
flv: "flv",
mov: "mov",
avi: "avi",
ogg: "ogg",
} as const;

View File

@@ -0,0 +1,7 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type GopayCreatePayment201 = { [key: string]: unknown };

View File

@@ -0,0 +1,7 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type GopayGetStatus200 = { [key: string]: unknown };

View File

@@ -0,0 +1,7 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export type GopayRefundPayment200 = { [key: string]: unknown };

View File

@@ -0,0 +1,101 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export * from "./additionalParam";
export * from "./apiAccountUsersListParams";
export * from "./apiAdvertisementContactMessagesListParams";
export * from "./apiCommerceCategoriesListParams";
export * from "./apiCommerceDiscountCodesListParams";
export * from "./apiCommerceOrdersListParams";
export * from "./apiCommerceProductImagesListParams";
export * from "./apiCommerceProductsListParams";
export * from "./apiCommerceRefundsListParams";
export * from "./apiConfigurationAdminShopConfigurationListParams";
export * from "./apiConfigurationPublicShopConfigurationListParams";
export * from "./apiSchemaRetrieve200Four";
export * from "./apiSchemaRetrieve200One";
export * from "./apiSchemaRetrieve200Three";
export * from "./apiSchemaRetrieve200Two";
export * from "./apiSchemaRetrieveFormat";
export * from "./apiSchemaRetrieveLang";
export * from "./apiSchemaRetrieveParams";
export * from "./apiZasilkovnaShipmentsListParams";
export * from "./callback";
export * from "./carrierRead";
export * from "./category";
export * from "./contact";
export * from "./contactMe";
export * from "./currencyEnum";
export * from "./customTokenObtainPair";
export * from "./customUser";
export * from "./discountCode";
export * from "./downloadErrorResponse";
export * from "./downloadRequest";
export * from "./downloaderStats";
export * from "./errorResponse";
export * from "./extEnum";
export * from "./formatEnum";
export * from "./gopayCreatePayment201";
export * from "./gopayGetStatus200";
export * from "./gopayRefundPayment200";
export * from "./item";
export * from "./orderCarrier";
export * from "./orderCreate";
export * from "./orderItemCreate";
export * from "./orderItemRead";
export * from "./orderMini";
export * from "./orderRead";
export * from "./paginatedCategoryList";
export * from "./paginatedContactMeList";
export * from "./paginatedCustomUserList";
export * from "./paginatedDiscountCodeList";
export * from "./paginatedOrderReadList";
export * from "./paginatedProductImageList";
export * from "./paginatedProductList";
export * from "./paginatedRefundList";
export * from "./paginatedSiteConfigurationAdminList";
export * from "./paginatedSiteConfigurationPublicList";
export * from "./paginatedZasilkovnaShipmentList";
export * from "./passwordResetConfirm";
export * from "./passwordResetRequest";
export * from "./patchedCategory";
export * from "./patchedContactMe";
export * from "./patchedCustomUser";
export * from "./patchedDiscountCode";
export * from "./patchedOrderRead";
export * from "./patchedProduct";
export * from "./patchedProductImage";
export * from "./patchedRefund";
export * from "./patchedSiteConfigurationAdmin";
export * from "./patchedSiteConfigurationAdminOpeningHours";
export * from "./payer";
export * from "./payment";
export * from "./paymentBody";
export * from "./paymentCreate";
export * from "./paymentMethodEnum";
export * from "./paymentRead";
export * from "./product";
export * from "./productImage";
export * from "./productMini";
export * from "./reasonChoiceEnum";
export * from "./refund";
export * from "./roleEnum";
export * from "./shippingMethodEnum";
export * from "./siteConfigurationAdmin";
export * from "./siteConfigurationAdminOpeningHours";
export * from "./siteConfigurationPublic";
export * from "./siteConfigurationPublicOpeningHours";
export * from "./stateE15Enum";
export * from "./stateFdaEnum";
export * from "./statusEnum";
export * from "./trackingURL";
export * from "./userRegistration";
export * from "./videoInfoResponse";
export * from "./zasilkovnaPacket";
export * from "./zasilkovnaPacketRead";
export * from "./zasilkovnaPacketReadReturnRouting";
export * from "./zasilkovnaPacketReturnRouting";
export * from "./zasilkovnaShipment";

View File

@@ -0,0 +1,17 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface Item {
name: string;
/**
* Minor units
* @minimum 1
*/
amount: number;
type?: string;
/** @minimum 1 */
count?: number;
}

View File

@@ -0,0 +1,17 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ShippingMethodEnum } from "./shippingMethodEnum";
import type { StateFdaEnum } from "./stateFdaEnum";
import type { ZasilkovnaPacket } from "./zasilkovnaPacket";
export interface OrderCarrier {
shipping_method?: ShippingMethodEnum;
readonly state: StateFdaEnum;
readonly zasilkovna: readonly ZasilkovnaPacket[];
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
readonly shipping_price: string;
packeta_address_id?: number;
}

View File

@@ -0,0 +1,24 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { OrderItemCreate } from "./orderItemCreate";
import type { OrderCarrier } from "./orderCarrier";
import type { Payment } from "./payment";
export interface OrderCreate {
first_name?: string;
last_name?: string;
email?: string;
phone?: string;
address?: string;
city?: string;
postal_code?: string;
country?: string;
note?: string;
items: OrderItemCreate[];
carrier: OrderCarrier;
payment: Payment;
discount_codes?: string[];
}

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface OrderItemCreate {
product_id: number;
/** @minimum 1 */
quantity?: number;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ProductMini } from "./productMini";
export interface OrderItemRead {
readonly id: number;
readonly product: ProductMini;
readonly quantity: number;
}

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { StatusEnum } from "./statusEnum";
export interface OrderMini {
readonly id: number;
readonly status: StatusEnum;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
readonly total_price: string;
readonly created_at: Date;
}

View File

@@ -0,0 +1,34 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { StatusEnum } from "./statusEnum";
import type { OrderItemRead } from "./orderItemRead";
import type { CarrierRead } from "./carrierRead";
import type { PaymentRead } from "./paymentRead";
export interface OrderRead {
readonly id: number;
readonly status: StatusEnum;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
readonly total_price: string;
readonly currency: string;
/** @nullable */
readonly user: number | null;
readonly first_name: string;
readonly last_name: string;
readonly email: string;
readonly phone: string;
readonly address: string;
readonly city: string;
readonly postal_code: string;
readonly country: string;
readonly note: string;
readonly created_at: Date;
readonly updated_at: Date;
readonly items: readonly OrderItemRead[];
readonly carrier: CarrierRead;
readonly payment: PaymentRead;
readonly discount_codes: string;
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { Category } from "./category";
export interface PaginatedCategoryList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: Category[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ContactMe } from "./contactMe";
export interface PaginatedContactMeList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: ContactMe[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { CustomUser } from "./customUser";
export interface PaginatedCustomUserList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: CustomUser[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { DiscountCode } from "./discountCode";
export interface PaginatedDiscountCodeList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: DiscountCode[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { OrderRead } from "./orderRead";
export interface PaginatedOrderReadList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: OrderRead[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ProductImage } from "./productImage";
export interface PaginatedProductImageList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: ProductImage[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { Product } from "./product";
export interface PaginatedProductList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: Product[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { Refund } from "./refund";
export interface PaginatedRefundList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: Refund[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { SiteConfigurationAdmin } from "./siteConfigurationAdmin";
export interface PaginatedSiteConfigurationAdminList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: SiteConfigurationAdmin[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { SiteConfigurationPublic } from "./siteConfigurationPublic";
export interface PaginatedSiteConfigurationPublicList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: SiteConfigurationPublic[];
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ZasilkovnaShipment } from "./zasilkovnaShipment";
export interface PaginatedZasilkovnaShipmentList {
count: number;
/** @nullable */
next?: string | null;
/** @nullable */
previous?: string | null;
results: ZasilkovnaShipment[];
}

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface PasswordResetConfirm {
/** Nové heslo musí mít alespoň 8 znaků, obsahovat velká a malá písmena a číslici. */
password: string;
}

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface PasswordResetRequest {
/** E-mail registrovaného a aktivního uživatele, na který bude zaslán reset hesla. */
email: string;
}

View File

@@ -0,0 +1,20 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface PatchedCategory {
readonly id?: number;
/** @maxLength 100 */
name?: string;
/**
* @maxLength 50
* @pattern ^[-a-zA-Z0-9_]+$
*/
url?: string;
/** @nullable */
parent?: number | null;
description?: string;
image?: string;
}

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface PatchedContactMe {
readonly id?: number;
/** @maxLength 254 */
client_email?: string;
content?: string;
readonly sent_at?: Date;
}

View File

@@ -0,0 +1,45 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { RoleEnum } from "./roleEnum";
export interface PatchedCustomUser {
readonly id?: number;
/** Požadováno. 150 znaků nebo méně. Pouze písmena, číslice a znaky @/./+/-/_. */
readonly username?: string;
/** @maxLength 150 */
first_name?: string;
/** @maxLength 150 */
last_name?: string;
/** @maxLength 254 */
email?: string;
role?: RoleEnum;
email_verified?: boolean;
/**
* @maxLength 16
* @nullable
* @pattern ^\+?\d{9,15}$
*/
phone_number?: string | null;
readonly create_time?: Date;
/**
* @maxLength 100
* @nullable
*/
city?: string | null;
/**
* @maxLength 200
* @nullable
*/
street?: string | null;
/**
* @maxLength 5
* @nullable
* @pattern ^\d{5}$
*/
postal_code?: string | null;
readonly gdpr?: boolean;
is_active?: boolean;
}

View File

@@ -0,0 +1,39 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface PatchedDiscountCode {
readonly id?: number;
/** @maxLength 50 */
code?: string;
/** @maxLength 255 */
description?: string;
/**
* Procento sleva 0-100
* @minimum 0
* @maximum 100
* @nullable
*/
percent?: number | null;
/**
* Fixní sleva v CZK
* @nullable
* @pattern ^-?\d{0,8}(?:\.\d{0,2})?$
*/
amount?: string | null;
valid_from?: Date;
/** @nullable */
valid_to?: Date | null;
active?: boolean;
/**
* @minimum 0
* @maximum 9223372036854776000
* @nullable
*/
usage_limit?: number | null;
readonly used_count?: number;
specific_products?: number[];
specific_categories?: number[];
}

View File

@@ -0,0 +1,34 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { StatusEnum } from "./statusEnum";
import type { OrderItemRead } from "./orderItemRead";
import type { CarrierRead } from "./carrierRead";
import type { PaymentRead } from "./paymentRead";
export interface PatchedOrderRead {
readonly id?: number;
readonly status?: StatusEnum;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
readonly total_price?: string;
readonly currency?: string;
/** @nullable */
readonly user?: number | null;
readonly first_name?: string;
readonly last_name?: string;
readonly email?: string;
readonly phone?: string;
readonly address?: string;
readonly city?: string;
readonly postal_code?: string;
readonly country?: string;
readonly note?: string;
readonly created_at?: Date;
readonly updated_at?: Date;
readonly items?: readonly OrderItemRead[];
readonly carrier?: CarrierRead;
readonly payment?: PaymentRead;
readonly discount_codes?: string;
}

View File

@@ -0,0 +1,39 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface PatchedProduct {
readonly id?: number;
/** @maxLength 200 */
name?: string;
description?: string;
/**
* @maxLength 100
* @nullable
*/
code?: string | null;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
price?: string;
/**
* @maxLength 50
* @pattern ^[-a-zA-Z0-9_]+$
*/
url?: string;
/**
* @minimum 0
* @maximum 9223372036854776000
*/
stock?: number;
is_active?: boolean;
/** @nullable */
limited_to?: Date | null;
readonly created_at?: Date;
readonly updated_at?: Date;
category?: number;
/** @nullable */
default_carrier?: number | null;
/** Symetrické varianty produktu: pokud přidáte variantu A → B, Django automaticky přidá i variantu B → A. Všechny varianty jsou rovnocenné a zobrazí se vzájemně. */
variants?: number[];
}

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface PatchedProductImage {
readonly id?: number;
product?: number;
image?: string;
/** @maxLength 150 */
alt_text?: string;
is_main?: boolean;
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ReasonChoiceEnum } from "./reasonChoiceEnum";
export interface PatchedRefund {
readonly id?: number;
reason_choice?: ReasonChoiceEnum;
reason_text?: string;
readonly verified?: boolean;
readonly created_at?: Date;
order?: number;
}

View File

@@ -0,0 +1,77 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { PatchedSiteConfigurationAdminOpeningHours } from "./patchedSiteConfigurationAdminOpeningHours";
import type { CurrencyEnum } from "./currencyEnum";
export interface PatchedSiteConfigurationAdmin {
readonly id?: number;
/** @maxLength 100 */
name?: string;
/** @nullable */
logo?: string | null;
/** @nullable */
favicon?: string | null;
/**
* @maxLength 254
* @nullable
*/
contact_email?: string | null;
/**
* @maxLength 20
* @nullable
*/
contact_phone?: string | null;
/** @nullable */
contact_address?: string | null;
/** @nullable */
opening_hours?: PatchedSiteConfigurationAdminOpeningHours;
/**
* @maxLength 200
* @nullable
*/
facebook_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
instagram_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
youtube_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
tiktok_url?: string | null;
/**
* @maxLength 20
* @nullable
*/
whatsapp_number?: string | null;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
zasilkovna_shipping_price?: string;
/**
* API klíč pro přístup k Zásilkovna API (zatím není využito)
* @maxLength 255
* @nullable
*/
zasilkovna_api_key?: string | null;
/**
* API heslo pro přístup k Zásilkovna API (zatím není využito)
* @maxLength 255
* @nullable
*/
zasilkovna_api_password?: string | null;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
free_shipping_over?: string;
/** Násobení kupónů v objednávce (ano/ne), pokud ne tak se použije pouze nejvyšší slevový kupón */
multiplying_coupons?: boolean;
/** Sčítání slevových kupónů v objednávce (ano/ne), pokud ne tak se použije pouze nejvyšší slevový kupón */
addition_of_coupons_amount?: boolean;
currency?: CurrencyEnum;
}

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* @nullable
*/
export type PatchedSiteConfigurationAdminOpeningHours = unknown | null;

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { Contact } from "./contact";
export interface Payer {
contact: Contact;
allowed_payment_instruments?: string[];
default_payment_instrument?: string;
allowed_swifts?: string[];
default_swift?: string;
}

View File

@@ -0,0 +1,16 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { PaymentMethodEnum } from "./paymentMethodEnum";
export interface Payment {
readonly id: number;
payment_method?: PaymentMethodEnum;
/** @nullable */
readonly stripe: number | null;
readonly stripe_session_id: string;
readonly stripe_payment_intent: string;
readonly stripe_session_url: string;
}

View File

@@ -0,0 +1,26 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { Payer } from "./payer";
import type { Callback } from "./callback";
import type { Item } from "./item";
import type { AdditionalParam } from "./additionalParam";
export interface PaymentBody {
/**
* Minor units (e.g. 100 CZK = 10000)
* @minimum 1
*/
amount: number;
currency: string;
order_number: string;
order_description?: string;
payer: Payer;
callback: Callback;
items?: Item[];
additional_params?: AdditionalParam[];
lang?: string;
preauthorize?: boolean;
}

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { PaymentBody } from "./paymentBody";
export interface PaymentCreate {
payment: PaymentBody;
user_id?: number;
}

View File

@@ -0,0 +1,20 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `Site` - cz#Platba v obchodě
* `stripe` - cz#Bankovní převod
* `cash_on_delivery` - cz#Dobírka
*/
export type PaymentMethodEnum =
(typeof PaymentMethodEnum)[keyof typeof PaymentMethodEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PaymentMethodEnum = {
Site: "Site",
stripe: "stripe",
cash_on_delivery: "cash_on_delivery",
} as const;

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { PaymentMethodEnum } from "./paymentMethodEnum";
export interface PaymentRead {
readonly payment_method: PaymentMethodEnum;
}

View File

@@ -0,0 +1,39 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface Product {
readonly id: number;
/** @maxLength 200 */
name: string;
description?: string;
/**
* @maxLength 100
* @nullable
*/
code?: string | null;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
price: string;
/**
* @maxLength 50
* @pattern ^[-a-zA-Z0-9_]+$
*/
url: string;
/**
* @minimum 0
* @maximum 9223372036854776000
*/
stock?: number;
is_active?: boolean;
/** @nullable */
limited_to?: Date | null;
readonly created_at: Date;
readonly updated_at: Date;
category: number;
/** @nullable */
default_carrier?: number | null;
/** Symetrické varianty produktu: pokud přidáte variantu A → B, Django automaticky přidá i variantu B → A. Všechny varianty jsou rovnocenné a zobrazí se vzájemně. */
variants?: number[];
}

View File

@@ -0,0 +1,14 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface ProductImage {
readonly id: number;
product: number;
image: string;
/** @maxLength 150 */
alt_text?: string;
is_main?: boolean;
}

View File

@@ -0,0 +1,13 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface ProductMini {
readonly id: number;
/** @maxLength 200 */
name: string;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
price: string;
}

View File

@@ -0,0 +1,22 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `retuning_before_fourteen_day_period` - cz#Vrácení před uplynutím 14-ti denní lhůty
* `damaged_product` - cz#Poškozený produkt
* `wrong_item` - cz#Špatná položka
* `other` - cz#Jiný důvod
*/
export type ReasonChoiceEnum =
(typeof ReasonChoiceEnum)[keyof typeof ReasonChoiceEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ReasonChoiceEnum = {
retuning_before_fourteen_day_period: "retuning_before_fourteen_day_period",
damaged_product: "damaged_product",
wrong_item: "wrong_item",
other: "other",
} as const;

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { ReasonChoiceEnum } from "./reasonChoiceEnum";
export interface Refund {
readonly id: number;
reason_choice: ReasonChoiceEnum;
reason_text?: string;
readonly verified: boolean;
readonly created_at: Date;
order: number;
}

View File

@@ -0,0 +1,19 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `admin` - cz#Administrátor
* `mod` - cz#Moderator
* `regular` - cz#Regular
*/
export type RoleEnum = (typeof RoleEnum)[keyof typeof RoleEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const RoleEnum = {
admin: "admin",
mod: "mod",
regular: "regular",
} as const;

View File

@@ -0,0 +1,18 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `packeta` - cz#Zásilkovna
* `store` - cz#Osobní odběr
*/
export type ShippingMethodEnum =
(typeof ShippingMethodEnum)[keyof typeof ShippingMethodEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ShippingMethodEnum = {
packeta: "packeta",
store: "store",
} as const;

View File

@@ -0,0 +1,77 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { SiteConfigurationAdminOpeningHours } from "./siteConfigurationAdminOpeningHours";
import type { CurrencyEnum } from "./currencyEnum";
export interface SiteConfigurationAdmin {
readonly id: number;
/** @maxLength 100 */
name?: string;
/** @nullable */
logo?: string | null;
/** @nullable */
favicon?: string | null;
/**
* @maxLength 254
* @nullable
*/
contact_email?: string | null;
/**
* @maxLength 20
* @nullable
*/
contact_phone?: string | null;
/** @nullable */
contact_address?: string | null;
/** @nullable */
opening_hours?: SiteConfigurationAdminOpeningHours;
/**
* @maxLength 200
* @nullable
*/
facebook_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
instagram_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
youtube_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
tiktok_url?: string | null;
/**
* @maxLength 20
* @nullable
*/
whatsapp_number?: string | null;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
zasilkovna_shipping_price?: string;
/**
* API klíč pro přístup k Zásilkovna API (zatím není využito)
* @maxLength 255
* @nullable
*/
zasilkovna_api_key?: string | null;
/**
* API heslo pro přístup k Zásilkovna API (zatím není využito)
* @maxLength 255
* @nullable
*/
zasilkovna_api_password?: string | null;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
free_shipping_over?: string;
/** Násobení kupónů v objednávce (ano/ne), pokud ne tak se použije pouze nejvyšší slevový kupón */
multiplying_coupons?: boolean;
/** Sčítání slevových kupónů v objednávce (ano/ne), pokud ne tak se použije pouze nejvyšší slevový kupón */
addition_of_coupons_amount?: boolean;
currency?: CurrencyEnum;
}

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* @nullable
*/
export type SiteConfigurationAdminOpeningHours = unknown | null;

View File

@@ -0,0 +1,56 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { SiteConfigurationPublicOpeningHours } from "./siteConfigurationPublicOpeningHours";
import type { CurrencyEnum } from "./currencyEnum";
export interface SiteConfigurationPublic {
readonly id: number;
/** @maxLength 100 */
name?: string;
/** @nullable */
logo?: string | null;
/** @nullable */
favicon?: string | null;
/**
* @maxLength 254
* @nullable
*/
contact_email?: string | null;
/**
* @maxLength 20
* @nullable
*/
contact_phone?: string | null;
/** @nullable */
contact_address?: string | null;
/** @nullable */
opening_hours?: SiteConfigurationPublicOpeningHours;
/**
* @maxLength 200
* @nullable
*/
facebook_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
instagram_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
youtube_url?: string | null;
/**
* @maxLength 200
* @nullable
*/
tiktok_url?: string | null;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
zasilkovna_shipping_price?: string;
/** @pattern ^-?\d{0,8}(?:\.\d{0,2})?$ */
free_shipping_over?: string;
currency?: CurrencyEnum;
}

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* @nullable
*/
export type SiteConfigurationPublicOpeningHours = unknown | null;

View File

@@ -0,0 +1,27 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `WAITING_FOR_ORDERING_SHIPMENT` - cz#Čeká na objednání zásilkovny
* `PENDING` - cz#Podáno
* `SENDED` - cz#Odesláno
* `ARRIVED` - cz#Doručeno
* `CANCELED` - cz#Zrušeno
* `RETURNING` - cz#Posláno zpátky
* `RETURNED` - cz#Vráceno
*/
export type StateE15Enum = (typeof StateE15Enum)[keyof typeof StateE15Enum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const StateE15Enum = {
WAITING_FOR_ORDERING_SHIPMENT: "WAITING_FOR_ORDERING_SHIPMENT",
PENDING: "PENDING",
SENDED: "SENDED",
ARRIVED: "ARRIVED",
CANCELED: "CANCELED",
RETURNING: "RETURNING",
RETURNED: "RETURNED",
} as const;

View File

@@ -0,0 +1,21 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `ordered` - cz#Objednávka se připravuje
* `shipped` - cz#Odesláno
* `delivered` - cz#Doručeno
* `ready_to_pickup` - cz#Připraveno k vyzvednutí
*/
export type StateFdaEnum = (typeof StateFdaEnum)[keyof typeof StateFdaEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const StateFdaEnum = {
ordered: "ordered",
shipped: "shipped",
delivered: "delivered",
ready_to_pickup: "ready_to_pickup",
} as const;

View File

@@ -0,0 +1,23 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* * `created` - cz#Vytvořeno
* `cancelled` - cz#Zrušeno
* `completed` - cz#Dokončeno
* `refunding` - cz#Vrácení v procesu
* `refunded` - cz#Vráceno
*/
export type StatusEnum = (typeof StatusEnum)[keyof typeof StatusEnum];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const StatusEnum = {
created: "created",
cancelled: "cancelled",
completed: "completed",
refunding: "refunding",
refunded: "refunded",
} as const;

View File

@@ -0,0 +1,10 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface TrackingURL {
readonly barcode: string;
readonly tracking_url: string;
}

View File

@@ -0,0 +1,53 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface UserRegistration {
/**
* Křestní jméno uživatele
* @maxLength 150
*/
first_name: string;
/**
* Příjmení uživatele
* @maxLength 150
*/
last_name: string;
/**
* Emailová adresa uživatele
* @maxLength 254
*/
email: string;
/**
* Telefonní číslo uživatele
* @maxLength 16
* @nullable
* @pattern ^\+?\d{9,15}$
*/
phone_number: string | null;
/** Heslo musí mít alespoň 8 znaků, obsahovat velká a malá písmena a číslici. */
password: string;
/**
* Město uživatele
* @maxLength 100
* @nullable
*/
city: string | null;
/**
* Ulice uživatele
* @maxLength 200
* @nullable
*/
street: string | null;
/**
* PSČ uživatele
* @maxLength 5
* @nullable
* @pattern ^\d{5}$
*/
postal_code: string | null;
/** Souhlas se zpracováním osobních údajů */
gdpr: boolean;
}

View File

@@ -0,0 +1,15 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
export interface VideoInfoResponse {
title: string;
/** @nullable */
duration: number | null;
/** @nullable */
thumbnail: string | null;
video_resolutions: string[];
audio_resolutions: string[];
}

View File

@@ -0,0 +1,32 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { StateE15Enum } from "./stateE15Enum";
import type { ZasilkovnaPacketReturnRouting } from "./zasilkovnaPacketReturnRouting";
export interface ZasilkovnaPacket {
readonly id: number;
readonly created_at: Date;
/**
* Číslo zásilky v Packetě (vraceno od API od Packety)
* @minimum -9223372036854776000
* @maximum 9223372036854776000
* @nullable
*/
packet_id?: number | null;
/**
* Čárový kód zásilky od Packety
* @nullable
*/
readonly barcode: string | null;
readonly state: StateE15Enum;
/** Hmotnost zásilky v gramech */
readonly weight: number;
/**
* Seznam 2 routing stringů pro vrácení zásilky
* @nullable
*/
readonly return_routing: ZasilkovnaPacketReturnRouting;
}

View File

@@ -0,0 +1,32 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
import type { StateE15Enum } from "./stateE15Enum";
import type { ZasilkovnaPacketReadReturnRouting } from "./zasilkovnaPacketReadReturnRouting";
export interface ZasilkovnaPacketRead {
readonly id: number;
readonly created_at: Date;
/**
* Číslo zásilky v Packetě (vraceno od API od Packety)
* @minimum -9223372036854776000
* @maximum 9223372036854776000
* @nullable
*/
packet_id?: number | null;
/**
* Čárový kód zásilky od Packety
* @nullable
*/
readonly barcode: string | null;
readonly state: StateE15Enum;
/** Hmotnost zásilky v gramech */
readonly weight: number;
/**
* Seznam 2 routing stringů pro vrácení zásilky
* @nullable
*/
readonly return_routing: ZasilkovnaPacketReadReturnRouting;
}

View File

@@ -0,0 +1,11 @@
/**
* Generated by orval v7.17.0 🍺
* Do not edit manually.
* OpenAPI spec version: 0.0.0
*/
/**
* Seznam 2 routing stringů pro vrácení zásilky
* @nullable
*/
export type ZasilkovnaPacketReadReturnRouting = unknown | null;

Some files were not shown because too many files have changed in this diff Show More