bizmatch-project/common-models/src/main.model.ts

210 lines
4.6 KiB
TypeScript

export interface KeyValue {
name: string;
value: string;
}
export interface KeyValueRatio {
label: string;
value: number;
}
export interface KeyValueStyle {
name: string;
value: string;
icon:string;
bgColorClass:string;
textColorClass:string;
}
export type SelectOption<T = number> = {
value: T;
label: string;
};
export type ImageType = {
name:'propertyPicture'|'companyLogo'|'profile',upload:string,delete:string,
}
export type ListingCategory = {
name: 'business' | 'commercialProperty'
}
export interface Listing {
id: string;
userId: string;
type: string; //enum
title: string;
description: string;
country: string;
city: string,
state: string;//enum
price?: number;
favoritesForUser:Array<string>;
hideImage?:boolean;
draft?:boolean;
created:Date;
updated:Date;
}
export interface BusinessListing extends Listing {
listingsCategory: 'business'; //enum
realEstateIncluded?: boolean;
leasedLocation?:boolean;
franchiseResale?:boolean;
salesRevenue?: number;
cashFlow?: number;
supportAndTraining?: string;
employees?: number;
established?: number;
internalListingNumber?:number;
reasonForSale?: string;
brokerLicencing?: string;
internals?: string;
}
export interface CommercialPropertyListing extends Listing {
listingsCategory: 'commercialProperty'; //enum
zipCode:number;
county:string
email?: string;
website?: string;
phoneNumber?: string;
imageOrder?:ImageProperty[];
}
export type ListingType =
| BusinessListing
| CommercialPropertyListing;
export type ResponseBusinessListingArray = {
data:BusinessListing[],
total:number
}
export type ResponseBusinessListing = {
data:BusinessListing
}
export type ResponseCommercialPropertyListingArray = {
data:CommercialPropertyListing[],
total:number
}
export type ResponseCommercialPropertyListing = {
data:CommercialPropertyListing
}
export interface ListingCriteria {
start:number,
length:number,
page:number,
pageCount:number,
type:string,
state:string,
minPrice:string,
maxPrice:string,
realEstateChecked:boolean,
title:string,
listingsCategory:'business'|'professionals_brokers'|'commercialProperty',
category:'professional|broker'
}
export interface UserBase {
id: string;
firstname: string;
lastname: string;
email: string;
phoneNumber?: string;
description?:string;
companyName?:string;
companyOverview?:string;
companyWebsite?:string;
companyLocation?:string;
offeredServices?:string;
areasServed?:string[];
hasProfile?:boolean;
hasCompanyLogo?:boolean;
}
export interface User extends UserBase {
licensedIn?:KeyValue[];
}
export interface KeycloakUser {
id: string
createdTimestamp: number
username: string
enabled: boolean
totp: boolean
emailVerified: boolean
firstName: string
lastName: string
email: string
disableableCredentialTypes: any[]
requiredActions: any[]
notBefore: number
access: Access
}
export interface Access {
manageGroupMembership: boolean
view: boolean
mapRoles: boolean
impersonate: boolean
manage: boolean
}
export interface Subscription {
id: string;
userId:string
level: string;
start: Date;
modified: Date;
end: Date;
status: string;
invoices: Array<Invoice>;
}
export interface Invoice {
id: string,
date: Date,
price: number
}
export interface JwtToken {
exp: number;
iat: number;
auth_time: number;
jti: string;
iss: string;
aud: string;
sub: string;
typ: string;
azp: string;
nonce: string;
session_state: string;
acr: string;
realm_access: Realmaccess;
resource_access: Resourceaccess;
scope: string;
sid: string;
email_verified: boolean;
name: string;
preferred_username: string;
given_name: string;
family_name: string;
email: string;
user_id: string;
}
interface Resourceaccess {
account: Realmaccess;
}
interface Realmaccess {
roles: string[];
}
export interface PageEvent {
first: number;
rows: number;
page: number;
pageCount: number;
}
export interface AutoCompleteCompleteEvent {
originalEvent: Event;
query: string;
}
export interface MailInfo {
sender: Sender;
userId: string;
}
export interface Sender {
name?: string;
email?: string;
phoneNumber?: string;
state?: string;
comments?: string;
}
export interface ImageProperty {
id:string;
code:string;
name:string;
}