Functionalities

Function definition#

This document, being a software-centric documentation, mostly describes the functionality of the system. Each function definition will be based of the following pattern:

Function name#

Self-explanatory.

Function description#

A brief description of the purpose of the function and what it does in layman's terms.

Function access#

Which users have the permission to operate the function. If omitted, the permission is inherited by the parent usertype section or, if not assigned to usertype, globally accessible. Make sure to check the introduction to each section in order to know if the accessibility is overridden. This section assumes that the user is authenticated by the system and, as such, the system knows what type of user the request belong to.

Function input#

The input that is permitted by the function. If not defined, an unexpected input will result in request rejection. If this section is omitted, then no input must be provided.

  • Input definition
    • Input type - One of the standard data types that exist in most programming languages which includes the following (for the sake of simplicity, the JavaScript data types will be used). If the type provided does not match the type expected, the request will be rejected.
    • Special note regarding EIDs
      • EIDs provided are expected to match the entity type that is expected. (Providing EIDs of clients when business EIDs are expected is invalid).
      • Unless explicitly stated, only admins can interact with deactivated entities.
    • Default value - Self-explanatory. If the input is omitted due to being optional. The default value will be used instead.
    • Validation - Rules that the specific input has to follow. View a list of standard validations below.
    • Localizable - Indicates that the input can be localized in different languages. ISO 639-1 codes will be used to indicate the language codes with Hebrew ("he") being the default and fallback in case other localizations are not available.
  • Additional validation - Additional rules that the provided input and/or the function activation in general has to follow which is not necessarily tied to any specific input. If there isn't any input but there are still validations to be performed. The input section is replaced by a "Validation" section.

Function mechanism#

Chronological series of actions that function operates.

  • The mechanism assumes that the input is valid.
  • Inputs will be referenced whenever relevant to a specific action.
  • Conditional actions will be indicated.
  • Output will not be mentioned explicitly unless the function manipulates it based on certain conditions.

Function output#

The data that the function returns after being activated. If this section is omitted, then no output will be provided.

Notes#

Self-explanatory.

View a sample of a function definition below


Input validations library#

Required#

The input must be provided. If omitted, the input is optional.

Maximum/Minimum (length/amount/size)#

The upper and lower bound length/amount/size of the given input. This, of course, depends on the data type of the input.


Special indications legend#

Indicating function inputs#

Function inputs will be highlighted like this: Function inputemail

Indicating values#

Values will be indicated like this: Valuetrue

Indicating entities#

Values will be indicated like this: business entityBusiness

Indicating entity properties#

Entity properties will be highlighted like this: Entity propertyaddress


General validations library#

Profile created#

The users must have created their profile before having access to this function. This generally means that the user must have a Entity propertyprofile created property is which is Valuetrue.

Notice!
  • For the sake of keeping the documentation lean, the following validations will remain implicit:
    • Ownership validation
      • If it makes no sense that a user has access to a certain resource, then assume they don't. Example: A client accessing a different clients' credit cards.
    • File validation
      • By default, files will be limited up to 5MB.
      • By default, files names will be limited to 100 characters.
      • Image files have the following allowed mimetypes:
        • PNG - "image/png"
        • JPG - "image/jpeg"
        • JPEG - "image/jpeg"

Sample function (Generate duckling)#

Description#

Generates a new duck ๐Ÿฆ†

Accessibility#

Only female ducks can activate this function.

Input#

  • Name
    • Type
      • String
    • Validation
      • Required
      • Minimum
        • 5
  • Sex
    • Type
      • Boolean
    • Validation
      • Required
  • Color
    • Type
      • Enum
        • Options type
          • String
        • Options
    • Default value
      • Yellow

Additional validation#

  • This function can only be activated by female ducks.
  • This function cannot be activated by a duck that's not pregnant for at least (insert some amount here).

Mechanism#

  1. Set the pregnant property of this duck to false
  2. Create a new duck entity using the provided input.
  3. Assign this duck as the parent of the duckling

Output#

img

(On a serious note), No output

Notes#

Caveats
  • Excessively using this function is probably not healthy for your duck.