Skip to main content

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โ€‹

FieldTypeDescription
corporateCorporateInfo for corporate entities
non_corporateNonCorporateInfo for non-corporates
individualIndividualInfo for individuals
directorDirectorInfo for directors

๐Ÿ“Š Report Typesโ€‹

  • STANDARD
  • SECTION_29A_RA

๐Ÿ“ฆ Message Definitions (Proto)โ€‹

ReportRequestโ€‹

Holds a full report request record with entity and report info.

FieldTypeDescription
idstringUnique ID
entity_typeEntityTypeType of entity
entity_idstringEntity's unique identifier
entity_detailsEntityDetailsDetails based on entity type
report_detailsrepeated ReportDetailsAssociated reports
org_iduint32Org ID
company_iduint32Company ID
department_iduint32Department ID
updated_atgoogle.protobuf.TimestampLast update time

ReportDetailsโ€‹

FieldTypeDescription
report_idstringID of the report
report_namestringName of the report
report_typeReportTypeType of report
weightage_idstring (ObjectID)Linked weightage config
created_atgoogle.protobuf.TimestampCreation time
created_byuint32User ID who created it
updated_atgoogle.protobuf.TimestampLast modified time
updated_byuint32User ID who updated it

๐Ÿ› ๏ธ Servicesโ€‹

ReportRequestServiceโ€‹

RPC MethodRequestResponseDescription
CreateReportRequestCreateReportRequestRequestCreateReportRequestResponseCreates a new report request
GetReportRequestByIDGetReportRequestByIDRequestGetReportRequestByIDResponseFetch a report by ID
GetReportRequestByEntityAndOrgGetReportRequestByEntityAndOrgRequestGetReportRequestByEntityAndOrgResponseGet report by entity ID and org ID
ListAllReportRequestsListAllReportRequestsRequestListAllReportRequestsResponsePaginated listing of all report requests

๐Ÿงพ Go Models Overviewโ€‹

models.ReportRequestโ€‹

Represents the stored format in MongoDB.

FieldTypeDescription
IDObjectIDMongoDB document ID
EntityTypestringType of the entity
EntityIDstringUnique identifier
EntityDetailsstructNested entity-specific info
ReportDetails[]structAssociated report list
OrgIDuint32Org ID
CompanyIDuint32Company ID
DepartmentIDuint32Department ID
UpdatedAttime.TimeLast 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.

FieldTypeDescription
IDuuidUnique report UUID
TitlestringTitle of the report
LegacyReportTypestringHistorical type field
CreatedAttime.TimeTimestamp of creation
UpdatedAttime.TimeLast update time
OrganizationID*intOrg ID (nullable)
IsSampleboolIf it's a sample report
StatusstringStatus of the report
YearsToCrawl*intOptional crawl depth
IsArchiveboolWhether 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.