feat: employee history type & function
This commit is contained in:
parent
764e759ee3
commit
39272000a7
3 changed files with 47 additions and 0 deletions
|
|
@ -256,6 +256,26 @@ const useEmployeeStore = defineStore('api-employee', () => {
|
|||
}
|
||||
}
|
||||
|
||||
async function getEditHistory(
|
||||
employeeId: string,
|
||||
flow?: {
|
||||
sessionId?: string;
|
||||
refTransactionId?: string;
|
||||
transactionId?: string;
|
||||
},
|
||||
) {
|
||||
const res = await api.get(`/employee/${employeeId}/edit-history`, {
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
},
|
||||
});
|
||||
if (res && res.status === 200) {
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
data,
|
||||
globalOption,
|
||||
|
|
@ -270,6 +290,7 @@ const useEmployeeStore = defineStore('api-employee', () => {
|
|||
fetchOther,
|
||||
getStatsEmployee,
|
||||
getStatsEmployeeGender,
|
||||
getEditHistory,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -214,3 +214,28 @@ export type EmployeeOtherCreate = {
|
|||
fatherBirthPlace?: string;
|
||||
citizenId?: string;
|
||||
};
|
||||
|
||||
export type EmployeeHistory = {
|
||||
masterId: string;
|
||||
updatedBy: string;
|
||||
updatedByUserId: string;
|
||||
timestamp: Date;
|
||||
valueAfter: string;
|
||||
valueBefore: string;
|
||||
field: string;
|
||||
updatedAt: Date;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type NewEmployeeHistory = {
|
||||
date: string;
|
||||
data: {
|
||||
masterId: string;
|
||||
updatedBy: string;
|
||||
updatedByUserId: string;
|
||||
timestamp: Date;
|
||||
updatedAt: Date;
|
||||
id: string;
|
||||
history: { valueAfter: string; valueBefore: string; field: string }[];
|
||||
}[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ const useOptionStore = defineStore('optionStore', () => {
|
|||
if (option) return option.label;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue