Skip to content

Commit 8bc3104

Browse files
committed
feat(*): 파일 구조를 FSD로 마이그레이션
1 parent f458bd1 commit 8bc3104

19 files changed

Lines changed: 70 additions & 51 deletions

File tree

src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Metadata } from 'next';
2-
import { QueryProvider } from '@/providers/query-provider';
3-
import { PwaUpdatePrompt } from '@/components/pwa-update-prompt';
2+
import { QueryProvider } from '@/app/providers/query-provider';
3+
import { PwaUpdatePrompt } from '@/shared/ui/pwa-update-prompt';
44
import './globals.css';
55

66
export const metadata: Metadata = {

src/entities/pay/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export type PointTransaction = {
2+
id: string;
3+
type: 'CHARGE' | 'USE' | 'REFUND';
4+
amount: number;
5+
balanceAfter: number;
6+
description: string;
7+
createdAt: string;
8+
};
9+
10+
export type PointBalance = {
11+
balance: number;
12+
updatedAt: string;
13+
};
Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export type ApiResponse<T> = {
1111

1212
export type PagedResponse<T> = ApiResponse<T[]>;
1313

14-
// Spot domain types
1514
export type SpotType = 'OFFER' | 'REQUEST';
1615
export type SpotStatus = 'OPEN' | 'MATCHED' | 'CLOSED' | 'CANCELLED';
1716

@@ -47,36 +46,3 @@ export type TimelineEvent = {
4746
export type SpotDetail = Spot & {
4847
timeline: TimelineEvent[];
4948
};
50-
51-
// Point domain types
52-
export type PointTransaction = {
53-
id: string;
54-
type: 'CHARGE' | 'USE' | 'REFUND';
55-
amount: number;
56-
balanceAfter: number;
57-
description: string;
58-
createdAt: string;
59-
};
60-
61-
export type PointBalance = {
62-
balance: number;
63-
updatedAt: string;
64-
};
65-
66-
// User/My domain types
67-
export type UserProfile = {
68-
id: string;
69-
nickname: string;
70-
email: string;
71-
pointBalance: number;
72-
joinedAt: string;
73-
};
74-
75-
export type Participation = {
76-
spotId: string;
77-
spotTitle: string;
78-
spotType: SpotType;
79-
role: 'AUTHOR' | 'PARTICIPANT';
80-
status: SpotStatus;
81-
joinedAt: string;
82-
};

src/entities/user/types.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { SpotType, SpotStatus } from '@/entities/spot/types';
2+
3+
export type UserProfile = {
4+
id: string;
5+
nickname: string;
6+
email: string;
7+
pointBalance: number;
8+
joinedAt: string;
9+
};
10+
11+
export type Participation = {
12+
spotId: string;
13+
spotTitle: string;
14+
spotType: SpotType;
15+
role: 'AUTHOR' | 'PARTICIPANT';
16+
status: SpotStatus;
17+
joinedAt: string;
18+
};
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { apiClient } from './client';
2-
import type { UserProfile, Participation, PagedResponse } from '@/types/api';
1+
import { apiClient } from '@/shared/api/client';
2+
import type { UserProfile, Participation } from '@/entities/user/types';
3+
import type { PagedResponse } from '@/entities/spot/types';
34

45
export const myApi = {
56
profile: () => apiClient.get('users/me').json<{ data: UserProfile }>(),

src/features/my/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export { myApi } from './api/my-api';
2+
export {
3+
myKeys,
4+
useMyProfile,
5+
useMyParticipations,
6+
useUpdateProfile,
7+
} from './model/use-my';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
2-
import { myApi } from '@/lib/api/my';
2+
import { myApi } from '../api/my-api';
33

44
export const myKeys = {
55
profile: ['my', 'profile'] as const,
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { apiClient } from './client';
2-
import type {
3-
PointBalance,
4-
PointTransaction,
5-
PagedResponse,
6-
} from '@/types/api';
1+
import { apiClient } from '@/shared/api/client';
2+
import type { PointBalance, PointTransaction } from '@/entities/pay/types';
3+
import type { PagedResponse } from '@/entities/spot/types';
74

85
export const payApi = {
96
balance: () =>

src/features/pay/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export { payApi } from './api/pay-api';
2+
export {
3+
payKeys,
4+
usePointBalance,
5+
usePointHistory,
6+
useChargePoints,
7+
} from './model/use-pay';

0 commit comments

Comments
 (0)