diff --git a/src/domains/Province.ts b/src/domains/Province.ts new file mode 100644 index 0000000..96241de --- /dev/null +++ b/src/domains/Province.ts @@ -0,0 +1,13 @@ +export type Province = { + id: number, + province_name: string, + region_id: number +} + +export function emptyProvince(): Province { + return { + id: 0, + province_name: '', + region_id: 0 + } +} \ No newline at end of file diff --git a/src/domains/Regency.ts b/src/domains/Regency.ts new file mode 100644 index 0000000..0f8c915 --- /dev/null +++ b/src/domains/Regency.ts @@ -0,0 +1,13 @@ +export type Regency = { + id: number, + regency_name: string, + province_id: number +} + +export function emptyRegency(): Regency { + return { + id: 0, + province_id: 0, + regency_name: '' + } +} \ No newline at end of file diff --git a/src/domains/Region.ts b/src/domains/Region.ts new file mode 100644 index 0000000..397193f --- /dev/null +++ b/src/domains/Region.ts @@ -0,0 +1,4 @@ +export type Region = { + id: number, + region_name: string +} \ No newline at end of file diff --git a/src/domains/User.ts b/src/domains/User.ts new file mode 100644 index 0000000..bd1aeda --- /dev/null +++ b/src/domains/User.ts @@ -0,0 +1,34 @@ +import { NullValueRes } from "../types/common"; + +export type User = { + id: number, + email: string, + username: string, + avatar_picture: string, + banned_at: NullValueRes<"Time", string>, + banned_until: NullValueRes<"Time", string>, + ban_reason: string, + is_permaban: boolean, + is_admin: boolean, + is_critics: boolean, + is_verfied: boolean, + social_media: NullValueRes<"RawMessage", any> +} + + +export function emptyUser(): User { + return { + avatar_picture: '', + ban_reason: '', + banned_at: { Time: '', Valid: false}, + banned_until: { Time: '', Valid: false}, + email: '', + id: 0, + is_admin: false, + is_critics: false, + is_permaban: false, + is_verfied: false, + social_media: {RawMessage: '', Valid: false}, + username: '' + } +} \ No newline at end of file diff --git a/src/domains/index.ts b/src/domains/index.ts new file mode 100644 index 0000000..c822618 --- /dev/null +++ b/src/domains/index.ts @@ -0,0 +1,18 @@ +import { LocationInfo } from "./LocationInfo" +import { Province, emptyProvince } from "./Province" +import { Regency, emptyRegency } from "./Regency" +import { User } from './User'; +import { Region } from "./Region" + +export type { + LocationInfo, + Province, + Regency, + Region, + User, +} + +export { + emptyProvince, + emptyRegency +} \ No newline at end of file diff --git a/src/features/auth/authSlice/type.ts b/src/features/auth/authSlice/type.ts deleted file mode 100644 index 6598389..0000000 --- a/src/features/auth/authSlice/type.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface IUser { - id: Number, - email: String, - username: String, - avatar_picture: String, - banned_at: NullValueRes<"Time", String>, - banned_until: NullValueRes<"Time", String>, - ban_reason: String, - is_permaban: boolean, - is_admin: boolean, - is_critics: boolean, - is_verfied: boolean, - social_media: NullValueRes<"RawMessage", any> -} \ No newline at end of file