{
    "rest": true,
    "allowMapping": true,
    "type": "estimate",
    "id": "estimate",
    "criteria": "transaction",
    "select": "",
    "where": "WHERE type = 'Estimate' AND voided = 'F'",
    "inner": "",
    "mapping": {
        "billingaddress": "billingAddress",
        "duedate": "dueDate",
        "email": "email",
        "employee": "employee",
        "entity": "entity",
        "entitystatus": "entityStatus",
        "estgrossprofit": "estGrossProfit",
        "estgrossprofitpercent": "estGrossProfitPercent",
        "exchangerate": "exchangeRate",
        "expectedclosedate": "expectedCloseDate",
        "forecasttype": "forecastType",
        "leadsource": "leadSource",
        "memo": "memo",
        "opportunity": "opportunity",
        "probability": "probability",
        "recordtype": "recordtype",
        "status": "status",
        "terms": "terms",
        "title": "title",
        "tobeprinted": "toBePrinted",
        "totalcostestimate": "totalCostEstimate",
        "trandate": "tranDate",
        "tranid": "tranId",
        "visibletocustomer": "visibleToCustomer"
    },
    "relationships": {
        "estimateitem": {
            "rest": true,
            "allowMapping": true,
            "type": "estimate",
            "id": "estimate",
            "criteria": "transaction",
            "select": "transaction.id, transaction.trandate, BUILTIN.DF( TransactionLine.Item ) AS Item, TransactionLine.Item,TransactionLine.Costestimate,TransactionLine.Price as PriceLevel,TransactionLine.Linesequencenumber,TransactionLine.Memo,TransactionLine.Subsidiary,TransactionLine.Quantity,TransactionLine.Rate,TransactionLine.ItemType,TransactionLine.Amount,Item.ItemID,BUILTIN.DF( Item.ItemType ) AS ItemType FROM transaction",
            "where": "WHERE type = 'Estimate' AND voided = 'F'",
            "inner": "INNER JOIN TransactionLine ON ( TransactionLine.Transaction = Transaction.ID ) INNER JOIN Item ON( Item.ID = TransactionLine.Item )"
        }
    },
    "dependencies": {
        "serviceitem": {
            "name": "Service Items",
            "model": "ServiceItem",
            "path": "/src/ServiceItems/Data/criteria.json"
        }
    },
    "sublists": {
        "items": {
            "mapping": {
                "amount": "amount",
                "billvariancestatus": "billVarianceStatus",
                "billingschedule": "billingSchedule",
                "chargetype": "chargeType",
                "class": "class",
                "costestimate": "costEstimate",
                "costestimaterate": "costEstimateRate",
                "costestimatetype": "costEstimateType",
                "department": "department",
                "description": "description",
                "estgrossprofit": "estGrossProfit",
                "estgrossprofitpercent": "estGrossProfitPercent",
                "excludefromraterequest": "excludeFromRateRequest",
                "fromjob": "fromJob",
                "initoqpbucket": "initOqpBucket",
                "isclosed": "isClosed",
                "isestimate": "isEstimate",
                "isopen": "isOpen",
                "item": "item",
                "itemsubtype": "itemSubtype",
                "itemtype": "itemType",
                "line": "line",
                "location": "location",
                "marginal": "marginal",
                "minqty": "minQty",
                "oqpbucket": "oqpBucket",
                "options": "options",
                "price": "price",
                "printitems": "printItems",
                "quantity": "quantity",
                "quantityavailable": "quantityAvailable",
                "quantitycommitted": "quantityCommitted",
                "quantityonhand": "quantityOnHand",
                "rate": "rate",
                "rateschedule": "rateSchedule",
                "refname": "refName",
                "subsidiary": "subsidiary",
                "units": "units"
            }
        }
    }
}
