File

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

Index

Properties

Properties

disableRequestCommission
disableRequestCommission: boolean
Type : boolean
Optional
hideRequestCommission
hideRequestCommission: boolean
Type : boolean
Optional
mlsLabel
mlsLabel: string
Type : string
Optional
mode
mode: "record" | "share-record" | "detail"
Type : "record" | "share-record" | "detail"
property
property: NewCompleteProperty
Type : NewCompleteProperty
toCurrency
toCurrency: literal type
Type : literal type
Optional
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 ""