Skip to content

Instantly share code, notes, and snippets.

@bigslycat
Forked from oonsamyi/MISResponse.js
Last active April 25, 2017 10:57
Show Gist options
  • Select an option

  • Save bigslycat/8491218d8222ee92393a5213900916cb to your computer and use it in GitHub Desktop.

Select an option

Save bigslycat/8491218d8222ee92393a5213900916cb to your computer and use it in GitHub Desktop.

Revisions

  1. bigslycat revised this gist Apr 25, 2017. 1 changed file with 77 additions and 70 deletions.
    147 changes: 77 additions & 70 deletions MISResponse.js
    Original file line number Diff line number Diff line change
    @@ -1,87 +1,94 @@
    /* @flow */

    export type ResponseError = {
    success: false,
    message: string,
    };

    export type GetClientByBarcode = {
    success: boolean;
    message?: string;
    result?: {
    id: string;
    barcode: string;
    isDms: boolean;
    isChild: boolean;
    hasDebt: boolean;
    phone: number;
    firstName: string;
    middleName?: string;
    lastName: string;
    };
    success: true,
    result: {
    id: string,
    barcode: string,
    isDms: boolean,
    isChild: boolean,
    hasDebt: boolean,
    phone: number,
    firstName: string,
    middleName?: string,
    lastName: string,
    },
    };

    export type OpenVisitByClientId = {
    success: boolean;
    message?: string;
    result?: {
    cardId: string;
    date: string;
    discount: string;
    payType: string;
    payTypeRemain: string;
    success: true,
    result: {
    cardId: string,
    date: string,
    discount: string,
    payType: string,
    payTypeRemain: string,
    records: Array<{
    cabinet: string;
    time: string;
    specialty: string;
    doctor: string;
    }>;
    };
    cabinet: string,
    time: string,
    specialty: string,
    doctor: string,
    }>,
    },
    };

    export type Services = Array<{
    id: string;
    type: string;
    name: string;
    date: string;
    doctor: string;
    sum: number;
    documentId?: string;
    id: string,
    type: string,
    name: string,
    date: string,
    doctor: string,
    sum: number,
    documentId?: string,
    }>;

    export type GetServicesByClientId = {
    success: boolean;
    message?: string;
    result?: {
    debt: Services;
    rendered: Services;
    unpaid: Services;
    };
    success: true,
    result: {
    debt: Services,
    rendered: Services,
    unpaid: Services,
    },
    };

    export type MakePayment = {
    success: boolean;
    message?: string;
    result?: {
    payDocumentId: string;
    sum: number;
    success: true,
    result: {
    payDocumentId: string,
    sum: number,
    debt: Array<{
    id: string;
    type: string;
    name: string;
    date: string;
    doctor: string;
    sum: number;
    }>;
    id: string,
    type: string,
    name: string,
    date: string,
    doctor: string,
    sum: number,
    }>,
    rendered: Array<{
    id: string;
    type: string;
    name: string;
    date: string;
    doctor: string;
    sum: number;
    }>;
    id: string,
    type: string,
    name: string,
    date: string,
    doctor: string,
    sum: number,
    }>,
    unpaid: Array<{
    id: string;
    type: string;
    name: string;
    date: string;
    doctor: string;
    sum: number;
    }>;
    };
    id: string,
    type: string,
    name: string,
    date: string,
    doctor: string,
    sum: number,
    }>,
    },
    };

    export type ConfirmPayment = {
    success: boolean;
    message?: string;
    success: true,
    result: {},
    };
  2. @oonsamyi oonsamyi created this gist Apr 25, 2017.
    87 changes: 87 additions & 0 deletions MISResponse.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,87 @@
    export type GetClientByBarcode = {
    success: boolean;
    message?: string;
    result?: {
    id: string;
    barcode: string;
    isDms: boolean;
    isChild: boolean;
    hasDebt: boolean;
    phone: number;
    firstName: string;
    middleName?: string;
    lastName: string;
    };
    };
    export type OpenVisitByClientId = {
    success: boolean;
    message?: string;
    result?: {
    cardId: string;
    date: string;
    discount: string;
    payType: string;
    payTypeRemain: string;
    records: Array<{
    cabinet: string;
    time: string;
    specialty: string;
    doctor: string;
    }>;
    };
    };
    export type Services = Array<{
    id: string;
    type: string;
    name: string;
    date: string;
    doctor: string;
    sum: number;
    documentId?: string;
    }>;

    export type GetServicesByClientId = {
    success: boolean;
    message?: string;
    result?: {
    debt: Services;
    rendered: Services;
    unpaid: Services;
    };
    };
    export type MakePayment = {
    success: boolean;
    message?: string;
    result?: {
    payDocumentId: string;
    sum: number;
    debt: Array<{
    id: string;
    type: string;
    name: string;
    date: string;
    doctor: string;
    sum: number;
    }>;
    rendered: Array<{
    id: string;
    type: string;
    name: string;
    date: string;
    doctor: string;
    sum: number;
    }>;
    unpaid: Array<{
    id: string;
    type: string;
    name: string;
    date: string;
    doctor: string;
    sum: number;
    }>;
    };
    };
    export type ConfirmPayment = {
    success: boolean;
    message?: string;
    };