init project portal web
This commit is contained in:
50
lib/price-plan-detail/state/rate-plan-form-state.ts
Normal file
50
lib/price-plan-detail/state/rate-plan-form-state.ts
Normal file
@ -0,0 +1,50 @@
|
||||
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 = "";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user