-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π·οΈ chore: funnel ν¨ν΄μ μ¬μ©ν νμ
μ μ #5
- Loading branch information
1 parent
17720d2
commit d2066c1
Showing
1 changed file
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// Enum types | ||
enum Gender { | ||
MALE = 'MALE', | ||
FEMALE = 'FEMALE', | ||
NONE = 'NONE', | ||
} | ||
|
||
enum Nationality { | ||
SOUTH_KOREA = 'SOUTH_KOREA', | ||
JAPAN = 'JAPAN', | ||
CHINA = 'CHINA', | ||
VIETNAME = 'VIETNAME', | ||
UZBEKISTAN = 'UZBEKISTAN', | ||
} | ||
|
||
enum Visa { | ||
'D-2-1' = 'D-2-1', | ||
'D-2-2' = 'D-2-2', | ||
'D-2-3' = 'D-2-3', | ||
'D-2-4' = 'D-2-4', | ||
'D-2-6' = 'D-2-6', | ||
'D-2-7' = 'D-2-7', | ||
'D-2-8' = 'D-2-8', | ||
'D-4-1' = 'D-4-1', | ||
'D-4-7' = 'D-4-7', | ||
'F-2' = 'F-2', | ||
} | ||
|
||
enum Language { | ||
KOREAN = 'KOREAN', | ||
VIETNAMESE = 'VIETNAMESE', | ||
UZBEK = 'UZBEK', | ||
TURKISH = 'TURKISH', | ||
ENGLISH = 'ENGLISH', | ||
} | ||
|
||
// Type for user info with undefinedable fields | ||
export type UserInfo = { | ||
id: string | undefined; | ||
email: string | undefined; | ||
marketing_allow: boolean | undefined; | ||
first_name: string | undefined; | ||
last_name: string | undefined; | ||
gender: Gender | undefined; | ||
birth: string | undefined; // Format: yyyy/mm/dd | ||
nationality: Nationality | undefined; | ||
visa: Visa | undefined; | ||
phone_number: string | undefined; | ||
} | ||
|
||
// Type for address with undefinedable fields | ||
type Address = { | ||
address_name: string | undefined; | ||
region_1depth_name: string | undefined; | ||
region_2depth_name: string | undefined; | ||
region_3depth_name: string | undefined; | ||
region_4depth_name: string | undefined; | ||
address_detail: string | undefined; | ||
longitude: number | undefined; | ||
latitude: number | undefined; | ||
} | ||
|
||
// Main type for the API request body with undefinedable fields | ||
export type UserInfoRequestBody = { | ||
temporary_token: string | undefined; | ||
user_info: UserInfo; | ||
address: Address; | ||
language: Language | undefined; | ||
} | ||
|
||
// Initial state for UserInfo | ||
export const initialUserInfo: UserInfo = { | ||
id: undefined, | ||
email: undefined, | ||
marketing_allow: undefined, | ||
first_name: undefined, | ||
last_name: undefined, | ||
gender: undefined, | ||
birth: undefined, | ||
nationality: undefined, | ||
visa: undefined, | ||
phone_number: undefined, | ||
} | ||
|
||
// Initial state for Address | ||
export const initialAddress: Address = { | ||
address_name: undefined, | ||
region_1depth_name: undefined, | ||
region_2depth_name: undefined, | ||
region_3depth_name: undefined, | ||
region_4depth_name: undefined, | ||
address_detail: undefined, | ||
longitude: undefined, | ||
latitude: undefined, | ||
} | ||
|
||
// Initial state for UserInfoRequestBody | ||
export const initialUserInfoRequestBody: UserInfoRequestBody = { | ||
temporary_token: undefined, | ||
user_info: initialUserInfo, | ||
address: initialAddress, | ||
language: undefined, | ||
} |