Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 110 additions & 24 deletions robosystems_client/clients/ledger_client.py

Large diffs are not rendered by default.

67 changes: 49 additions & 18 deletions robosystems_client/graphql/generated/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,14 @@ def get_ledger_account_rollups(
mapping_id: Union[Optional[str], UnsetType] = UNSET,
start_date: Union[Optional[str], UnsetType] = UNSET,
end_date: Union[Optional[str], UnsetType] = UNSET,
entity_id: Union[Optional[str], UnsetType] = UNSET,
**kwargs: Any,
) -> GetLedgerAccountRollups:
variables: dict[str, object] = {
"mappingId": mapping_id,
"startDate": start_date,
"endDate": end_date,
"entityId": entity_id,
}
response = self.execute(
query=GET_LEDGER_ACCOUNT_ROLLUPS_GQL,
Expand All @@ -287,8 +289,10 @@ def get_ledger_account_rollups(
data = self.get_data(response)
return GetLedgerAccountRollups.model_validate(data)

def get_ledger_account_tree(self, **kwargs: Any) -> GetLedgerAccountTree:
variables: dict[str, object] = {}
def get_ledger_account_tree(
self, entity_id: Union[Optional[str], UnsetType] = UNSET, **kwargs: Any
) -> GetLedgerAccountTree:
variables: dict[str, object] = {"entityId": entity_id}
response = self.execute(
query=GET_LEDGER_ACCOUNT_TREE_GQL,
operation_name="GetLedgerAccountTree",
Expand All @@ -310,9 +314,9 @@ def get_ledger_agent(self, id: str, **kwargs: Any) -> GetLedgerAgent:
return GetLedgerAgent.model_validate(data)

def get_ledger_closing_book_structures(
self, **kwargs: Any
self, entity_id: Union[Optional[str], UnsetType] = UNSET, **kwargs: Any
) -> GetLedgerClosingBookStructures:
variables: dict[str, object] = {}
variables: dict[str, object] = {"entityId": entity_id}
response = self.execute(
query=GET_LEDGER_CLOSING_BOOK_STRUCTURES_GQL,
operation_name="GetLedgerClosingBookStructures",
Expand All @@ -322,8 +326,10 @@ def get_ledger_closing_book_structures(
data = self.get_data(response)
return GetLedgerClosingBookStructures.model_validate(data)

def get_ledger_entity(self, **kwargs: Any) -> GetLedgerEntity:
variables: dict[str, object] = {}
def get_ledger_entity(
self, entity_id: Union[Optional[str], UnsetType] = UNSET, **kwargs: Any
) -> GetLedgerEntity:
variables: dict[str, object] = {"entityId": entity_id}
response = self.execute(
query=GET_LEDGER_ENTITY_GQL,
operation_name="GetLedgerEntity",
Expand All @@ -344,8 +350,10 @@ def get_ledger_event_block(self, id: str, **kwargs: Any) -> GetLedgerEventBlock:
data = self.get_data(response)
return GetLedgerEventBlock.model_validate(data)

def get_ledger_fiscal_calendar(self, **kwargs: Any) -> GetLedgerFiscalCalendar:
variables: dict[str, object] = {}
def get_ledger_fiscal_calendar(
self, entity_id: Union[Optional[str], UnsetType] = UNSET, **kwargs: Any
) -> GetLedgerFiscalCalendar:
variables: dict[str, object] = {"entityId": entity_id}
response = self.execute(
query=GET_LEDGER_FISCAL_CALENDAR_GQL,
operation_name="GetLedgerFiscalCalendar",
Expand Down Expand Up @@ -401,11 +409,16 @@ def get_ledger_mapping_coverage(
return GetLedgerMappingCoverage.model_validate(data)

def get_ledger_period_close_status(
self, period_start: str, period_end: str, **kwargs: Any
self,
period_start: str,
period_end: str,
entity_id: Union[Optional[str], UnsetType] = UNSET,
**kwargs: Any,
) -> GetLedgerPeriodCloseStatus:
variables: dict[str, object] = {
"periodStart": period_start,
"periodEnd": period_end,
"entityId": entity_id,
}
response = self.execute(
query=GET_LEDGER_PERIOD_CLOSE_STATUS_GQL,
Expand All @@ -417,9 +430,9 @@ def get_ledger_period_close_status(
return GetLedgerPeriodCloseStatus.model_validate(data)

def get_ledger_period_drafts(
self, period: str, **kwargs: Any
self, period: str, entity_id: Union[Optional[str], UnsetType] = UNSET, **kwargs: Any
) -> GetLedgerPeriodDrafts:
variables: dict[str, object] = {"period": period}
variables: dict[str, object] = {"period": period, "entityId": entity_id}
response = self.execute(
query=GET_LEDGER_PERIOD_DRAFTS_GQL,
operation_name="GetLedgerPeriodDrafts",
Expand Down Expand Up @@ -511,8 +524,10 @@ def get_ledger_statement(
data = self.get_data(response)
return GetLedgerStatement.model_validate(data)

def get_ledger_summary(self, **kwargs: Any) -> GetLedgerSummary:
variables: dict[str, object] = {}
def get_ledger_summary(
self, entity_id: Union[Optional[str], UnsetType] = UNSET, **kwargs: Any
) -> GetLedgerSummary:
variables: dict[str, object] = {"entityId": entity_id}
response = self.execute(
query=GET_LEDGER_SUMMARY_GQL,
operation_name="GetLedgerSummary",
Expand All @@ -539,9 +554,14 @@ def get_ledger_trial_balance(
self,
start_date: Union[Optional[str], UnsetType] = UNSET,
end_date: Union[Optional[str], UnsetType] = UNSET,
entity_id: Union[Optional[str], UnsetType] = UNSET,
**kwargs: Any,
) -> GetLedgerTrialBalance:
variables: dict[str, object] = {"startDate": start_date, "endDate": end_date}
variables: dict[str, object] = {
"startDate": start_date,
"endDate": end_date,
"entityId": entity_id,
}
response = self.execute(
query=GET_LEDGER_TRIAL_BALANCE_GQL,
operation_name="GetLedgerTrialBalance",
Expand Down Expand Up @@ -593,13 +613,15 @@ def list_ledger_accounts(
offset: int,
classification: Union[Optional[str], UnsetType] = UNSET,
is_active: Union[Optional[bool], UnsetType] = UNSET,
entity_id: Union[Optional[str], UnsetType] = UNSET,
**kwargs: Any,
) -> ListLedgerAccounts:
variables: dict[str, object] = {
"classification": classification,
"isActive": is_active,
"limit": limit,
"offset": offset,
"entityId": entity_id,
}
response = self.execute(
query=LIST_LEDGER_ACCOUNTS_GQL,
Expand Down Expand Up @@ -698,6 +720,7 @@ def list_ledger_event_blocks(
agent_id: Union[Optional[str], UnsetType] = UNSET,
source: Union[Optional[str], UnsetType] = UNSET,
is_reconciling_item: Union[Optional[bool], UnsetType] = UNSET,
entity_id: Union[Optional[str], UnsetType] = UNSET,
**kwargs: Any,
) -> ListLedgerEventBlocks:
variables: dict[str, object] = {
Expand All @@ -709,6 +732,7 @@ def list_ledger_event_blocks(
"isReconcilingItem": is_reconciling_item,
"limit": limit,
"offset": offset,
"entityId": entity_id,
}
response = self.execute(
query=LIST_LEDGER_EVENT_BLOCKS_GQL,
Expand All @@ -729,6 +753,7 @@ def list_ledger_journal_entries(
type_: Union[Optional[str], UnsetType] = UNSET,
provenance: Union[Optional[str], UnsetType] = UNSET,
transaction_id: Union[Optional[str], UnsetType] = UNSET,
entity_id: Union[Optional[str], UnsetType] = UNSET,
**kwargs: Any,
) -> ListLedgerJournalEntries:
variables: dict[str, object] = {
Expand All @@ -740,6 +765,7 @@ def list_ledger_journal_entries(
"transactionId": transaction_id,
"limit": limit,
"offset": offset,
"entityId": entity_id,
}
response = self.execute(
query=LIST_LEDGER_JOURNAL_ENTRIES_GQL,
Expand Down Expand Up @@ -775,9 +801,9 @@ def list_ledger_publish_lists(
return ListLedgerPublishLists.model_validate(data)

def list_ledger_reconciliations(
self, period: str, **kwargs: Any
self, period: str, entity_id: Union[Optional[str], UnsetType] = UNSET, **kwargs: Any
) -> ListLedgerReconciliations:
variables: dict[str, object] = {"period": period}
variables: dict[str, object] = {"period": period, "entityId": entity_id}
response = self.execute(
query=LIST_LEDGER_RECONCILIATIONS_GQL,
operation_name="ListLedgerReconciliations",
Expand All @@ -788,9 +814,12 @@ def list_ledger_reconciliations(
return ListLedgerReconciliations.model_validate(data)

def list_ledger_reports(
self, lifecycle: Union[Optional[ReportLifecycle], UnsetType] = UNSET, **kwargs: Any
self,
lifecycle: Union[Optional[ReportLifecycle], UnsetType] = UNSET,
entity_id: Union[Optional[str], UnsetType] = UNSET,
**kwargs: Any,
) -> ListLedgerReports:
variables: dict[str, object] = {"lifecycle": lifecycle}
variables: dict[str, object] = {"lifecycle": lifecycle, "entityId": entity_id}
response = self.execute(
query=LIST_LEDGER_REPORTS_GQL,
operation_name="ListLedgerReports",
Expand Down Expand Up @@ -839,6 +868,7 @@ def list_ledger_transactions(
type_: Union[Optional[str], UnsetType] = UNSET,
start_date: Union[Optional[str], UnsetType] = UNSET,
end_date: Union[Optional[str], UnsetType] = UNSET,
entity_id: Union[Optional[str], UnsetType] = UNSET,
**kwargs: Any,
) -> ListLedgerTransactions:
variables: dict[str, object] = {
Expand All @@ -847,6 +877,7 @@ def list_ledger_transactions(
"endDate": end_date,
"limit": limit,
"offset": offset,
"entityId": entity_id,
}
response = self.execute(
query=LIST_LEDGER_TRANSACTIONS_GQL,
Expand Down
2 changes: 2 additions & 0 deletions robosystems_client/graphql/generated/get_ledger_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class GetLedgerEntityEntity(BaseModel):
lei: Optional[str]
industry: Optional[str]
entity_type: Optional[str] = Field(alias="entityType")
reporting_style_id: Optional[str] = Field(alias="reportingStyleId")
phone: Optional[str]
website: Optional[str]
status: str
is_parent: bool = Field(alias="isParent")
parent_entity_id: Optional[str] = Field(alias="parentEntityId")
ownership_pct: Optional[float] = Field(alias="ownershipPct")
source: str
source_id: Optional[str] = Field(alias="sourceId")
source_graph_id: Optional[str] = Field(alias="sourceGraphId")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class GetLedgerFiscalCalendar(BaseModel):

class GetLedgerFiscalCalendarFiscalCalendar(BaseModel):
graph_id: str = Field(alias="graphId")
entity_id: Optional[str] = Field(alias="entityId")
fiscal_year_start_month: int = Field(alias="fiscalYearStartMonth")
closed_through: Optional[str] = Field(alias="closedThrough")
close_target: Optional[str] = Field(alias="closeTarget")
Expand Down
1 change: 1 addition & 0 deletions robosystems_client/graphql/generated/get_ledger_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class GetLedgerReport(BaseModel):

class GetLedgerReportReport(BaseModel):
id: str
entity_id: Optional[str] = Field(alias="entityId")
name: str
taxonomy_id: str = Field(alias="taxonomyId")
generation_status: str = Field(alias="generationStatus")
Expand Down
1 change: 1 addition & 0 deletions robosystems_client/graphql/generated/get_ledger_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class GetLedgerSummary(BaseModel):

class GetLedgerSummarySummary(BaseModel):
graph_id: str = Field(alias="graphId")
entity_id: Optional[str] = Field(alias="entityId")
account_count: int = Field(alias="accountCount")
transaction_count: int = Field(alias="transactionCount")
entry_count: int = Field(alias="entryCount")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ListLedgerEntitiesEntities(BaseModel):
status: str
is_parent: bool = Field(alias="isParent")
parent_entity_id: Optional[str] = Field(alias="parentEntityId")
ownership_pct: Optional[float] = Field(alias="ownershipPct")
source: str
source_graph_id: Optional[str] = Field(alias="sourceGraphId")
connection_id: Optional[str] = Field(alias="connectionId")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ListLedgerReportsReports(BaseModel):

class ListLedgerReportsReportsReports(BaseModel):
id: str
entity_id: Optional[str] = Field(alias="entityId")
name: str
taxonomy_id: str = Field(alias="taxonomyId")
generation_status: str = Field(alias="generationStatus")
Expand Down
Loading
Loading