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

Minis-login #155

Merged
merged 7 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
OneOfFilterItemInterface,
StringFilterItemInterface,
} from "@ukdanceblue/common";
import { DateTimeISOResolver, VoidResolver } from "graphql-scalars";
import { GraphQLDateTimeISO, VoidResolver } from "graphql-scalars";
import { Field, InputType } from "type-graphql";

import type { Comparator } from "../ListQueryTypes.js";
Expand Down Expand Up @@ -103,7 +103,7 @@ export abstract class AbstractDateFilterItem<Field extends string>
extends FilterItem<Field, string>
implements DateFilterItemInterface<Field>
{
@Field(() => DateTimeISOResolver)
@Field(() => GraphQLDateTimeISO)
value!: string;

@Field(() => NumericComparator, {
Expand Down
16 changes: 11 additions & 5 deletions packages/common/lib/api/params/CreateFeedInput.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import { NonEmptyStringResolver } from "graphql-scalars";
import { MinLength } from "class-validator";
import { GraphQLNonEmptyString } from "graphql-scalars";
import { Field, InputType } from "type-graphql";

import { GlobalIdScalar } from "../scalars/GlobalId.js";

@InputType()
export class CreateFeedInput {
@Field(() => NonEmptyStringResolver)
@MinLength(5)
@Field(() => GraphQLNonEmptyString)
title!: string;
@Field(() => NonEmptyStringResolver, { nullable: true })

@Field(() => GraphQLNonEmptyString, { nullable: true })
textContent?: string | undefined | null;

@Field(() => GlobalIdScalar, { nullable: true })
imageUuid?: string | undefined | null;
}

@InputType()
export class SetFeedInput {
@Field(() => NonEmptyStringResolver)
@MinLength(5)
@Field(() => GraphQLNonEmptyString)
title!: string;
@Field(() => NonEmptyStringResolver, { nullable: true })

@Field(() => GraphQLNonEmptyString, { nullable: true })
textContent?: string | undefined | null;
}
100 changes: 50 additions & 50 deletions packages/common/lib/api/params/DailyDepartmentNotificationParams.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalDateResolver, NonEmptyStringResolver } from "graphql-scalars";
import { GraphQLLocalDate, GraphQLNonEmptyString } from "graphql-scalars";
import { ArgsType, Field, InputType, ObjectType } from "type-graphql";

import type { LocalDate } from "../../utility/time/localDate.js";
Expand Down Expand Up @@ -82,25 +82,25 @@ export class ListDailyDepartmentNotificationsResponse extends AbstractGraphQLPag

@InputType()
export class DailyDepartmentNotificationInput implements DDNInit {
@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
division?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
department?: string | undefined;

@Field(() => LocalDateResolver, { nullable: true })
@Field(() => GraphQLLocalDate, { nullable: true })
effectiveDate?: LocalDate | undefined;

@Field(() => LocalDateResolver)
@Field(() => GraphQLLocalDate)
processDate!: LocalDate;

@Field(() => LocalDateResolver, { nullable: true })
@Field(() => GraphQLLocalDate, { nullable: true })
pledgedDate?: LocalDate | undefined;

@Field(() => LocalDateResolver, { nullable: true })
@Field(() => GraphQLLocalDate, { nullable: true })
transactionDate?: LocalDate | undefined;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
transactionType!: string;

@Field(() => Number, { nullable: true })
Expand All @@ -115,46 +115,46 @@ export class DailyDepartmentNotificationInput implements DDNInit {
@Field(() => Number)
pledgedAmount!: number;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
accountNumber!: string;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
accountName!: string;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
holdingDestination?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
comment?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
secShares?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
secType?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
gikType?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
gikDescription?: string | undefined;

@Field(() => Boolean)
onlineGift!: boolean;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
solicitationCode!: string;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
solicitation?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
behalfHonorMemorial?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
matchingGift?: string | undefined;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
batchId!: string;

@Field(() => Boolean)
Expand All @@ -163,103 +163,103 @@ export class DailyDepartmentNotificationInput implements DDNInit {
@Field(() => Boolean)
divFirstGift!: boolean;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
idSorter!: string;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
combinedDonorName!: string;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
combinedDonorSalutation!: string;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
combinedDonorSort?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor1Id?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor1GiftKey?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor1Name?: string | undefined;

@Field(() => Boolean, { nullable: true })
donor1Deceased?: boolean | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor1Constituency?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor1TitleBar?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor1Pm?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor1Degrees?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor2Id?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor2GiftKey?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor2Name?: string | undefined;

@Field(() => Boolean, { nullable: true })
donor2Deceased?: boolean | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor2Constituency?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor2TitleBar?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor2Pm?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor2Degrees?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor1Relation?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donor2Relation?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
transmittalSn?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
sapDocNum?: string | undefined;

@Field(() => LocalDateResolver, { nullable: true })
@Field(() => GraphQLLocalDate, { nullable: true })
sapDocDate?: LocalDate | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
jvDocNum?: string | undefined;

@Field(() => LocalDateResolver, { nullable: true })
@Field(() => GraphQLLocalDate, { nullable: true })
jvDocDate?: LocalDate | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
advFeeCcPhil?: string | undefined;

@Field(() => Number, { nullable: true })
advFeeAmtPhil?: number | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
advFeeCcUnit?: string | undefined;

@Field(() => Number, { nullable: true })
advFeeAmtUnit?: number | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
advFeeStatus?: string | undefined;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
hcUnit?: string | undefined;
}

Expand Down
8 changes: 5 additions & 3 deletions packages/common/lib/api/params/GetConfigurationResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DateTimeISOResolver } from "graphql-scalars";
import { MinDate } from "class-validator";
import { GraphQLDateTimeISO } from "graphql-scalars";
import { Field, InputType, ObjectType } from "type-graphql";

import { ConfigurationNode } from "../resources/Configuration.js";
Expand All @@ -17,9 +18,10 @@ export class CreateConfigurationInput implements Partial<ConfigurationNode> {
@Field()
value!: string;

@Field(() => DateTimeISOResolver, { nullable: true })
@Field(() => GraphQLDateTimeISO, { nullable: true })
validAfter!: Date | null;

@Field(() => DateTimeISOResolver, { nullable: true })
@MinDate(() => new Date())
@Field(() => GraphQLDateTimeISO, { nullable: true })
validUntil!: Date | null;
}
6 changes: 3 additions & 3 deletions packages/common/lib/api/params/GetImageByUuidResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NonEmptyStringResolver, URLResolver } from "graphql-scalars";
import { GraphQLNonEmptyString, GraphQLURL } from "graphql-scalars";
import { ArgsType, Field, InputType, ObjectType } from "type-graphql";

import { FilteredListQueryArgs } from "../filtering/list-query-args/FilteredListQueryArgs.js";
Expand All @@ -7,10 +7,10 @@ import { AbstractGraphQLPaginatedResponse } from "./ApiResponse.js";

@InputType()
export class CreateImageInput implements Partial<ImageNode> {
@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
alt?: string | undefined | null;

@Field(() => URLResolver, { nullable: true })
@Field(() => GraphQLURL, { nullable: true })
url?: URL | undefined | null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NonEmptyStringResolver, URLResolver } from "graphql-scalars";
import { GraphQLNonEmptyString, GraphQLURL } from "graphql-scalars";
import { ArgsType, Field, InputType, Int, ObjectType } from "type-graphql";

import { FilteredListQueryArgs } from "../filtering/list-query-args/FilteredListQueryArgs.js";
Expand Down Expand Up @@ -35,13 +35,13 @@ class NotificationAudienceInput {

@ArgsType()
export class StageNotificationArgs {
@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
title!: string;

@Field(() => NonEmptyStringResolver)
@Field(() => GraphQLNonEmptyString)
body!: string;

@Field(() => URLResolver, { nullable: true })
@Field(() => GraphQLURL, { nullable: true })
url?: string | undefined | null;

@Field(() => NotificationAudienceInput)
Expand Down
4 changes: 2 additions & 2 deletions packages/common/lib/api/params/GetPointEntryByUuidResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NonEmptyStringResolver } from "graphql-scalars";
import { GraphQLNonEmptyString } from "graphql-scalars";
import { ArgsType, Field, InputType, Int, ObjectType } from "type-graphql";

import { FilteredListQueryArgs } from "../filtering/list-query-args/FilteredListQueryArgs.js";
Expand All @@ -16,7 +16,7 @@ export class ListPointEntriesResponse extends AbstractGraphQLPaginatedResponse<P

@InputType()
export class CreatePointEntryInput implements Partial<PointEntryNode> {
@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
comment!: string | null;

@Field(() => Int)
Expand Down
12 changes: 7 additions & 5 deletions packages/common/lib/api/params/ListFundraisingEntriesResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LocalDateResolver, NonEmptyStringResolver } from "graphql-scalars";
import { IsDivisibleBy } from "class-validator";
import { GraphQLLocalDate, GraphQLNonEmptyString } from "graphql-scalars";
import { ArgsType, Field, Float, InputType, ObjectType } from "type-graphql";

import type { LocalDate } from "../../utility/time/localDate.js";
Expand Down Expand Up @@ -54,22 +55,23 @@ export class ListFundraisingEntriesResponse extends AbstractGraphQLPaginatedResp

@InputType("SetFundraisingEntryInput")
export class SetFundraisingEntryInput {
@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
notes?: string;

@Field(() => GlobalIdScalar, { nullable: true })
solicitationCodeOverrideId?: GlobalId;

@IsDivisibleBy(0.01)
@Field(() => Float, { nullable: true })
amountOverride?: number;

@Field(() => LocalDateResolver, { nullable: true })
@Field(() => GraphQLLocalDate, { nullable: true })
donatedOnOverride?: LocalDate;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donatedToOverride?: string;

@Field(() => NonEmptyStringResolver, { nullable: true })
@Field(() => GraphQLNonEmptyString, { nullable: true })
donatedByOverride?: string;

@Field(() => BatchType, { nullable: true })
Expand Down
Loading
Loading