Validierung Part II, neue Komponenten

This commit is contained in:
2024-08-01 22:43:32 +02:00
parent 2955c034a0
commit 29f88d610f
18 changed files with 1431 additions and 242 deletions

View File

@@ -1,94 +1,93 @@
import { Router } from '@angular/router';
import { ConsoleFormattedStream, INFO, createLogger as _createLogger, stdSerializers } from 'browser-bunyan';
import { jwtDecode } from 'jwt-decode';
import { BusinessListing, CommercialPropertyListing, User } from '../../../../bizmatch-server/src/models/db.model';
import { BusinessListingCriteria, CommercialPropertyListingCriteria, JwtToken, KeycloakUser, UserListingCriteria } from '../../../../bizmatch-server/src/models/main.model';
export function createDefaultUser(email: string, firstname: string, lastname: string): User {
return {
id: undefined,
email,
firstname,
lastname,
phoneNumber: '',
description: '',
companyName: '',
companyOverview: '',
companyWebsite: '',
companyLocation: '',
offeredServices: '',
areasServed: [],
hasProfile: false,
hasCompanyLogo: false,
licensedIn: [],
gender: undefined,
customerType: undefined,
customerSubType: undefined,
created: new Date(),
updated: new Date(),
};
}
// export function createDefaultUser(email: string, firstname: string, lastname: string): User {
// return {
// id: undefined,
// email,
// firstname,
// lastname,
// phoneNumber: '',
// description: '',
// companyName: '',
// companyOverview: '',
// companyWebsite: '',
// companyLocation: '',
// offeredServices: '',
// areasServed: [],
// hasProfile: false,
// hasCompanyLogo: false,
// licensedIn: [],
// gender: undefined,
// customerType: undefined,
// customerSubType: undefined,
// created: new Date(),
// updated: new Date(),
// };
// }
export function createDefaultCommercialPropertyListing(): CommercialPropertyListing {
return {
id: undefined,
serialId: undefined,
email: '',
type: null,
title: '',
description: '',
city: '',
state: '',
price: null,
favoritesForUser: [],
hideImage: false,
draft: false,
zipCode: null,
county: '',
imageOrder: [],
imagePath: '',
created: null,
updated: null,
visits: null,
lastVisit: null,
latitude: null,
longitude: null,
listingsCategory: 'commercialProperty',
};
}
export function createDefaultBusinessListing(): BusinessListing {
return {
id: undefined,
email: '',
type: null,
title: '',
description: '',
city: '',
state: '',
price: null,
favoritesForUser: [],
draft: false,
realEstateIncluded: false,
leasedLocation: false,
franchiseResale: false,
salesRevenue: null,
cashFlow: null,
supportAndTraining: '',
employees: null,
established: null,
internalListingNumber: null,
reasonForSale: '',
brokerLicencing: '',
internals: '',
created: null,
updated: null,
visits: null,
lastVisit: null,
latitude: null,
longitude: null,
listingsCategory: 'business',
};
}
// export function createDefaultCommercialPropertyListing(): CommercialPropertyListing {
// return {
// id: undefined,
// serialId: undefined,
// email: '',
// type: null,
// title: '',
// description: '',
// city: '',
// state: '',
// price: null,
// favoritesForUser: [],
// hideImage: false,
// draft: false,
// zipCode: null,
// county: '',
// imageOrder: [],
// imagePath: '',
// created: null,
// updated: null,
// visits: null,
// lastVisit: null,
// latitude: null,
// longitude: null,
// listingsCategory: 'commercialProperty',
// };
// }
// export function createDefaultBusinessListing(): BusinessListing {
// return {
// id: undefined,
// email: '',
// type: null,
// title: '',
// description: '',
// city: '',
// state: '',
// price: null,
// favoritesForUser: [],
// draft: false,
// realEstateIncluded: false,
// leasedLocation: false,
// franchiseResale: false,
// salesRevenue: null,
// cashFlow: null,
// supportAndTraining: '',
// employees: null,
// established: null,
// internalListingNumber: null,
// reasonForSale: '',
// brokerLicencing: '',
// internals: '',
// created: null,
// updated: null,
// visits: null,
// lastVisit: null,
// latitude: null,
// longitude: null,
// listingsCategory: 'business',
// };
// }
export function createEmptyBusinessListingCriteria(): BusinessListingCriteria {
return {
start: 0,