11import { type MutateOptions , mutationOptions , queryOptions } from '@tanstack/react-query'
22import { db } from '@workspace/db/db'
3- import { dbWalletCreate } from '@workspace/db/db- wallet-create'
4- import { dbWalletDelete } from '@workspace/db/db- wallet-delete '
5- import { dbWalletFindMany } from '@workspace/db/db- wallet-find-many '
6- import { dbWalletFindUnique } from '@workspace/db/db- wallet-find-unique '
7- import { dbWalletSetActive } from '@workspace/db/db- wallet-set-active '
8- import { dbWalletUpdate } from '@workspace/db/db- wallet-update '
9- import type { WalletInputCreate } from '@workspace/db/dto /wallet-input-create '
10- import type { WalletInputFindMany } from '@workspace/db/dto /wallet-input-find-many '
11- import type { WalletInputUpdate } from '@workspace/db/dto /wallet-input- update'
3+ import { walletCreate } from '@workspace/db/wallet/ wallet-create'
4+ import type { WalletCreateInput } from '@workspace/db/wallet/wallet-create-input '
5+ import { walletDelete } from '@workspace/db/wallet/wallet-delete '
6+ import { walletFindMany } from '@workspace/db/wallet/wallet -find-many '
7+ import type { WalletFindManyInput } from '@workspace/db/wallet/wallet-find-many-input '
8+ import { walletFindUnique } from '@workspace/db/wallet/wallet-find-unique '
9+ import { walletSetActive } from '@workspace/db/wallet /wallet-set-active '
10+ import { walletUpdate } from '@workspace/db/wallet /wallet-update '
11+ import type { WalletUpdateInput } from '@workspace/db/wallet /wallet-update-input '
1212import { queryClient } from './db-query-client.tsx'
1313import { dbSettingOptions } from './db-setting-options.tsx'
1414
15- export type DbWalletCreateMutateOptions = MutateOptions < string , Error , { input : WalletInputCreate } >
15+ export type DbWalletCreateMutateOptions = MutateOptions < string , Error , { input : WalletCreateInput } >
1616export type DbWalletDeleteMutateOptions = MutateOptions < void , Error , { id : string } >
1717export type DbWalletSetActiveMutateOptions = MutateOptions < void , Error , { id : string } >
18- export type DbWalletUpdateMutateOptions = MutateOptions < number , Error , { input : WalletInputUpdate } >
18+ export type DbWalletUpdateMutateOptions = MutateOptions < number , Error , { input : WalletUpdateInput } >
1919
2020export const dbWalletOptions = {
2121 create : ( props : DbWalletCreateMutateOptions = { } ) =>
2222 mutationOptions ( {
23- mutationFn : ( { input } : { input : WalletInputCreate } ) => dbWalletCreate ( db , input ) ,
23+ mutationFn : ( { input } : { input : WalletCreateInput } ) => walletCreate ( db , input ) ,
2424 onSuccess : ( ) => {
2525 queryClient . invalidateQueries ( dbSettingOptions . getAll ( ) )
2626 queryClient . invalidateQueries ( dbSettingOptions . getValue ( 'activeWalletId' ) )
@@ -29,22 +29,22 @@ export const dbWalletOptions = {
2929 } ) ,
3030 delete : ( props : DbWalletDeleteMutateOptions = { } ) =>
3131 mutationOptions ( {
32- mutationFn : ( { id } : { id : string } ) => dbWalletDelete ( db , id ) ,
32+ mutationFn : ( { id } : { id : string } ) => walletDelete ( db , id ) ,
3333 ...props ,
3434 } ) ,
35- findMany : ( input : WalletInputFindMany ) =>
35+ findMany : ( input : WalletFindManyInput ) =>
3636 queryOptions ( {
37- queryFn : ( ) => dbWalletFindMany ( db , input ) ,
38- queryKey : [ 'dbWalletFindMany ' , input ] ,
37+ queryFn : ( ) => walletFindMany ( db , input ) ,
38+ queryKey : [ 'walletFindMany ' , input ] ,
3939 } ) ,
4040 findUnique : ( id : string ) =>
4141 queryOptions ( {
42- queryFn : ( ) => dbWalletFindUnique ( db , id ) ,
43- queryKey : [ 'dbWalletFindUnique ' , id ] ,
42+ queryFn : ( ) => walletFindUnique ( db , id ) ,
43+ queryKey : [ 'walletFindUnique ' , id ] ,
4444 } ) ,
4545 setActive : ( props : DbWalletSetActiveMutateOptions = { } ) =>
4646 mutationOptions ( {
47- mutationFn : ( { id } : { id : string } ) => dbWalletSetActive ( db , id ) ,
47+ mutationFn : ( { id } : { id : string } ) => walletSetActive ( db , id ) ,
4848 onSuccess : ( ) => {
4949 queryClient . invalidateQueries ( dbSettingOptions . getAll ( ) )
5050 queryClient . invalidateQueries ( dbSettingOptions . getValue ( 'activeWalletId' ) )
@@ -54,7 +54,7 @@ export const dbWalletOptions = {
5454 } ) ,
5555 update : ( props : DbWalletUpdateMutateOptions = { } ) =>
5656 mutationOptions ( {
57- mutationFn : ( { id, input } : { id : string ; input : WalletInputUpdate } ) => dbWalletUpdate ( db , id , input ) ,
57+ mutationFn : ( { id, input } : { id : string ; input : WalletUpdateInput } ) => walletUpdate ( db , id , input ) ,
5858 ...props ,
5959 } ) ,
6060}
0 commit comments