Added state selector for world
This commit is contained in:
@@ -3,8 +3,8 @@ import type { CalendarEvent } from "./CalendarEvent"
|
||||
import { calendarMonthSchema, type CalendarMonth } from "./CalendarMonth"
|
||||
import { dateSchema, type RPGDate } from "./Date"
|
||||
import type { World } from "./World"
|
||||
import type { ContentState } from "./Entity"
|
||||
|
||||
export type CalendarState = "published" | "draft" | "archived"
|
||||
|
||||
export interface CalendarConfig {
|
||||
months: CalendarMonth[]
|
||||
@@ -17,7 +17,7 @@ export interface Calendar extends CalendarConfig {
|
||||
name: string
|
||||
events: CalendarEvent[]
|
||||
eventNb?: Array<{ count: number }>
|
||||
state: CalendarState
|
||||
state: ContentState
|
||||
color?: string
|
||||
world?: World
|
||||
createdAt?: string
|
||||
|
||||
2
models/Entity.ts
Normal file
2
models/Entity.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export const contentStates = ["published", "draft", "archived"] as const
|
||||
export type ContentState = typeof contentStates[number]
|
||||
@@ -1,8 +1,7 @@
|
||||
import { z } from "zod"
|
||||
import type { Calendar } from "./CalendarConfig"
|
||||
import { rpgColorSchema, type RPGColor } from "./Color"
|
||||
|
||||
export type WorldState = "published" | "draft" | "archived"
|
||||
import type { ContentState } from "./Entity"
|
||||
|
||||
export interface World {
|
||||
id?: number
|
||||
@@ -11,7 +10,7 @@ export interface World {
|
||||
color?: RPGColor
|
||||
calendars?: Calendar[]
|
||||
gmId?: string
|
||||
state?: WorldState
|
||||
state?: ContentState
|
||||
createdAt?: string
|
||||
updatedAt?: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user