rename combining ledger to combined

This commit is contained in:
Sophie-Gaëlle CALLOCH
2026-05-22 14:53:33 +02:00
parent e137bec8dd
commit 2970f48e65
4 changed files with 63 additions and 63 deletions
+42 -42
View File
@@ -23,20 +23,20 @@ import type { RequestArgs } from './base';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
export interface CombiningLedgerResponse extends LedgerResponse {
export interface CombinedLedgerResponse extends LedgerResponse {
'ledgerId': string;
'name': string;
'memberLedgerIds': Array<string>;
'type'?: CombiningLedgerResponseTypeEnum;
'type'?: CombinedLedgerResponseTypeEnum;
}
export const CombiningLedgerResponseTypeEnum = {
Combining: 'COMBINING',
export const CombinedLedgerResponseTypeEnum = {
Combined: 'COMBINED',
} as const;
export type CombiningLedgerResponseTypeEnum = typeof CombiningLedgerResponseTypeEnum[keyof typeof CombiningLedgerResponseTypeEnum];
export type CombinedLedgerResponseTypeEnum = typeof CombinedLedgerResponseTypeEnum[keyof typeof CombinedLedgerResponseTypeEnum];
export interface CreateCombiningLedgerRequest {
export interface CreateCombinedLedgerRequest {
'name': string;
'memberLedgerIds': Array<string>;
}
@@ -46,7 +46,7 @@ export interface CreateMainLedgerRequest {
/**
* @type FindAll200ResponseInner
*/
export type FindAll200ResponseInner = CombiningLedgerResponse | MainLedgerResponse;
export type FindAll200ResponseInner = CombinedLedgerResponse | MainLedgerResponse;
export interface LedgerResponse {
'type'?: LedgerResponseTypeEnum;
@@ -54,7 +54,7 @@ export interface LedgerResponse {
export const LedgerResponseTypeEnum = {
Main: 'MAIN',
Combining: 'COMBINING',
Combined: 'COMBINED',
} as const;
export type LedgerResponseTypeEnum = typeof LedgerResponseTypeEnum[keyof typeof LedgerResponseTypeEnum];
@@ -71,7 +71,7 @@ export const MainLedgerResponseTypeEnum = {
export type MainLedgerResponseTypeEnum = typeof MainLedgerResponseTypeEnum[keyof typeof MainLedgerResponseTypeEnum];
export interface UpdateCombiningLedgerRequest {
export interface UpdateCombinedLedgerRequest {
'name': string;
'memberLedgerIds': Array<string>;
}
@@ -86,14 +86,14 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
return {
/**
*
* @param {CreateCombiningLedgerRequest} createCombiningLedgerRequest
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCombiningLedger: async (createCombiningLedgerRequest: CreateCombiningLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createCombiningLedgerRequest' is not null or undefined
assertParamExists('createCombiningLedger', 'createCombiningLedgerRequest', createCombiningLedgerRequest)
const localVarPath = `/ledgers/combining`;
createCombinedLedger: async (createCombinedLedgerRequest: CreateCombinedLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createCombinedLedgerRequest' is not null or undefined
assertParamExists('createCombinedLedger', 'createCombinedLedgerRequest', createCombinedLedgerRequest)
const localVarPath = `/ledgers/combined`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
@@ -111,7 +111,7 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(createCombiningLedgerRequest, localVarRequestOptions, configuration)
localVarRequestOptions.data = serializeDataIfNeeded(createCombinedLedgerRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
@@ -217,16 +217,16 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
/**
*
* @param {string} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCombiningLedger: async (ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
updateCombinedLedger: async (ledgerId: string, updateCombinedLedgerRequest: UpdateCombinedLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'ledgerId' is not null or undefined
assertParamExists('updateCombiningLedger', 'ledgerId', ledgerId)
// verify required parameter 'updateCombiningLedgerRequest' is not null or undefined
assertParamExists('updateCombiningLedger', 'updateCombiningLedgerRequest', updateCombiningLedgerRequest)
const localVarPath = `/ledgers/combining/{ledgerId}`
assertParamExists('updateCombinedLedger', 'ledgerId', ledgerId)
// verify required parameter 'updateCombinedLedgerRequest' is not null or undefined
assertParamExists('updateCombinedLedger', 'updateCombinedLedgerRequest', updateCombinedLedgerRequest)
const localVarPath = `/ledgers/combined/{ledgerId}`
.replace('{ledgerId}', encodeURIComponent(String(ledgerId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -245,7 +245,7 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(updateCombiningLedgerRequest, localVarRequestOptions, configuration)
localVarRequestOptions.data = serializeDataIfNeeded(updateCombinedLedgerRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
@@ -301,14 +301,14 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {CreateCombiningLedgerRequest} createCombiningLedgerRequest
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createCombiningLedger(createCombiningLedgerRequest: CreateCombiningLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombiningLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createCombiningLedger(createCombiningLedgerRequest, options);
async createCombinedLedger(createCombinedLedgerRequest: CreateCombinedLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombinedLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createCombinedLedger(createCombinedLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.createCombiningLedger']?.[localVarOperationServerIndex]?.url;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.createCombinedLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
@@ -349,14 +349,14 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
/**
*
* @param {string} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateCombiningLedger(ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombiningLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateCombiningLedger(ledgerId, updateCombiningLedgerRequest, options);
async updateCombinedLedger(ledgerId: string, updateCombinedLedgerRequest: UpdateCombinedLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombinedLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateCombinedLedger(ledgerId, updateCombinedLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.updateCombiningLedger']?.[localVarOperationServerIndex]?.url;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.updateCombinedLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
@@ -383,12 +383,12 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
return {
/**
*
* @param {CreateCombiningLedgerRequest} createCombiningLedgerRequest
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCombiningLedger(createCombiningLedgerRequest: CreateCombiningLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<CombiningLedgerResponse> {
return localVarFp.createCombiningLedger(createCombiningLedgerRequest, options).then((request) => request(axios, basePath));
createCombinedLedger(createCombinedLedgerRequest: CreateCombinedLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<CombinedLedgerResponse> {
return localVarFp.createCombinedLedger(createCombinedLedgerRequest, options).then((request) => request(axios, basePath));
},
/**
*
@@ -419,12 +419,12 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
/**
*
* @param {string} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCombiningLedger(ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<CombiningLedgerResponse> {
return localVarFp.updateCombiningLedger(ledgerId, updateCombiningLedgerRequest, options).then((request) => request(axios, basePath));
updateCombinedLedger(ledgerId: string, updateCombinedLedgerRequest: UpdateCombinedLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<CombinedLedgerResponse> {
return localVarFp.updateCombinedLedger(ledgerId, updateCombinedLedgerRequest, options).then((request) => request(axios, basePath));
},
/**
*
@@ -445,12 +445,12 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
export class LedgerControllerApi extends BaseAPI {
/**
*
* @param {CreateCombiningLedgerRequest} createCombiningLedgerRequest
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public createCombiningLedger(createCombiningLedgerRequest: CreateCombiningLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).createCombiningLedger(createCombiningLedgerRequest, options).then((request) => request(this.axios, this.basePath));
public createCombinedLedger(createCombinedLedgerRequest: CreateCombinedLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).createCombinedLedger(createCombinedLedgerRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
@@ -485,12 +485,12 @@ export class LedgerControllerApi extends BaseAPI {
/**
*
* @param {string} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public updateCombiningLedger(ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).updateCombiningLedger(ledgerId, updateCombiningLedgerRequest, options).then((request) => request(this.axios, this.basePath));
public updateCombinedLedger(ledgerId: string, updateCombinedLedgerRequest: UpdateCombinedLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).updateCombinedLedger(ledgerId, updateCombinedLedgerRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
+8 -8
View File
@@ -2,7 +2,7 @@
import {computed, ref} from "vue";
import {storeToRefs} from "pinia";
import {isCombining, Ledger, LedgerType, LedgerTypes, useLedgersStore} from "./ledger";
import {isCombined, Ledger, LedgerType, LedgerTypes, useLedgersStore} from "./ledger";
import {Modal} from "@/components";
import LedgerLabel from "./LedgerLabel.vue";
import {PlusIcon, TrashIcon} from '@heroicons/vue/24/outline';
@@ -15,7 +15,7 @@ const props = defineProps<Props>();
const ledgersStore = useLedgersStore();
const {ledgers} = storeToRefs(ledgersStore);
const {findById, findAllById, createMain, createCombining, updateMain, updateCombining} = ledgersStore;
const {findById, findAllById, createMain, createCombined, updateMain, updateCombined} = ledgersStore;
const modalOpen = ref<boolean>(false);
@@ -39,7 +39,7 @@ const open = () => {
if (ledger) {
type.value = ledger.type;
name.value = ledger.name;
members.value = isCombining(ledger) ? findAllById(ledger.memberLedgerIds) : [];
members.value = isCombined(ledger) ? findAllById(ledger.memberLedgerIds) : [];
} else {
type.value = LedgerTypes.Main;
name.value = "";
@@ -52,7 +52,7 @@ const canSave = computed(() => name.value.trim().length > 0);
const isCreating = computed(() => props.ledgerId)
const title = computed(() => {
if (isCreating.value) {
return `Creating ${type.value === LedgerTypes.Main ? 'Main' : 'Combining'} Ledger`
return `Creating ${type.value === LedgerTypes.Main ? 'Main' : 'Combined'} Ledger`
}
return `Updating ${name.value}`
})
@@ -61,7 +61,7 @@ const create = () => {
if (type.value === LedgerTypes.Main) {
createMain({name: name.value})
} else {
createCombining({name: name.value, memberLedgerIds: members.value.map(l => l.ledgerId)})
createCombined({name: name.value, memberLedgerIds: members.value.map(l => l.ledgerId)})
}
}
@@ -69,7 +69,7 @@ const update = () => {
if (type.value === LedgerTypes.Main) {
updateMain(props.ledgerId, {name: name.value})
} else {
updateCombining(props.ledgerId, {name: name.value, memberLedgerIds: members.value.map(l => l.ledgerId)})
updateCombined(props.ledgerId, {name: name.value, memberLedgerIds: members.value.map(l => l.ledgerId)})
}
}
@@ -100,7 +100,7 @@ defineExpose({ open });
<button class="switch" :class="{active: type === LedgerTypes.Main}" @click="type = LedgerTypes.Main">Main</button>
</div>
<div class="switch flex bg-slate-600 rounded-e-md p-1">
<button class="switch" :class="{active: type === LedgerTypes.Combining}" @click="type = LedgerTypes.Combining">Combining</button>
<button class="switch" :class="{active: type === LedgerTypes.Combined}" @click="type = LedgerTypes.Combined">Combined</button>
</div>
</div>
<div class="m-4">
@@ -110,7 +110,7 @@ defineExpose({ open });
</div>
</div>
</div>
<div v-if="type === LedgerTypes.Combining" class="ms-4 mb-4">
<div v-if="type === LedgerTypes.Combined" class="ms-4 mb-4">
Member Ledgers:
<div v-for="ledger in members" :key="ledger.ledgerId" class="flex">
<LedgerLabel class="flex grow mb-2" :ledger="ledger" />
+2 -2
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import {isCombining, Ledger} from "@/ledger/ledger.ts";
import {isCombined, Ledger} from "@/ledger/ledger.ts";
import {FolderOpenIcon} from '@heroicons/vue/24/outline';
interface Props {
@@ -12,7 +12,7 @@ const props = defineProps<Props>();
<template>
<div class="flex">
<FolderOpenIcon v-if="isCombining(ledger)" class="w-4 me-1" />
<FolderOpenIcon v-if="isCombined(ledger)" class="w-4 me-1" />
<div v-else class="w-4 me-1"/>
<span>{{ ledger.name }}</span>
</div>
+11 -11
View File
@@ -1,12 +1,12 @@
import {
CombiningLedgerResponse,
CombiningLedgerResponseTypeEnum,
CreateCombiningLedgerRequest,
CombinedLedgerResponse,
CombinedLedgerResponseTypeEnum,
CreateCombinedLedgerRequest,
CreateMainLedgerRequest,
LedgerResponseTypeEnum,
MainLedgerResponse,
MainLedgerResponseTypeEnum,
UpdateCombiningLedgerRequest,
UpdateCombinedLedgerRequest,
UpdateMainLedgerRequest
} from "@/generated/mammon";
import {defineStore} from "pinia";
@@ -17,14 +17,14 @@ export const LedgerTypes = LedgerResponseTypeEnum;
export type LedgerType = LedgerResponseTypeEnum;
export type MainLedger = MainLedgerResponse & {type: MainLedgerResponseTypeEnum}
export type CombiningLedger = CombiningLedgerResponse & {type: CombiningLedgerResponseTypeEnum}
export type Ledger = MainLedger | CombiningLedger;
export type CombinedLedger = CombinedLedgerResponse & {type: CombinedLedgerResponseTypeEnum}
export type Ledger = MainLedger | CombinedLedger;
export const isMain = (ledger: Ledger): ledger is MainLedger => {
return ledger.type === LedgerTypes.Main;
}
export const isCombining = (ledger: Ledger): ledger is CombiningLedger => {
return ledger.type === LedgerTypes.Combining;
export const isCombined = (ledger: Ledger): ledger is CombinedLedger => {
return ledger.type === LedgerTypes.Combined;
}
export const useLedgersStore = defineStore('ledgers', () => {
@@ -50,14 +50,14 @@ export const useLedgersStore = defineStore('ledgers', () => {
const findAllById = (ledgerIds: string[]): Ledger[] => ledgerIds.map(findById).filter((x): x is Ledger => x !== undefined)
const createMain = (ledger: CreateMainLedgerRequest) => ledgerControllerApi.createMainLedger(ledger).then(response => addLedger(response.data as Ledger));
const createCombining = (ledger: CreateCombiningLedgerRequest) => ledgerControllerApi.createCombiningLedger(ledger).then(response => addLedger(response.data as Ledger));
const createCombined = (ledger: CreateCombinedLedgerRequest) => ledgerControllerApi.createCombinedLedger(ledger).then(response => addLedger(response.data as Ledger));
const updateMain = (ledgerId: string, ledger: UpdateMainLedgerRequest) => ledgerControllerApi.updateMainLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const updateCombining = (ledgerId: string, ledger: UpdateCombiningLedgerRequest) => ledgerControllerApi.updateCombiningLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const updateCombined = (ledgerId: string, ledger: UpdateCombinedLedgerRequest) => ledgerControllerApi.updateCombinedLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const refresh = () => ledgerControllerApi.findAll().then(response => ledgers.value = response.data as Ledger[]);
refresh();
return {ledgers, findById, findAllById, createMain, createCombining, updateMain, updateCombining, refresh};
return {ledgers, findById, findAllById, createMain, createCombined, updateMain, updateCombined, refresh};
})