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

Add additional fields to campaign model #946

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
46 changes: 46 additions & 0 deletions admin/src/collections/Campaigns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,36 @@ export const campaignsCollection = buildAuditedCollection<Campaign>({
description: 'Visible in the fundraising page.',
multiline: true,
},
link_website: {
title: 'Website Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the website (optional)',
},
link_instagram: {
title: 'Instagram Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the Instagram profile (optional)',
},
link_tiktok: {
title: 'TikTok Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the TikTok profile (optional)',
},
link_facebook: {
title: 'Facebook Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the Facebook profile (optional)',
},
link_x: {
title: 'X (formerly Twitter) Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the X profile (optional)',
},
andrashee marked this conversation as resolved.
Show resolved Hide resolved
amount_collected_chf: {
dataType: 'number',
name: 'Collected amount in CHF',
Expand Down Expand Up @@ -104,6 +134,22 @@ export const campaignsCollection = buildAuditedCollection<Campaign>({
enumValues: campaignStatusEnumValues,
validation: { required: true },
},
public: {
dataType: 'boolean',
name: 'Public',
description: 'Listed on campaign overview',
defaultValue: false,
},
featured: {
dataType: 'boolean',
name: 'Featured',
description: 'Featured on campaign overview',
defaultValue: false,
},
andrashee marked this conversation as resolved.
Show resolved Hide resolved
slug: {
dataType: 'string',
name: 'Url Slug',
},
andrashee marked this conversation as resolved.
Show resolved Hide resolved
metadata_description: {
dataType: 'string',
name: 'Metadata Description',
Expand Down
13 changes: 13 additions & 0 deletions shared/src/types/campaign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ export type Campaign = {
second_description?: string;
third_description_title?: string;
third_description?: string;
link_website?: string;
link_instagram?: string;
link_tiktok?: string;
link_facebook?: string;
link_x?: string;
amount_collected_chf: number; // automatically updated by incoming payments.
contributions: number; // automatically updated by incoming payments.
goal?: number;
goal_currency?: Currency;
end_date: Timestamp;
status: CampaignStatus;
public?: boolean;
featured?: boolean;
slug?: string; // optional, for nicer url instead of firestore id
metadata_description?: string;
metadata_ogImage?: string;
metadata_twitterImage?: string;
Expand All @@ -27,3 +35,8 @@ export enum CampaignStatus {
Active = 'active',
Inactive = 'inactive',
}

export type Link = {
name: string;
url: string;
};
Loading