194 lines
6.7 KiB
TypeScript
194 lines
6.7 KiB
TypeScript
import type { CreateShiftSeriesInput, UpdateShiftSeriesInput } from './shift-series.schemas';
|
|
export declare class ShiftSeriesService {
|
|
/**
|
|
* Generate occurrence dates based on recurrence rules
|
|
*/
|
|
static generateOccurrences(input: CreateShiftSeriesInput): Date[];
|
|
/**
|
|
* Create a shift series and generate all individual shifts
|
|
*/
|
|
static createSeries(input: CreateShiftSeriesInput, createdBy?: string): Promise<{
|
|
series: {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
location: string | null;
|
|
title: string;
|
|
startDate: Date;
|
|
endDate: Date | null;
|
|
description: string | null;
|
|
createdBy: string | null;
|
|
isPublic: boolean;
|
|
cutId: string | null;
|
|
startTime: string;
|
|
endTime: string;
|
|
maxVolunteers: number;
|
|
frequency: import(".prisma/client").$Enums.RecurrenceFrequency;
|
|
daysOfWeek: import("@prisma/client/runtime/library").JsonValue | null;
|
|
};
|
|
generatedShiftsCount: number;
|
|
}>;
|
|
/**
|
|
* Get count of non-exception shifts in a series
|
|
*/
|
|
static getShiftCount(seriesId: string): Promise<number>;
|
|
/**
|
|
* Get series with all its shifts
|
|
*/
|
|
static getSeries(seriesId: string): Promise<{
|
|
shifts: ({
|
|
signups: {
|
|
status: import(".prisma/client").$Enums.SignupStatus;
|
|
id: string;
|
|
userId: string | null;
|
|
userEmail: string;
|
|
shiftId: string;
|
|
userName: string | null;
|
|
shiftTitle: string | null;
|
|
userPhone: string | null;
|
|
signupDate: Date;
|
|
signupSource: import(".prisma/client").$Enums.SignupSource;
|
|
}[];
|
|
} & {
|
|
status: import(".prisma/client").$Enums.ShiftStatus;
|
|
date: Date;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
location: string | null;
|
|
title: string;
|
|
description: string | null;
|
|
createdBy: string | null;
|
|
isPublic: boolean;
|
|
cutId: string | null;
|
|
startTime: string;
|
|
endTime: string;
|
|
gancioEventId: number | null;
|
|
meetingId: string | null;
|
|
seriesId: string | null;
|
|
isException: boolean;
|
|
maxVolunteers: number;
|
|
currentVolunteers: number;
|
|
})[];
|
|
cut: {
|
|
id: string;
|
|
name: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
category: import(".prisma/client").$Enums.CutCategory | null;
|
|
description: string | null;
|
|
isPublic: boolean;
|
|
createdByUserId: string | null;
|
|
color: string;
|
|
opacity: import("@prisma/client/runtime/library").Decimal;
|
|
isOfficial: boolean;
|
|
geojson: string;
|
|
bounds: string | null;
|
|
showLocations: boolean;
|
|
exportEnabled: boolean;
|
|
assignedTo: string | null;
|
|
filterSettings: import("@prisma/client/runtime/library").JsonValue | null;
|
|
lastCanvassed: Date | null;
|
|
completionPercentage: number;
|
|
} | null;
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
location: string | null;
|
|
title: string;
|
|
startDate: Date;
|
|
endDate: Date | null;
|
|
description: string | null;
|
|
createdBy: string | null;
|
|
isPublic: boolean;
|
|
cutId: string | null;
|
|
startTime: string;
|
|
endTime: string;
|
|
maxVolunteers: number;
|
|
frequency: import(".prisma/client").$Enums.RecurrenceFrequency;
|
|
daysOfWeek: import("@prisma/client/runtime/library").JsonValue | null;
|
|
}>;
|
|
/**
|
|
* Update series shifts based on edit mode
|
|
*/
|
|
static updateSeries(seriesId: string, input: UpdateShiftSeriesInput): Promise<{
|
|
shifts: ({
|
|
signups: {
|
|
status: import(".prisma/client").$Enums.SignupStatus;
|
|
id: string;
|
|
userId: string | null;
|
|
userEmail: string;
|
|
shiftId: string;
|
|
userName: string | null;
|
|
shiftTitle: string | null;
|
|
userPhone: string | null;
|
|
signupDate: Date;
|
|
signupSource: import(".prisma/client").$Enums.SignupSource;
|
|
}[];
|
|
} & {
|
|
status: import(".prisma/client").$Enums.ShiftStatus;
|
|
date: Date;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
location: string | null;
|
|
title: string;
|
|
description: string | null;
|
|
createdBy: string | null;
|
|
isPublic: boolean;
|
|
cutId: string | null;
|
|
startTime: string;
|
|
endTime: string;
|
|
gancioEventId: number | null;
|
|
meetingId: string | null;
|
|
seriesId: string | null;
|
|
isException: boolean;
|
|
maxVolunteers: number;
|
|
currentVolunteers: number;
|
|
})[];
|
|
cut: {
|
|
id: string;
|
|
name: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
category: import(".prisma/client").$Enums.CutCategory | null;
|
|
description: string | null;
|
|
isPublic: boolean;
|
|
createdByUserId: string | null;
|
|
color: string;
|
|
opacity: import("@prisma/client/runtime/library").Decimal;
|
|
isOfficial: boolean;
|
|
geojson: string;
|
|
bounds: string | null;
|
|
showLocations: boolean;
|
|
exportEnabled: boolean;
|
|
assignedTo: string | null;
|
|
filterSettings: import("@prisma/client/runtime/library").JsonValue | null;
|
|
lastCanvassed: Date | null;
|
|
completionPercentage: number;
|
|
} | null;
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
location: string | null;
|
|
title: string;
|
|
startDate: Date;
|
|
endDate: Date | null;
|
|
description: string | null;
|
|
createdBy: string | null;
|
|
isPublic: boolean;
|
|
cutId: string | null;
|
|
startTime: string;
|
|
endTime: string;
|
|
maxVolunteers: number;
|
|
frequency: import(".prisma/client").$Enums.RecurrenceFrequency;
|
|
daysOfWeek: import("@prisma/client/runtime/library").JsonValue | null;
|
|
}>;
|
|
/**
|
|
* Delete series (cascades to shifts via onDelete: SetNull)
|
|
*/
|
|
static deleteSeries(seriesId: string): Promise<void>;
|
|
}
|
|
//# sourceMappingURL=shift-series.service.d.ts.map
|