File

projects/maplander/components/src/lib/components/property/propertyConfig.ts

Implements

DetailsConfigModel

Index

Properties

Constructor

constructor(config: DetailsConfigModel)
Parameters :
Name Type Optional
config DetailsConfigModel No

Properties

disableRequestCommission
Type : boolean
hideRequestCommission
Type : boolean
mlsLabel
Type : string
mode
Type : "record" | "share-record" | "detail"
property
Type : NewCompleteProperty
toCurrency
Type : literal type
import {Address, Currency, NewCompleteProperty, OfferingTypeEnum, PropertyTypeEnum} from '@maplander/types';

// ----------------------------------------------------------

export interface DetailsConfigModel {
  property: NewCompleteProperty;
  mode: 'record' | 'share-record' | 'detail';
  hideRequestCommission?: boolean;
  disableRequestCommission?: boolean;
  toCurrency?: {
    value: number,
    currency: Currency;
  };
  mlsLabel?: string;
}

export class DetailsConfig implements DetailsConfigModel {
  disableRequestCommission: boolean;
  hideRequestCommission: boolean;
  mlsLabel: string;
  mode: 'record' | 'share-record' | 'detail';
  property: NewCompleteProperty;
  toCurrency: { value: number; currency: Currency };

  constructor(config: DetailsConfigModel) {
    this.mode = config.mode;
    this.property = config.property;
    this.disableRequestCommission = config ? config.disableRequestCommission : false;
    this.hideRequestCommission = config ? config.hideRequestCommission : false;
    this.mlsLabel = config ? config.mlsLabel : null;
    this.toCurrency = config ? config.toCurrency : null;
  }

}

// ----------------------------------------------------------

export interface EditorConfigModel<T extends AddPropertyConfigModel | EditPropertyConfigModel> {
  config: T;
  disableConfirmAnnounce?: boolean;
  mlsLabel?: string;
}

export interface AddPropertyConfigModel {
  address: Address;
  type: PropertyTypeEnum;
  offering: OfferingTypeEnum;
}

export interface EditPropertyConfigModel {
  property: NewCompleteProperty;
}

export class EditorConfig<T extends AddPropertyConfig | EditPropertyConfig> implements EditorConfigModel<T> {
  config: T;
  disableConfirmAnnounce: boolean;
  mlsLabel: string;

  constructor(config: T) {
    this.config = config;
    this.disableConfirmAnnounce = false;
    this.mlsLabel = 'MLS';
  }

}

export class AddPropertyConfig implements AddPropertyConfigModel {
  address: Address;
  offering: OfferingTypeEnum;
  type: PropertyTypeEnum;

  constructor(config: AddPropertyConfigModel) {
    this.address = config.address;
    this.offering = config.offering;
    this.type = config.type;
  }
}

export class EditPropertyConfig implements EditPropertyConfigModel {
  property: NewCompleteProperty;

  constructor(property: NewCompleteProperty) {
    this.property = property;
  }
}

// ----------------------------------------------------------

result-matching ""

    No results matching ""