export const env = {
    production: false,
    default_api_url: "/api",
    routes: {
        user: "/user",
        group: "/group",
        module: "/module",
        moduleOfUser: "/moduleOfUser",
        groupOfUser: "/groupOfUser",
        userRep: "/userRep",
        dirGroup: "/directory/Group?propName=samaccountname",
        dirUser: "/directory/user",
        directory: "/directory",
        login: "/auth/login",
        logout: "/auth/logout",
        loginCheck: "/auth/check"
    },
    columnNames: {
        user: {
            basic: [
                {
                    header: 'Benutzername',
                    field: 'username'
                },
                {
                    header: 'Vorname',
                    field: 'prename'
                },
                {
                    header: 'Name',
                    field: 'name'
                },
                {
                    header: 'E-email',
                    field: 'email'
                }
            ],
            detailed: [
                {
                    header: 'Benutzername',
                    field: 'username'
                },
                {
                    header: 'Vorname',
                    field: 'prename'
                },
                {
                    header: 'Name',
                    field: 'name'
                },
                {
                    header: 'E-email',
                    field: 'email'
                },
                {
                    header:'Kommentar',
                    field: 'comment'
                },
                {
                    header: 'DatumsFormat',
                    field: 'dateFormat'
                },
                {
                    header: 'Kürzel',
                    field: 'shortname'
                },
                {
                    header: 'Hinzugefügt<br>wer',
                    field: 'addedWho'
                },
                {
                    header: 'Hinzugefügt<br>wann',
                    field: 'addedWhen'
                },
                {
                    header: 'Geändert<br>wer',
                    field: 'changedWho'
                },
                {
                    header: 'Geändert<br>wann',
                    field: 'changedWhen'
                }
            ]
        },
        group: {
            basic: [
                {
                    header: "Gruppe",
                    field: "name"
                }
            ],
            complete: [
                {
                    header: "Gruppe",
                    field: "name"
                },
                {
                    header: "Kommentar",
                    field: "comment"
                },
                {
                    header: "Active",
                    field: (group: any) => group.active ? "✓" : ""
                },
                {
                    header: "AD Sync",
                    field: (group: any) => group.adSync ? "✓" : ""
                },
                {
                    header: "Internal",
                    field: (group: any) => group.internal ? "✓" : ""
                },
                {
                    header: 'Hinzugefügt<br>wer',
                    field: (g: any) => g.addedWho
                },
                {
                    header: 'Hinzugefügt<br>wann',
                    field: (g: any) => new Date(g.addedWhen).toLocaleString('de-DE', { day: '2-digit', month: '2-digit', year: '2-digit', hour: '2-digit', minute: '2-digit' }).replace(',', '')
                },
                {
                    header: 'Geändert<br>wer',
                    field: 'changedWho'
                },
                {
                    header: 'Geändert<br>wann',
                    field: (g: any) => new Date(g.changedWhen).toLocaleString('de-DE', { day: '2-digit', month: '2-digit', year: '2-digit', hour: '2-digit', minute: '2-digit' }).replace(',', '')
                }
            ],
            representative: [
                {
                    header: "Repräsentation",
                    field: "name"
                }
            ],
            right: [
                {
                    header: "Richtiger",
                    field: "name"
                }
            ]
        },
        dirGroup: [
            {
                header: "SAM-Account-Name",
                field: (dirGroup: any) => dirGroup?.samaccountname[0]
            }
        ],
        dirUser: [
            {
                header: 'Benutzername',
                field: (dirUser: any) => dirUser?.samaccountname?.[0] ?? ""
            },
            {
                header: 'Vorname',
                field: (dirUser: any) => dirUser?.givenname?.[0] ?? ""
            },
            {
                header: 'Name',
                field: (dirUser: any) => dirUser?.sn?.[0] ?? ""
            },
            {
                header: 'E-email',
                field: (dirUser: any) => dirUser?.mail?.[0] ?? ""
            }
        ],
        module: [
            {
                header: "Produkt",
                field: "name"
            },
            {
                header: "Kurzname",
                field: "shortName"
            }
        ],
        groupOfUser: [
            {
                header: "Benutzername",
                field: (gou: any) => gou.user.username
            },
            {
                header: "Gruppen",
                field: (gou: any) => gou.group.name
            },
        ],
        userRep: [
            {
                header: "Repr. Gruppen",
                field: (ur: any) => ur.repGroup?.name
            },
            {
                header: "Repr. Benutzer",
                field: (ur: any) => ur.repUser?.username
            },
        ]
    },
    config_url: "/assets/config.json"
};
