package
0.0.0-20250129182436-068acd4502c2
Repository: https://github.com/maelvls/foncia.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
The `authClient` given as input is only used to authenticate and is not used after that.
No description provided by the author
At first, I coded this using ShurcooL/graphql.
No description provided by the author
No description provided by the author
{ "query": "query getAccountDocuments($accountUuid: EncodedID!, $first: Int, $after: Cursor, $documentCategory: MyFonciaFileCategoryEnum!, $originalFilename: String, $subCategories: [String!], $fromDate: String, $toDate: String, $missionGeneralAssemblyIds: [String!]) {\n account(uuid: $accountUuid) {\n uuid\n documents(\n documentCategory: $documentCategory\n first: $first\n after: $after\n originalFilename: $originalFilename\n subCategories: $subCategories\n fromDate: $fromDate\n toDate: $toDate\n missionGeneralAssemblyIds: $missionGeneralAssemblyIds\n ) {\n totalCount\n pageInfo {\n ...pageInfo\n __typename\n }\n edges {\n node {\n ...document\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n\nfragment pageInfo on PageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n pageNumber\n itemsPerPage\n totalDisplayPages\n totalPages\n __typename\n}\n\nfragment document on Document {\n id\n hashFile\n mimeType\n originalFilename\n category\n createdAt\n __typename\n}", "variables": { "accountUuid": "eyJhY2NvdW50SWQiOiI2NDg1MGU4MGIzYjI5NDdjNmNmYmQ2MDgiLCJjdXN0b21lcklkIjoiNjQ4NTBlODAzNmNjZGMyNDA3YmFlY2Q0IiwicXVhbGl0eSI6IkNPX09XTkVSIiwiYnVpbGRpbmdJZCI6IjY0ODUwZTgwYTRjY2I5NWNlNGI2YjExNSIsInRydXN0ZWVNZW1iZXIiOnRydWV9", "documentCategory": "reportVisit", "originalFilename": "", "subCategories": [], "after": "eyJwYWdlTnVtYmVyIjoyLCJpdGVtc1BlclBhZ2UiOjEwfQ" }, "operationName": "getAccountDocuments" }.
query getAccountingPeriods($accountUuid: EncodedID!, $sortBy: [SortByType!], $status: [AccountingPeriodStatusEnum!], $closingDateTo: String, $first: Int, $before: Cursor, $after: Cursor) { coownerAccount(uuid: $accountUuid) { uuid trusteeCouncil { accountingPeriods( first: $first before: $before after: $after sortBy: $sortBy status: $status closingDateTo: $closingDateTo ) { totalCount pageInfo { startCursor endCursor hasPreviousPage hasNextPage } edges { node { id name openingDate closingDate status } } } } } }
This query is light and doesn't need to be paginated.
The accountUUID is the base 64 encoded ID of the account.
query getBuildingAccountingRGDD($uuid: EncodedID!, $accountingPeriodId: String) {\n coownerAccount(uuid: $uuid) {\n uuid\n trusteeCouncil {\n pastAccountingRGDD(accountingPeriodId: $accountingPeriodId) {\n totalToAllocate {\n ...amount\n __typename\n }\n totalVat {\n ...amount\n __typename\n }\n totalRecoverable {\n ...amount\n __typename\n }\n allocations {\n ...allocation\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n\nfragment amount on Amount {\n value\n currency\n __typename\n}\n\nfragment allocation on Allocation {\n id\n name\n code\n toAllocate {\n ...amount\n __typename\n }\n vat {\n ...amount\n __typename\n }\n recoverable {\n ...amount\n __typename\n }\n expenseTypes {\n ...expenseType\n __typename\n }\n __typename\n}\n\nfragment expenseType on ExpenseType {\n id\n allocationId\n name\n code\n toAllocate {\n ...amount\n __typename\n }\n vat {\n ...amount\n __typename\n }\n recoverable {\n ...amount\n __typename\n }\n expenses {\n ...expense\n __typename\n }\n __typename\n}\n\nfragment expense on Expense {\n id\n label\n date\n invoiceId\n piece {\n hashFile\n category\n id\n __typename\n }\n toAllocate {\n ...amount\n __typename\n }\n vat {\n ...amount\n __typename\n }\n recoverable {\n ...amount\n __typename\n }\n __typename\n}
This query is light and doesn't need to be paginated.
No description provided by the author
No description provided by the author
This query is light and doesn't need to be paginated.
Important: don't call getInvoiceURL if invoiceID exists but the hashFile is empty.
Repairs and Incidents.
After getting the token, create a client with the following:
client := oauth2.NewClient(context.Background(), oauth2.StaticTokenSource( &oauth2.getToken{AccessToken: token}, ))
The given client isn't mutated.
No description provided by the author
Detect when 429 too many requests is returned by the server.
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author