Programming Standards

From Seedbury Square
Revision as of 17:51, 31 March 2025 by Jcm-seedburry (talk | contribs) (.)

Naming Convention

Constants

ROW_VALUE_DESCRIPTION_COLUMN_NAME_TABLE_NAME

COFI

  • ObjectType
- DESCRIPTION_EN_OBJECT_TYPE_CODE
  • [Table]Type
DESCRIPTION_EN_[TABLENAME]_TYPE_CODE
i.e (FileType - MotionType - Code MOTION_FILE_TYPE_CODE)

Handling Service Response

Standards how to handle service response.

SUMAC

Every main in any app will have algo asi:

async request(params, { transition = false, showMsg = true, setStatus = undefined, fullResponse = false } = {}) {
       const serverResponse = await httpRequest(params, setStatus, REQUEST_BRIDGE_SERVICE);
       if (!serverResponse?.success) console.error(serverResponse?.errorMsg ?? 'Backend service NULL');
       return serverResponse?.success
           ? Promise.resolve(fullResponse
               ? serverResponse
               : serverResponse.response)
           : Promise.reject(serverResponse);
   }

Por eso in the services should be handled like this:

[service]

   .then((response) => {
       // Handle successful service
   })
   .catch((err) => {
       console.log("Error: ", err);
       // Handle not successful service
   });