// I put all constant value here
// so that everybody can go here to modify the constant value if any changes
angular
    .module('689Cloud')

    // Using project detail
    // I think we should read from mine type
    // File types are encodable [ pdf, docx, xlsx, pptx ]
    .constant('ENCODED_TYPE', [1, 2, 3, 4])

    // App config
    .constant("app", {
        BACKEND_API_URL: "http://localhost:8080/",
        // Using for upload - Using MB
        MAX_FILE_SIZE: 500,
        //Max length email
        MAX_LENGTH_EMAIL: 65,
        MAX_LENGTH_DOMAIN: 128,
        MAX_LENGTH_GROUP_NAME: 64,
        // Cache module using ocLazyLoad
        OCLAZY_CACHE_MODULE: true, // Should use "true" when deploy to server

        // Cloud environment. Using for upload file
        UPLOAD_CLOUD_ENVIRONMENT: "server_test", // production, server_test, local

        // Event list size
        EVENT_PAGE_SIZE: 20,
        // Page size for all list
        LIST_PAGE_SIZE: 10,
        // Date type. Moment is now using this format
        // This value is fixed right now
        DATE_FORMAT: "YYYY/MM/DD HH:mm:ss",
        // I think we should format on server
        BOOKEND_DATE_FORMAT: "YYYY-MM-DD HH:mm:ss",
        // Using for date picker
        CALENDAR_FORMAT: "MM/DD/YYYY",
        // Email pattern
        // EMAIL_PATTERN: /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
        EMAIL_PATTERN: /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,
        SPECIAL_CHARS_PATTERN: /^[a-zA-Z0-9 \.,]*$/,
        DOMAIN_PATTERN: /(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/,
        SCRIPT_PATTERN: /^((?!<|>|{|})[\s\S])*?$/,
        COLOR_PATTERN: /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,
        URL_PATTERN: /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?/,
        PHONE_PATTERN: /^[\(\)\.\- 0-9]*$/,
        CREDIT_CARD: /\b(?:4[0-9]{12}(?:[0-9]{3})?|5[12345][0-9]{14}|3[47][0-9]{13}|3(?:0[012345]|[68][0-9])[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35[0-9]{3})[0-9]{11})\b/,

        LIST_FILE_EXTENSION_PATTERN: /^([a-z0-9]{2,4})(,[a-z0-9]{2,4})*$/,

        MAX_EXPIRY_DATE: '12/30/9999', // MM/dd/yyyy
        MAX_EXPIRY_DATE_2: '12/31/9999', // MM/dd/yyyy
        MAX_EXPIRY_DATE_TIME: '12/30/9999 23:59:59', // MM/dd/yyyy HH:mm:ss
        MAX_EXPIRY_DATE_TIME_2: '12/31/9999 23:59:59', // MM/dd/yyyy HH:mm:ss
        MAX_EXPIRY_DATE_FORMAT: 'MM/DD/YYYY',
        MAX_EXPIRY_DATE_FORMAT_2: 'MM/DD/YYYY HH:mm:ss',
        MAX_EXPIRY_DATE_TIME_FORMAT: 'MM/DD/YYYY H:m:ss',
        PATTERN_INTEGER: /^(0|[1-9][0-9]*)$/,

        FACTOR_AUTHEN_TWO_STEP: 1,
        CHANGE_PASSWORD_EXPIRED: 2,

        SPECIAL_CHARS_NOT_ALLOW: '\\/:*?\"<>|{}',
        XSS_CHARS: '<>{}',
        PASSWORD_PATTERN_DEFAULT: '^.{6,64}$',
        NUMBER_PATTERN: /^[0-9]*$/,
        REGEX_SPECIAL_FOLDER_NAME: /[*/<>?\\/:"{}]/g
    })

    // Role constant
    .constant('projectRole', {
        TEAM_ADMIN: {id: 0, name: "Team Admin", i18n: ""},
        OWNER: {id: 1, name: "Owner", i18n: ""},
        EDITOR: {id: 2, name: "Editor", i18n: ""},
        VIEWER: {id: 3, name: "Viewer", i18n: ""},
        PREVIEWER: {id: 4, name: "Previewer", i18n: ""},
        VIEWER_UPLOADER: {id: 5, name: "Viewer Uploader", i18n: ""},
        PREVIEWER_UPLOADER: {id: 6, name: "Previewer Uploader", i18n: ""},
        UPLOADER: {id: 7, name: "Uploader", i18n: ""}
    })

    // ConsoleType constant
    .constant('ConsoleType', {
        SecureDrive: {id: 1, type: "SecureDrive", i18n: ""},
        SecureMail: {id: 2, type: "SecureMail", i18n: ""},
        TeamAdmin: {id: 3, type: "TeamAdmin", i18n: ""},
        Reseller: {id: 4, type: "Reseller", i18n: ""},
    })

    // Config user role info
    // User level in our system
    .constant("userConfig", {
        SUPER_ADMIN: {
            role: 0,
            login_link: "admin/login",
            landing_page: "super-admin/company-list",
            landing_page_state: "companyList"
        },
        COMPANY_ADMIN: {
            role: 5,
            login_link: "admin/login",
            landing_page: "admin/team-list",
            landing_page_state: "teamList"
        },
        ADMIN: {
            role: 1,
            login_link: "login",
            landing_page: "project",
            landing_page_state: "login"
        },
        MANAGER: {
            role: 2,
            login_link: "login",
            landing_page: "project",
            landing_page_state: "login"
        },
        MEMBER: {
            role: 3,
            login_link: "login",
            landing_page: "project",
            login_LDAP: "login-ldap",
            landing_page_state: "login"
        },
        GUEST: {
            role: 4,
            login_link: "login",
            landing_page: "project",
            landing_page_state: "login"
        }
    })

    // Some selector related to list view
    // Using in project detail
    .constant('SELECTOR', {
        SELECT: '#browse-box', // Child can be selected
        DRAG: '.browse-file', // class of element can drag
        DROP: '.folder', // Acceptable class using for drop
        MENU: '#view-wrapper' // Menu using for context menu
    })

    .constant('ViewerUrl', {
        GOOGLE_DRIVE: 'https://docs.google.com/gview?url=',
        ONE_DRIVE: 'https://view.officeapps.live.com/op/embed.aspx?src=',
        OLD_VIEWER: 'https://www.hogodoc.com/viewer/old-viewer.html?url=',
        PDF_JS: 'js/pdfjs/web/viewer.html?file=',
        //parentURL for porthole js
        HOGO: 'https://689cloud.com/viewer/',
        CLOUD: 'https://viewer.689cloud.com/?id=2a16ecb9cb9347198e465a141907a857?ak=78ea3e80c1684973b22058f64f82f90d',
        VIEWER_CLOUD_ORIGIN: 'https://viewer.689cloud.com',
        VIEWER_ORIGIN: 'https://689cloud.com'
    })

    .constant('ViewerSupportType', {
        SUPPORT_TYPES_DOC: ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'xlsm', 'pdf'],
        SUPPORT_TYPES_IMG: ['jpg', 'png', 'gif'],
        SUPPORT_TYPES_PLAN_TEXT: ['txt'],
        SUPPORT_AUDIO: ['mp3'],
        SUPPORT_VIDEO: ['mp4']
    })

    // All mime type
    .constant('MimeTypes', {
        secure: {
            types: [
                "application/pdf",
                "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                "application/vnd.openxmlformats-officedocument.presentationml.presentation",
                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
            ],
            icon: "I need a default icon right here"
        },
        video: {
            types: [
                "video/mpeg", "video/mpeg", "video/mpeg", "video/quicktime", "video/quicktime", "video/mp4",
                "video/x-m4v", "video/x-flv", "video/x-ms-wmv", "video/avi", "video/webm", "video/vnd.rn-realvideo"
            ],
            icon: "img/ui/file-video-32.png"
        },
        audio: {
            types: [
                "audio/mpeg", "audio/mpeg", "audio/mpeg", "audio/mpeg", "audio/x-wav", "audio/mp4"
            ],
            icon: "img/ui/file-audio-32.png"
        },
        image: {
            types: [
                "image/bmp", "image/gif", "image/jpeg", "image/photoshop", "image/png", "image/svg+xml", "image/svg+xml", "image/tiff", "image/tiff"
            ],
            icon: "img/ui/file-image-32.png"
        },
        compress: {
            types: [
                "application/zip", "application/rar", "application/x-zip-compressed", "application/x-gunzip", "application/x-gzip", "application/x-7z-compressed"
            ],
            icon: "img/ui/file-compress-32.png"
        },
        text: {
            types: [
                "text/rtf", "text/plain", "text/html", "text/xml", "text/css", "text/csv"
            ],
            icon: "img/ui/file-text-32.png"
        },
        folder: {
            types: ["application/folder"],
            icon: "img/ui/folder-icon.png"
        },
        project: {
            types: ["application/project"],
            icon: "img/ui/folder-icon.png"
        },
        office: {
            types: [
                "application/msword", "application/vnd.ms-excel", "application/vnd.ms-powerpoint"
            ]
        },
        default: {
            icon: "img/ui/file-default.png"
        }
    })

    // Detail of secure file
    .constant("MimeTypeDetail", {
        PDF: {type: "application/pdf", ext: "pdf", icon: "img/ui/file-pdf-32.png"},
        WORD: {
            type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
            ext: "docx",
            icon: "img/ui/file-docx-32.png"
        },
        PPTX: {
            type: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
            ext: "pptx",
            icon: "img/ui/file-pptx-32.png"
        },
        EXCEL: {
            type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
            ext: "xlsx",
            icon: "img/ui/file-xlsx-32.png"
        }
    })

    // Event history
    .constant('Events', {
        // Using for project
        PROJECT: {
            // LICENSE (100  - 199)
            USER_REVOKED: {code: 100, desc: "Revoked recipient license"},
            //FILE (200 - 299)
            FILE_ADDED: {code: 200, desc: "Uploaded file"},
            FILE_UPDATE: {code: 201, desc: "User renamed file"},
            FILE_DELETE: {code: 202, desc: "User deleted forever file"},
            FILE_ENCODED: {code: 203, desc: "User set DRM file"},
            FILE_RESTORED: {code: 204, desc: "User restored file"},
            FILE_MOVE: {code: 205, desc: "User moved file"},
            FILE_REMOVE: {code: 206, desc: "User removed file"},
            LICENSE_UPDATED: {code: 207, desc: "User updated DRM file setting"},
            DELETE_LICENSE: {code: 208, desc: "User disabled DRM file setting"},
            ATTACH_LABEL: {code: 209, desc: "Attach label file"},
            DETACH_LABEL: {code: 210, desc: "Detach label file"},
            COPY_FILE: {code: 211, desc: "User Copied File"},
            // PROJECT (300 - 399)
            PROJECT_ADDED: {code: 300, desc: "Added new project"},
            PROJECT_UPDATED: {code: 301, desc: "Updated project"},
            PROJECT_DELETED: {code: 302, desc: "Deleted project"},
            PROJECT_COPY: {code: 303, desc: "Copied project"},
            TRANSFER_PROJECT: {code: 304, desc: "Transferred a project"},
            // FOLDER (500 - 599)
            FOLDER_CREATED: {code: 500, desc: "Created folder"},
            FOLDER_UPDATED: {code: 501, desc: "User renamed folder"},
            FOLDER_DELETED: {code: 502, desc: "User deleted forever folder"},
            FOLDER_REMOVE: {code: 503, desc: "User removed folder"},
            FOLDER_MOVED: {code: 504, desc: "User moved folder"},
            FOLDER_RESTORE: {code: 505, desc: "User restored folder"},
            FOLDER_UPDATED_SETTING: {code: 506, desc: "User updated folder setting"},
            FOLDER_COPY: {code: 507, desc: "Copied folder"},
            //COLLABORATOR (700 - 799)
            USER_REMOVE: {code: 700, desc: "Removed individual collaborator"},
            USER_CHANGE_ROLE: {code: 701, desc: "Changed role for individual collaborator"},
            USER_INVITED: {code: 702, desc: "Added individual collaborator"},
            GROUP_INVITED: {code: 703, desc: "Added group collaborator"},
            GROUP_CHANGE_ROLE: {code: 704, desc: "Changed role for group collaborator"},
            GROUP_REMOVE: {code: 705, desc: "Removed group collaborator"},
            //LABEL (900 - 999)
            CREATE_LABEL: {code: 900, desc: "User created label"},
            UPDATE_LABEL: {code: 901, desc: "User updated label"},
            DELETE_LABEL: {code: 902, desc: "User deleted label"},
            // LINK (1100 - 1199)
            LINK_CREATED: {code: 1100, desc: "User created link"},
            LINK_DELETED: {code: 1101, desc: "User deleted link"},
            LINK_UPDATE: {code: 1102, desc: "User updated link"},
            LINK_SHARED: {code: 1103, desc: "User shared link"},
            SHARED_SECURE_MAIL: {code: 1104, desc: "Shared SecureMail"},
            // COMMENT (1200 - 1299)
            USER_CREATE_COMMENT: {code: 1200, desc: "Added comment in project"},
            USER_UPDATE_COMMENT: {code: 1201, desc: "Updated comment in project"},
            USER_DELETE_COMMENT: {code: 1202, desc: "Removed comment in project"},
            USER_CREATE_COMMENT_FILE: {code: 1203, desc: "User added comment in file"},
            USER_UPDATE_COMMENT_FILE: {code: 1204, desc: "User updated comment in file"},
            USER_DELETE_COMMENT_FILE: {code: 1205, desc: "User removed comment in file"}
        },
        // Using for the team
        TEAM: {
            // PROJECT (300 - 399)
            PROJECT_ADDED: {code: 300, desc: "Add new project"},
            PROJECT_UPDATED: {code: 301, desc: "Update project"},
            PROJECT_DELETED: {code: 302, desc: "Delete project"},
            PROJECT_COPY: {code: 303, desc: "Copy project"},
            TRANSFER_PROJECT: {code: 304, desc: "Transferred a project"},
            // USER (400 - 499)
            USER_ADDED: {code: 400, desc: "Created user"},
            USER_UPDATED: {code: 401, desc: "Updated user"},
            USER_DELETED: {code: 402, desc: "Deleted user"},
            USER_LOGIN: {code: 403, desc: "Login"},
            USER_LOGOUT: {code: 404, desc: "Logout"},

            //GROUP USER (800 - 899)
            CREATE_MEMBER_GROUP: {code: 800, desc: "User created new member group"},
            UPDATE_MEMBER_GROUP: {code: 801, desc: "User updated member group"},
            DELETED_MEMBER_GROUP: {code: 802, desc: "User deleted member group"},
            ADD_MEMBER: {code: 803, desc: "Added member to group"},
            REMOVE_MEMBER: {code: 804, desc: "Removed member from group"},
            MOVE_MEMBER: {code: 805, desc: "Moved member to another group"},


        },
        ADDRESS_BOOK: {
            // ADDRESS_BOOK (600 - 699)
            ADDRESS_BOOK_ADDED: {code: 600, desc: "Created address book"},
            ADDRESS_BOOK_UPDATED: {code: 601, desc: "Updated address book"},
            ADDRESS_BOOK_DELETED: {code: 602, desc: "Deleted address book"},

            //GROUP ADDRESS (1000 - 1099)
            CREATE_ADDRESS_GROUP: {code: 1000, desc: "User created new member group"},
            UPDATE_ADDRESS_GROUP: {code: 1001, desc: "User updated member group"},
            DELETED_ADDRESS_GROUP: {code: 1002, desc: "User deleted member group"},
            ADD_ADDRESS: {code: 1003, desc: "Added member to group"},
            REMOVE_ADDRESS: {code: 1004, desc: "Removed member from group"},
            MOVE_ADDRESS: {code: 1005, desc: "Moved member to another group"}
        },
        CATEGORIES: {
            LICENSE: {code: 1, desc: "LICENSE"},
            FILE: {code: 2, desc: "FILE"},
            PROJECT: {code: 3, desc: "PROJECT"},
            USER: {code: 4, desc: "USER"},
            FOLDER: {code: 5, desc: "FOLDER"},
            ADDRESS_BOOK: {code: 6, desc: "ADDRESS_BOOK"},
            COLLABORATOR: {code: 7, desc: "COLLABORATOR"},
            GROUP_USER: {code: 8, desc: "GROUP_USER"},
            LABEL: {code: 9, desc: "LABEL"},
            GROUP_ADDRESS: {code: 10, desc: "GROUP_ADDRESS"},
            LINK: {code: 11, desc: "LINK"},
            COMMENT: {code: 12, desc: "COMMENT"}
        }
    })

    // API name
    .constant('APIName', {
        GET_ADMIN_COMPANIES: {name: 'api/auth/admin/companies', method: 'GET', params: {}, show_error: true},
        LOGIN_ADMIN: {name: 'api/auth/admin/login', method: 'POST', show_error: true},
        LOGOUT: {name: 'api/auth/logout'},
        GET_AUTH_INFO: {name: 'api/auth/info', method: 'GET', auth: true},
        GET_TEAM_HISTORY: {
            name: "api/histories/team/",
            method: "GET",
            auth: true
        },
        // Group User management
        CREATE_GROUP_USER: {
            name: 'api/user_groups',
            method: "POST",
            params: {},
            auth: true,
            success_msg: "default_toast.create_success"
        },
        GROUP_USER_LIST_MEMBER_BY_GROUP_IDS: {
            name: 'api/user_groups/users',
            method: 'GET',
            auth: true
        },
        REMOVE_MEMBER_OUT_GROUP_USER: {
            name: 'api/user_groups/',
            method: "DELETE",
            auth: true,
            success_msg: "default_toast.remove_success"
        },
        GROUP_USER_LIST_NOT_THIS_GROUP: {name: 'api/user_groups/', method: "GET", auth: true},

        GROUP_USER_LIST: {name: 'api/user_groups', method: "GET", auth: true},
        GROUP_USER_LIST_ALL: {name: 'api/user_groups/all', method: "GET", auth: true},
        GROUP_USER_ADD_MEMBERS_TO_GROUPS: {name: 'api/user_groups/users', method: "POST", auth: true},
        DELETE_GROUP_MEMBER: {
            name: 'api/user_groups',
            method: "DELETE",
            auth: true,
            success_msg: "default_toast.delete_success"
        },

        GROUP_USER_LIST_MEMBER: {name: 'api/user_groups/', method: "GET", auth: true},
        MEMBER: {name: '/users'},
        MOVE_USER_TO_GROUP: {
            name: 'api/user_groups/',
            method: "PUT",
            auth: true,
            success_msg: "default_toast.move_success"
        },

        CREATE_USER: {
            name: 'api/users',
            params: {},
            method: "POST",
            auth: true,
            success_msg: "default_toast.create_success",
            show_error: true
        },
        EDIT_USER: {
            name: 'api/users/',
            method: "PUT",
            params: {},
            auth: true,
            success_msg: "default_toast.update_success",
            show_error: true
        },
        DELETE_USER: {name: 'api/users', method: "DELETE", auth: true},
        USER_LIST: {name: 'api/users', method: "GET", auth: true},
        USER_LIST_ALL_BY_TEAM_ID: {name: 'api/users/', method: "GET", surfix: '/all', auth: true},
        GET_USER_PROFILE: {name: 'api/users/', method: "GET", params: {user_id: ''}, auth: true},
        UNLOCK_ACCOUNT: {
            name: 'api/users/',
            method: "PUT",
            suffix: '/unlock',
            auth: true
        },
        SIGN_UP: {name: 'api/users/signup', params: {}},
        SIGN_UP_TRIAL: {name: 'api/users/signup/trial', method: 'POST', params: {}},
        EXPORT_USER: {name: "api/users/export", method: 'GET'},
        ACTIVE_PAYMENT: {
            name: 'api/payments/team/',
            params: {},
            method: "POST",
            surfix: '/active'
        },
        API_TEAM: {name: 'api/team/'},
        UPDATE_PAYMENT_TEAM_PLAN: {name: 'api/payments/usage_plan/team/', method: "PUT"},
        CREATE_USER_FROM_CSV: {name: 'api/users/import', auth: true},
        GET_TEAM: {
            name: "api/teams/",
            method: "GET",
            auth: true,
            show_error: true
        },
        GET_TEAM_SETTING: {
            name: "api/team/settings",
            method: "GET",
            auth: true,
            show_error: true
        },
        GET_TEAM_DOMAINS: {
            name: "api/domains",
            method: "GET",
            auth: true,
            show_error: true
        },
        DELETE_TEAM_DOMAINS: {
            name: "api/domains",
            method: "DELETE",
            auth: true,
            show_error: true
        },
        ADD_TEAM_DOMAINS: {
            name: "api/domains",
            method: "POST",
            auth: true,
            show_error: true
        },
        GET_ACCOUNT_POLICY: {
            name: "api/team/settings",
            method: "GET",
            auth: true,
            show_error: true
        },
        GET_COMPANY_INFO: {
            name: "api/companies/",
            method: 'GET',
            prams: {},
            auth: true
        },

        API_USER: {name: "api/users/"},
        UPDATE_PASSWORD: {
            name: "/password",
            method: "PUT",
            prams: {},
            auth: true,
            success_msg: "default_toast.save_success"
        },
        UPDATE_EMAIL: {
            name: "api/auth/user/email",
            method: "PUT",
            auth: true,
            success_msg: "default_toast.save_success"
        },
        USER_CONFIRM_CHANGE_EMAIL: {
            name: "api/auth/user/email",
            method: "POST",
            auth: true
        },
        GENERATE_PIN_CODE: {name: "api/auth/user/pincode"},
        GET_PAYMENT_INFO: {name: "api/payments/team/", suffix: "/histories", method: "GET"},
        GET_PAYMENT_HISTORY: {name: "api/payments/team/", suffix: "/histories", method: "GET"},
        DOWNLOAD_RECEIPT: {name: "api/team/downloadreceipt", params: {}, auth: true},

        USER_CHANGE_CARD_INFO: {name: "api/payments/", suffix: "/card", method: "PUT"},
        USER_UPDATE_TEAM: {name: "api/teams/", method: "PUT"},
        USER_UPDATE_TEAM_SETTING: {name: "api/team/setting", method: "PUT"},
        UPDATE_NOTIFICATION_SETTING: {name: "api/team/settings/notification", method: "PUT"},
        UPDATE_PASSWORD_POLICY_SETTING: {name: "api/team/settings/password_policy", method: "PUT"},
        UPDATE_OUTLOOK_SETTING: {name: "api/team/settings/outlook", method: "PUT"},
        GET_TEAM_LIST: {name: "api/teams", method: 'GET'},
        ADMIN_CHANGE_PASSWORD: {name: "api/teams/", method: 'PUT', surfix: "/password"},
        ADMIN_CHANGE_EMAIL: {name: "api/teams/", method: 'PUT', surfix: "/email_change"},
        TEAM_STATUS: {name: "api/teams/", surfix: '/status/', method: 'PUT'},
        ADMIN_CREATE_TEAM: {name: "api/teams", method: 'POST'},
        GET_MEMBERS_TEAM: {
            name: "api/users/all",
            method: 'GET',
            auth: true
        },

        CHANGE_MEMBER_EMAIL: {
            name: "api/users/",
            method: 'PUT',
            auth: true,
            success_msg: "default_toast.save_success",
            surfix: '/change_email'
        },
        CHANGE_MEMBER_PASSWORD: {
            name: "api/users/",
            method: 'PUT',
            auth: true,
            success_msg: "default_toast.save_success",
            surfix: '/password'
        },
        //Super admin
        GET_COMPANY_LIST: {
            name: "api/companies",
            method: 'GET',
            auth: true
        },
        ADMIN_DEACTIVE_COMPANY: {
            name: "api/companies",
            method: 'DELETE',
            auth: true
        },
        ADMIN_CREATE_COMPANY: {name: "api/companies", method: 'POST'},
        GET_COMPANY_TEAM_LIST: {name: "api/teams/companies/", method: 'GET'},
        EXPORT_TEAM: {name: "api/teams/export", method: 'GET'},
        EDIT_COMPANY: {
            name: 'api/companies/',
            method: 'PUT',
            params: {},
            auth: true,
        },
        SUPER_ADMIN_CHANGE_COMPANY_PASSWORD: {
            name: "api/companies/",
            method: 'PUT',
            params: {},
            auth: true,
            success_msg: "default_toast.save_success",
            surfix: "/password"
        },
        ACTIVE_TEAM: {name: "api/admin/activeteam", auth: true, success_msg: "default_toast.update_success"},
        //Dashboard
        TEAM_STATISTIC: {name: "api/dashboard/teams/", method: "GET"},
        TEAM_USER_REGISTRATION_STATISTIC: {name: "api/dashboard/teams/", method: "GET", suffix: '/users'},
        COMPANY_STATISTIC: {name: "api/dashboard/companies", method: "GET"},
        TEAM_REGISTRATION_STATISTIC: {name: "api/dashboard/teams/registration", method: "GET"},
        SUPER_ADMIN_DASHBOARD_STATISTIC: {
            name: "api/dashboard/general",
            method: "GET",
            auth: true
        },
        // Forgot password
        FORGOT_PASSWORD: {
            name: "api/auth/user/password",
            method: "POST"
        },
        UPDATE_FORGOT_PASSWORD: {
            name: "api/auth/user/password",
            method: "PUT"
        },
        CHANGE_PASSWORD_EXPIRE: {
            name: "api/auth/user/password/expire",
            method: "PUT"
        },
        GET_PASSWORD_POLICY_SETTING: {
            name: "api/team/settings/password_policy",
            method: "GET"
        },
        GET_TEAM_SETTING_BY_TYPE: {
            name: "api/team/settings",
            method: "GET"
        },
        //File Report
        GET_FILE_REPORT: {name: 'api/files/', last: '/report/internal', method: "GET", params: {}, auth: true},
        GET_FILE_REPORT_DETAIL: {
            name: 'api/files/',
            last: '/report/internal/open',
            method: "GET",
            params: {},
            auth: true
        },
        // verify authen code to login
        VERIFY_AUTHEN_CODE_LOGIN: {
            name: 'api/auth/user/otp/login',
            method: "POST"
        },
        //get group member profile
        GET_GROUP_USER_PROFILE: {name: 'api/user_groups/', method: "GET", params: {}, auth: true},
        //update group member detail
        UPDATE_GROUP_USER_PROFILE: {
            name: 'api/user_groups/',
            method: "PUT",
            params: {},
            auth: true
        },
        DELETE_USAGE_PACKAGE: {
            name: 'api/pricing/package/',
            method: "DELETE",
            auth: true
        },
        GET_LIST_USER_PRICE_PAGING: {
            name: 'api/usage_package/user_price',
            method: "GET",
            auth: true
        },
        GET_LIST_STORAGE_PRICE_PAGING: {
            name: 'api/usage_package/storage_price',
            method: "GET",
            auth: true
        },
        ADD_USAGE_PACKAGE: {
            name: '/api/pricing/package',
            method: "POST",
            auth: true
        },
        GET_USAGE_PACKAGE_DETAIL: {
            name: 'api/usage_package/',
            method: "GET",
            auth: true
        },
        UPDATE_USAGE_PACKAGE: {
            name: 'api/usage_package/',
            method: "PUT",
            auth: true
        },
        GET_PAYMENT_PACKAGE: {name: "api/usage_package/packages", method: "GET"},
        VERIFY_PASSWORD_LINK: {
            name: 'api/links/',
            method: "GET",
            suffix: '/share/',
        },
        GET_REPORT: {name: "api/reports", method: "GET"},
        EXPORT_REPORT: {name: "api/reports/export", method: 'GET'},
        CREATE_TEAM_FROM_CSV: {name: 'api/teams/import', auth: true},
        CHECK_TEAM_FROM_CSV: {name: 'api/teams/upload/import', method: 'POST', auth: true},
        GET_TEAM_PAYMENT_INFO: {name: "api/payments/team/", method: "GET"},
        GET_PACKAGE_DETAIL: {
            name: 'api/pricing/package/',
            method: 'GET',
            auth: true
        },
    })

    // API status
    .constant('APIStatus', {
        OK: 200,
        UNAUTHORIZED: 401,
        WRONG_PASSWORD: 508,
        LINK_EXPIRED: 410,
        LIMITED_USER: 512,
        INVALID_PERMISSION: 403,
        EXISTED_EMAIL: 113,
        INVALID_EMAIL_FORMAT: 501,
        INVALID_DATE_FORMAT: 307
    })

    // Error from our server
    .constant('error', {
        AUTH: [
            {code: 401, description: "You're not allowed to do this."}
        ],
        OTHERS: [
            {code: 100, description: "Your data is not valid"},
            {code: 110, description: "User is not exist in the system."},
            {code: 111, description: "Username or password is not correct."},
            {code: 112, description: "You do not have permission to access this page."},
            {code: 113, description: "Email address already in use."},
            {code: 400, description: "There's an error occur"},
            {code: 300, description: "There's an error while encoding file."},
            {code: 301, description: "There's an error while uploading file."},
            {code: 302, description: "File is invalid. Your file is already encoded by HoGo, please try another file"},
            {code: 307, description: "Invalid expire date."},
            {code: 403, description: "You do not have permission."},
            {code: 404, description: "Not found."},
            {code: 410, description: "Link is expired."},
            {code: 411, description: "The activation code is out of date."},
            {code: 412, description: "Your account is already active."},
            {code: 413, description: "Out of number of members in team"},
            {code: 417, description: "Tracking failed"},
            {code: 500, description: "There's an error occur"},
            {code: 501, description: "Invalid email format"},
            {code: 502, description: "First Name contains speacial character"},
            {code: 503, description: "Last Name contains speacial character"},
            {code: 504, description: "Password is too short"},
            {code: 505, description: "Your confirm password is incorrect"},
            {code: 506, description: "You do not have the permission to do this action."},
            {code: 507, description: "This email is already exist"},
            {code: 508, description: "Wrong password"},
            {code: 509, description: "Cannot change yourself status from active to remove"},
            {code: 510, description: "This role is not exist"},
            {code: 511, description: "Middle Name contains speacial character"},
            {code: 512, description: "Limited Create User"},
            {code: 513, description: "This Team does not exist"},
            {code: 514, description: "This Team is existent"},
            {code: 515, description: "The input time is incorrect"},
            {code: 520, description: "File version not found"},
            {code: 521, description: "Can not delete current version of file"},
            {code: 602, description: "Your Team Payment data is missing"},
            {code: 708, description: "There are files encoding"}
        ]
    })

    .constant('objectStatus', {
        ACTIVE: 1,
        PENDING: 5,
        TRIAL: 6
    })

    .constant('notifyCode', {
        ADD_COMMENT: {code: 100, description: "ADD_COMMENT"},
        EDIT_COMMENT: {code: 101, description: "EDIT_COMMENT"},
        DELETE_COMMENT: {code: 102, description: "DELETE_COMMMENT"},
        ADD_PROJECT: {code: 200, description: "ADD_PROJECT"},
        EDIT_PROJECT: {code: 201, description: "EDIT_PROJECT"},
        DELETE_PROJECT: {code: 202, description: "DELETE_PROJECT"},
        COPY_PROJECT: {code: 203, description: "COPY_PROJECT"},
        MOVE_FOLDER: {code: 300, description: "MOVE_FOLDER"},
        ADD_FOLDER: {code: 301, description: "ADD_FOLDER"},
        DELETE_FOLDER: {code: 302, description: "DELETE_FOLDER"},
        COPY_FOLDER: {code: 306, description: "COPY_FOLDER"},
        MOVE_FILE: {code: 400, description: "MOVE_FILE"},
        ADD_FILE: {code: 401, description: "ADD_FILE"},
        ADD_FILE_CLOUD: {code: 402, description: "ADD_FILE_CLOUD"},
        DELETE_FILE: {code: 403, description: "DELETE_FILE"},
        FILE_NAME_UPDATED: {code: 405, description: "FILE_NAME_UPDATED"},
        COPY_FILE: {code: 407, description: "COPY_FILE"},

        ADD_MEMBER: {code: 500, description: "ADD_MEMBER"},
        ADD_MEMBER_FROM_CSV: {code: 501, description: "ADD_MEMBER_FROM_CSV"},
        UPDATE_MEMBER: {code: 502, description: "UPDATE_MEMBER"},
        DELETE_MEMBER: {code: 503, description: "DELETE_MEMBER"},
        RENAME_FILE_FOLDER: {code: 600, description: "DENAME_OBJECT"},
        INVITE_USER: {code: 700, description: "INVITE_USER_TO_PROJECT"},

    })

    .constant('notifyStatus', {
        NOTIFICATION: 1,
        SYSTEM_NOTIFY: 2
    })
    .constant('exchangeRate', {
        USD: 1,
        VND: 20000,
        JPY: 100
    })

    .constant('sortPage', {
        PROJECT_LIST: 'projectList',
        PROJECT_DETAIL: 'projectDetail',
        USER_LIST: 'userList',
        USER_GROUP_LIST: 'userGroupList',
        USER_LIST_IN_GROUP: 'userListInGroup',
        ADDRESS_LIST: 'addressList',
        ADDRESS_GROUP_LIST: 'addressGroupList',
        ADDRESS_LIST_IN_GROUP: 'addressListInGroup',
        INTERNAL_PROTECT_OFFLINE_TRACKING: 'internalProtectOfflineTracking',
        INTERNAL_NONE_PROTECT_ONLINE_TRACKING: 'internalNoneProtectOnlineTracking',
        INTERNAL_PROTECT_ONLINE_TRACKING: 'internalProtectOnlineTracking',
        EXTERNAL_PROTECT_OFFLINE_TRACKING: 'externalProtectOfflineTracking',
        LABEL_LIST: 'labelList',
        LINK_LIST: 'linkList',
        COMPANY_LIST: 'companyList',
        COMPANY_TEAM_LIST: 'companyTeamList',
        TEAM_USER_LIST: 'teamUserList',
        TEAM_LIST: 'teamList',
        LINK_DETAIL: 'linkDetail',
        USER_PRICES: 'userPrices',
        STORAGE_PRICES: 'storagePrices',
        PAYMENT_HISTORY: 'paymentHistory',
        REPORT: 'report',
    })

    .constant('localStorageKey', {
        CURRENCY: 'currency',
        TEAM_SETTING: 'teamSetting',
        DATA_SORT: 'dataSort',
        PASSWORD_POLICY: 'passwordPolicy',
    })

    .constant('paymentType', {
        ONLINE: 0,
        OFFLINE: 1,
    });
