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

148 lines
3.3 KiB
TypeScript

export interface KeyValue {
name: string;
value: string;
}
export interface KeyValueStyle {
name: string;
value: string;
icon:string;
bgColorClass:string;
textColorClass:string;
}
export type SelectOption<T = number> = {
value: T;
label: string;
};
export interface Listing {
id: string;
userId: string;
title: string;
description: Array<string>;
country: string;
city: string,
state: string;//enum
favoritesForUser:Array<string>;
hideImage?:boolean;
draft?:boolean;
created:Date;
updated:Date;
}
export interface BusinessListing extends Listing {
listingsCategory: 'business'; //enum
// summary: Array<string>;
type: string; //enum
price?: number;
realEstateIncluded?: boolean;
leasedLocation?:boolean;
franchiseResale?:boolean;
salesRevenue?: number;
cashFlow?: number;
// netProfit?: number;
supportAndTraining?: string;
employees?: number;
established?: number;
internalListingNumber?:number;
reasonForSale?: string;
brokerLicencing?: string;
internals?: string;
}
export interface ProfessionalsBrokersListing extends Listing {
listingsCategory: 'professionals_brokers'; //enum
summary: string;
address?: string;
email?: string;
website?: string;
category?: 'Professionals' | 'Broker';
}
export interface InvestmentsListing extends Listing {
listingsCategory: 'investment'; //enum
email?: string;
website?: string;
phoneNumber?: string;
}
export type ListingType =
| BusinessListing
| ProfessionalsBrokersListing
| InvestmentsListing;
export interface ListingCriteria {
type:string,
location:string,
minPrice:string,
maxPrice:string,
realEstateChecked:boolean,
listingsCategory:'business'|'professionals_brokers'|'investment',
category:'professional|broker'
}
export interface UserBase {
id: string;
firstname: string;
lastname: string;
email: string;
phoneNumber?: string;
companyOverview?:string;
companyWebsite?:string;
companyLocation?:string;
offeredServices?:string;
areasServed?:string;
}
export interface User extends UserBase {
licensedIn?:KeyValue[];
}
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;
}