From 93ff8c3378702ad0f51d145c07e9d3eb8fdfd9db Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Tue, 5 Aug 2025 11:43:12 -0500 Subject: [PATCH] Issues 157,156,155 --- .../src/listings/business-listing.service.ts | 8 +- bizmatch-server/src/models/db.model.ts | 5 +- bizmatch-server/src/models/main.model.ts | 3 +- .../search-modal/search-modal.component.html | 48 ++-- .../search-modal/search-modal.component.ts | 12 +- .../details-business-listing.component.ts | 24 +- .../business-listings.component.html | 2 +- .../edit-business-listing.component.html | 268 +----------------- ...commercial-property-listing.component.html | 5 +- .../my-listing/my-listing.component.html | 14 - bizmatch/src/app/utils/utils.ts | 6 +- 11 files changed, 64 insertions(+), 331 deletions(-) diff --git a/bizmatch-server/src/listings/business-listing.service.ts b/bizmatch-server/src/listings/business-listing.service.ts index a17f2c6..1390c3d 100644 --- a/bizmatch-server/src/listings/business-listing.service.ts +++ b/bizmatch-server/src/listings/business-listing.service.ts @@ -70,12 +70,8 @@ export class BusinessListingService { whereConditions.push(lte(sql`(${businesses_json.data}->>'employees')::integer`, criteria.maxNumberEmployees)); } - if (criteria.establishedSince) { - whereConditions.push(gte(sql`(${businesses_json.data}->>'established')::integer`, criteria.establishedSince)); - } - - if (criteria.establishedUntil) { - whereConditions.push(lte(sql`(${businesses_json.data}->>'established')::integer`, criteria.establishedUntil)); + if (criteria.establishedMin) { + whereConditions.push(gte(sql`(${businesses_json.data}->>'established')::integer`, criteria.establishedMin)); } if (criteria.realEstateChecked) { diff --git a/bizmatch-server/src/models/db.model.ts b/bizmatch-server/src/models/db.model.ts index 16d7d3b..af2a956 100644 --- a/bizmatch-server/src/models/db.model.ts +++ b/bizmatch-server/src/models/db.model.ts @@ -277,9 +277,11 @@ export const BusinessListingSchema = z franchiseResale: z.boolean().optional().nullable(), salesRevenue: z.number().positive().nullable(), cashFlow: z.number().optional().nullable(), + ffe: z.number().optional().nullable(), + inventory: z.number().optional().nullable(), supportAndTraining: z.string().min(5).optional().nullable(), employees: z.number().int().positive().max(100000).optional().nullable(), - established: z.number().int().min(1800).max(2030).optional().nullable(), + established: z.number().int().min(1).max(250).optional().nullable(), internalListingNumber: z.number().int().positive().optional().nullable(), reasonForSale: z.string().min(5).optional().nullable(), brokerLicencing: z.string().optional().nullable(), @@ -327,6 +329,7 @@ export const CommercialPropertyListingSchema = z price: z.number().positive(), favoritesForUser: z.array(z.string()), listingsCategory: ListingsCategoryEnum, + internalListingNumber: z.number().int().positive().optional().nullable(), draft: z.boolean(), imageOrder: z.array(z.string()), imagePath: z.string().nullable().optional(), diff --git a/bizmatch-server/src/models/main.model.ts b/bizmatch-server/src/models/main.model.ts index 51db50b..47de0ab 100644 --- a/bizmatch-server/src/models/main.model.ts +++ b/bizmatch-server/src/models/main.model.ts @@ -84,8 +84,7 @@ export interface BusinessListingCriteria extends ListCriteria { maxCashFlow: number; minNumberEmployees: number; maxNumberEmployees: number; - establishedSince: number; - establishedUntil: number; + establishedMin: number; realEstateChecked: boolean; leasedLocation: boolean; franchiseResale: boolean; diff --git a/bizmatch/src/app/components/search-modal/search-modal.component.html b/bizmatch/src/app/components/search-modal/search-modal.component.html index c110041..d7a5be3 100644 --- a/bizmatch/src/app/components/search-modal/search-modal.component.html +++ b/bizmatch/src/app/components/search-modal/search-modal.component.html @@ -39,6 +39,9 @@ Cashflow: {{ criteria.minCashFlow || 'Any' }} - {{ criteria.maxCashFlow || 'Any' }} + + Title: {{ criteria.title }} + Categories: {{ criteria.types.join(', ') }} @@ -48,8 +51,8 @@ Employees: {{ criteria.minNumberEmployees || 'Any' }} - {{ criteria.maxNumberEmployees || 'Any' }} - - Established: {{ criteria.establishedSince || 'Any' }} - {{ criteria.establishedUntil || 'Any' }} + + Established: {{ criteria.establishedMin || 'Any' }} Broker: {{ criteria.brokerName }} @@ -176,24 +179,15 @@
- +
- - -
@@ -243,6 +237,9 @@ Cashflow: {{ criteria.minCashFlow || 'Any' }} - {{ criteria.maxCashFlow || 'Any' }} + + Title: {{ criteria.title }} + Categories: {{ criteria.types.join(', ') }} @@ -252,8 +249,8 @@ Employees: {{ criteria.minNumberEmployees || 'Any' }} - {{ criteria.maxNumberEmployees || 'Any' }} - - Established: {{ criteria.establishedSince || 'Any' }} - {{ criteria.establishedUntil || 'Any' }} + + Years established: {{ criteria.establishedMin || 'Any' }} Broker: {{ criteria.brokerName }} @@ -380,24 +377,15 @@
- +
- - -
diff --git a/bizmatch/src/app/components/search-modal/search-modal.component.ts b/bizmatch/src/app/components/search-modal/search-modal.component.ts index be46a2a..ac9496f 100644 --- a/bizmatch/src/app/components/search-modal/search-modal.component.ts +++ b/bizmatch/src/app/components/search-modal/search-modal.component.ts @@ -89,9 +89,9 @@ export class SearchModalComponent { this.selectedPropertyType || this.criteria.minNumberEmployees || this.criteria.maxNumberEmployees || - this.criteria.establishedSince || - this.criteria.establishedUntil || - this.criteria.brokerName + this.criteria.establishedMin || + this.criteria.brokerName || + this.criteria.title ); } removeFilter(filterType: string) { @@ -131,12 +131,14 @@ export class SearchModalComponent { this.criteria.maxNumberEmployees = null; break; case 'established': - this.criteria.establishedSince = null; - this.criteria.establishedUntil = null; + this.criteria.establishedMin = null; break; case 'brokerName': this.criteria.brokerName = null; break; + case 'title': + this.criteria.title = null; + break; } this.searchService.search(this.criteria); } diff --git a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts index f205a37..90ea8e5 100644 --- a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts +++ b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts @@ -150,12 +150,28 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent { const result = [ { label: 'Category', value: this.selectOptions.getBusiness(this.listing.type) }, { label: 'Located in', value: `${this.listing.location.name ? this.listing.location.name : this.listing.location.county}, ${this.selectOptions.getState(this.listing.location.state)}` }, - { label: 'Asking Price', value: `${this.listing.price ? `$${this.listing.price.toLocaleString()}` : ''}` }, - { label: 'Sales revenue', value: `${this.listing.salesRevenue ? `$${this.listing.salesRevenue.toLocaleString()}` : ''}` }, - { label: 'Cash flow', value: `${this.listing.cashFlow ? `$${this.listing.cashFlow.toLocaleString()}` : ''}` }, + { label: 'Asking Price', value: `${this.listing.price ? `$${this.listing.price.toLocaleString()}` : 'undisclosed '}` }, + { label: 'Sales revenue', value: `${this.listing.salesRevenue ? `$${this.listing.salesRevenue.toLocaleString()}` : 'undisclosed '}` }, + { label: 'Cash flow', value: `${this.listing.cashFlow ? `$${this.listing.cashFlow.toLocaleString()}` : 'undisclosed '}` }, + ...(this.listing.ffe + ? [ + { + label: 'Furniture, Fixtures / Equipment Value (FFE)', + value: `$${this.listing.ffe.toLocaleString()}`, + }, + ] + : []), + ...(this.listing.inventory + ? [ + { + label: 'Inventory at Cost Value', + value: `$${this.listing.inventory.toLocaleString()}`, + }, + ] + : []), { label: 'Type of Real Estate', value: typeOfRealEstate }, { label: 'Employees', value: this.listing.employees }, - { label: 'Established since', value: this.listing.established }, + { label: 'Years established', value: this.listing.established }, { label: 'Support & Training', value: this.listing.supportAndTraining }, { label: 'Reason for Sale', value: this.listing.reasonForSale }, { label: 'Broker licensing', value: this.listing.brokerLicencing }, diff --git a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html index 8e3a812..0d69647 100644 --- a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html +++ b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html @@ -36,7 +36,7 @@

Sales revenue: {{ listing.salesRevenue | currency : 'USD' : 'symbol' : '1.0-0' }}

Net profit: {{ listing.cashFlow | currency : 'USD' : 'symbol' : '1.0-0' }}

Location: {{ listing.location.name ? listing.location.name : listing.location.county }}

-

Established: {{ listing.established }}

+

Years established: {{ listing.established }}

Company logo