Skip to content

Commit

Permalink
WIP fancy exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Theophile-Madet committed Jan 30, 2025
1 parent 53d5e00 commit f587f87
Show file tree
Hide file tree
Showing 41 changed files with 1,692 additions and 430 deletions.
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@types/node": "^22.7.5",
"bootstrap": "^5.3.3",
"chart.js": "^4.4.6",
"prettier": "^3.4.2",
"react": "^18.3.1",
"react-bootstrap": "^2.10.5",
"react-bootstrap-icons": "^1.11.4",
Expand Down
757 changes: 440 additions & 317 deletions poetry.lock

Large diffs are not rendered by default.

118 changes: 118 additions & 0 deletions schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,54 @@ info:
title: ''
version: 0.0.0
paths:
/statistics/abcd_member_export_view:
get:
operationId: statistics_abcd_member_export_view_list
description: Verify that the current user is authenticated.
parameters:
- in: query
name: at_date
schema:
type: string
format: date
required: true
- in: query
name: export_columns
schema:
type: array
items:
type: string
required: true
tags:
- statistics
security:
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/DatapointExport'
description: ''
/statistics/available_export_columns_view:
get:
operationId: statistics_available_export_columns_view_list
description: Verify that the current user is authenticated.
tags:
- statistics
security:
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Column'
description: ''
/statistics/number_of_abcd_members_at_date:
get:
operationId: statistics_number_of_abcd_members_at_date_retrieve
Expand Down Expand Up @@ -487,6 +535,76 @@ paths:
description: ''
components:
schemas:
Column:
type: object
properties:
column_name:
type: string
required:
- column_name
DatapointExport:
type: object
properties:
member_number:
type: integer
display_name:
type: string
is_company:
type: boolean
company_name:
type: string
first_name:
type: string
last_name:
type: string
usage_name:
type: string
pronouns:
type: string
email:
type: string
phone_number:
type: string
birthdate:
type: string
street:
type: string
street_2:
type: string
postcode:
type: string
city:
type: string
country:
type: string
preferred_language:
type: string
is_investing:
type: boolean
ratenzahlung:
type: boolean
attended_welcome_session:
type: boolean
co_purchaser:
type: string
allows_purchase_tracking:
type: boolean
shift_capabilities:
type: array
items:
type: string
shift_partner:
type: integer
shift_status:
type: string
is_working:
type: boolean
is_exempted:
type: boolean
is_paused:
type: boolean
can_shop:
type: boolean
ShareOwnerForWelcomeDesk:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions src/api-client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apis/StatisticsApi.ts
apis/WelcomedeskApi.ts
apis/index.ts
index.ts
models/Column.ts
models/DatapointExport.ts
models/ShareOwnerForWelcomeDesk.ts
models/index.ts
runtime.ts
89 changes: 89 additions & 0 deletions src/api-client/apis/StatisticsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@


import * as runtime from '../runtime';
import type {
Column,
DatapointExport,
} from '../models/index';
import {
ColumnFromJSON,
ColumnToJSON,
DatapointExportFromJSON,
DatapointExportToJSON,
} from '../models/index';

export interface StatisticsAbcdMemberExportViewListRequest {
atDate: Date;
exportColumns: Array<string>;
}

export interface StatisticsNumberOfAbcdMembersAtDateRetrieveRequest {
atDate: Date;
Expand Down Expand Up @@ -105,6 +120,80 @@ export interface StatisticsNumberOfWorkingMembersAtDateRetrieveRequest {
*/
export class StatisticsApi extends runtime.BaseAPI {

/**
* Verify that the current user is authenticated.
*/
async statisticsAbcdMemberExportViewListRaw(requestParameters: StatisticsAbcdMemberExportViewListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<DatapointExport>>> {
if (requestParameters['atDate'] == null) {
throw new runtime.RequiredError(
'atDate',
'Required parameter "atDate" was null or undefined when calling statisticsAbcdMemberExportViewList().'
);
}

if (requestParameters['exportColumns'] == null) {
throw new runtime.RequiredError(
'exportColumns',
'Required parameter "exportColumns" was null or undefined when calling statisticsAbcdMemberExportViewList().'
);
}

const queryParameters: any = {};

if (requestParameters['atDate'] != null) {
queryParameters['at_date'] = (requestParameters['atDate'] as any).toISOString().substring(0,10);
}

if (requestParameters['exportColumns'] != null) {
queryParameters['export_columns'] = requestParameters['exportColumns'];
}

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/statistics/abcd_member_export_view`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DatapointExportFromJSON));
}

/**
* Verify that the current user is authenticated.
*/
async statisticsAbcdMemberExportViewList(requestParameters: StatisticsAbcdMemberExportViewListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<DatapointExport>> {
const response = await this.statisticsAbcdMemberExportViewListRaw(requestParameters, initOverrides);
return await response.value();
}

/**
* Verify that the current user is authenticated.
*/
async statisticsAvailableExportColumnsViewListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Column>>> {
const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/statistics/available_export_columns_view`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ColumnFromJSON));
}

/**
* Verify that the current user is authenticated.
*/
async statisticsAvailableExportColumnsViewList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Column>> {
const response = await this.statisticsAvailableExportColumnsViewListRaw(initOverrides);
return await response.value();
}

/**
* Verify that the current user is authenticated.
*/
Expand Down
66 changes: 66 additions & 0 deletions src/api-client/models/Column.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
/**
*
* @export
* @interface Column
*/
export interface Column {
/**
*
* @type {string}
* @memberof Column
*/
columnName: string;
}

/**
* Check if a given object implements the Column interface.
*/
export function instanceOfColumn(value: object): value is Column {
if (!('columnName' in value) || value['columnName'] === undefined) return false;
return true;
}

export function ColumnFromJSON(json: any): Column {
return ColumnFromJSONTyped(json, false);
}

export function ColumnFromJSONTyped(json: any, ignoreDiscriminator: boolean): Column {
if (json == null) {
return json;
}
return {

'columnName': json['column_name'],
};
}

export function ColumnToJSON(json: any): Column {
return ColumnToJSONTyped(json, false);
}

export function ColumnToJSONTyped(value?: Column | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}

return {

'column_name': value['columnName'],
};
}

Loading

0 comments on commit f587f87

Please sign in to comment.