Coder Social home page Coder Social logo

ic-surveys-ios's Introduction

Hi there ๐Ÿ‘‹

ic-surveys-ios's People

Contributors

chiiida avatar

Watchers

 avatar  avatar  avatar

ic-surveys-ios's Issues

[Backend] As a user, I can invoke API to sign in

Why

  • Initiate the authentication in order to retrieve an access token and a refresh token

Acceptance Criteria

  • Call API endpoint /api/v1/oauth/token with the body:
{
    "grant_type": "password",
    "email": "{{email}}",
    "password": "{{password}}",
    "client_id": "{{client_id}}",
    "client_secret": "{{client_secret}}"
}

[Chore] Setup UI test

Why

  • UI test is required.
  • Setting UI test on the CI might take a long time, so it should be able to run on locally first.

Acceptance Criteria

  • Can run UI test locally

[UI] As a user, I can see error banner

Why

  • To show error banner when failure occur
  • This is not required in the design but it better to show feedback when failure occur

Acceptance Criteria

  • Show error message
  • Show error banner and fade out after 1 second

[Chore] Add IQKeyboardManager to the project

Why

  • Keyboard on the app needs toolbar buttons to allow users to end editing text and move to the next or previous field easier.

Acceptance Criteria

  • IQKeyboardManager library is added
  • Keyboard on the app has done, previous, and next actions.

[Chore] Setup base API service

Why

  • Need an API service to handle the response from API call

Acceptance Criteria

On success:

  • Map to model object

On failure:

  • Map error detail from response to APIError model

[Chore] Add unit test for Login Module

Why

  • Login module needs unit tests

Acceptance Criteria

  • Implement unit test for LoginModule
  • Implement unit test for LoginRouter
  • Implement unit test for LoginPresenter
  • Implement unit test for LoginInteractor
  • Implement unit test for LoginViewController
  • Tests passed

[UI] As a logged in user, I can see Survey Question Screen

Why

  • We need a screen to show questions for the user to complete them.

Acceptance Criteria

  • Show question
  • Show answer (with different type)
  • Show quit survey button
  • Show go to next question button
  • Show Submit button on the last question

Screen Shot 2021-06-21 at 6 07 16 PM

Screen Shot 2021-06-21 at 6 07 30 PM

[UI] As a logged in user, I can see Home Screen

Why

Allow user to see Home screen after login

Acceptance Criteria

  • Show the header
    • Show current date
    • Show user's avatar
  • Show navigation indicator
  • Show survey card
    • Show survey's cover image
    • Show survey's title
    • Show survey's description
  • Show the next circle button
  • User can swipe left or right to see more surveys

Screen Shot 2021-06-08 at 11 57 27 PM

[Chore] Setup Data Layer

Why

  • BaseAPI don't have user session to manage the user credential yet
  • We need to store shared data and user session so that we can use user credential when make an API call

Acceptance Criteria

  • Implement Keychain and User Session
  • Change to use Keychain to access and store local storage instead of UserDefaults
  • Refactor AuthToken (consider rename and/or refactor model)
  • Update BaseAPI

[Bug] Wrong id type for API response object

Issue

id in Session object should be string based on API response, which make request failure
Screen Shot 2021-06-22 at 1 22 16 PM

Expected

id in Session object should be update to string type

struct Session: Codable {
    
    enum CodingKeys: String, CodingKey {
        case id, type
        case userCredential = "attributes"
    }
    
    let id: String?
    let type: String?
    let userCredential: UserCredential?
}

Steps to reproduce

  1. Login from the Login Screen
  2. Error banner show message Failed to login

[Chore] Update README.md

Why

  • README.md needs an update to provide the prerequisites, installation steps, and running test steps.

Acceptance Criteria

  • README.md updated with necessary information.

[Backend] As a logged in user, I can submit survey questions

Why

  • The user must be able to submit the answer for survey questions

Acceptance Criteria

  • Make a request with post method to API endpoint /api/v1/responses with body:
{
    "survey_id": "survey_id",
    "questions": [
        {
            "id": "question_id",
            "answers": [
                {
                    "id": "answer_id"
                }
            ]
        },
        {
            "id": "question_id",
            "answers": [
                {
                    "id": "answer_id",
                    "answer": "My answer"
                }
            ]
        }
    ]
}

[Integration] As a user, I can see Splash Screen and move to next screen

Why

  • When open the app, the user will see Splash Screen first and then move the next screen (Login Screen or Home Screen).

Acceptance Criteria

  • If the user didn't login
    • Move to Login Screen.
    • Show Nimble logo with move up and reduce size animation while changing screen.
  • If the user already login
    • Move to Home Screen.

[Chore] Add unit test for Splash module

Why

  • Login module needs unit tests

Acceptance Criteria

  • Implement unit test for SplashModule
  • Implement unit test for SplashRouter
  • Implement unit test for SplashPresenter
  • Implement unit test for SplashInteractor
  • Implement unit test for SplashViewController
  • Tests passed

[Backend] As a logged in user, I can renew an access token

Why

  • When the access token is expired and in order to renew an access token, the app must renew it with a refresh token.

Acceptance Criteria

  • Use a refresh token to call API endpoint /api/v1/oauth/token to retrieve a new access token with the body:
{
    "grant_type": "refresh_token",
    "refresh_token": {{refresh_token}},
    "client_id": "{{client_id}}",
    "client_secret": "{{client_secret}}"
}
  • After successful request, update an access and a refresh token in local storage.

[Chore] Setup CD pipeline

Why

  • No manual execution of releases

Acceptance Criteria

  • CD pipeline is run on Github Action
  • CD pipeline run to build a staging version and upload to Firebase Distribution

[Integrate] As a user, I can see the Survey Questions Screen

Why

  • We need a screen to show questions for the user to complete them.
  • We need to show survey questions from the API

Acceptance Criteria

The list of questions must be implemented based on the API response with paginations:

  • Each question type has a different layout and UI which must be respected.
  • A user can scroll the next question using a horizontal swipe gesture.
  • Allow users to select a response and store the selected responses.
  • At the end of the survey, submit all answers.

[Integration] As a user, I can sign in and go to home screen

Why

  • Allow users to go to home screen after sign in

Acceptance Criteria

  • Users can sign in and go to home screen
  • After successful login then store access and refresh token to local storage
  • Show error banner when failed to login or invalid email

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.