Add divisions management module with database schema and validation

- Introduced `DivisionsModule` to manage organizational divisions, including read and write controllers.
- Created database migrations for the `divisions` table and related constraints.
- Implemented validation for division name and code with corresponding utility functions.
- Added service and repository layers for handling division data operations.
- Developed unit tests for the divisions service, repository, and controllers to ensure functionality and correctness.
- Updated application module to include the new `ConfigurationModule` for better organization.
This commit is contained in:
shancheas
2026-08-24 12:14:46 +07:00
parent 07550b3167
commit a8faea20ff
22 changed files with 2521 additions and 6 deletions
+2 -6
View File
@@ -45,9 +45,7 @@ describe('Privileges (e2e)', () => {
.post('/auth/register')
.send({ username: adminUsername, password })
.expect(201);
adminAccessToken = (
adminReg.body as { accessToken: string }
).accessToken;
adminAccessToken = (adminReg.body as { accessToken: string }).accessToken;
const adminMe = await request(app.getHttpServer())
.get('/auth/me')
@@ -63,9 +61,7 @@ describe('Privileges (e2e)', () => {
.post('/auth/register')
.send({ username: otherUsername, password })
.expect(201);
otherAccessToken = (
otherReg.body as { accessToken: string }
).accessToken;
otherAccessToken = (otherReg.body as { accessToken: string }).accessToken;
const otherMe = await request(app.getHttpServer())
.get('/auth/me')
.set('Authorization', `Bearer ${otherAccessToken}`)