export interface EventPropertiesData {
  province?: string;
  city?: string;
  [key: string]: unknown;
}

export class EventProperties {
  private readonly _data: EventPropertiesData;

  private constructor(data: EventPropertiesData) {
    this._data = { ...data };
  }

  get data(): EventPropertiesData {
    return { ...this._data };
  }

  get province(): string | undefined {
    return this._data.province;
  }

  get city(): string | undefined {
    return this._data.city;
  }

  get appVersion(): string | undefined {
    return this._data.appVersion as string | undefined;
  }

  static empty(): EventProperties {
    return new EventProperties({});
  }

  static fromData(data: EventPropertiesData): EventProperties {
    return new EventProperties(data);
  }

  toJSON(): EventPropertiesData {
    return this._data;
  }
}
