@arkasuryawan/m2-interfaces
Version:
Squaremetre Data Interfaces
196 lines (195 loc) • 5.52 kB
TypeScript
import mongoose from "mongoose";
import { AddressInterface, AuditInterface, EmployeeType, TenantType } from "../interfaces";
import { OfficesInterface } from "./office.interface";
import { TenantInterface } from "./tenant.interface";
export interface AgentInterface extends AuditInterface {
uid?: string;
fullName: string;
firstName: string;
lastName?: string;
mobile?: string;
phone?: string;
image: string;
email: string;
dateOfBirth?: string;
licenceNumber?: string;
licenceExpiryDate?: string;
address?: AddressInterface;
/**
* @deprecated The method should not be used move to `officeId`
*/
OfficeId?: string;
officeId?: string;
office?: OfficesInterface;
jobTitle?: string;
specialistAreas?: string[];
awards?: string[];
employeeType?: EmployeeType;
coa?: string;
/**
* @deprecated The method should not be used move to `tenantTypes`
*/
tenantType?: TenantType;
/**
* @abstract New field moving from `tenantType`
*/
tenantTypes?: TenantType[];
tenantId?: string;
tenant?: TenantInterface;
aggregatorIds?: string[];
aggregators?: TenantInterface[];
profile?: string;
profileVideo?: string;
startDate?: string;
contractValedDate?: string;
showOnWeb: boolean;
status: "Active" | "Archived";
customToken?: string;
facebookUrl?: string;
instagramUrl?: string;
linkedInUrl?: string;
twitterUrl?: string;
keyword?: string;
callCalenderUrl?: string;
agentLanguages?: string[];
deviceToken?: string[];
integrationTokens?: {
provider: string;
token: any;
}[];
groupId?: string;
group?: GroupInterface;
/**
* @abstract just for JWT
*/
groupAccess?: GroupAccessInterface[];
}
export interface AgentInterfaceServer extends AuditInterface {
uid?: string;
fullName: string;
firstName: string;
lastName?: string;
mobile?: string;
phone?: string;
image: string;
email: string;
dateOfBirth?: string;
licenceNumber?: string;
licenceExpiryDate?: string;
address?: mongoose.Types.ObjectId;
OfficeId?: string;
office?: mongoose.Types.ObjectId;
jobTitle?: string;
specialistAreas?: string[];
awards?: string[];
employeeType?: EmployeeType;
/**
* @deprecated The method should not be used move to `tenantTypes`
*/
tenantType?: TenantType;
/**
* @abstract New field moving from `tenantType`
*/
tenantTypes?: TenantType[];
tenantId?: string;
tenant?: mongoose.Types.ObjectId;
aggregatorIds?: string[];
aggregators?: mongoose.Types.ObjectId[];
profile?: string;
profileVideo?: string;
startDate?: string;
contractValedDate?: string;
showOnWeb: boolean;
status: "Active" | "Archived";
customToken?: string;
facebookUrl?: string;
instagramUrl?: string;
linkedInUrl?: string;
twitterUrl?: string;
keyword?: string;
callCalenderUrl?: string;
agentLanguages?: string[];
deviceToken?: string[];
integrationTokens?: {
provider: string;
token: any;
}[];
groupId?: string;
group?: mongoose.Types.ObjectId;
/**
* @abstract just for JWT
*/
groupAccess?: mongoose.Types.ObjectId[];
}
export interface GroupInterface extends AuditInterface {
name: string;
description: string;
tenantType: TenantType;
}
/**
* @abstract TODO: Think letter
*/
export interface GroupAccessContex extends AuditInterface {
groupId: string;
group: GroupInterface;
}
export interface GroupAccessContexServer extends AuditInterface {
groupId: string;
group: mongoose.Types.ObjectId;
}
export interface GroupAccessInterface extends AuditInterface {
groupId: string;
group: GroupInterface;
/**
* @abstract ModelName -- Menu
*/
menu: string;
/**
* @abstract Array of Field Name of model eq: ["name", "address", "date"]
* @abstract * for all field ["*"]
* @abstract !name => Except ["!name", "!address", "!date"]
*/
view: string[];
/**
* @abstract Array of Field Name of model eq: ["name", "address", "date"]
* @abstract * for all field
* @abstract !name => Except ["!name", "!address", "!date"]
*/
create: string[];
/**
* @abstract Array of Field Name of model eq: ["name", "address", "date"]
* @abstract * for all field
* @abstract !name => Except ["!name", "!address", "!date"]
*/
update: string[];
delete: boolean;
exceptField?: string[];
}
export interface GroupAccessInterfaceServer extends AuditInterface {
groupId: string;
group: mongoose.Types.ObjectId;
/**
* @abstract ModelName -- Menu
*/
menu: string;
/**
* @abstract Array of Field Name of model eq: ["name", "address", "date"]
* @abstract * for all field ["*"]
* @abstract !name => Except ["!name", "!address", "!date"]
*/
view: string[];
/**
* @abstract Array of Field Name of model eq: ["name", "address", "date"]
* @abstract * for all field
* @abstract !name => Except ["!name", "!address", "!date"]
*/
create: string[];
/**
* @abstract Array of Field Name of model eq: ["name", "address", "date"]
* @abstract * for all field
* @abstract !name => Except ["!name", "!address", "!date"]
*/
update: string[];
delete: boolean;
exceptField?: string[];
}