Programming Standards
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
<syntaxhighlight lang="javascript" line>
async request(params, { transition = false, showMsg = true, setStatus = undefined, fullResponse = false } = {}) {
if (transition) this.transition.display(true);
params.sessionDetails = this.getSessionDetails();
const serverResponse = await httpRequest(params, setStatus, REQUEST_BRIDGE_SERVICE);
this.setAlertTimeout();
this.handleUserFeedback(serverResponse, showMsg);
if (transition) this.transition.display(false);
if (!serverResponse?.success) console.error(serverResponse?.errorMsg ?? 'Backend service NULL');
return serverResponse?.success
? Promise.resolve(fullResponse
? serverResponse
: serverResponse.response)
: Promise.reject(serverResponse);
}
</syntaxhighlight>