feat: Personnel => Option (type, store)

This commit is contained in:
puriphatt 2024-04-10 17:00:28 +07:00
parent 38089a5312
commit 7d6ae75551
4 changed files with 169 additions and 45 deletions

View file

@ -27,6 +27,7 @@ export type Branch = {
taxNo: string;
id: string;
code: string;
branch: Branch[];
};
export type BranchWithChildren = Branch & { branch: Branch[] };

View file

@ -124,6 +124,7 @@ const useUserStore = defineStore('api-user', () => {
pageSize?: number;
zipCode?: string;
query?: string;
includeBranch?: boolean;
},
flow?: {
sessionId: string;
@ -139,6 +140,7 @@ const useUserStore = defineStore('api-user', () => {
if (opts?.page && opts.page > 0) params.append('page', `${opts.page}`);
if (opts?.zipCode) params.append('zipCode', opts.zipCode);
if (opts?.query) params.append('query', opts.query);
if (opts?.includeBranch) params.append('includeBranch', 'true');
const query = params.toString();

View file

@ -1,4 +1,5 @@
import { District, Province, SubDistrict } from '../address';
import { Branch } from '../branch/types';
import { Status } from '../types';
export type User = {
@ -39,6 +40,9 @@ export type User = {
id: string;
profileImageUrl: string;
code: string;
birthDate?: Date | null;
responsibleArea: string,
branch: Branch[]
};
export type UserCreate = {
@ -57,7 +61,7 @@ export type UserCreate = {
licenseExpireDate?: Date | null;
licenseIssueDate?: Date | null;
licenseNo?: string | null;
discountCondition?: string;
discountCondition?: string | null;
retireDate?: Date | null;
startDate?: Date | null;
registrationNo?: string | null;
@ -92,3 +96,13 @@ export type UserTypeStats = {
DELEGATE: number;
AGENCY: number;
}
export type UserOption = {
hqOpts: Option[]
brOpts: Option[]
}
export type Option = {
label: string;
value: string;
}