init project portal web

This commit is contained in:
Sweli Giri
2025-04-15 13:56:54 +07:00
parent 9a25243035
commit 8b15dcebf8
122 changed files with 13965 additions and 1 deletions

View File

@ -0,0 +1,102 @@
import { makeAutoObservable } from "mobx";
export class PricePlanFormStore {
// --- Private state ---
private isOpen = false;
private offerType = "";
private offerName = "";
private applyLevel = "";
private serviceType = "S";
private pricePlanCode = "";
private remarks = "";
private copyFrom = "";
private sourceFrom = "";
private effType = "";
private baseValidPeriod: Date | undefined = undefined;
private versionValidPeriod: Date | undefined = undefined;
constructor() {
makeAutoObservable(this);
}
// --- Getters ---
getIsOpen = () => this.isOpen;
getOfferType = () => this.offerType;
getOfferName = () => this.offerName;
getApplyLevel = () => this.applyLevel;
getServiceType = () => this.serviceType;
getPricePlanCode = () => this.pricePlanCode;
getRemarks = () => this.remarks;
getCopyFrom = () => this.copyFrom;
getSourceFrom = () => this.sourceFrom;
getEffType = () => this.effType;
getBaseValidPeriod = () => this.baseValidPeriod;
getVersionValidPeriod = () => this.versionValidPeriod;
// --- Setters ---
setIsOpen = (val: boolean) => {
this.isOpen = val;
};
setOfferType = (val: string) => {
this.offerType = val;
};
setOfferName = (val: string) => {
this.offerName = val;
};
setApplyLevel = (val: string) => {
this.applyLevel = val;
};
setServiceType = (val: string) => {
this.serviceType = val;
};
setPricePlanCode = (val: string) => {
this.pricePlanCode = val;
};
setRemarks = (val: string) => {
this.remarks = val;
};
setCopyFrom = (val: string) => {
this.copyFrom = val;
};
setSourceFrom = (val: string) => {
this.sourceFrom = val;
};
setEffType = (val: string) => {
this.effType = val;
};
setBaseValidPeriod = (val: Date | undefined) => {
this.baseValidPeriod = val;
};
setVersionValidPeriod = (val: Date | undefined) => {
this.versionValidPeriod = val;
};
resetForm = () => {
this.isOpen = false;
this.offerType = "";
this.offerName = "";
this.applyLevel = "";
this.serviceType = "S";
this.pricePlanCode = "";
this.remarks = "";
this.copyFrom = "";
this.sourceFrom = "";
this.effType = "";
this.baseValidPeriod = undefined;
this.versionValidPeriod = undefined;
};
}
const pricePlanFormStore = new PricePlanFormStore();
export default pricePlanFormStore;

View File

@ -0,0 +1,55 @@
import { makeAutoObservable } from "mobx";
class PricePlanStore {
private currentPage = 0;
private size = 10;
private type = "";
private isAlertOpen = false;
private priceplanId = "";
constructor() {
makeAutoObservable(this);
}
getCurrentPage = () => this.currentPage
getSize = () => this.size
getType = () => this.type
getIsAlertOpen = () => this.isAlertOpen
getPricePlanId = () => this.priceplanId
setPricePlanId = (id: string) => {
this.priceplanId = id;
};
setIsAlertOpen = (isOpen: boolean) => {
this.isAlertOpen = isOpen;
};
setCurrentPage = (page: number) => {
this.currentPage = page;
};
setSize = (size: number) => {
this.size = size;
};
setType = (type: string) => {
this.type = type;
};
reset = () => {
this.currentPage = 0;
this.size = 10;
this.type = "";
this.isAlertOpen = false;
this.priceplanId = "";
}
}
const pricePlanStore = new PricePlanStore();
export default pricePlanStore;