Skip to content
Draft
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
4 changes: 2 additions & 2 deletions apps/cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
"@sanity/color-input": "6.0.4",
"@sanity/icons": "3.7.4",
"@sanity/ui": "3.1.11",
"@sanity/vision": "5.11.0",
"@sanity/vision": "5.18.0",
"nanoid": "5.1.6",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-is": "19.2.4",
"sanity": "5.11.0",
"sanity": "5.18.0",
"sanity-plugin-markdown": "8.0.5",
"sanity-plugin-media": "4.1.1",
"sanity-plugin-singleton-tools": "^1.1.0",
Expand Down
267 changes: 48 additions & 219 deletions apps/cms/sanity.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Query TypeMap
import "@sanity/client";

/**
* ---------------------------------------------------------------------------------
* This file has been generated by Sanity TypeGen.
Expand All @@ -15,6 +12,12 @@ import "@sanity/client";
* ---------------------------------------------------------------------------------
*/

export declare const internalGroqTypeReferenceTo: unique symbol;

type ArrayOf<T> = Array<T & {
_key: string;
}>;

// Source: schema.json
export type ProfileReference = {
_ref: string;
Expand Down Expand Up @@ -85,92 +88,8 @@ export type Slug = {

export type Ttime = {
_type: "ttime";
hour:
| 0
| 1
| 2
| 3
| 4
| 5
| 6
| 7
| 8
| 9
| 10
| 11
| 12
| 13
| 14
| 15
| 16
| 17
| 18
| 19
| 20
| 21
| 22
| 23;
minute:
| 0
| 1
| 2
| 3
| 4
| 5
| 6
| 7
| 8
| 9
| 10
| 11
| 12
| 13
| 14
| 15
| 16
| 17
| 18
| 19
| 20
| 21
| 22
| 23
| 24
| 25
| 26
| 27
| 28
| 29
| 30
| 31
| 32
| 33
| 34
| 35
| 36
| 37
| 38
| 39
| 40
| 41
| 42
| 43
| 44
| 45
| 46
| 47
| 48
| 49
| 50
| 51
| 52
| 53
| 54
| 55
| 56
| 57
| 58
| 59;
hour: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23;
minute: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59;
};

export type Banner = {
Expand Down Expand Up @@ -328,11 +247,9 @@ export type Job = {
company: CompanyReference;
expiresAt: string;
weight: number;
locations: Array<
{
_key: string;
} & LocationReference
>;
locations: Array<{
_key: string;
} & LocationReference>;
jobType: "fulltime" | "parttime" | "internship" | "summerjob" | "event" | "ad";
link: string;
deadline?: string;
Expand Down Expand Up @@ -382,11 +299,9 @@ export type RepeatingHappening = {
title: string;
slug: Slug;
happeningType: "event" | "external";
organizers?: Array<
{
_key: string;
} & StudentGroupReference
>;
organizers?: Array<{
_key: string;
} & StudentGroupReference>;
location?: LocationReference;
cost?: number;
dayOfWeek: 1 | 2 | 3 | 4 | 5 | 6 | 0;
Expand All @@ -396,11 +311,9 @@ export type RepeatingHappening = {
endDate: string;
interval: "weekly" | "bi-weekly" | "monthly";
ignoredDates?: Array<string>;
contacts?: Array<
{
_key: string;
} & ContactProfile
>;
contacts?: Array<{
_key: string;
} & ContactProfile>;
externalLink?: string;
body?: Markdown;
};
Expand All @@ -415,40 +328,30 @@ export type Happening = {
slug: Slug;
isPinned?: boolean;
happeningType: "event" | "bedpres" | "external";
organizers?: Array<
{
_key: string;
} & StudentGroupReference
>;
organizers?: Array<{
_key: string;
} & StudentGroupReference>;
company?: CompanyReference;
location?: LocationReference;
cost?: number;
hideRegistrations?: boolean;
date: string;
endDate?: string;
registrationStartGroups?: string;
registrationGroups?: Array<
{
_key: string;
} & StudentGroupReference
>;
registrationGroups?: Array<{
_key: string;
} & StudentGroupReference>;
registrationStart?: string;
registrationEnd?: string;
contacts?: Array<
{
_key: string;
} & ContactProfile
>;
spotRanges?: Array<
{
_key: string;
} & SpotRange
>;
additionalQuestions?: Array<
{
_key: string;
} & Question
>;
contacts?: Array<{
_key: string;
} & ContactProfile>;
spotRanges?: Array<{
_key: string;
} & SpotRange>;
additionalQuestions?: Array<{
_key: string;
} & Question>;
externalLink?: string;
body?: Markdown;
};
Expand Down Expand Up @@ -644,57 +547,7 @@ export type Geopoint = {
alt?: number;
};

export type AllSanitySchemaTypes =
| ProfileReference
| HungerGames
| SanityImageAssetReference
| Merch
| Markdown
| SanityImageCrop
| SanityImageHotspot
| Slug
| Ttime
| Banner
| Color
| Movie
| Question
| ContactProfile
| SpotRange
| SanityFileAssetReference
| MeetingMinute
| StudentGroup
| StaticInfo
| CompanyReference
| LocationReference
| Job
| StudentGroupReference
| Post
| RepeatingHappening
| Happening
| Location
| Company
| HsApplication
| Profile
| RgbaColor
| HsvaColor
| HslaColor
| MediaTag
| SanityImagePaletteSwatch
| SanityImagePalette
| SanityImageDimensions
| SanityImageMetadata
| SanityFileAsset
| SanityAssetSourceData
| SanityImageAsset
| Geopoint;

export declare const internalGroqTypeReferenceTo: unique symbol;

type ArrayOf<T> = Array<
T & {
_key: string;
}
>;
export type AllSanitySchemaTypes = ProfileReference | HungerGames | SanityImageAssetReference | Merch | Markdown | SanityImageCrop | SanityImageHotspot | Slug | Ttime | Banner | Color | Movie | Question | ContactProfile | SpotRange | SanityFileAssetReference | MeetingMinute | StudentGroup | StaticInfo | CompanyReference | LocationReference | Job | StudentGroupReference | Post | RepeatingHappening | Happening | Location | Company | HsApplication | Profile | RgbaColor | HsvaColor | HslaColor | MediaTag | SanityImagePaletteSwatch | SanityImagePalette | SanityImageDimensions | SanityImageMetadata | SanityFileAsset | SanityAssetSourceData | SanityImageAsset | Geopoint;

// Source: ../../packages/sanity/src/queries/banner.ts
// Variable: bannerQuery
Expand Down Expand Up @@ -986,24 +839,21 @@ export type AllPostsQueryResult = Array<{
_updatedAt: string;
title: string;
slug: string;
authors: Array<
| {
_id: string;
name: string;
image: null;
}
| {
_id: string;
name: string;
image: {
asset?: SanityImageAssetReference;
media?: unknown;
hotspot?: SanityImageHotspot;
crop?: SanityImageCrop;
_type: "image";
} | null;
}
> | null;
authors: Array<{
_id: string;
name: string;
image: null;
} | {
_id: string;
name: string;
image: {
asset?: SanityImageAssetReference;
media?: unknown;
hotspot?: SanityImageHotspot;
crop?: SanityImageCrop;
_type: "image";
} | null;
}> | null;
image: {
asset?: SanityImageAssetReference;
media?: unknown;
Expand Down Expand Up @@ -1180,24 +1030,3 @@ export type HappeningQueryListResult = Array<{
}> | null;
}>;

declare module "@sanity/client" {
interface SanityQueries {
'\n*[_type == "banner" && _id == "banner" && !(_id in path(\'drafts.**\'))] {\n backgroundColor,\n textColor,\n text,\n expiringDate,\n linkTo,\n isExternal,\n}[0]\n': BannerQueryResult;
'\n*[_type == "happening" && slug.current == $slug] {\n"contacts": contacts[] {\nemail,\n"profile": profile->{\n _id,\n name,\n},\n},\n}[0].contacts\n': HappeningContactsQueryResult;
'\n*[_type == "happening"\n && !(_id in path(\'drafts.**\'))]\n | order(date asc) {\n _id,\n _createdAt,\n _updatedAt,\n title,\n "slug": slug.current,\n isPinned,\n happeningType,\n "company": company->{\n _id,\n name,\n website,\n image,\n },\n "organizers": organizers[]->{\n _id,\n name,\n "slug": slug.current\n },\n "contacts": contacts[] {\n email,\n "profile": profile->{\n _id,\n name,\n },\n },\n "date": date,\n "endDate": endDate,\n cost,\n "registrationStartGroups": registrationStartGroups,\n "registrationGroups": registrationGroups[]->slug.current,\n "registrationStart": registrationStart,\n "registrationEnd": registrationEnd,\n "location": location->{\n name,\n link\n },\n "spotRanges": spotRanges[] {\n spots,\n minYear,\n maxYear,\n },\n "additionalQuestions": additionalQuestions[] {\n id,\n title,\n required,\n type,\n options,\n },\n externalLink,\n body\n}\n': AllHappeningsQueryResult;
'\n*[_type == "happening"\n && !(_id in path(\'drafts.**\'))\n && slug.current == $slug\n][0] {\n _id,\n _createdAt,\n _updatedAt,\n _type,\n title,\n "slug": slug.current,\n isPinned,\n happeningType,\n hideRegistrations,\n "company": company->{\n _id,\n name,\n website,\n image,\n },\n "organizers": organizers[]->{\n _id,\n name,\n "slug": slug.current\n },\n "contacts": contacts[] {\n email,\n "profile": profile->{\n _id,\n name,\n },\n },\n "date": date,\n "endDate": endDate,\n cost,\n "registrationStartGroups": registrationStartGroups,\n "registrationGroups": registrationGroups[]->slug.current,\n "registrationStart": registrationStart,\n "registrationEnd": registrationEnd,\n "location": location->{\n name,\n link\n },\n "spotRanges": spotRanges[] {\n spots,\n minYear,\n maxYear,\n },\n "additionalQuestions": additionalQuestions[] {\n title,\n required,\n type,\n options,\n },\n externalLink,\n body\n}\n': HappeningQueryResult;
'\n*[_type == "happening"\n && !(_id in path(\'drafts.**\'))\n && (isPinned || date >= now())\n && happeningType in $happeningTypes\n]\n| order(coalesce(isPinned, false) desc, date asc) {\n _id,\n title,\n isPinned,\n happeningType,\n date,\n registrationStart,\n "slug": slug.current,\n "image": company->image,\n "organizers": organizers[]->{\n name\n }.name\n}[0...$n]': HomeHappeningsQueryResult;
"\n*[_type == \"happening\"\n && !(_id in path('drafts.**'))\n && slug.current == $slug\n ] {\n happeningType,\n}[0].happeningType\n": HappeningTypeQueryResult;
'*[_type == "hs-application" && !(_id in path(\'drafts.**\'))] {\n "profile": profile->{\n _id,\n name,\n picture\n },\n "poster": poster.asset->url\n}': AllHsApplicationsResult;
'\n*[_type == "job"\n && !(_id in path(\'drafts.**\'))\n && expiresAt > now()]\n | order(weight desc, deadline desc) {\n _id,\n _createdAt,\n _updatedAt,\n weight,\n title,\n "slug": slug.current,\n "company": company->{\n _id,\n name,\n website,\n image,\n },\n expiresAt,\n "locations": locations[]->{\n _id,\n name,\n },\n jobType,\n link,\n deadline,\n degreeYears,\n body\n}\n': JobAdsQueryResult;
'\n*[_type == "merch" && !(_id in path(\'drafts.**\'))] | order(_createdAt desc) {\n _id,\n _createdAt,\n _updatedAt,\n title,\n "slug": slug.current,\n price,\n image,\n body\n}\n': AllMerchQueryResult;
'\n*[_type == "meetingMinute" && !(_id in path(\'drafts.**\'))] | order(date desc) {\n _id,\n isAllMeeting,\n date,\n title,\n "document": document.asset->url\n}\n': AllMeetingMinuteQueryResult;
"\n*[_type == \"movie\"\n && !(_id in path('drafts.**'))]\n | order(_createdAt desc) {\n _id,\n title,\n date,\n link,\n image,\n}\n": MoviesQueryResult;
'\n*[_type == "post" && !(_id in path(\'drafts.**\'))] | order(_createdAt desc) {\n _id,\n _createdAt,\n _updatedAt,\n title,\n "slug": slug.current,\n "authors": authors[]->{\n _id,\n name,\n image,\n },\n image,\n body\n}\n': AllPostsQueryResult;
'\n*[_type == "repeatingHappening"\n && !(_id in path(\'drafts.**\'))] {\n _id,\n _type,\n title,\n "slug": slug.current,\n happeningType,\n "organizers": organizers[]->{\n _id,\n name,\n "slug": slug.current\n },\n "contacts": contacts[] {\n email,\n "profile": profile->{\n _id,\n name,\n },\n },\n "location": location->{\n name,\n link,\n },\n dayOfWeek,\n startTime,\n endTime,\n startDate,\n endDate,\n interval,\n cost,\n ignoredDates,\n externalLink,\n body,\n}': AllRepeatingHappeningsQueryResult;
'\n*[_type == "staticInfo" && !(_id in path(\'drafts.**\'))] {\n title,\n "slug": slug.current,\n pageType,\n body\n}\n': StaticInfoQueryResult;
'\n*[_type == "studentGroup"\n && groupType == $type\n && !(_id in path(\'drafts.**\'))] | order(_createdAt asc) {\n _id,\n _createdAt,\n _updatedAt,\n name,\n isActive,\n groupType,\n "slug": slug.current,\n description,\n image,\n "members": members[] {\n role,\n "profile": profile->{\n _id,\n name,\n picture,\n socials,\n },\n },\n "socials": socials {\n facebook,\n instagram,\n linkedin,\n email,\n }\n}[0..$n]\n': StudentGroupsByTypeQueryResult;
'\n*[_type == "studentGroup"\n && slug.current == $slug\n && !(_id in path(\'drafts.**\'))] {\n _id,\n _createdAt,\n _updatedAt,\n name,\n isActive,\n groupType,\n "slug": slug.current,\n description,\n image,\n "members": members[] {\n role,\n "profile": profile->{\n _id,\n name,\n picture,\n socials,\n },\n },\n "socials": socials {\n facebook,\n instagram,\n linkedin,\n email,\n }\n}[0]\n': StudentGroupBySlugQueryResult;
'*[_type == "happening" && !(_id in path(\'drafts.**\'))] {\n _id,\n title,\n "slug": slug.current,\n "date": date,\n happeningType,\n "registrationStartGroups": registrationStartGroups,\n "registrationGroups": registrationGroups[]->slug.current,\n "registrationStart": registrationStart,\n "registrationEnd": registrationEnd,\n "groups": organizers[]->slug.current,\n "spotRanges": spotRanges[] {\n spots,\n minYear,\n maxYear,\n },\n "questions": additionalQuestions[] {\n id,\n title,\n required,\n type,\n isSensitive,\n options,\n }\n}\n': HappeningQueryListResult;
}
}
6 changes: 6 additions & 0 deletions apps/uno/domain/model/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
RegistrationStatusUnregistered RegistrationStatus = "unregistered"
RegistrationStatusPending RegistrationStatus = "pending"
RegistrationStatusRemoved RegistrationStatus = "removed"
RegistrationStatusAttended RegistrationStatus = "attended"
)

func (s RegistrationStatus) String() string {
Expand Down Expand Up @@ -70,6 +71,11 @@ func (r *Registration) CanUnregister() bool {
return r.IsActive() || r.IsPending()
}

// Is Attended checks if the user has attended the happening
func (r *Registration) IsAttended() bool {
return r.Status == RegistrationStatusAttended
}

// Unregister marks the registration as unregistered with a reason.
func (r *Registration) Unregister(reason string, changedBy string, now time.Time) {
r.PrevStatus = stringPtr(string(r.Status))
Expand Down
Loading