Changes to the graphql query and the datas needed for the gdtTransactions.

This commit is contained in:
elweyn 2021-08-16 16:13:18 +02:00
parent b5337bf473
commit 594030eb9a
4 changed files with 29 additions and 21 deletions

View File

@ -15,6 +15,7 @@ export enum GdtEntryType {
@ObjectType()
export class GdtEntry {
constructor(json: any) {
this.transactionId = json.transaction_id
this.amount = json.amount
this.date = json.date
this.email = json.email
@ -27,6 +28,9 @@ export class GdtEntry {
this.gdt = json.gdt
}
@Field(() => Number)
transactionId: number
@Field(() => Number)
amount: number

View File

@ -125,20 +125,16 @@ export const checkUsername = gql`
`
export const listGDTEntriesQuery = gql`
query($email: String!, $currentPage: Float!, $pageSize: Float!) {
query($email: String!, $currentPage: Int!, $pageSize: Int!) {
listGDTEntries(email: $email, currentPage: $currentPage, pageSize: $pageSize) {
state
count
gdtEntries {
transactionId
amount
date
email
comment
couponCode
gdtEntryType
factor
amount2
factor2
gdt
}
gdtSum

View File

@ -2,8 +2,8 @@
<div class="gdd-transaction-list">
<div class="list-group">
<div
v-for="{ decay, transaction_id, type, date, balance, name, memo } in transactions"
:key="transaction_id"
v-for="{ decay, transactionId, type, date, balance, name, memo } in transactions"
:key="transactionId"
:style="type === 'decay' ? 'background-color:#f1e0ae3d' : ''"
>
<div class="list-group-item gdd-transaction-list-item" v-b-toggle="'a' + date + ''">

View File

@ -6,16 +6,24 @@
</div>
<div
v-else
v-for="{ id, amount, date, comment, gdt_entry_type_id, factor, gdt } in transactionsGdt"
:key="id"
v-for="{
transactionId,
amount,
date,
comment,
gdtEntryType,
factor,
gdt,
} in transactionsGdt"
:key="transactionId"
>
<div class="list-group-item gdt-transaction-list-item" v-b-toggle="'a' + date + ''">
<!-- Icon -->
<div class="text-right" style="position: absolute">
<b-icon
v-if="gdt_entry_type_id"
:icon="getIcon(gdt_entry_type_id).icon"
:class="getIcon(gdt_entry_type_id).class"
v-if="gdtEntryType"
:icon="getIcon(gdtEntryType).icon"
:class="getIcon(gdtEntryType).class"
></b-icon>
</div>
@ -29,7 +37,7 @@
<!-- Betrag -->
<!-- 7 nur GDT erhalten -->
<b-row v-if="gdt_entry_type_id === 7">
<b-row v-if="gdtEntryType === 7">
<div class="col-6 text-right">
<div>{{ $t('gdt.gdt-receive') }}</div>
<div>{{ $t('gdt.credit') }}</div>
@ -40,7 +48,7 @@
</div>
</b-row>
<!--4 publisher -->
<b-row v-else-if="gdt_entry_type_id === 4">
<b-row v-else-if="gdtEntryType === 4">
<div class="col-6 text-right">
<div>{{ $t('gdt.your-share') }}</div>
<div>{{ $t('gdt.credit') }}</div>
@ -65,7 +73,7 @@
<!-- Betrag ENDE-->
<!-- Nachricht-->
<b-row v-if="comment && gdt_entry_type_id !== 7">
<b-row v-if="comment && gdtEntryType !== 7">
<div class="col-6 text-right">
{{ $t('form.memo') }}
</div>
@ -87,21 +95,21 @@
<!-- Collaps START -->
<b-collapse v-if="gdt_entry_type_id" :id="'a' + date + ''" class="pb-4">
<b-collapse v-if="gdtEntryType" :id="'a' + date + ''" class="pb-4">
<div style="border: 0px; background-color: #f1f1f1" class="p-2 pb-4 mb-4">
<!-- Überschrift -->
<b-row class="gdt-list-clooaps-header-text text-center pb-3">
<div class="col h4" v-if="gdt_entry_type_id === 7">
<div class="col h4" v-if="gdtEntryType === 7">
{{ $t('gdt.conversion-gdt-euro') }}
</div>
<div class="col h4" v-else-if="gdt_entry_type_id === 4">
<div class="col h4" v-else-if="gdtEntryType === 4">
{{ $t('gdt.publisher') }}
</div>
<div class="col h4" v-else>{{ $t('gdt.calculation') }}</div>
</b-row>
<!-- 7 nur GDT erhalten -->
<b-row class="gdt-list-clooaps-box-7" v-if="gdt_entry_type_id == 7">
<b-row class="gdt-list-clooaps-box-7" v-if="gdtEntryType == 7">
<div class="col-6 text-right clooaps-col-left">
<div>{{ $t('gdt.raise') }}</div>
<div>{{ $t('gdt.conversion') }}</div>
@ -115,7 +123,7 @@
</div>
</b-row>
<!-- 4 publisher -->
<b-row class="gdt-list-clooaps-box-4" v-else-if="gdt_entry_type_id === 4">
<b-row class="gdt-list-clooaps-box-4" v-else-if="gdtEntryType === 4">
<div class="col-6 text-right clooaps-col-left"></div>
<div class="col-6 clooaps-col-right"></div>
</b-row>