server/src/Entity/customer.js
/**
    * method to add customer pet details.
    * @param petType
    * @param petName
    * @param breed
    * @param age
    * @param ageMonth
    * @param sex
    * @param weight
    * @returns {Promise<unknown>}: 1 if complete else -1
    */
method to add customer pet details.
method to add customer pet details .
addCustomerPetDetails(petType, petName, breed, age, ageMonth, sex, weight) {
      return new Promise((resolve, reject) => {
         database.runSp(constants.SP_CREATE_CUSTOMER_PET_DETAILS,
            [this._id, petType, petName, breed, age, ageMonth, sex, weight]).then(_resultSet => {
            const result = _resultSet[0][0];
            if (validators.validateUndefined(result))
               resolve(result);
            else
               resolve({"id": -1})
         }).catch(err => {
            printer.printError(err);
            reject(err);
         })
      });
   }
addCustomerPetDetails ( petType , petName , breed , age , ageMonth , sex , weight ) { return new Promise ( ( resolve , reject ) => { database . runSp ( constants . SP_CREATE_CUSTOMER_PET_DETAILS , [ this . _id , petType , petName , breed , age , ageMonth , sex , weight ] ) . then ( _resultSet => { const result = _resultSet [ 0 ] [ 0 ] ; if ( validators . validateUndefined ( result ) ) resolve ( result ) ; else resolve ( { "id" : - 1 } ) } ) . catch ( err => { printer . printError ( err ) ; reject ( err ) ; } ) } ) ; }
method to add customer pet details.
method to add customer pet details .