Ticket Fixing: #111, #110, #108 (SortBy)

This commit is contained in:
2024-09-09 17:35:08 +02:00
parent 9ecc0c2429
commit 06d83a478d
23 changed files with 308 additions and 70 deletions

View File

@@ -22,6 +22,8 @@ export interface UserData {
created?: Date;
updated?: Date;
}
export type SortByOptions = 'priceAsc' | 'priceDesc' | 'creationDateFirst' | 'creationDateLast' | 'nameAsc' | 'nameDesc' | 'srAsc' | 'srDesc' | 'cfAsc' | 'cfDesc';
export type SortByTypes = 'professional' | 'listing' | 'business' | 'commercial';
export type Gender = 'male' | 'female';
export type CustomerType = 'buyer' | 'seller' | 'professional';
export type CustomerSubType = 'broker' | 'cpa' | 'attorney' | 'titleCompany' | 'surveyor' | 'appraiser';
@@ -143,8 +145,7 @@ export const GeoSchema = z.object({
},
),
});
const phoneRegex = /^\(\d{3}\)\s\d{3}-\d{4}$/;
const phoneRegex = /^(\+1|1)?[-.\s]?\(?[2-9]\d{2}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/;
export const UserSchema = z
.object({
id: z.string().uuid().optional().nullable(),

View File

@@ -1,5 +1,5 @@
import Stripe from 'stripe';
import { BusinessListing, CommercialPropertyListing, Sender, User } from './db.model';
import { BusinessListing, CommercialPropertyListing, Sender, SortByOptions, SortByTypes, User } from './db.model';
import { State } from './server.model';
export interface StatesResult {
@@ -11,6 +11,12 @@ export interface KeyValue {
name: string;
value: string;
}
export interface KeyValueAsSortBy {
name: string;
value: SortByOptions;
type?: SortByTypes;
selectName?: string;
}
export interface KeyValueRatio {
label: string;
value: number;
@@ -63,6 +69,7 @@ export interface ListCriteria {
state: string;
city: GeoResult;
prompt: string;
sortBy: SortByOptions;
searchType: 'exact' | 'radius';
// radius: '5' | '20' | '50' | '100' | '200' | '300' | '400' | '500';
radius: number;