{
  "name": "Customer",
  "base": "User",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "hidden": [
    "password"
  ],
  "properties": {
    "firstName": {
      "type": "string",
      "required": true,
      "template": {
        "type": "input",
        "templateOptions": {
          "container": "customerBox",
          "type": "text",
          "label": "Enter first name",
          "id": "CustomerFirstName",
          "inline": true,
          "colSize": "col-xs-6",
          "priority": 10
        }
      }
    },
    "lastName": {
      "type": "string",
      "template": {
        "type": "input",
        "templateOptions": {
          "container": "customerBox",
          "type": "text",
          "label": "Enter lastName",
          "id": "CustomerSurName",
          "inline": true,
          "colSize": "col-xs-6",
          "priority": 9
        }
      }
    },
    "email": {
      "type": "string",
      "template": {
        "type": "input",
        "templateOptions": {
          "container": "customerBox",
          "type": "email",
          "label": "Enter customer email",
          "id": "CustomerEmail",
          "priority": 8
        }
      }
    },
    "username": {
      "type": "string",
      "template": {
        "type": "input",
        "templateOptions": {
          "container": "customerBox",
          "type": "text",
          "label": "Enter customer username",
          "id": "CustomerUsername",
          "priority": 8
        }
      }
    },
    "added": {
      "type": "date",
      "required": true,
      "defaultFn": "now",
      "template": {
        "type": "dummy"
      }
    },
    "updated": {
      "type": "date",
      "required": true,
      "defaultFn": "now"
    },
    "registrationId": {
      "type": "string",
      "required": false
    },
    "profilePic": {
      "type": "object",
      "template": {
        "type": "singleFileUpload",
        "templateOptions": {
          "label": "Add profile pic",
          "containerName": "AMAZON_CONTAINER_NAME",
          "containerModel": "Container",
          "bind": true,
          "fileDataSource": "Image",
          "onImageUpdate": {
            "deletePrevious": true
          }
        }
      }
    },
    "googleRefreshToken":{
      "type": "string"
    }
  },
  "validations": [],
  "relations": {
    "facebookAccessToken": {
      "type": "hasMany",
      "model": "FacebookAccessToken",
      "foreignKey": "",
      "onCascadeDelete": true
    }
  },
  "acls": [
    {
      "accessType": "*",
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "DENY"
    },
    {
      "accessType": "*",
      "principalType": "ROLE",
      "principalId": "admin",
      "permission": "ALLOW"
    },
    {
      "accessType": "*",
      "principalType": "ROLE",
      "principalId": "staff",
      "permission": "ALLOW"
    },
    {
      "accessType": "EXECUTE",
      "principalType": "ROLE",
      "principalId": "staff",
      "permission": "ALLOW",
      "property": "find"
    },
    {
      "accessType": "EXECUTE",
      "principalType": "ROLE",
      "principalId": "staff",
      "permission": "ALLOW",
      "property": "findById"
    },
    {
      "accessType": "EXECUTE",
      "principalType": "ROLE",
      "principalId": "staff",
      "permission": "ALLOW",
      "property": "findOne"
    },
    {
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "ALLOW",
      "property": "isAdmin"
    },
    {
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "ALLOW",
      "property": "getSchema"
    },
    {
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "ALLOW",
      "property": "getAbsoluteSchema"
    },
    {
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "ALLOW",
      "property": "count"
    },
    {
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "ALLOW",
      "property": "save"
    },
    {
      "accessType": "*",
      "principalType": "ROLE",
      "principalId": "$owner",
      "permission": "ALLOW"
    },
    {
      "accessType": "READ",
      "principalType": "ROLE",
      "principalId": "$authenticated",
      "permission": "ALLOW"
    }
  ],
  "methods": {}
}
