Skip to content

frontend data scheme

Teihong93 edited this page Nov 28, 2019 · 4 revisions

data types - question

updated

  • 2019-11-27 by hkwon
  • 2019-11-28 by teihong93
const question = {
    id: ID,
    eventId: ID,
    userName: String, ==> join 으둜 κ°€μ Έμ˜΄
    guestId: ID,
    hostId: ID?,
    date: Date,
    question: String,
    isAnonymous: Boolean, ==> Guest table에 좔가함
    status: String, ==> Question table에 "state" 둜 μ €μž₯λ˜μ–΄ μžˆμœΌλ―€λ‘œ codeμ—μ„œλ„ state 둜 변경함
    isStared: Boolean, ==> Question table에 좔가함
    isShowEditButton: Boolean, ==> join 으둜 κ°€μ Έμ˜΄
    isLike: Boolean, ==> join 으둜 κ°€μ Έμ˜΄
    likeCount: Number, ==> join 으둜 κ°€μ Έμ˜΄
    emoji:[emoji],
    reply:[reply]
}

graphQl κ΅¬ν˜„μ²΄

type Question {
	id: Int!
	eventId: Int!
	guestName: String!
	guestUuid: ID!
	date: String!
	content: String!
	isAnonymous: Boolean!
	state: String!
	isStared: Boolean!
	isLike: Boolean!
	likeCount: Int!
	emojis: [Emoji]!
	replies: [Question]!
}

data types - emoji

const emoji ={
    id:ID,
    name:String,
    count:Number,
    didIPicked:Boolean
    questionId:ID,
    userId:ID
}

graphQl κ΅¬ν˜„μ²΄

type Emoji {
	id: Int!
	emojiName: String!
	count: Int!
	questionId: Int!
	guestId: ID!
	didIPicked: Boolean!
}

data types - reply

const reply = {
    id:ID,
    userId:ID
    questionId:ID
    contents:ID
    emojis : [emoji]
    likes: [likes]
    date:Date
}

data types - event

const event = {
    id:ID
    eventName: String,
	startDate: Date,
	endDate: Date,
	hashTags: ["λΆ€μŠ€νŠΈμΊ ν”„", "μžλ°”μŠ€ν¬λ¦½νŠΈ"],
	eventLink: String,
	eventCode: String,
    allowReply: true,
	anonymousReply: false,
	closeQuestion: false,
	showPollsNum: true,
	showPollResultAsRate: false,
};

data types - polls

// poll 데이터
const NItemPoll =
    {
        pollId: ID!,
        pollName: String,
        pollType: oneof(["NItems", "rating"]),
        selectionType: oneof(["text", "date"]),
        allowDuplication: Boolean,
        pollDate: Date,
        isActive: Boolean,
        totalVoters: Number,
        candidates: [candadiate],
    }

const ratingPoll =   {
        pollId: ID!,
        pollName: "λ§ˆμŠ€ν„° κ°•μ˜ 평가",
        pollType: "rating",
        allowDuplication: Boolean,
        pollDate: Date,
        isActive: Boolean,
        totalVoters: Number,
        maxStars: Number,
        rating: Number,
        didIRated:Boolean,
        ],
    },

data types - candadate

const candidate = {
    id: ID,
    cadidateOrder: Number,
    title: String,
    numberOfvoters: Number,
    didIvoted: Boolean,
};

data types - vote

const vote = {
    id:ID,
    guestId:ID
    candidate:ID
}

data types - likes

const likes = {
    id: ID ? questionId : ID,
    guestId: ID,
};

data types - hashTag

const hashTag = {
    id:ID,
    eventId:ID
    name:String

}
Clone this wiki locally