[
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ProjectType",
    "table": "prjtype",
    "idSequenceName": "prjtype_prjtype_id_seq",
    "isRest": true,
    "comment": "Project Type Map",
    "privileges": {
      "all": {
        "create": "MaintainProjectTypes",
        "read": true,
        "update": "MaintainProjectTypes",
        "delete": "MaintainProjectTypes"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "prjtype_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "code",
        "attr": {
          "type": "String",
          "column": "prjtype_code",
          "isNaturalKey": true
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "prjtype_active"
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "prjtype_descr"
        }
      },
      {
        "name": "characteristics",
        "toMany": {
          "isNested": true,
          "type": "ProjectTypeCharacteristic",
          "column": "prjtype_id",
          "inverse": "projectType"
        }
      },
      {
        "name": "workflow",
        "toMany": {
          "isNested": true,
          "type": "ProjectTypeWorkflow",
          "column": "prjtype_id",
          "inverse": "parent"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ProjectTypeCharacteristic",
    "table": "charass",
    "idSequenceName": "charass_charass_id_seq",
    "comment": "Project Type Characteristic Map",
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "charass_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "targetType",
        "attr": {
          "type": "String",
          "column": "charass_target_type",
          "value": "PROJTYPE"
        }
      },
      {
        "name": "projectType",
        "attr": {
          "type": "Number",
          "column": "charass_target_id"
        }
      },
      {
        "name": "characteristic",
        "toOne": {
          "type": "Characteristic",
          "column": "charass_char_id",
          "required": true
        }
      },
      {
        "name": "value",
        "attr": {
          "type": "String",
          "column": "charass_value"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ProjectTypeWorkflow",
    "table": "xt.prjtypewf",
    "comment": "Project Type Workflow Map",
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "wfsrc_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "parent",
        "attr": {
          "type": "Number",
          "column": "wfsrc_parent_id",
          "isNaturalKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "wfsrc_name",
          "required": true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "wfsrc_description"
        }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "wfsrc_status"
        }
      },
      {
        "name": "startSet",
        "attr": {
          "type": "Boolean",
          "column": "wfsrc_start_set"
        }
      },
      {
        "name": "startOffset",
        "attr": {
          "type": "Number",
          "column": "wfsrc_start_offset"
        }
      },
      {
        "name": "dueSet",
        "attr": {
          "type": "Boolean",
          "column": "wfsrc_due_set"
        }
      },
      {
        "name": "dueOffset",
        "attr": {
          "type": "Number",
          "column": "wfsrc_due_offset"
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "wfsrc_notes"
        }
      },
      {
        "name": "priority",
        "toOne": {
          "type": "Priority",
          "column": "wfsrc_priority_id",
          "required": true
        }
      },
      {
        "name": "sequence",
        "attr": {
          "type": "Number",
          "column": "wfsrc_sequence"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "wfsrc_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "assignedTo",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "wfsrc_assigned_username",
          "inverse": "username"
        }
      },
      {
        "name": "completedParentStatus",
        "attr": {
          "type": "String",
          "column": "wfsrc_completed_parent_status"
        }
      },
      {
        "name": "deferredParentStatus",
        "attr": {
          "type": "String",
          "column": "wfsrc_deferred_parent_status"
        }
      },
      {
        "name": "completedSuccessors",
        "attr": {
          "type": "String",
          "column": "wfsrc_completed_successors"
        }
      },
      {
        "name": "deferredSuccessors",
        "attr": {
          "type": "String",
          "column": "wfsrc_deferred_successors"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ProjectListItem",
    "table": "xt.prjinfo",
    "isRest": true,
    "comment": "Project List Item Map",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewAllProjects MaintainAllProjects",
        "update": false,
        "delete": false
      },
      "personal": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false,
        "properties": [
          "owner.username",
          "assignedTo.username"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "prj_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "prj_number",
          "isNaturalKey":true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "prj_name"
        }
      },
      {
        "name": "projectType",
        "toOne": {
          "type": "ProjectType",
          "column": "prj_prjtype_id"
        }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "prj_status"
        }
      },
      {
        "name": "startDate",
        "attr": {
          "type": "Date",
          "column": "prj_start_date"
        }
      },
      {
        "name": "dueDate",
        "attr": {
          "type": "DueDate",
          "column": "prj_due_date"
        }
      },
      {
        "name": "assignDate",
        "attr": {
          "type": "Date",
          "column": "prj_assigned_date"
        }
      },
      {
        "name": "completeDate",
        "attr": {
          "type": "Date",
          "column": "prj_completed_date"
        }
      },
      {
        "name": "assignedTo",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "prj_username",
          "inverse": "username"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "prj_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "account",
        "toOne": {
          "isNested": true,
          "type": "AccountRelation",
          "column": "prj_crmacct_id"
        }
      },
      {
        "name": "contact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "prj_cntct_id"
        }
      },
      {
        "name": "budgetedHours",
        "attr": {
          "type": "Hours",
          "column": "prj_hours_budget"
        }
      },
      {
        "name": "actualHours",
        "attr": {
          "type": "Hours",
          "column": "prj_hours_actual"
        }
      },
      {
        "name": "balanceHours",
        "attr": {
          "type": "Hours",
          "column": "prj_hours_balance"
        }
      },
      {
        "name": "budgetedExpenses",
        "attr": {
          "type": "Money",
          "column": "prj_exp_budget"
        }
      },
      {
        "name": "actualExpenses",
        "attr": {
          "type": "Money",
          "column": "prj_exp_actual"
        }
      },
      {
        "name": "balanceExpenses",
        "attr": {
          "type": "Money",
          "column": "prj_exp_balance"
        }
      },
      {
        "name": "characteristics",
        "toMany": {
          "isNested": true,
          "type": "ProjectListItemCharacteristic",
          "column": "prj_id",
          "inverse": "project"
        }
      }    
    ],
    "extensions": [
      {
        "table": "xt.prjext",
        "relations": [
          {
            "column": "prjext_id",
            "inverse": "id"
          }
        ],
        "properties": [
          {
            "name": "department",
            "toOne": {
              "type": "Department",
              "column": "prjext_dept_id"
            }
          },
          {
            "name": "priority",
            "toOne": {
              "isNested": true,
              "type": "Priority",
              "column": "prjext_priority_id"
            }
          },
          {
            "name": "percentComplete",
            "attr": {
              "type": "Percent",
              "column": "prjext_pct_complete"
            }
          }
        ]
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ProjectListItemCharacteristic",
    "table": "charass",
    "comment": "Project List Item Characteristic Map",
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "charass_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "targetType",
        "attr": {
          "type": "String",
          "column": "charass_target_type",
          "value": "PROJ"
        }
      },
      {
        "name": "project",
        "attr": {
          "type": "Number",
          "column": "charass_target_id"
        }
      },
      {
        "name": "characteristic",
        "toOne": {
          "type": "Characteristic",
          "column": "charass_char_id",
          "required": true
        }
      },
      {
        "name": "value",
        "attr": {
          "type": "String",
          "column": "charass_value"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ProjectRelation",
    "table": "xt.prjinfo",
    "isRest": true,
    "comment": "Project Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewAllProjects MaintainAllProjects",
        "update": false,
        "delete": false
      },
      "personal": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false,
        "properties": [
          "owner.username",
          "assignedTo.username"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "prj_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "prj_number",
          "isNaturalKey":true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "prj_name"
        }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "prj_status"
        }
      },
      {
        "name": "assignedTo",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "prj_username",
          "inverse": "username"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "prj_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "account",
        "attr": {
          "type": "String",
          "column": "crmacct_number"
        }
      },
      {
        "name": "contact",
        "attr": {
          "type": "String",
          "column": "cntct_number"
        }
      }
    ],
    "isSystem": true
  }
]
