Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose newsletterOptIn flag in members export #540

Merged
merged 1 commit into from
Mar 7, 2024
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
1 change: 1 addition & 0 deletions src/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3978,6 +3978,7 @@ type User implements CollectiveInterface {
categories: [String]!
policies: Policies!
email: String
newsletterOptIn: Boolean
}

"""
Expand Down
55 changes: 55 additions & 0 deletions src/graphql/schemaV2.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4466,6 +4466,51 @@ type AccountStats {
currency: Currency
): TimeSeriesAmount!

"""
Balance time series
"""
balanceTimeSeries(
"""
The start date of the time series
"""
dateFrom: DateTime

"""
The end date of the time series
"""
dateTo: DateTime

"""
The time unit of the time series (such as MONTH, YEAR, WEEK etc). If no value is provided this is calculated using the dateFrom and dateTo values.
"""
timeUnit: TimeUnit

"""
Return the net amount (with payment processor fees removed)
"""
net: Boolean = false

"""
Filter by kind
"""
kind: [TransactionKind]

"""
Calculate amount for the last x months. Cannot be used with startDate/endDate
"""
periodInMonths: Int

"""
Include transactions from children (Projects and Events)
"""
includeChildren: Boolean = false

"""
An optional currency. If not provided, will use the collective currency.
"""
currency: Currency
): TimeSeriesAmount!

"""
Total of paid expenses to the account, filter per expense type
"""
Expand Down Expand Up @@ -5108,6 +5153,11 @@ type AccountPermissions {
Whether the current user can contact this account
"""
contact: Permission!

"""
Whether the current user can download this account's payment receipts
"""
canDownloadPaymentReceipts: Permission!
}

type Permission {
Expand Down Expand Up @@ -5170,6 +5220,11 @@ type Activity {
"""
update: Update

"""
The conversation related to this activity, if any
"""
conversation: Conversation

"""
The transaction related to this activity, if any
"""
Expand Down
2 changes: 2 additions & 0 deletions src/server/controllers/members.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export async function list(req, res, next) {
}
... on User {
email
newsletterOptIn
}
}
tier {
Expand Down Expand Up @@ -169,6 +170,7 @@ export async function list(req, res, next) {
description: 'member.description',
image: 'member.image',
email: 'member.email',
newsletterOptIn: 'member.newsletterOptIn',
twitter: (r) => {
return r.member.twitterHandle ? `https://twitter.com/${r.member.twitterHandle}` : null;
},
Expand Down