refactor: improve code formatting and organization across multiple components

- Enhanced readability by restructuring code formatting in various components, including API documentation, user management, and sales modules.
- Standardized table and object definitions for better clarity in API documentation.
- Improved layout and indentation in React components for better maintainability.
- Updated unit tests to reflect changes in formatting and ensure consistency.

These changes enhance the overall code quality and maintainability of the project, making it easier for developers to navigate and understand the codebase.
This commit is contained in:
shancheas
2026-08-27 13:09:57 +07:00
parent 105cf3030a
commit 6b012a6aae
44 changed files with 371 additions and 260 deletions
+11 -7
View File
@@ -45,7 +45,11 @@ Do **not** redeclare:
// GOOD
const columnDefs = [
{ field: 'username', headerName: t('common:fields.username'), minWidth: 160 },
{ field: 'privilege', headerName: t('common:fields.privilege'), valueGetter: ({ data }) => relationLabel(data?.privilege) },
{
field: 'privilege',
headerName: t('common:fields.privilege'),
valueGetter: ({ data }) => relationLabel(data?.privilege),
},
];
// BAD — duplicates shared chrome
@@ -59,12 +63,12 @@ const columnDefs = [
API and transformers map:
| Entity field | Meaning |
|---|---|
| `createdBy` | actor string, `{ username }`, or uuid |
| `createdAt` | unix ms |
| `updatedBy` | actor string, `{ username }`, or uuid |
| `updatedAt` | unix ms |
| Entity field | Meaning |
| ------------ | ------------------------------------- |
| `createdBy` | actor string, `{ username }`, or uuid |
| `createdAt` | unix ms |
| `updatedBy` | actor string, `{ username }`, or uuid |
| `updatedAt` | unix ms |
`EnterpriseDataTable` postfix columns bind those names and fall back to legacy snake_case (`creator_name`, `created_at`, `editor_name`, `updated_at`) for leftover local/Pouch rows.