Department Microservice
The Department microservice manages organizational departments. It provides a data model for persistent storage and a gRPC interface to perform CRUD operations.
Model (department.go)
Department
Represents a department within an organization.
| Field | Type | Description |
|---|---|---|
ID | uint32 | Unique identifier for the department (auto-incremented) |
Name | string | Name of the department (minimum 2 characters) |
OrgID | uint32 | ID of the organization to which the department belongs |
CreatedAt | time.Time | Timestamp of when the department was created |
UpdatedAt | time.Time | Timestamp of the last update |
CreatedBy | uint32 | ID of the user who created the department |
UpdatedBy | uint32 | ID of the user who last updated the department |
gRPC Service (department.proto)
This Protocol Buffers file defines the service for managing departments via gRPC.
Messages
Department: Mirrors the Go model fields.DepartmentId: Request message containing a department ID.DepartmentList: Response message containing a list of departments.DepartmentRequest: Used for creating or updating a department.DepartmentResponse: Returns a single department.Empty: Used where no input/output is needed.
Services
CreateDepartment(DepartmentRequest) returns (DepartmentResponse)GetDepartment(DepartmentId) returns (DepartmentResponse)ListDepartments(Empty) returns (DepartmentList)UpdateDepartment(DepartmentRequest) returns (DepartmentResponse)DeleteDepartment(DepartmentId) returns (Empty)
These gRPC services enable full management of department records in the system.