-- SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

CREATE TABLE IF NOT EXISTS cqrs_identity_employee_query
(
    version           bigint CHECK (version >= 0) NOT NULL,

    created_time timestamp with time zone DEFAULT (CURRENT_TIMESTAMP) NOT NULL,

    first_name TEXT NOT NULL,
    last_name TEXT NOT NULL,

	emp_id UUID NOT NULL UNIQUE,



    phone_number_country_code INTEGER NOT NULL,
    phone_number_number BIGINT NOT NULL,

    phone_verified BOOLEAN NOT NULL DEFAULT FALSE,

	store_id UUID DEFAULT NULL,

	role_id UUID DEFAULT NULL,

	deleted BOOLEAN NOT NULL DEFAULT FALSE,

    PRIMARY KEY (emp_id)
);
