﻿CREATE TABLE [dbo].[BO_Operators] (
    [OperatorId]           INT            IDENTITY (1, 1) NOT NULL,
	[ApiConsumerId]		   INT			   NOT NULL,
    [OperatorName]         VARCHAR (50)   NOT NULL,
    [OperatorPassword]     VARCHAR (100)  NOT NULL,
    [OperatorCreationDate] DATETIME2 (7)  CONSTRAINT [DF_Operators_OperatorCreationDate] DEFAULT (getutcdate()) NOT NULL,
    [FirstName]            NVARCHAR (50)  NULL,
    [LastName]             NVARCHAR (50)  NULL,
    [Phone]                VARCHAR (50)   NULL,
    [Email]                NVARCHAR (250) NULL,
    [CountryId]            INT            NULL,
    [IsActive]             BIT            CONSTRAINT [DF_Operators_IsActive] DEFAULT ((1)) NOT NULL,
    [IsReadOnly]           BIT            CONSTRAINT [DF_Operators_IsReadOnly] DEFAULT ((0)) NOT NULL,
    [IsTest]               BIT            CONSTRAINT [DF_Operators_IsTest] DEFAULT ((0)) NOT NULL,
    [OperatorTeamId]       SMALLINT       NULL,
    [IsTeamManager]        BIT            CONSTRAINT [DF_Operators_IsTeamManager] DEFAULT ((0)) NOT NULL,
    [PermissionRoleId]     INT            NULL,
    CONSTRAINT [PK_BO_Operators_OperatorId] PRIMARY KEY CLUSTERED ([OperatorId] ASC)
);

