XPEHO / XpeApp

BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Front - V1 - iOS - Get the form from the Wordpress #70

Open MayuriXx opened 6 months ago

MayuriXx commented 6 months ago

• Get the form in the wordpress • Create the different components


Edit(Loucas):

User story: As a XPEHO employee, I want to be able to answer QVST forms so that my opinions are taken into account. I want to clearly see which questions I've already answered so that I don't waste time.

Acceptance Criteria:

Priority: High

Steps to follow:


lcubeddu commented 1 month ago

Current progress visually

There is the prerequisite of having the userId

See the questions

Questions of campaign {id} for user {userId}

Endpoint: xpeho/v1/qvst/campaigns/{Id}/questions Verb: GET Header: userId: {userId} Example Type:

struct QvstAnswer: Codable {
    let id: String
    let answer: String
    let value: String
}

struct QvstQuestion: Codable {
    let questionId: String
    let question: String
    let hasAnswered: Bool
    let answers: [QvstAnswer]
    var userAnswer: String?

    enum CodingKeys: String, CodingKey {
        case questionId = "question_id"
        case question
        case hasAnswered
        case answers
        case userAnswer
    }
}

Answer the questions

Answer campaign {id}'s question {questionId} with answer {answerId} as user {userId}

Endpoint: xpeho/v1/qvst/campaigns/{id}/questions:answer Verb: POST Header: userId: {userId} Example Type:

struct QvstAnswerBody: Codable {
    let questionId: String
    let answerId: String

    enum CodingKeys: String, CodingKey {
        case questionId = "question_id"
        case answerId = "answer_id"
    }
}