1.0.4 • Published 5 years ago

appointment-module-prodio v1.0.4

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

appointment-module-prodio

appointment-module-prodio is an node js client for the appointment-services-prodio API.

Prerequisite (Things to do before installing this module):

  • Clone its dependency repository first on your server git clone https://github.com/ProdioDesignWorks/appointment-services-prodio.git
  • Navigate to your repo cd appointment-services-prodio
  • Install dependencies npm install
  • Start service node . or npm start or node server/server.js
  • Open http://localhost:3030/explorer/ in your browser
  • If you've pm2 installed then use this pm2 start server/server.js --name="APPOINTMENT_SERVICE"
  • When you install appointment-module-prodio, it will ask question for the BASE_URL of this APPOINTMENT_SERVICE - eventually.

Features!

Functions

  • Add/Edit Business Site

  • Add/Edit Services

  • Add/Edit Service Providers

  • Add/Edit Clients

  • Book Appointment

  • Reschedule Appointment

  • Cancel Appointment

  • Edit Appointment

  • List Appointments

  • Get Appointment Details

  • Search/Filter Appointments

  • TimeSlot Settings

Installation

$ npm install appointment-module-prodio@latest --save

Initialization

Require the appointment-module-prodio module and initialize the appointment npm module client.

 const appointmentClass = require('appointment-module-prodio');
 const appointmentObj = new appointmentClass(BASE_URL); //BASE_URL => is the url where its loopback apis are running. eg.

Method

1. ADD BUSINESS SITE:

This will create new business site.

Payload

KeyTypeValueDescriptionRequired
actionstringADD_BIZ_SITEkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

Example

	const payload = {
	    "action": "ADD_BUSINESS_SITE",
	    "meta": SAMPLE_META_INFO
	};
	//create business in appointment module
	paymentObj.execute(payload, function(response) {
	    if (typeof response == "string" || typeof response === "string") {
	        response = JSON.parse(response);
	    }

	    if (!isNull(response.data)) {
	        let serverResponse = response["data"];
	        if (typeof serverResponse == "string" || typeof serverResponse === "string") {
	            serverResponse = JSON.parse(response["data"]);
	        }

	        if (!isNull(serverResponse.error)) {
	            //Error Response
	            return cb(new HttpErrors.InternalServerError(response.data.error.message, {
	                expose: false
	            }));
	        } else {
	            // HTTP : 200 , Success Response , Merchant Successfully Created!!
	            return cb(null, response.data);
	        }
	    } else {
	        if (!isNull(response["response"])) {
	            let serverResponse = response["response"]["data"];
	            if (typeof serverResponse == "string" || typeof serverResponse === "string") {
	                serverResponse = JSON.parse(response["response"]["data"]);
	            }

	            let serverResponseError = serverResponse["error"];
	            if (typeof serverResponseError == "string" || typeof serverResponseError === "string") {
	                serverResponseError = JSON.parse(serverResponseError["error"]);
	            }

	            let _msg = isNull(serverResponseError["message"]) ? 'Internal Server Error' : serverResponseError["message"];

	            //Error Response
	            return cb(new HttpErrors.InternalServerError(_msg, {
	                expose: false
	            }));
	        } else {
	            let _msg = isNull(response["data"]["message"]) ? 'Internal Server Error' : response["data"]["message"];

	            //Error Response
	            return cb(new HttpErrors.InternalServerError(_msg, {
	                expose: false
	            }));
	        }
	    }
	});

2. EDIT BUSINESS SITE:

This will edit the business site.

Payload

KeyTypeValueDescriptionRequired
actionstringEDIT_BIZ_SITEkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

3. ADD BUSINESS SERVICE:

This will create new service provided by business site.

Payload

KeyTypeValueDescriptionRequired
actionstringADD_BIZ_SERVICEkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

4. EDIT BUSINESS SERVICE:

This will create new service provided by business site.

Payload

KeyTypeValueDescriptionRequired
actionstringEDIT_BIZ_SERVICEkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

5. ADD BUSINESS SERVICE PROVIDER:

This will create new service provided by business site.

Payload

KeyTypeValueDescriptionRequired
actionstringADD_BIZ_SERVICEPROVIDERkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

6. EDIT BUSINESS SERVICE PROVIDER:

This will create new service provided by business site.

Payload

KeyTypeValueDescriptionRequired
actionstringEDIT_BIZ_SERVICEPROVIDERkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

7. ADD BUSINESS CLIENT:

This will create new client for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringADD_BIZ_CLIENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

8. EDIT BUSINESS CLIENT:

This will create new client for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringEDIT_BIZ_CLIENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

9. LIST CLIENTS:

This will create new client for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringLIST_BIZ_CLIENTSkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

10. REMOVE CLIENTS FROM SITE:

This will create new client for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringREMOVE_BIZ_CLIENTSkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

11. LIST SERVICE PROVIDERS:

This will create new client for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringLIST_BIZ_SERVICEPROVIDERSkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

12. REMOVE SERVICE PROVIDERS FROM SITE:

This will create new client for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringREMOVE_BIZ_SERVICEPROVIDERSkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

13. BOOK APPOINTMENT:

This will create new appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringBOOK_APPOINTMENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

14. EDIT APPOINTMENT:

This will edit appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringEDIT_APPOINTMENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

15. RESCHEDULE APPOINTMENT:

This will edit appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringRESCHEDULE_APPOINTMENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

16. CANCEL APPOINTMENT:

This will edit appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringCANCEL_APPOINTMENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

17. DELETE APPOINTMENT:

This will edit appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringDELETE_APPOINTMENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

18. CONFIRM APPOINTMENT:

This will mark confirm the appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringCONFIRM_APPOINTMENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

19. LIST APPOINTMENTS:

This will list appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringLIST_APPOINTMENTSkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

20. LIST APPOINTMENTS BY SERVICE:

This will list appointment for business site of particular service.

Payload

KeyTypeValueDescriptionRequired
actionstringLIST_APPOINTMENTS_BY_SERVICEkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

21. GET SERVICE PROVIDER CALENDAR:

This will edit appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringGET_SERVICEPROVIDERS_CALENDARkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

22. GET APPOINTMENTS CALENDAR:

This will edit appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringGET_APPOINTMENTS_CALENDARkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

23. GET APPOINTMENT DETAILS:

This will give a appointment details for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringGET_APPOINTMENT_DETAILSkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES

24. COMPLETE APPOINTMENT:

This will mark complete appointment for business site.

Payload

KeyTypeValueDescriptionRequired
actionstringCOMPLETE_APPOINTMENTkey which defines the type of action to be performedYES
metajsonSAMPLE_META_INFOJson having business details.YES
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

0.0.17

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago