<% /*
    $Revision$
    $Id$

    File:           model_aut_client.inc
    Description:
    Notes:
*/

%>
<!-- #include file="./model_aut_client_perslid.inc" -->
<%
function model_aut_client(params)
{
    params = params || {};
    this.records_name = "autclients";
    this.record_name = "autclient";
    this.table = "aut_client";
    this.primary = "aut_client_key";
    this.autfunction = params.internal?false:"WEB_FACTAB";
    this.record_title = L("aut_client");
    this.records_title = L("aut_client_m");

    this.fields = {
        "id": {
            "dbs": "aut_client_key",
            "label": L("lcl_key"),
            "typ": "key",
            "seq": "aut_s_aut_client_key"
        },
        "code": {
            "dbs": "aut_client_id",
            "label": L("aut_client_code"),
            "typ": "varchar",
            "caseinsensitive": true
        },
        "name": {
            "dbs": "aut_client_omschrijving",
            "label": L("aut_client_omschrijving"),
            "typ": "varchar",
            "required": true
        },
        "type": {
            "dbs": "aut_client_type",
            "label": L("aut_client_type"),
            "typ": "key",
            "required": true,
            "LOV": L("aut_client_typeLOV")
        },
        "remark": {
            "dbs": "aut_client_opmerking",
            "label": L("aut_client_opmerking"),
            "typ": "memo"
        },
        "secret": {
            "dbs": "aut_client_secret",
            "label": L("aut_client_secret"),
            "typ": "varchar",
            "defaultvalue": shared.random(32),
            "secret": true
        },
        "company": {
            "dbs": "prs_bedrijf_key",
            "label": L("prs_bedrijf_key"),
            "typ": "key",
            "foreign": "PRS_BEDRIJF"
        }
/*        ,
        "redirect_uri": {
            "dbs": "aut_client_redirect_uri",
            "label": L("aut_client_redirect_uri"),
            "typ": "varchar"
        }*/
    }

    this.includes = {
        "clientpersons": {
            "model": new model_aut_client_perslid(),
            "joinfield": "autclient"
        }
    };

    this.REST_GET    = generic_REST_GET(this);
    this.REST_POST   = generic_REST_POST(this);
    this.REST_PUT    = generic_REST_PUT(this);
    this.REST_DELETE = generic_REST_DELETE(this);
}
%>