SolidX
TutorialSchool Fees Portal RevampedData Modeling

Institute Model

Business Purpose: Represents an educational institution that will use the platform. It stores details like the institute's name, branding, contact information, and payment gateway configuration. This is the central model to which most other data in this module will be linked.

Fields:

Field NameTypeDescription
instituteNameshortTextThe official name of the institute. Marked as the user key.
logomediaSingleThe institute's logo for branding.
descriptionlongTextA brief description of the institute.
paymentGatewayMerchantIdshortTextMerchant ID for the payment gateway.
paymentGatewayAccessKeyshortTextAccess key for the payment gateway.
paymentGatewayAccessSecretshortTextSecret key for the payment gateway.
instituteAddresslongTextThe physical address of the institute.
feeTypesrelationOne-to-many relationship with Fee Types.
instituteUsersrelationOne-to-many relationship with Institute Users.
instituteBrochuremediaSingleA brochure or informational document.
instituteIntroVideomediaSingleAn introductory video for the institute.
supportEmailshortTextEmail address for support queries.
supportMobileshortTextMobile number for support queries.
gstshortTextGST number of the institute.
tnCrichTextTerms and Conditions for the institute.
faqsrichTextFrequently Asked Questions.
privacyPolicyrichTextThe institute's privacy policy.
emailDomainshortTextThe official email domain of the institute.
custUserIdshortTextCustomer User ID for the institute.

Key Fields Explained

  • instituteName (User Key): This field is marked as the "User Key" (isUserKey: true). This means it's the primary human-readable identifier for an institute record. It must be unique.

  • paymentGateway... fields: These fields store the credentials for the institute's specific payment gateway account. This allows the platform to process payments on behalf of each institute securely.

  • feeTypes & instituteUsers (Inverse Relations): These fields represent the "one-to-many" side of a relationship. It's important to understand that you do not create these fields directly on the Institute model. Instead, they are automatically generated by SolidX.

    When you create the FeeType and InstituteUser models later in this tutorial, you will define a many-to-one relationship from them to the Institute model. By enabling the relationCreateInverse option on those fields, you instruct SolidX to automatically add the corresponding feeTypes (a list of FeeType records) and instituteUsers (a list of InstituteUser records) fields to this Institute model. This creates a bi-directional link, allowing you to easily navigate from an institute to all its associated fee types or users, and vice-versa.

Creation Steps

If you are following the manual "Guided Tour", follow these steps to create the Institute model in the App Builder.

  1. Navigate to Fees Portal > App Builder > Model and click Add.
  2. Fill in the primary details for the model:
    • Singular Name: institute
    • Plural Name: institutes
    • Display Name: Institute
  3. Go to the Fields tab.
  4. Click Add Field and create each field exactly as defined in the table above. Pay close attention to the Field Name and Type.
  5. Click Save.

Tip After you have created all the models for this module, you will need to run the code generation step again to create the files for them.

For the Fast Track: Model Metadata The JSON block below contains the complete metadata definition for the Institute model.

This definition is structured with top-level properties for the model itself (like singularName, pluralName, tableName) and a fields array that defines every attribute you see in the table above.

You can use this metadata as part of the "Fast Track" approach by including it in the main fees-portal-metadata.json file.

{
  "singularName": "institute",
  "pluralName": "institutes",
  "displayName": "Institute",
  "description": "The institute name...",
  "dataSource": "default",
  "dataSourceType": "postgres",
  "tableName": "fees_portal_institute",
  "userKeyFieldUserKey": "instituteName",
  "isChild": false,
  "enableAuditTracking": true,
  "enableSoftDelete": false,
  "draftPublishWorkflow": false,
  "internationalisation": false,
  "fields": [
    {
      "name": "instituteName",
      "displayName": "Institute Name",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": true,
      "unique": true,
      "index": true,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": true,
      "enableAuditTracking": true
    },
    {
      "name": "logo",
      "displayName": "Logo",
      "description": null,
      "type": "mediaSingle",
      "ormType": "varchar",
      "isSystem": false,
      "mediaTypes": [
        "image"
      ],
      "mediaMaxSizeKb": 5120,
      "required": true,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "mediaStorageProviderUserKey": "default-aws-s3"
    },
    {
      "name": "description",
      "displayName": "Description",
      "description": null,
      "type": "longText",
      "ormType": "text",
      "isSystem": false,
      "regexPattern": "",
      "regexPatternNotMatchingErrorMsg": "",
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null
    },
    {
      "name": "paymentGatewayMerchantId",
      "displayName": "Cust Code",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": true,
      "unique": true,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": false,
      "enableAuditTracking": true
    },
    {
      "name": "paymentGatewayAccessKey",
      "displayName": "Access Key",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": true,
      "unique": true,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": false,
      "enableAuditTracking": true
    },
    {
      "name": "paymentGatewayAccessSecret",
      "displayName": "Access Secret",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": true,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": false,
      "enableAuditTracking": true
    },
    {
      "name": "instituteAddress",
      "displayName": "Institute Address",
      "description": null,
      "type": "longText",
      "ormType": "text",
      "isSystem": false,
      "regexPattern": "",
      "regexPatternNotMatchingErrorMsg": "",
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null
    },
    {
      "name": "instituteBrochure",
      "displayName": "Institute Brochure",
      "description": null,
      "type": "mediaSingle",
      "ormType": "varchar",
      "isSystem": false,
      "mediaTypes": [
        "file"
      ],
      "mediaMaxSizeKb": 5120,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "mediaStorageProviderUserKey": "default-aws-s3"
    },
    {
      "name": "instituteIntroVideo",
      "displayName": "Institute Intro Video",
      "description": null,
      "type": "mediaSingle",
      "ormType": "varchar",
      "isSystem": false,
      "mediaTypes": [
        "video"
      ],
      "mediaMaxSizeKb": 5120,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "mediaStorageProviderUserKey": "default-filesystem"
    },
    {
      "name": "supportEmail",
      "displayName": "Support Email",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": true,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": false,
      "enableAuditTracking": true
    },
    {
      "name": "supportMobile",
      "displayName": "Support Mobile",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": 10,
      "max": 10,
      "required": true,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": false,
      "enableAuditTracking": true
    },
    {
      "name": "gst",
      "displayName": "GST",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": false,
      "enableAuditTracking": true
    },
    {
      "name": "tnC",
      "displayName": "Terms and Conditions",
      "description": null,
      "type": "richText",
      "ormType": "text",
      "isSystem": false,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null
    },
    {
      "name": "faqs",
      "displayName": "FAQS",
      "description": null,
      "type": "richText",
      "ormType": "text",
      "isSystem": false,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null
    },
    {
      "name": "privacyPolicy",
      "displayName": "Privacy Policy",
      "description": null,
      "type": "richText",
      "ormType": "text",
      "isSystem": false,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null
    },
    {
      "name": "emailDomain",
      "displayName": "Email Domain",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": false,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": false,
      "enableAuditTracking": true
    },
    {
      "name": "custUserId",
      "displayName": "Cust UserID",
      "description": null,
      "type": "shortText",
      "ormType": "varchar",
      "isSystem": false,
      "defaultValue": null,
      "min": null,
      "max": null,
      "required": true,
      "unique": false,
      "index": false,
      "private": false,
      "encrypt": false,
      "encryptionType": null,
      "decryptWhen": null,
      "columnName": null,
      "isUserKey": false,
      "enableAuditTracking": false
    }
  ]
}