forked from Yara724/api
daghi + expert and damage expert name in decision +
signature required added
This commit is contained in:
29
src/helpers/expert-profile-snapshot.ts
Normal file
29
src/helpers/expert-profile-snapshot.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { ExpertModel } from "src/users/entities/schema/expert.schema";
|
||||
import { DamageExpertModel } from "src/users/entities/schema/damage-expert.schema";
|
||||
import { ExpertProfileSnapshot } from "src/request-management/entities/schema/expert-profile-snapshot.schema";
|
||||
|
||||
export function snapshotFromFieldExpert(
|
||||
doc: ExpertModel | null | undefined,
|
||||
): ExpertProfileSnapshot | undefined {
|
||||
if (!doc) return undefined;
|
||||
return {
|
||||
firstName: doc.firstName ?? undefined,
|
||||
lastName: doc.lastName ?? undefined,
|
||||
email: doc.email ?? undefined,
|
||||
insuActivityCo: doc.insuActivityCo ?? undefined,
|
||||
mobile: (doc.mobile ?? doc.phone) ?? undefined,
|
||||
};
|
||||
}
|
||||
|
||||
export function snapshotFromDamageExpert(
|
||||
doc: DamageExpertModel | null | undefined,
|
||||
): ExpertProfileSnapshot | undefined {
|
||||
if (!doc) return undefined;
|
||||
return {
|
||||
firstName: doc.firstName ?? undefined,
|
||||
lastName: doc.lastName ?? undefined,
|
||||
email: doc.email ?? undefined,
|
||||
insuActivityCo: doc.insuActivityCo ?? undefined,
|
||||
mobile: doc.mobile ?? undefined,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user