Skip to content

Commit

Permalink
chore(develop): sync types to dmgincs/nestjs-api
Browse files Browse the repository at this point in the history
  • Loading branch information
damageinc-bot[bot] committed Jan 13, 2024
1 parent d74a2a8 commit a4a6a6b
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/PaginatedResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PaginatedMeta {
totalPages: number;

/** The filters applied to the current pagination */
filter: Record<string, string>;
filter?: Record<string, string | string[]>;

/** The search keyword that was applied */
search?: string;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/common/GetRecruitsActivityResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export class GetRecruitsActivityResponseObjectDto {
}

export class GetRecruitsActivityResponseDto {

[key: string]: GetRecruitsActivityResponseObjectDto;
}
2 changes: 1 addition & 1 deletion src/common/ProfileDataResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class ProfileDataResponseDto {
is_trusted_host: boolean;
}

export class ProfileDataDro {
export class GetProfileDataDto {

members: {
[memberID: number]: ProfileDataResponseDto;
Expand Down
1 change: 1 addition & 0 deletions src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export * from './GetMemberVotingPaginatedResponse';
export * from './GetMemberVotingResponse';
export * from './GetNewsResponse';
export * from './GetOrderResponse';
export * from './GetRecruiterTierResponse';
export * from './GetRecruitsActivityResponse';
export * from './GetRecruitsTopFiveResponse';
export * from './GetRepActivityResponse';
Expand Down
3 changes: 2 additions & 1 deletion src/mainsite/awayhistory/AwayHistoryResponse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-restricted-imports */
import { MemberRanks } from '~/constants/MemberRanks';
import { AwayHistoryStatus } from '~/types/mainsite/AwayHistoryStatus';

export class AwayHistoryResponseDto {
/** History ID */
Expand All @@ -18,7 +19,7 @@ export class AwayHistoryResponseDto {
previous_group_id: number | null;

/** Status */
status: number;
status: AwayHistoryStatus;

/** Last updated timestamp */
last_updated: Date;
Expand Down
9 changes: 9 additions & 0 deletions src/mainsite/awayhistory/CreateAwayResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

export class CreateAwayResponseDto {

/** Start date and time */
start: number;

/** End date and time */
end: number;
}
9 changes: 2 additions & 7 deletions src/mainsite/awayhistory/UpdateAwayResponse.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { CreateAwayResponseDto } from './CreateAwayResponse';

export class UpdateAwayResponseDto {

/** Start date and time */
start: number;

/** End date and time */
end: number;
export class UpdateAwayResponseDto extends CreateAwayResponseDto {
}
23 changes: 23 additions & 0 deletions src/mainsite/crafting/CraftingTableResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

export class CraftingTableResponseDto {
/** The member id of the user */
member_id: number;

/** The table number */
table_number: number;

/** The recipe id */
recipe_id: number;

/** The item one id */
item_one_id: number;

/** The item two id */
item_two_id: number;

/** The item three id */
item_three_id: number;

/** The xp gained */
xp_gained: number;
}
13 changes: 13 additions & 0 deletions src/mainsite/notification/GetNotificationSettingsResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NotificationApplications, NotificationPlatforms } from '~/types/Notification';

class NotificationSettingsDto {
/** Description about the notification platform */
description: string;

/** List of enabled platforms */
platform: Record<NotificationPlatforms, boolean>;
}

export type GetNotificationSettingsResponseDto = {
[key in NotificationApplications]: NotificationSettingsDto;
};
2 changes: 1 addition & 1 deletion src/mainsite/perks/XpBoostsMapResponse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

export class XpBoostsMapDto {
export class XpBoostsMapResponseDto {

/** Global XP Boost */
global: number;
Expand Down
5 changes: 5 additions & 0 deletions src/mainsite/repshop/GetTaxReductionResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

export class GetTaxReductionResponseDto {
/** The percentile of how much tax reduction the member gets */
tax_reduction: number;
}
26 changes: 26 additions & 0 deletions src/mainsite/repshop/RepshopItemBuyResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { StatusNames } from '~/constants/RepShopItemBuyStatusNames';

export class RepshopItemBuyResponseDto {
/** The ID of the buy log */
id: number;

/** The ID of the member */
member_id: number;

status: StatusNames;

/** The ID of the item which was purchased */
itemId: number;

/** The name of the item which was purchased */
itemName: string;

/** The amount of REP which was paid for the purchase */
itemPrice: number;

/** The date at which the item was bought */
itemBoughtDate: Date;

/** The date at which the purchase was processed */
itemProcessedDate: Date | null;
}
2 changes: 1 addition & 1 deletion src/mainsite/repshop/RepshopItemResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ export class RepshopItemResponseDto {
/** Whether the item is selectable after a purchase */
isSelectable: boolean;

profileFieldMap: object;
profileFieldMap: Record<string, unknown>;
}
33 changes: 33 additions & 0 deletions src/types/mainsite/AwayHistoryStatus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { AwayHistory } from 'entities/mainsite/AwayHistory.entity';

Check failure on line 1 in src/types/mainsite/AwayHistoryStatus.ts

View workflow job for this annotation

GitHub Actions / Push @dmgincs/api-types

Cannot find module 'entities/mainsite/AwayHistory.entity' or its corresponding type declarations.

export enum AwayHistoryStatus {
SCHEDULED = 1,
ACTIVE = 2,
COMPLETED = 3,
ABORTED = 4,
CANCELLED = 5
}

export const AwayHistoryStatusNames: { [key in AwayHistoryStatus]: string } = {
[AwayHistoryStatus.SCHEDULED]: 'scheduled',
[AwayHistoryStatus.ACTIVE]: 'active',
[AwayHistoryStatus.COMPLETED]: 'completed',
[AwayHistoryStatus.ABORTED]: 'aborted',
[AwayHistoryStatus.CANCELLED]: 'cancelled'
};

export interface AwayStatus {
active_away: AwayHistory;
last_6_months: AwayDaysStats;
}

export interface AwayDaysStats{
days: Number;
max: Number;
}

export interface AwayBankDays{
member_id: Number;
away_days: Number;
max_days: Number;
}

0 comments on commit a4a6a6b

Please sign in to comment.