import { InitPaymentModel } from "../models/init-payment.model";
const INIT_PAYMENT_KEY = "initPayment";

export class InitPaymentHelper {
    static Get(): InitPaymentModel | null | undefined {
        return JSON.parse(localStorage.getItem(INIT_PAYMENT_KEY)) as InitPaymentModel | null | undefined;
  }

    static Set(value: InitPaymentModel) {
        localStorage.setItem(INIT_PAYMENT_KEY, JSON.stringify(value));
  }

  static UpdateMultiPayments(value: boolean) {
    const data = this.Get();
    if(data) {
      data.isMultiPayments = value;
      this.Set(data)
    }
    } 

    static UpdateModel(value: object) {
        const data = this.Get();
        if (data) {
            data.data.finalModel = value;
            this.Set(data)
        }
    }
}