Report Request Service
This service is responsible for handling report request operations for various types of entities such as Corporates, Non-Corporates, Individuals, and Directors. It supports creation, retrieval, and listing of report requests.
๐งฉ Entity Typesโ
- Corporate
- Non-Corporate
- Individual
- Director
Each type has its own structure with relevant fields.
EntityDetails Structureโ
| Field | Type | Description |
|---|---|---|
corporate | Corporate | Info for corporate entities |
non_corporate | NonCorporate | Info for non-corporates |
individual | Individual | Info for individuals |
director | Director | Info for directors |
๐ Report Typesโ
STANDARDSECTION_29A_RA
๐ฆ Message Definitions (Proto)โ
ReportRequestโ
Holds a full report request record with entity and report info.
| Field | Type | Description |
|---|---|---|
id | string | Unique ID |
entity_type | EntityType | Type of entity |
entity_id | string | Entity's unique identifier |
entity_details | EntityDetails | Details based on entity type |
report_details | repeated ReportDetails | Associated reports |
org_id | uint32 | Org ID |
company_id | uint32 | Company ID |
department_id | uint32 | Department ID |
updated_at | google.protobuf.Timestamp | Last update time |
ReportDetailsโ
| Field | Type | Description |
|---|---|---|
report_id | string | ID of the report |
report_name | string | Name of the report |
report_type | ReportType | Type of report |
weightage_id | string (ObjectID) | Linked weightage config |
created_at | google.protobuf.Timestamp | Creation time |
created_by | uint32 | User ID who created it |
updated_at | google.protobuf.Timestamp | Last modified time |
updated_by | uint32 | User ID who updated it |
๐ ๏ธ Servicesโ
ReportRequestServiceโ
| RPC Method | Request | Response | Description |
|---|---|---|---|
CreateReportRequest | CreateReportRequestRequest | CreateReportRequestResponse | Creates a new report request |
GetReportRequestByID | GetReportRequestByIDRequest | GetReportRequestByIDResponse | Fetch a report by ID |
GetReportRequestByEntityAndOrg | GetReportRequestByEntityAndOrgRequest | GetReportRequestByEntityAndOrgResponse | Get report by entity ID and org ID |
ListAllReportRequests | ListAllReportRequestsRequest | ListAllReportRequestsResponse | Paginated listing of all report requests |
๐งพ Go Models Overviewโ
models.ReportRequestโ
Represents the stored format in MongoDB.
| Field | Type | Description |
|---|---|---|
ID | ObjectID | MongoDB document ID |
EntityType | string | Type of the entity |
EntityID | string | Unique identifier |
EntityDetails | struct | Nested entity-specific info |
ReportDetails | []struct | Associated report list |
OrgID | uint32 | Org ID |
CompanyID | uint32 | Company ID |
DepartmentID | uint32 | Department ID |
UpdatedAt | time.Time | Last update time |
models.NewReportRequestโ
Used for creating a new request. Includes token, weightage ID, and report meta.
models.Reportโ
GORM model for relational DB representation of reports.
| Field | Type | Description |
|---|---|---|
ID | uuid | Unique report UUID |
Title | string | Title of the report |
LegacyReportType | string | Historical type field |
CreatedAt | time.Time | Timestamp of creation |
UpdatedAt | time.Time | Last update time |
OrganizationID | *int | Org ID (nullable) |
IsSample | bool | If it's a sample report |
Status | string | Status of the report |
YearsToCrawl | *int | Optional crawl depth |
IsArchive | bool | Whether archived |
๐ Notesโ
- MongoDB is used for storing request details.
- GORM is used for handling persistent report entities in a relational DB.
- Protobufs are used for gRPC communication.