
{
    "modelSettings" : {
      "context" : "user",
      "userType": "", 
      "strictModel" : false,
      "modelName" : "purchaseOrder",
      "service" : "payments",
      "access_roles" : {"admin": ["READ", "ALL"], "owner": ["WRITE"]},
      "controlAccess" : false,
      "encryptedModels" : []
    },
  
    "modelData" : {
      "systemManagedEntities" : {

          "invoiceDetails" : {
            "quoteNumber" : "MSB-56357",
            "referenceNumber" : "",
            "total" : 0,
            "vatTax" : 0,
            "status" : "Draft, Awaiting Approval, Awaiting Payment, Paid, Repeating",
            "statusId" : 0,
            "onlinePayment" : false
          }

      },
  
      "formFieldsEntities" : {
        
        "invoiceDetails": {
          "date": {
            "name": "date",
            "question": "Date Created",
            "questionShort": "Date",
            "answerType": "text",
            "tooltip": "Please provide date of creation.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "date"
          },
          "expiryDate": {
            "name": "expiryDate",
            "question": "Due Date",
            "questionShort": "Due Date",
            "answerType": "text",
            "tooltip": "What is your due date?",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "number"
          },
          "accountType": {
            "name": "accountType",
            "question": "Account",
            "questionShort": "Account",
            "answerType": "text",
            "tooltip": "Account type of the quote",
            "answerOptions": [
                {
                    "id": "0",
                    "value": "Sale of Goods"
                },

                {
                    "id": "1",
                    "value": "Sale of Digital Content"
                },

                {
                    "id": "2",
                    "value": "Services Rendering"
                }
            ],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "dropdown"
          },
          "taxType": {
            "name": "taxType",
            "question": "Amounts are",
            "questionShort": "Amounts are",
            "answerType": "text",
            "tooltip": "Is vat included in the amounts",
            "answerOptions": [
                {
                    "id": "0",
                    "value": "Vat Tax Exclusive"
                },

                {
                    "id": "1",
                    "value": "Vat Tax Inclusive"
                },

                {
                    "id": "2",
                    "value": "No Tax"
                }
            ],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "dropdown"
          },
          "attention": {
            "name": "attention",
            "question": "Attention",
            "questionShort": "Attention",
            "answerType": "text",
            "tooltip": "Attention.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": [],
            "type": "text"
          },
          "tell": {
            "name": "tell",
            "question": "Telephone",
            "questionShort": "Telephone",
            "answerType": "text",
            "tooltip": "Telephone.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": [],
            "type": "text"
          },
          "deliveryInstructions": {
            "name": "deliveryInstructions",
            "question": "Delivery Instructions",
            "questionShort": "Delivery Instructions",
            "answerType": "text",
            "tooltip": "Delivery Instructions.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": [],
            "type": "text-area"
          },
          "notes": {
            "name": "notes",
            "question": "History Notes",
            "questionShort": "History Notes",
            "answerType": "text",
            "tooltip": "Provide History notes.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": [],
            "type": "text-area"
          }
        },

        "items" : {
          "repeatable" : true,
          "itemName": {
            "name": "itemName",
            "question": "Item",
            "questionShort": "Item",
            "answerType": "text",
            "tooltip": "Item.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "text"
          },

          "description": {
            "name": "description",
            "question": "Description",
            "questionShort": "Description",
            "answerType": "text",
            "tooltip": "Description.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "text"
          },

          "quantity": {
            "name": "quantity",
            "question": "Qty",
            "questionShort": "Qty",
            "answerType": "text",
            "tooltip": "Qty.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "number"
          },

          "unitPrice": {
            "name": "unitPrice",
            "question": "Unit Price",
            "questionShort": "Unit Price",
            "answerType": "text",
            "tooltip": "Unit Price.",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "number"
          },

          "discountPercantage": {
            "name": "discountPercantage",
            "question": "Disc %",
            "questionShort": "Disc %",
            "answerType": "text",
            "tooltip": "Disc % .",
            "answerOptions": [],
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "number"
          },

          "accountType": {
            "name": "accountType",
            "question": "Account",
            "questionShort": "Account",
            "answerType": "text",
            "tooltip": "Account",
            "modelOptions": 
                {
                    "modelName" : "AccountTypes",
                    "queryExtras" : [
                        {
                        "key" : "user_role" , 
                        "value" : "Car-Track-Bot-User"
                        }, 
                        {
                        "key" : "mid" , 
                        "value" : "285"
                        }
                    ]
                },
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "dropdown-model"
          },

          "taxRates": {
            "name": "taxRates",
            "question": "Tax Rate",
            "questionShort": "Tax Rate",
            "answerType": "text",
            "tooltip": "Tax Rate",
            "modelOptions": 
                {
                    "modelName" : "taxRates",
                    "queryExtras" : [
                        {
                            "key" : "user_role" , 
                            "value" : "Car-Track-Bot-User"
                        }
                    ]
                },
            "answerOptionsType": null,
            "answerColumns": [],
            "validations": ["required"],
            "type": "dropdown-model"
          }
        },

        "clientDetails" : {
        }
      }
    }
  
  }