Skip to content
Merged
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
296 changes: 186 additions & 110 deletions opt/wildcat/__dev_openapi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion opt/wildcat/openapi.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"lucide-react": "^0.479.0",
"next-themes": "^0.4.6",
"react": "^19.0.0",
"react-day-picker": "^9.6.2",
"react-day-picker": "^9.6.4",
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.2",
"react-router": "^7.3.0",
Expand Down
4 changes: 0 additions & 4 deletions src/components/AppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const data = {
{
title: "Offered",
url: "/quotes/offered",
disabled: true,
},
{
title: "Accepted",
Expand All @@ -43,17 +42,14 @@ const data = {
{
title: "Denied",
url: "/quotes/denied",
disabled: true,
},
{
title: "Rejected",
url: "/quotes/rejected",
disabled: true,
},
{
title: "Expired",
url: "/quotes/expired",
disabled: true,
},
],
},
Expand Down
60 changes: 32 additions & 28 deletions src/components/ui/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,62 @@
...props
}: React.ComponentProps<typeof DayPicker>) {
return (
<DayPicker
<DayPicker

Check warning on line 15 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L15

Added line #L15 was not covered by tests
showOutsideDays={showOutsideDays}
className={cn("p-3", className)}
classNames={{
months: "flex flex-col sm:flex-row gap-2",
months: "flex flex-col gap-2",

Check warning on line 19 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L19

Added line #L19 was not covered by tests
month: "flex flex-col gap-4",
caption: "flex justify-center pt-1 relative items-center w-full",
month_caption: "flex justify-center pt-1 relative items-center w-full",

Check warning on line 21 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L21

Added line #L21 was not covered by tests
caption_label: "text-sm font-medium",
nav: "flex items-center gap-1",
nav_button: cn(
button_previous: cn(

Check warning on line 24 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L24

Added line #L24 was not covered by tests
buttonVariants({ variant: "outline" }),
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
" left-1"

Check warning on line 27 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L26-L27

Added lines #L26 - L27 were not covered by tests
),
nav_button_previous: "absolute left-1",
nav_button_next: "absolute right-1",
table: "w-full border-collapse space-x-1",
head_row: "flex",
head_cell:
button_next: cn(
buttonVariants({ variant: "outline" }),
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
" right-1"
),
month_grid: "w-full border-collapse space-x-1",
weekdays: "flex",
weekday:

Check warning on line 36 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L29-L36

Added lines #L29 - L36 were not covered by tests
"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",
row: "flex w-full mt-2",
cell: cn(
week: "flex w-full mt-2",
day: cn(

Check warning on line 39 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L38-L39

Added lines #L38 - L39 were not covered by tests
"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",
props.mode === "range"
? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md"
: "[&:has([aria-selected])]:rounded-md"
),
day: cn(
day_button: cn(

Check warning on line 45 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L45

Added line #L45 was not covered by tests
buttonVariants({ variant: "ghost" }),
"size-8 p-0 font-normal aria-selected:opacity-100"
),
day_range_start:
range_start:

Check warning on line 49 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L49

Added line #L49 was not covered by tests
"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",
day_range_end:
range_middle:
"aria-selected:bg-accent aria-selected:text-accent-foreground",
range_end:

Check warning on line 53 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L51-L53

Added lines #L51 - L53 were not covered by tests
"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",
day_selected:
selected:

Check warning on line 55 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L55

Added line #L55 was not covered by tests
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
day_today: "bg-accent text-accent-foreground",
day_outside:
today: "bg-accent text-accent-foreground",
outside:

Check warning on line 58 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L57-L58

Added lines #L57 - L58 were not covered by tests
"day-outside text-muted-foreground aria-selected:text-muted-foreground",
day_disabled: "text-muted-foreground opacity-50",
day_range_middle:
"aria-selected:bg-accent aria-selected:text-accent-foreground",
day_hidden: "invisible",
disabled: "text-muted-foreground opacity-50",
hidden: "invisible",

Check warning on line 61 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L60-L61

Added lines #L60 - L61 were not covered by tests
...classNames,
}}
components={{
PreviousMonthButton: ({ className }) => (
<ChevronLeft className={cn("size-4", className)} />
),
NextMonthButton: ({ className }) => (
<ChevronRight className={cn("size-4", className)} />
),
Chevron: (props) => {
if (props.orientation === "left") {
return <ChevronLeft {...props} className={cn("size-4", props.className)} />;
}
return <ChevronRight {...props} className={cn("size-4", props.className)} />;
},

Check warning on line 70 in src/components/ui/calendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ui/calendar.tsx#L65-L70

Added lines #L65 - L70 were not covered by tests
}}
{...props}
/>
Expand Down
12 changes: 2 additions & 10 deletions src/constants/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
const INFO = "/v1/info"
const BALANCES = "/v1/balances"

const ADMIN_QUOTE = "/v1/admin/credit/quote"

Check warning on line 4 in src/constants/endpoints.ts

View check run for this annotation

Codecov / codecov/patch

src/constants/endpoints.ts#L4

Added line #L4 was not covered by tests
const ADMIN_QUOTE_PENDING = "/v1/admin/credit/quote/pending"
const ADMIN_QUOTE_ACCEPTED = "/v1/admin/credit/quote/accepted"
const ADMIN_QUOTE_BY_ID = "/v1/admin/credit/quote/:id"

const CREDIT_QUOTE = "/v1/credit/mint/quote"
const CREDIT_QUOTES_BY_ID = "/v1/credit/mint/quote/:id"

export {
INFO,
BALANCES,
ADMIN_QUOTE_PENDING,
ADMIN_QUOTE_ACCEPTED,
ADMIN_QUOTE_BY_ID,
CREDIT_QUOTE,
CREDIT_QUOTES_BY_ID,
}
export { INFO, BALANCES, ADMIN_QUOTE, ADMIN_QUOTE_PENDING, ADMIN_QUOTE_BY_ID, CREDIT_QUOTE, CREDIT_QUOTES_BY_ID }
64 changes: 32 additions & 32 deletions src/generated/client/@tanstack/react-query.gen.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file is auto-generated by @hey-api/openapi-ts

import { type Options, adminLookupQuote, resolveQuote, listAcceptedQuotes, listPendingQuotes, resolveOffer, enquireQuote, lookupQuote } from '../sdk.gen';
import { type Options, listQuotes, listPendingQuotes, adminLookupQuote, adminUpdateQuote, resolveOffer, enquireQuote, lookupQuote } from '../sdk.gen';

Check warning on line 3 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L3

Added line #L3 was not covered by tests
import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query';
import type { AdminLookupQuoteData, ResolveQuoteData, ListAcceptedQuotesData, ListPendingQuotesData, ResolveOfferData, EnquireQuoteData, EnquireQuoteResponse, LookupQuoteData } from '../types.gen';
import type { ListQuotesData, ListPendingQuotesData, AdminLookupQuoteData, AdminUpdateQuoteData, AdminUpdateQuoteResponse, ResolveOfferData, EnquireQuoteData, EnquireQuoteResponse, LookupQuoteData } from '../types.gen';
import { client as _heyApiClient } from '../client.gen';

export type QueryKey<TOptions extends Options> = [
Expand Down Expand Up @@ -36,88 +36,88 @@
];
};

export const adminLookupQuoteQueryKey = (options: Options<AdminLookupQuoteData>) => createQueryKey('adminLookupQuote', options);
export const listQuotesQueryKey = (options?: Options<ListQuotesData>) => createQueryKey('listQuotes', options);

Check warning on line 39 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L39

Added line #L39 was not covered by tests

export const adminLookupQuoteOptions = (options: Options<AdminLookupQuoteData>) => {
export const listQuotesOptions = (options?: Options<ListQuotesData>) => {

Check warning on line 41 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L41

Added line #L41 was not covered by tests
return queryOptions({
queryFn: async ({ queryKey, signal }) => {
const { data } = await adminLookupQuote({
const { data } = await listQuotes({

Check warning on line 44 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L44

Added line #L44 was not covered by tests
...options,
...queryKey[0],
signal,
throwOnError: true
});
return data;
},
queryKey: adminLookupQuoteQueryKey(options)
queryKey: listQuotesQueryKey(options)

Check warning on line 52 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L52

Added line #L52 was not covered by tests
});
};

export const resolveQuoteQueryKey = (options: Options<ResolveQuoteData>) => createQueryKey('resolveQuote', options);
export const listPendingQuotesQueryKey = (options?: Options<ListPendingQuotesData>) => createQueryKey('listPendingQuotes', options);

Check warning on line 56 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L56

Added line #L56 was not covered by tests

export const resolveQuoteOptions = (options: Options<ResolveQuoteData>) => {
export const listPendingQuotesOptions = (options?: Options<ListPendingQuotesData>) => {

Check warning on line 58 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L58

Added line #L58 was not covered by tests
return queryOptions({
queryFn: async ({ queryKey, signal }) => {
const { data } = await resolveQuote({
const { data } = await listPendingQuotes({

Check warning on line 61 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L61

Added line #L61 was not covered by tests
...options,
...queryKey[0],
signal,
throwOnError: true
});
return data;
},
queryKey: resolveQuoteQueryKey(options)
queryKey: listPendingQuotesQueryKey(options)

Check warning on line 69 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L69

Added line #L69 was not covered by tests
});
};

export const resolveQuoteMutation = (options?: Partial<Options<ResolveQuoteData>>) => {
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<ResolveQuoteData>> = {
mutationFn: async (localOptions) => {
const { data } = await resolveQuote({
...options,
...localOptions,
throwOnError: true
});
return data;
}
};
return mutationOptions;
};

export const listAcceptedQuotesQueryKey = (options?: Options<ListAcceptedQuotesData>) => createQueryKey('listAcceptedQuotes', options);
export const adminLookupQuoteQueryKey = (options: Options<AdminLookupQuoteData>) => createQueryKey('adminLookupQuote', options);

Check warning on line 73 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L73

Added line #L73 was not covered by tests

export const listAcceptedQuotesOptions = (options?: Options<ListAcceptedQuotesData>) => {
export const adminLookupQuoteOptions = (options: Options<AdminLookupQuoteData>) => {

Check warning on line 75 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L75

Added line #L75 was not covered by tests
return queryOptions({
queryFn: async ({ queryKey, signal }) => {
const { data } = await listAcceptedQuotes({
const { data } = await adminLookupQuote({

Check warning on line 78 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L78

Added line #L78 was not covered by tests
...options,
...queryKey[0],
signal,
throwOnError: true
});
return data;
},
queryKey: listAcceptedQuotesQueryKey(options)
queryKey: adminLookupQuoteQueryKey(options)

Check warning on line 86 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L86

Added line #L86 was not covered by tests
});
};

export const listPendingQuotesQueryKey = (options?: Options<ListPendingQuotesData>) => createQueryKey('listPendingQuotes', options);
export const adminUpdateQuoteQueryKey = (options: Options<AdminUpdateQuoteData>) => createQueryKey('adminUpdateQuote', options);

Check warning on line 90 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L90

Added line #L90 was not covered by tests

export const listPendingQuotesOptions = (options?: Options<ListPendingQuotesData>) => {
export const adminUpdateQuoteOptions = (options: Options<AdminUpdateQuoteData>) => {

Check warning on line 92 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L92

Added line #L92 was not covered by tests
return queryOptions({
queryFn: async ({ queryKey, signal }) => {
const { data } = await listPendingQuotes({
const { data } = await adminUpdateQuote({

Check warning on line 95 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L95

Added line #L95 was not covered by tests
...options,
...queryKey[0],
signal,
throwOnError: true
});
return data;
},
queryKey: listPendingQuotesQueryKey(options)
queryKey: adminUpdateQuoteQueryKey(options)

Check warning on line 103 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L103

Added line #L103 was not covered by tests
});
};

export const adminUpdateQuoteMutation = (options?: Partial<Options<AdminUpdateQuoteData>>) => {
const mutationOptions: UseMutationOptions<AdminUpdateQuoteResponse, DefaultError, Options<AdminUpdateQuoteData>> = {
mutationFn: async (localOptions) => {
const { data } = await adminUpdateQuote({
...options,
...localOptions,
throwOnError: true
});
return data;
}
};
return mutationOptions;
};

Check warning on line 119 in src/generated/client/@tanstack/react-query.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/@tanstack/react-query.gen.ts#L107-L119

Added lines #L107 - L119 were not covered by tests

export const resolveOfferQueryKey = (options: Options<ResolveOfferData>) => createQueryKey('resolveOffer', options);

export const resolveOfferOptions = (options: Options<ResolveOfferData>) => {
Expand Down
40 changes: 20 additions & 20 deletions src/generated/client/sdk.gen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is auto-generated by @hey-api/openapi-ts

import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
import type { AdminLookupQuoteData, AdminLookupQuoteResponse, ResolveQuoteData, ListAcceptedQuotesData, ListAcceptedQuotesResponse, ListPendingQuotesData, ListPendingQuotesResponse, ResolveOfferData, EnquireQuoteData, EnquireQuoteResponse, LookupQuoteData, LookupQuoteResponse } from './types.gen';
import type { ListQuotesData, ListQuotesResponse, ListPendingQuotesData, ListPendingQuotesResponse, AdminLookupQuoteData, AdminLookupQuoteResponse, AdminUpdateQuoteData, AdminUpdateQuoteResponse, ResolveOfferData, EnquireQuoteData, EnquireQuoteResponse, LookupQuoteData, LookupQuoteResponse } from './types.gen';
import { client as _heyApiClient } from './client.gen';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
Expand All @@ -18,15 +18,32 @@
meta?: Record<string, unknown>;
};

export const listQuotes = <ThrowOnError extends boolean = false>(options?: Options<ListQuotesData, ThrowOnError>) => {
return (options?.client ?? _heyApiClient).get<ListQuotesResponse, unknown, ThrowOnError>({
url: '/v1/admin/credit/quote',
...options
});
};

Check warning on line 26 in src/generated/client/sdk.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/sdk.gen.ts#L21-L26

Added lines #L21 - L26 were not covered by tests

/**
* --------------------------- List quotes
*/
export const listPendingQuotes = <ThrowOnError extends boolean = false>(options?: Options<ListPendingQuotesData, ThrowOnError>) => {
return (options?.client ?? _heyApiClient).get<ListPendingQuotesResponse, unknown, ThrowOnError>({
url: '/v1/admin/credit/quote/pending',
...options
});
};

Check warning on line 36 in src/generated/client/sdk.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/sdk.gen.ts#L31-L36

Added lines #L31 - L36 were not covered by tests

export const adminLookupQuote = <ThrowOnError extends boolean = false>(options: Options<AdminLookupQuoteData, ThrowOnError>) => {
return (options.client ?? _heyApiClient).get<AdminLookupQuoteResponse, unknown, ThrowOnError>({
url: '/v1/admin/credit/quote/{id}',
...options
});
};

export const resolveQuote = <ThrowOnError extends boolean = false>(options: Options<ResolveQuoteData, ThrowOnError>) => {
return (options.client ?? _heyApiClient).post<unknown, unknown, ThrowOnError>({
export const adminUpdateQuote = <ThrowOnError extends boolean = false>(options: Options<AdminUpdateQuoteData, ThrowOnError>) => {
return (options.client ?? _heyApiClient).post<AdminUpdateQuoteResponse, unknown, ThrowOnError>({

Check warning on line 46 in src/generated/client/sdk.gen.ts

View check run for this annotation

Codecov / codecov/patch

src/generated/client/sdk.gen.ts#L45-L46

Added lines #L45 - L46 were not covered by tests
url: '/v1/admin/credit/quote/{id}',
...options,
headers: {
Expand All @@ -36,23 +53,6 @@
});
};

export const listAcceptedQuotes = <ThrowOnError extends boolean = false>(options?: Options<ListAcceptedQuotesData, ThrowOnError>) => {
return (options?.client ?? _heyApiClient).get<ListAcceptedQuotesResponse, unknown, ThrowOnError>({
url: '/v1/admin/credit/quote/accepted',
...options
});
};

/**
* --------------------------- List quotes
*/
export const listPendingQuotes = <ThrowOnError extends boolean = false>(options?: Options<ListPendingQuotesData, ThrowOnError>) => {
return (options?.client ?? _heyApiClient).get<ListPendingQuotesResponse, unknown, ThrowOnError>({
url: '/v1/admin/credit/quote/pending',
...options
});
};

export const resolveOffer = <ThrowOnError extends boolean = false>(options: Options<ResolveOfferData, ThrowOnError>) => {
return (options.client ?? _heyApiClient).post<unknown, unknown, ThrowOnError>({
url: '/v1/credit/quote/{id}',
Expand Down
Loading