github.com/lauslim12/expert-systems@v0.0.0-20221115131159-018513aad29c/web/src/types/Response.ts (about)

     1  /**
     2   * Core data from the API to be read in the front-end.
     3   */
     4  type Inferred = {
     5    verdict: boolean;
     6    probability: number;
     7    disease: {
     8      id: string;
     9      name: string;
    10      description: string;
    11      treatment: string;
    12      prevention: string;
    13      source: {
    14        name: string;
    15        link: string;
    16      }[];
    17      symptoms: {
    18        symptomId: string;
    19        weight: number;
    20      }[];
    21    };
    22  };
    23  
    24  /**
    25   * Data type to represent the response from the API.
    26   */
    27  type Response = {
    28    code: number;
    29    message: string;
    30    status: 'success' | 'fail';
    31    data?: Inferred;
    32  };
    33  
    34  export default Response;