51 lines
1.1 KiB
TypeScript
51 lines
1.1 KiB
TypeScript
import { makeAutoObservable } from "mobx"
|
|
|
|
export default class RatePlanFormState {
|
|
private open: boolean = false;
|
|
private ratePlanName: string = "";
|
|
private ratePlanCode: string = "";
|
|
private ratePlanType: string = "";
|
|
private remarks: string = "";
|
|
|
|
constructor() {
|
|
makeAutoObservable(this);
|
|
}
|
|
|
|
// --- Getters ---
|
|
getOpen = () => this.open;
|
|
getRatePlanName = () => this.ratePlanName;
|
|
getRatePlanCode = () => this.ratePlanCode;
|
|
getRatePlanType = () => this.ratePlanType;
|
|
getRemarks = () => this.remarks;
|
|
|
|
// --- Setters ---
|
|
setOpen = (value: boolean) => {
|
|
this.open = value;
|
|
};
|
|
|
|
setRatePlanName = (value: string) => {
|
|
this.ratePlanName = value;
|
|
};
|
|
|
|
setRatePlanCode = (value: string) => {
|
|
this.ratePlanCode = value;
|
|
};
|
|
|
|
setRatePlanType = (value: string) => {
|
|
this.ratePlanType = value;
|
|
};
|
|
|
|
setRemarks = (value: string) => {
|
|
this.remarks = value;
|
|
};
|
|
|
|
// --- Reset ---
|
|
reset = () => {
|
|
this.open = false;
|
|
this.ratePlanName = "";
|
|
this.ratePlanCode = "";
|
|
this.ratePlanType = "";
|
|
this.remarks = "";
|
|
};
|
|
}
|