feat: add time entry manager, controller, and API routes
This commit is contained in:
@@ -212,6 +212,51 @@ export type ScheduleSpan = Prisma.ScheduleSpanModel
|
||||
*
|
||||
*/
|
||||
export type Schedule = Prisma.ScheduleModel
|
||||
/**
|
||||
* Model Activity
|
||||
*
|
||||
*/
|
||||
export type Activity = Prisma.ActivityModel
|
||||
/**
|
||||
* Model ActivityNotes
|
||||
*
|
||||
*/
|
||||
export type ActivityNotes = Prisma.ActivityNotesModel
|
||||
/**
|
||||
* Model ActivityType
|
||||
*
|
||||
*/
|
||||
export type ActivityType = Prisma.ActivityTypeModel
|
||||
/**
|
||||
* Model ActivityStatus
|
||||
*
|
||||
*/
|
||||
export type ActivityStatus = Prisma.ActivityStatusModel
|
||||
/**
|
||||
* Model TimeEntry
|
||||
*
|
||||
*/
|
||||
export type TimeEntry = Prisma.TimeEntryModel
|
||||
/**
|
||||
* Model TimeEntryStatus
|
||||
*
|
||||
*/
|
||||
export type TimeEntryStatus = Prisma.TimeEntryStatusModel
|
||||
/**
|
||||
* Model TimeEntryChargeCode
|
||||
*
|
||||
*/
|
||||
export type TimeEntryChargeCode = Prisma.TimeEntryChargeCodeModel
|
||||
/**
|
||||
* Model TimeActivityClass
|
||||
*
|
||||
*/
|
||||
export type TimeActivityClass = Prisma.TimeActivityClassModel
|
||||
/**
|
||||
* Model TimeActivityType
|
||||
*
|
||||
*/
|
||||
export type TimeActivityType = Prisma.TimeActivityTypeModel
|
||||
/**
|
||||
* Model CredentialType
|
||||
*
|
||||
@@ -242,3 +287,8 @@ export type TaxCode = Prisma.TaxCodeModel
|
||||
*
|
||||
*/
|
||||
export type CwMember = Prisma.CwMemberModel
|
||||
/**
|
||||
* Model CwMemberType
|
||||
*
|
||||
*/
|
||||
export type CwMemberType = Prisma.CwMemberTypeModel
|
||||
|
||||
@@ -236,6 +236,51 @@ export type ScheduleSpan = Prisma.ScheduleSpanModel
|
||||
*
|
||||
*/
|
||||
export type Schedule = Prisma.ScheduleModel
|
||||
/**
|
||||
* Model Activity
|
||||
*
|
||||
*/
|
||||
export type Activity = Prisma.ActivityModel
|
||||
/**
|
||||
* Model ActivityNotes
|
||||
*
|
||||
*/
|
||||
export type ActivityNotes = Prisma.ActivityNotesModel
|
||||
/**
|
||||
* Model ActivityType
|
||||
*
|
||||
*/
|
||||
export type ActivityType = Prisma.ActivityTypeModel
|
||||
/**
|
||||
* Model ActivityStatus
|
||||
*
|
||||
*/
|
||||
export type ActivityStatus = Prisma.ActivityStatusModel
|
||||
/**
|
||||
* Model TimeEntry
|
||||
*
|
||||
*/
|
||||
export type TimeEntry = Prisma.TimeEntryModel
|
||||
/**
|
||||
* Model TimeEntryStatus
|
||||
*
|
||||
*/
|
||||
export type TimeEntryStatus = Prisma.TimeEntryStatusModel
|
||||
/**
|
||||
* Model TimeEntryChargeCode
|
||||
*
|
||||
*/
|
||||
export type TimeEntryChargeCode = Prisma.TimeEntryChargeCodeModel
|
||||
/**
|
||||
* Model TimeActivityClass
|
||||
*
|
||||
*/
|
||||
export type TimeActivityClass = Prisma.TimeActivityClassModel
|
||||
/**
|
||||
* Model TimeActivityType
|
||||
*
|
||||
*/
|
||||
export type TimeActivityType = Prisma.TimeActivityTypeModel
|
||||
/**
|
||||
* Model CredentialType
|
||||
*
|
||||
@@ -266,3 +311,8 @@ export type TaxCode = Prisma.TaxCodeModel
|
||||
*
|
||||
*/
|
||||
export type CwMember = Prisma.CwMemberModel
|
||||
/**
|
||||
* Model CwMemberType
|
||||
*
|
||||
*/
|
||||
export type CwMemberType = Prisma.CwMemberTypeModel
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -90,12 +90,22 @@ export const ModelName = {
|
||||
ScheduleType: 'ScheduleType',
|
||||
ScheduleSpan: 'ScheduleSpan',
|
||||
Schedule: 'Schedule',
|
||||
Activity: 'Activity',
|
||||
ActivityNotes: 'ActivityNotes',
|
||||
ActivityType: 'ActivityType',
|
||||
ActivityStatus: 'ActivityStatus',
|
||||
TimeEntry: 'TimeEntry',
|
||||
TimeEntryStatus: 'TimeEntryStatus',
|
||||
TimeEntryChargeCode: 'TimeEntryChargeCode',
|
||||
TimeActivityClass: 'TimeActivityClass',
|
||||
TimeActivityType: 'TimeActivityType',
|
||||
CredentialType: 'CredentialType',
|
||||
SecureValue: 'SecureValue',
|
||||
Credential: 'Credential',
|
||||
GeneratedQuotes: 'GeneratedQuotes',
|
||||
TaxCode: 'TaxCode',
|
||||
CwMember: 'CwMember'
|
||||
CwMember: 'CwMember',
|
||||
CwMemberType: 'CwMemberType'
|
||||
} as const
|
||||
|
||||
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
|
||||
@@ -888,6 +898,204 @@ export const ScheduleScalarFieldEnum = {
|
||||
export type ScheduleScalarFieldEnum = (typeof ScheduleScalarFieldEnum)[keyof typeof ScheduleScalarFieldEnum]
|
||||
|
||||
|
||||
export const ActivityScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
subject: 'subject',
|
||||
startTime: 'startTime',
|
||||
endTime: 'endTime',
|
||||
assignToId: 'assignToId',
|
||||
assignedById: 'assignedById',
|
||||
enteredBy: 'enteredBy',
|
||||
automated: 'automated',
|
||||
closedFlag: 'closedFlag',
|
||||
notifyCompleteFlag: 'notifyCompleteFlag',
|
||||
notificationSentFlat: 'notificationSentFlat',
|
||||
opportunityId: 'opportunityId',
|
||||
serviceTicketId: 'serviceTicketId',
|
||||
contactId: 'contactId',
|
||||
companyId: 'companyId',
|
||||
activityTypeId: 'activityTypeId',
|
||||
activityStatusId: 'activityStatusId',
|
||||
createdById: 'createdById',
|
||||
updatedById: 'updatedById',
|
||||
closedById: 'closedById',
|
||||
closedAt: 'closedAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type ActivityScalarFieldEnum = (typeof ActivityScalarFieldEnum)[keyof typeof ActivityScalarFieldEnum]
|
||||
|
||||
|
||||
export const ActivityNotesScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
notes: 'notes',
|
||||
activityId: 'activityId',
|
||||
internalAnalysisFlag: 'internalAnalysisFlag',
|
||||
enteredById: 'enteredById',
|
||||
updatedById: 'updatedById',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type ActivityNotesScalarFieldEnum = (typeof ActivityNotesScalarFieldEnum)[keyof typeof ActivityNotesScalarFieldEnum]
|
||||
|
||||
|
||||
export const ActivityTypeScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
inactiveFlag: 'inactiveFlag',
|
||||
historyFlag: 'historyFlag',
|
||||
defaultFlag: 'defaultFlag',
|
||||
importFlag: 'importFlag',
|
||||
emailFlag: 'emailFlag',
|
||||
memoFlag: 'memoFlag',
|
||||
pointsValue: 'pointsValue',
|
||||
updatedById: 'updatedById',
|
||||
createdById: 'createdById',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type ActivityTypeScalarFieldEnum = (typeof ActivityTypeScalarFieldEnum)[keyof typeof ActivityTypeScalarFieldEnum]
|
||||
|
||||
|
||||
export const ActivityStatusScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
closedFlag: 'closedFlag',
|
||||
inactiveFlag: 'inactiveFlag',
|
||||
defaultFlag: 'defaultFlag',
|
||||
spawnFollowupFlag: 'spawnFollowupFlag',
|
||||
updatedById: 'updatedById',
|
||||
createdById: 'createdById',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type ActivityStatusScalarFieldEnum = (typeof ActivityStatusScalarFieldEnum)[keyof typeof ActivityStatusScalarFieldEnum]
|
||||
|
||||
|
||||
export const TimeEntryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
memberId: 'memberId',
|
||||
serviceTicketId: 'serviceTicketId',
|
||||
activityId: 'activityId',
|
||||
projectId: 'projectId',
|
||||
chargeCodeId: 'chargeCodeId',
|
||||
companyId: 'companyId',
|
||||
statusId: 'statusId',
|
||||
locationId: 'locationId',
|
||||
contactId: 'contactId',
|
||||
dateStart: 'dateStart',
|
||||
timeStart: 'timeStart',
|
||||
timeEnd: 'timeEnd',
|
||||
notes: 'notes',
|
||||
notesMd: 'notesMd',
|
||||
internalNote: 'internalNote',
|
||||
billableHours: 'billableHours',
|
||||
actualHours: 'actualHours',
|
||||
invoicedHours: 'invoicedHours',
|
||||
deductedHours: 'deductedHours',
|
||||
hourlyRate: 'hourlyRate',
|
||||
effectiveRate: 'effectiveRate',
|
||||
issueFlag: 'issueFlag',
|
||||
mergedFlag: 'mergedFlag',
|
||||
invoiceFlag: 'invoiceFlag',
|
||||
billableFlag: 'billableFlag',
|
||||
documentFlag: 'documentFlag',
|
||||
teProblemFlag: 'teProblemFlag',
|
||||
teResolutionFlag: 'teResolutionFlag',
|
||||
teInternalAnalysisFlag: 'teInternalAnalysisFlag',
|
||||
chargeToRecId: 'chargeToRecId',
|
||||
chargeToType: 'chargeToType',
|
||||
createdById: 'createdById',
|
||||
updatedById: 'updatedById',
|
||||
originalAuthorId: 'originalAuthorId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type TimeEntryScalarFieldEnum = (typeof TimeEntryScalarFieldEnum)[keyof typeof TimeEntryScalarFieldEnum]
|
||||
|
||||
|
||||
export const TimeEntryStatusScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
statusId: 'statusId',
|
||||
description: 'description',
|
||||
action: 'action',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type TimeEntryStatusScalarFieldEnum = (typeof TimeEntryStatusScalarFieldEnum)[keyof typeof TimeEntryStatusScalarFieldEnum]
|
||||
|
||||
|
||||
export const TimeEntryChargeCodeScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
chargeCodeId: 'chargeCodeId',
|
||||
description: 'description',
|
||||
expenseFlag: 'expenseFlag',
|
||||
timeFlag: 'timeFlag',
|
||||
billableFlag: 'billableFlag',
|
||||
invoiceFlag: 'invoiceFlag',
|
||||
updatedById: 'updatedById',
|
||||
createdById: 'createdById',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type TimeEntryChargeCodeScalarFieldEnum = (typeof TimeEntryChargeCodeScalarFieldEnum)[keyof typeof TimeEntryChargeCodeScalarFieldEnum]
|
||||
|
||||
|
||||
export const TimeActivityClassScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
description: 'description',
|
||||
hourlyRate: 'hourlyRate',
|
||||
inactiveFlag: 'inactiveFlag',
|
||||
taxExemptFlag: 'taxExemptFlag',
|
||||
createdById: 'createdById',
|
||||
updatedById: 'updatedById',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type TimeActivityClassScalarFieldEnum = (typeof TimeActivityClassScalarFieldEnum)[keyof typeof TimeActivityClassScalarFieldEnum]
|
||||
|
||||
|
||||
export const TimeActivityTypeScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
description: 'description',
|
||||
minHours: 'minHours',
|
||||
maxHours: 'maxHours',
|
||||
rate: 'rate',
|
||||
costMultiplier: 'costMultiplier',
|
||||
inactiveFlag: 'inactiveFlag',
|
||||
invoiceFlag: 'invoiceFlag',
|
||||
billableFlag: 'billableFlag',
|
||||
utilizationFlag: 'utilizationFlag',
|
||||
defaultFlag: 'defaultFlag',
|
||||
multiplierFlag: 'multiplierFlag',
|
||||
createdById: 'createdById',
|
||||
updatedById: 'updatedById',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type TimeActivityTypeScalarFieldEnum = (typeof TimeActivityTypeScalarFieldEnum)[keyof typeof TimeActivityTypeScalarFieldEnum]
|
||||
|
||||
|
||||
export const CredentialTypeScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -980,6 +1188,20 @@ export const CwMemberScalarFieldEnum = {
|
||||
export type CwMemberScalarFieldEnum = (typeof CwMemberScalarFieldEnum)[keyof typeof CwMemberScalarFieldEnum]
|
||||
|
||||
|
||||
export const CwMemberTypeScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
description: 'description',
|
||||
inactiveFlag: 'inactiveFlag',
|
||||
updatedById: 'updatedById',
|
||||
createdById: 'createdById',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type CwMemberTypeScalarFieldEnum = (typeof CwMemberTypeScalarFieldEnum)[keyof typeof CwMemberTypeScalarFieldEnum]
|
||||
|
||||
|
||||
export const SortOrder = {
|
||||
asc: 'asc',
|
||||
desc: 'desc'
|
||||
|
||||
@@ -47,10 +47,20 @@ export type * from './models/ScheduleStatus.ts'
|
||||
export type * from './models/ScheduleType.ts'
|
||||
export type * from './models/ScheduleSpan.ts'
|
||||
export type * from './models/Schedule.ts'
|
||||
export type * from './models/Activity.ts'
|
||||
export type * from './models/ActivityNotes.ts'
|
||||
export type * from './models/ActivityType.ts'
|
||||
export type * from './models/ActivityStatus.ts'
|
||||
export type * from './models/TimeEntry.ts'
|
||||
export type * from './models/TimeEntryStatus.ts'
|
||||
export type * from './models/TimeEntryChargeCode.ts'
|
||||
export type * from './models/TimeActivityClass.ts'
|
||||
export type * from './models/TimeActivityType.ts'
|
||||
export type * from './models/CredentialType.ts'
|
||||
export type * from './models/SecureValue.ts'
|
||||
export type * from './models/Credential.ts'
|
||||
export type * from './models/GeneratedQuotes.ts'
|
||||
export type * from './models/TaxCode.ts'
|
||||
export type * from './models/CwMember.ts'
|
||||
export type * from './models/CwMemberType.ts'
|
||||
export type * from './commonInputTypes.ts'
|
||||
@@ -293,6 +293,8 @@ export type CompanyWhereInput = {
|
||||
credentials?: Prisma.CredentialListRelationFilter
|
||||
unifiSites?: Prisma.UnifiSiteListRelationFilter
|
||||
opportunities?: Prisma.OpportunityListRelationFilter
|
||||
timeEntries?: Prisma.TimeEntryListRelationFilter
|
||||
activities?: Prisma.ActivityListRelationFilter
|
||||
deletedBy?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
enteredBy?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
serviceTickets?: Prisma.ServiceTicketListRelationFilter
|
||||
@@ -319,6 +321,8 @@ export type CompanyOrderByWithRelationInput = {
|
||||
credentials?: Prisma.CredentialOrderByRelationAggregateInput
|
||||
unifiSites?: Prisma.UnifiSiteOrderByRelationAggregateInput
|
||||
opportunities?: Prisma.OpportunityOrderByRelationAggregateInput
|
||||
timeEntries?: Prisma.TimeEntryOrderByRelationAggregateInput
|
||||
activities?: Prisma.ActivityOrderByRelationAggregateInput
|
||||
deletedBy?: Prisma.UserOrderByWithRelationInput
|
||||
enteredBy?: Prisma.UserOrderByWithRelationInput
|
||||
serviceTickets?: Prisma.ServiceTicketOrderByRelationAggregateInput
|
||||
@@ -348,6 +352,8 @@ export type CompanyWhereUniqueInput = Prisma.AtLeast<{
|
||||
credentials?: Prisma.CredentialListRelationFilter
|
||||
unifiSites?: Prisma.UnifiSiteListRelationFilter
|
||||
opportunities?: Prisma.OpportunityListRelationFilter
|
||||
timeEntries?: Prisma.TimeEntryListRelationFilter
|
||||
activities?: Prisma.ActivityListRelationFilter
|
||||
deletedBy?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
enteredBy?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
serviceTickets?: Prisma.ServiceTicketListRelationFilter
|
||||
@@ -414,6 +420,8 @@ export type CompanyCreateInput = {
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
@@ -440,6 +448,8 @@ export type CompanyUncheckedCreateInput = {
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
@@ -462,6 +472,8 @@ export type CompanyUpdateInput = {
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
@@ -488,6 +500,8 @@ export type CompanyUncheckedUpdateInput = {
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
@@ -798,6 +812,36 @@ export type CompanyUpdateOneWithoutOpportunitiesNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CompanyUpdateToOneWithWhereWithoutOpportunitiesInput, Prisma.CompanyUpdateWithoutOpportunitiesInput>, Prisma.CompanyUncheckedUpdateWithoutOpportunitiesInput>
|
||||
}
|
||||
|
||||
export type CompanyCreateNestedOneWithoutActivitiesInput = {
|
||||
create?: Prisma.XOR<Prisma.CompanyCreateWithoutActivitiesInput, Prisma.CompanyUncheckedCreateWithoutActivitiesInput>
|
||||
connectOrCreate?: Prisma.CompanyCreateOrConnectWithoutActivitiesInput
|
||||
connect?: Prisma.CompanyWhereUniqueInput
|
||||
}
|
||||
|
||||
export type CompanyUpdateOneWithoutActivitiesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CompanyCreateWithoutActivitiesInput, Prisma.CompanyUncheckedCreateWithoutActivitiesInput>
|
||||
connectOrCreate?: Prisma.CompanyCreateOrConnectWithoutActivitiesInput
|
||||
upsert?: Prisma.CompanyUpsertWithoutActivitiesInput
|
||||
disconnect?: Prisma.CompanyWhereInput | boolean
|
||||
delete?: Prisma.CompanyWhereInput | boolean
|
||||
connect?: Prisma.CompanyWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CompanyUpdateToOneWithWhereWithoutActivitiesInput, Prisma.CompanyUpdateWithoutActivitiesInput>, Prisma.CompanyUncheckedUpdateWithoutActivitiesInput>
|
||||
}
|
||||
|
||||
export type CompanyCreateNestedOneWithoutTimeEntriesInput = {
|
||||
create?: Prisma.XOR<Prisma.CompanyCreateWithoutTimeEntriesInput, Prisma.CompanyUncheckedCreateWithoutTimeEntriesInput>
|
||||
connectOrCreate?: Prisma.CompanyCreateOrConnectWithoutTimeEntriesInput
|
||||
connect?: Prisma.CompanyWhereUniqueInput
|
||||
}
|
||||
|
||||
export type CompanyUpdateOneRequiredWithoutTimeEntriesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CompanyCreateWithoutTimeEntriesInput, Prisma.CompanyUncheckedCreateWithoutTimeEntriesInput>
|
||||
connectOrCreate?: Prisma.CompanyCreateOrConnectWithoutTimeEntriesInput
|
||||
upsert?: Prisma.CompanyUpsertWithoutTimeEntriesInput
|
||||
connect?: Prisma.CompanyWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CompanyUpdateToOneWithWhereWithoutTimeEntriesInput, Prisma.CompanyUpdateWithoutTimeEntriesInput>, Prisma.CompanyUncheckedUpdateWithoutTimeEntriesInput>
|
||||
}
|
||||
|
||||
export type CompanyCreateNestedOneWithoutCredentialsInput = {
|
||||
create?: Prisma.XOR<Prisma.CompanyCreateWithoutCredentialsInput, Prisma.CompanyUncheckedCreateWithoutCredentialsInput>
|
||||
connectOrCreate?: Prisma.CompanyCreateOrConnectWithoutCredentialsInput
|
||||
@@ -830,6 +874,8 @@ export type CompanyCreateWithoutDeletedByInput = {
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutBillingCompanyInput
|
||||
@@ -854,6 +900,8 @@ export type CompanyUncheckedCreateWithoutDeletedByInput = {
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
@@ -886,6 +934,8 @@ export type CompanyCreateWithoutEnteredByInput = {
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutBillingCompanyInput
|
||||
@@ -910,6 +960,8 @@ export type CompanyUncheckedCreateWithoutEnteredByInput = {
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
@@ -993,6 +1045,8 @@ export type CompanyCreateWithoutUnifiSitesInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressCreateNestedManyWithoutCompanyInput
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
@@ -1018,6 +1072,8 @@ export type CompanyUncheckedCreateWithoutUnifiSitesInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedCreateNestedManyWithoutCompanyInput
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
@@ -1055,6 +1111,8 @@ export type CompanyUpdateWithoutUnifiSitesInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUpdateManyWithoutCompanyNestedInput
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
@@ -1080,6 +1138,8 @@ export type CompanyUncheckedUpdateWithoutUnifiSitesInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
@@ -1101,6 +1161,8 @@ export type CompanyCreateWithoutCompanyAddressesInput = {
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
@@ -1126,6 +1188,8 @@ export type CompanyUncheckedCreateWithoutCompanyAddressesInput = {
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
@@ -1163,6 +1227,8 @@ export type CompanyUpdateWithoutCompanyAddressesInput = {
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
@@ -1188,6 +1254,8 @@ export type CompanyUncheckedUpdateWithoutCompanyAddressesInput = {
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
@@ -1209,6 +1277,8 @@ export type CompanyCreateWithoutContactsInput = {
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
@@ -1234,6 +1304,8 @@ export type CompanyUncheckedCreateWithoutContactsInput = {
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
@@ -1271,6 +1343,8 @@ export type CompanyUpdateWithoutContactsInput = {
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
@@ -1296,6 +1370,8 @@ export type CompanyUncheckedUpdateWithoutContactsInput = {
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
@@ -1318,6 +1394,8 @@ export type CompanyCreateWithoutServiceTicketsInput = {
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutBillingCompanyInput
|
||||
@@ -1343,6 +1421,8 @@ export type CompanyUncheckedCreateWithoutServiceTicketsInput = {
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
|
||||
@@ -1369,6 +1449,8 @@ export type CompanyCreateWithoutBillingServiceTicketsInput = {
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
@@ -1394,6 +1476,8 @@ export type CompanyUncheckedCreateWithoutBillingServiceTicketsInput = {
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
}
|
||||
|
||||
@@ -1431,6 +1515,8 @@ export type CompanyUpdateWithoutServiceTicketsInput = {
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUpdateManyWithoutBillingCompanyNestedInput
|
||||
@@ -1456,6 +1542,8 @@ export type CompanyUncheckedUpdateWithoutServiceTicketsInput = {
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
|
||||
@@ -1488,6 +1576,8 @@ export type CompanyUpdateWithoutBillingServiceTicketsInput = {
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
@@ -1513,6 +1603,8 @@ export type CompanyUncheckedUpdateWithoutBillingServiceTicketsInput = {
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
}
|
||||
|
||||
@@ -1533,6 +1625,8 @@ export type CompanyCreateWithoutOpportunitiesInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressCreateNestedManyWithoutCompanyInput
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
@@ -1558,6 +1652,8 @@ export type CompanyUncheckedCreateWithoutOpportunitiesInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedCreateNestedManyWithoutCompanyInput
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
@@ -1595,6 +1691,8 @@ export type CompanyUpdateWithoutOpportunitiesInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUpdateManyWithoutCompanyNestedInput
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
@@ -1620,6 +1718,240 @@ export type CompanyUncheckedUpdateWithoutOpportunitiesInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
|
||||
export type CompanyCreateWithoutActivitiesInput = {
|
||||
id: number
|
||||
uid?: string
|
||||
name: string
|
||||
phone?: string | null
|
||||
website?: string | null
|
||||
deleteFlag?: boolean
|
||||
dateDeleted?: Date | string | null
|
||||
taxId?: string | null
|
||||
taxExempt?: boolean
|
||||
deletedAt?: Date | string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
contacts?: Prisma.ContactCreateNestedManyWithoutCompanyInput
|
||||
companyAddresses?: Prisma.CompanyAddressCreateNestedManyWithoutCompanyInput
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
|
||||
export type CompanyUncheckedCreateWithoutActivitiesInput = {
|
||||
id: number
|
||||
uid?: string
|
||||
name: string
|
||||
phone?: string | null
|
||||
website?: string | null
|
||||
deleteFlag?: boolean
|
||||
dateDeleted?: Date | string | null
|
||||
taxId?: string | null
|
||||
taxExempt?: boolean
|
||||
enteredById?: string | null
|
||||
deletedById?: string | null
|
||||
deletedAt?: Date | string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
contacts?: Prisma.ContactUncheckedCreateNestedManyWithoutCompanyInput
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedCreateNestedManyWithoutCompanyInput
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
|
||||
export type CompanyCreateOrConnectWithoutActivitiesInput = {
|
||||
where: Prisma.CompanyWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.CompanyCreateWithoutActivitiesInput, Prisma.CompanyUncheckedCreateWithoutActivitiesInput>
|
||||
}
|
||||
|
||||
export type CompanyUpsertWithoutActivitiesInput = {
|
||||
update: Prisma.XOR<Prisma.CompanyUpdateWithoutActivitiesInput, Prisma.CompanyUncheckedUpdateWithoutActivitiesInput>
|
||||
create: Prisma.XOR<Prisma.CompanyCreateWithoutActivitiesInput, Prisma.CompanyUncheckedCreateWithoutActivitiesInput>
|
||||
where?: Prisma.CompanyWhereInput
|
||||
}
|
||||
|
||||
export type CompanyUpdateToOneWithWhereWithoutActivitiesInput = {
|
||||
where?: Prisma.CompanyWhereInput
|
||||
data: Prisma.XOR<Prisma.CompanyUpdateWithoutActivitiesInput, Prisma.CompanyUncheckedUpdateWithoutActivitiesInput>
|
||||
}
|
||||
|
||||
export type CompanyUpdateWithoutActivitiesInput = {
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
uid?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
website?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
deleteFlag?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
dateDeleted?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
taxId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
taxExempt?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
contacts?: Prisma.ContactUpdateManyWithoutCompanyNestedInput
|
||||
companyAddresses?: Prisma.CompanyAddressUpdateManyWithoutCompanyNestedInput
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
|
||||
export type CompanyUncheckedUpdateWithoutActivitiesInput = {
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
uid?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
website?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
deleteFlag?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
dateDeleted?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
taxId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
taxExempt?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
enteredById?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
deletedById?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
contacts?: Prisma.ContactUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
|
||||
export type CompanyCreateWithoutTimeEntriesInput = {
|
||||
id: number
|
||||
uid?: string
|
||||
name: string
|
||||
phone?: string | null
|
||||
website?: string | null
|
||||
deleteFlag?: boolean
|
||||
dateDeleted?: Date | string | null
|
||||
taxId?: string | null
|
||||
taxExempt?: boolean
|
||||
deletedAt?: Date | string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
contacts?: Prisma.ContactCreateNestedManyWithoutCompanyInput
|
||||
companyAddresses?: Prisma.CompanyAddressCreateNestedManyWithoutCompanyInput
|
||||
credentials?: Prisma.CredentialCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
|
||||
export type CompanyUncheckedCreateWithoutTimeEntriesInput = {
|
||||
id: number
|
||||
uid?: string
|
||||
name: string
|
||||
phone?: string | null
|
||||
website?: string | null
|
||||
deleteFlag?: boolean
|
||||
dateDeleted?: Date | string | null
|
||||
taxId?: string | null
|
||||
taxExempt?: boolean
|
||||
enteredById?: string | null
|
||||
deletedById?: string | null
|
||||
deletedAt?: Date | string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
contacts?: Prisma.ContactUncheckedCreateNestedManyWithoutCompanyInput
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedCreateNestedManyWithoutCompanyInput
|
||||
credentials?: Prisma.CredentialUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
|
||||
export type CompanyCreateOrConnectWithoutTimeEntriesInput = {
|
||||
where: Prisma.CompanyWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.CompanyCreateWithoutTimeEntriesInput, Prisma.CompanyUncheckedCreateWithoutTimeEntriesInput>
|
||||
}
|
||||
|
||||
export type CompanyUpsertWithoutTimeEntriesInput = {
|
||||
update: Prisma.XOR<Prisma.CompanyUpdateWithoutTimeEntriesInput, Prisma.CompanyUncheckedUpdateWithoutTimeEntriesInput>
|
||||
create: Prisma.XOR<Prisma.CompanyCreateWithoutTimeEntriesInput, Prisma.CompanyUncheckedCreateWithoutTimeEntriesInput>
|
||||
where?: Prisma.CompanyWhereInput
|
||||
}
|
||||
|
||||
export type CompanyUpdateToOneWithWhereWithoutTimeEntriesInput = {
|
||||
where?: Prisma.CompanyWhereInput
|
||||
data: Prisma.XOR<Prisma.CompanyUpdateWithoutTimeEntriesInput, Prisma.CompanyUncheckedUpdateWithoutTimeEntriesInput>
|
||||
}
|
||||
|
||||
export type CompanyUpdateWithoutTimeEntriesInput = {
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
uid?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
website?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
deleteFlag?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
dateDeleted?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
taxId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
taxExempt?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
contacts?: Prisma.ContactUpdateManyWithoutCompanyNestedInput
|
||||
companyAddresses?: Prisma.CompanyAddressUpdateManyWithoutCompanyNestedInput
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
|
||||
export type CompanyUncheckedUpdateWithoutTimeEntriesInput = {
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
uid?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
website?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
deleteFlag?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
dateDeleted?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
taxId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
taxExempt?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
enteredById?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
deletedById?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
contacts?: Prisma.ContactUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
@@ -1641,6 +1973,8 @@ export type CompanyCreateWithoutCredentialsInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityCreateNestedManyWithoutCompanyInput
|
||||
deletedBy?: Prisma.UserCreateNestedOneWithoutCompaniesDeletedInput
|
||||
enteredBy?: Prisma.UserCreateNestedOneWithoutCompaniesEnteredInput
|
||||
serviceTickets?: Prisma.ServiceTicketCreateNestedManyWithoutCompanyInput
|
||||
@@ -1666,6 +2000,8 @@ export type CompanyUncheckedCreateWithoutCredentialsInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedCreateNestedManyWithoutCompanyInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedCreateNestedManyWithoutCompanyInput
|
||||
opportunities?: Prisma.OpportunityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedCreateNestedManyWithoutCompanyInput
|
||||
activities?: Prisma.ActivityUncheckedCreateNestedManyWithoutCompanyInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutCompanyInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedCreateNestedManyWithoutBillingCompanyInput
|
||||
}
|
||||
@@ -1703,6 +2039,8 @@ export type CompanyUpdateWithoutCredentialsInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
@@ -1728,6 +2066,8 @@ export type CompanyUncheckedUpdateWithoutCredentialsInput = {
|
||||
companyAddresses?: Prisma.CompanyAddressUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
@@ -1782,6 +2122,8 @@ export type CompanyUpdateWithoutDeletedByInput = {
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
enteredBy?: Prisma.UserUpdateOneWithoutCompaniesEnteredNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUpdateManyWithoutBillingCompanyNestedInput
|
||||
@@ -1806,6 +2148,8 @@ export type CompanyUncheckedUpdateWithoutDeletedByInput = {
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
@@ -1844,6 +2188,8 @@ export type CompanyUpdateWithoutEnteredByInput = {
|
||||
credentials?: Prisma.CredentialUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUpdateManyWithoutCompanyNestedInput
|
||||
deletedBy?: Prisma.UserUpdateOneWithoutCompaniesDeletedNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUpdateManyWithoutBillingCompanyNestedInput
|
||||
@@ -1868,6 +2214,8 @@ export type CompanyUncheckedUpdateWithoutEnteredByInput = {
|
||||
credentials?: Prisma.CredentialUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
unifiSites?: Prisma.UnifiSiteUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
opportunities?: Prisma.OpportunityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
timeEntries?: Prisma.TimeEntryUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
activities?: Prisma.ActivityUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
serviceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutCompanyNestedInput
|
||||
billingServiceTickets?: Prisma.ServiceTicketUncheckedUpdateManyWithoutBillingCompanyNestedInput
|
||||
}
|
||||
@@ -1899,6 +2247,8 @@ export type CompanyCountOutputType = {
|
||||
credentials: number
|
||||
unifiSites: number
|
||||
opportunities: number
|
||||
timeEntries: number
|
||||
activities: number
|
||||
serviceTickets: number
|
||||
billingServiceTickets: number
|
||||
}
|
||||
@@ -1909,6 +2259,8 @@ export type CompanyCountOutputTypeSelect<ExtArgs extends runtime.Types.Extension
|
||||
credentials?: boolean | CompanyCountOutputTypeCountCredentialsArgs
|
||||
unifiSites?: boolean | CompanyCountOutputTypeCountUnifiSitesArgs
|
||||
opportunities?: boolean | CompanyCountOutputTypeCountOpportunitiesArgs
|
||||
timeEntries?: boolean | CompanyCountOutputTypeCountTimeEntriesArgs
|
||||
activities?: boolean | CompanyCountOutputTypeCountActivitiesArgs
|
||||
serviceTickets?: boolean | CompanyCountOutputTypeCountServiceTicketsArgs
|
||||
billingServiceTickets?: boolean | CompanyCountOutputTypeCountBillingServiceTicketsArgs
|
||||
}
|
||||
@@ -1958,6 +2310,20 @@ export type CompanyCountOutputTypeCountOpportunitiesArgs<ExtArgs extends runtime
|
||||
where?: Prisma.OpportunityWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* CompanyCountOutputType without action
|
||||
*/
|
||||
export type CompanyCountOutputTypeCountTimeEntriesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.TimeEntryWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* CompanyCountOutputType without action
|
||||
*/
|
||||
export type CompanyCountOutputTypeCountActivitiesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.ActivityWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* CompanyCountOutputType without action
|
||||
*/
|
||||
@@ -1993,6 +2359,8 @@ export type CompanySelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
credentials?: boolean | Prisma.Company$credentialsArgs<ExtArgs>
|
||||
unifiSites?: boolean | Prisma.Company$unifiSitesArgs<ExtArgs>
|
||||
opportunities?: boolean | Prisma.Company$opportunitiesArgs<ExtArgs>
|
||||
timeEntries?: boolean | Prisma.Company$timeEntriesArgs<ExtArgs>
|
||||
activities?: boolean | Prisma.Company$activitiesArgs<ExtArgs>
|
||||
deletedBy?: boolean | Prisma.Company$deletedByArgs<ExtArgs>
|
||||
enteredBy?: boolean | Prisma.Company$enteredByArgs<ExtArgs>
|
||||
serviceTickets?: boolean | Prisma.Company$serviceTicketsArgs<ExtArgs>
|
||||
@@ -2062,6 +2430,8 @@ export type CompanyInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
credentials?: boolean | Prisma.Company$credentialsArgs<ExtArgs>
|
||||
unifiSites?: boolean | Prisma.Company$unifiSitesArgs<ExtArgs>
|
||||
opportunities?: boolean | Prisma.Company$opportunitiesArgs<ExtArgs>
|
||||
timeEntries?: boolean | Prisma.Company$timeEntriesArgs<ExtArgs>
|
||||
activities?: boolean | Prisma.Company$activitiesArgs<ExtArgs>
|
||||
deletedBy?: boolean | Prisma.Company$deletedByArgs<ExtArgs>
|
||||
enteredBy?: boolean | Prisma.Company$enteredByArgs<ExtArgs>
|
||||
serviceTickets?: boolean | Prisma.Company$serviceTicketsArgs<ExtArgs>
|
||||
@@ -2085,6 +2455,8 @@ export type $CompanyPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
credentials: Prisma.$CredentialPayload<ExtArgs>[]
|
||||
unifiSites: Prisma.$UnifiSitePayload<ExtArgs>[]
|
||||
opportunities: Prisma.$OpportunityPayload<ExtArgs>[]
|
||||
timeEntries: Prisma.$TimeEntryPayload<ExtArgs>[]
|
||||
activities: Prisma.$ActivityPayload<ExtArgs>[]
|
||||
deletedBy: Prisma.$UserPayload<ExtArgs> | null
|
||||
enteredBy: Prisma.$UserPayload<ExtArgs> | null
|
||||
serviceTickets: Prisma.$ServiceTicketPayload<ExtArgs>[]
|
||||
@@ -2504,6 +2876,8 @@ export interface Prisma__CompanyClient<T, Null = never, ExtArgs extends runtime.
|
||||
credentials<T extends Prisma.Company$credentialsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Company$credentialsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CredentialPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
unifiSites<T extends Prisma.Company$unifiSitesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Company$unifiSitesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$UnifiSitePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
opportunities<T extends Prisma.Company$opportunitiesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Company$opportunitiesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$OpportunityPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
timeEntries<T extends Prisma.Company$timeEntriesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Company$timeEntriesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$TimeEntryPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
activities<T extends Prisma.Company$activitiesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Company$activitiesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ActivityPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
deletedBy<T extends Prisma.Company$deletedByArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Company$deletedByArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
enteredBy<T extends Prisma.Company$enteredByArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Company$enteredByArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
serviceTickets<T extends Prisma.Company$serviceTicketsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Company$serviceTicketsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ServiceTicketPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
@@ -3071,6 +3445,54 @@ export type Company$opportunitiesArgs<ExtArgs extends runtime.Types.Extensions.I
|
||||
distinct?: Prisma.OpportunityScalarFieldEnum | Prisma.OpportunityScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Company.timeEntries
|
||||
*/
|
||||
export type Company$timeEntriesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the TimeEntry
|
||||
*/
|
||||
select?: Prisma.TimeEntrySelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the TimeEntry
|
||||
*/
|
||||
omit?: Prisma.TimeEntryOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.TimeEntryInclude<ExtArgs> | null
|
||||
where?: Prisma.TimeEntryWhereInput
|
||||
orderBy?: Prisma.TimeEntryOrderByWithRelationInput | Prisma.TimeEntryOrderByWithRelationInput[]
|
||||
cursor?: Prisma.TimeEntryWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.TimeEntryScalarFieldEnum | Prisma.TimeEntryScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Company.activities
|
||||
*/
|
||||
export type Company$activitiesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Activity
|
||||
*/
|
||||
select?: Prisma.ActivitySelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Activity
|
||||
*/
|
||||
omit?: Prisma.ActivityOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ActivityInclude<ExtArgs> | null
|
||||
where?: Prisma.ActivityWhereInput
|
||||
orderBy?: Prisma.ActivityOrderByWithRelationInput | Prisma.ActivityOrderByWithRelationInput[]
|
||||
cursor?: Prisma.ActivityWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.ActivityScalarFieldEnum | Prisma.ActivityScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Company.deletedBy
|
||||
*/
|
||||
|
||||
+332
-44
@@ -124,10 +124,10 @@ enum SyncJobStatus {
|
||||
}
|
||||
|
||||
model SyncJobRun {
|
||||
id String @id @default(uuid())
|
||||
jobType SyncJobType
|
||||
status SyncJobStatus @default(QUEUED)
|
||||
triggeredBy String @default("system")
|
||||
id String @id @default(uuid())
|
||||
jobType SyncJobType
|
||||
status SyncJobStatus @default(QUEUED)
|
||||
triggeredBy String @default("system")
|
||||
|
||||
startedAt DateTime?
|
||||
completedAt DateTime?
|
||||
@@ -250,6 +250,7 @@ model CorporateLocation {
|
||||
opportunities Opportunity[]
|
||||
serviceBoards ServiceTicketBoard[]
|
||||
productDataRecords ProductData[]
|
||||
timeEntries TimeEntry[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -307,6 +308,9 @@ model Company {
|
||||
credentials Credential[]
|
||||
unifiSites UnifiSite[]
|
||||
opportunities Opportunity[]
|
||||
timeEntries TimeEntry[]
|
||||
|
||||
activities Activity[]
|
||||
|
||||
deletedBy User? @relation("DeletedBy", fields: [deletedById], references: [cwIdentifier])
|
||||
enteredBy User? @relation("EnteredBy", fields: [enteredById], references: [cwIdentifier])
|
||||
@@ -384,12 +388,15 @@ model Contact {
|
||||
memberId Int?
|
||||
companyId Int?
|
||||
|
||||
company Company? @relation(fields: [companyId], references: [id])
|
||||
opportunities Opportunity[]
|
||||
company Company? @relation(fields: [companyId], references: [id])
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
opportunities Opportunity[]
|
||||
serviceTickets ServiceTicket[]
|
||||
activities Activity[]
|
||||
timeEntries TimeEntry[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model CatalogItemType {
|
||||
@@ -606,7 +613,7 @@ model ProductData {
|
||||
qty Float @default(1)
|
||||
internalNote String?
|
||||
shortDescription String?
|
||||
description String?
|
||||
description String?
|
||||
sequenceNumber Int? // This is the sequence number of the product on the ticket, which may be different from the sequence number of the product in the catalog, and is important for maintaining the order of products on the ticket as they were added.
|
||||
|
||||
procurementNotes String?
|
||||
@@ -692,7 +699,8 @@ model ServiceTicket {
|
||||
|
||||
// ------ Billing and invoicing fields ------
|
||||
|
||||
products ProductData[] // The products used on this ticket, which may be important for billing and invoicing, as well as reporting and analytics.
|
||||
products ProductData[] // The products used on this ticket, which may be important for billing and invoicing, as well as reporting and analytics.
|
||||
timeEntries TimeEntry[] // The time entries logged against this ticket.
|
||||
|
||||
poNumber String?
|
||||
billCompleteFlag Boolean @default(false) // Bill after ticket is closed, not allowing any billing while open.
|
||||
@@ -739,12 +747,12 @@ model ServiceTicket {
|
||||
billingAddressId Int?
|
||||
|
||||
severity ServiceTicketSeverity @relation(fields: [severityId], references: [id])
|
||||
impact ServiceTicketImpact @relation(fields: [impactId], references: [id])
|
||||
priority ServiceTicketPriority @relation(fields: [priorityId], references: [id])
|
||||
source ServiceTicketSource @relation(fields: [sourceId], references: [id])
|
||||
location ServiceTicketLocation @relation(fields: [locationId], references: [id])
|
||||
serviceTicketBoard ServiceTicketBoard? @relation(fields: [serviceTicketBoardId], references: [id])
|
||||
ticketOwner User? @relation("ServiceTicketOwner", fields: [ticketOwnerId], references: [cwIdentifier])
|
||||
impact ServiceTicketImpact @relation(fields: [impactId], references: [id])
|
||||
priority ServiceTicketPriority @relation(fields: [priorityId], references: [id])
|
||||
source ServiceTicketSource @relation(fields: [sourceId], references: [id])
|
||||
location ServiceTicketLocation @relation(fields: [locationId], references: [id])
|
||||
serviceTicketBoard ServiceTicketBoard? @relation(fields: [serviceTicketBoardId], references: [id])
|
||||
ticketOwner User? @relation("ServiceTicketOwner", fields: [ticketOwnerId], references: [cwIdentifier])
|
||||
|
||||
company Company? @relation(fields: [companyId], references: [id])
|
||||
contact Contact? @relation(fields: [contactId], references: [id])
|
||||
@@ -1104,9 +1112,9 @@ model ScheduleStatus {
|
||||
|
||||
name String
|
||||
description String? // Optima Only field, not synced to CW
|
||||
color String?
|
||||
color String?
|
||||
|
||||
softFlag Boolean @default(false)
|
||||
softFlag Boolean @default(false)
|
||||
defaultFlag Boolean @default(false)
|
||||
|
||||
schedules Schedule[]
|
||||
@@ -1122,15 +1130,15 @@ model ScheduleType {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
name String
|
||||
description String? // Optima Only field, not synced to CW
|
||||
displayColor String?
|
||||
name String
|
||||
description String? // Optima Only field, not synced to CW
|
||||
displayColor String?
|
||||
|
||||
tableReference String?
|
||||
moduleId String? @db.Char(2)
|
||||
moduleId String? @db.Char(2)
|
||||
scheduleTypeId String? @db.Char(1)
|
||||
|
||||
systemFlag Boolean @default(false)
|
||||
systemFlag Boolean @default(false)
|
||||
displayFlag Boolean @default(false)
|
||||
|
||||
schedules Schedule[]
|
||||
@@ -1143,15 +1151,15 @@ model ScheduleType {
|
||||
}
|
||||
|
||||
model ScheduleSpan {
|
||||
id Int @id @default(autoincrement())
|
||||
id Int @id @default(autoincrement())
|
||||
scheduleSpanId String? @db.Char(1)
|
||||
spanDesc String? @db.Char(20)
|
||||
spanDesc String? @db.Char(20)
|
||||
|
||||
schedules Schedule[]
|
||||
}
|
||||
|
||||
model Schedule {
|
||||
id Int @unique
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
name String
|
||||
@@ -1159,24 +1167,24 @@ model Schedule {
|
||||
|
||||
memberId String?
|
||||
|
||||
closedFlag Boolean @default(false)
|
||||
reminderFlag Boolean @default(false)
|
||||
allDayFlag Boolean @default(false)
|
||||
closedFlag Boolean @default(false)
|
||||
reminderFlag Boolean @default(false)
|
||||
allDayFlag Boolean @default(false)
|
||||
acknowledgementFlag Boolean @default(false)
|
||||
meetingFlag Boolean @default(false)
|
||||
recurringFlag Boolean @default(false)
|
||||
meetingFlag Boolean @default(false)
|
||||
recurringFlag Boolean @default(false)
|
||||
|
||||
billableFlag Boolean @default(false)
|
||||
|
||||
acknowledgedById String?
|
||||
acknowledgedAt DateTime?
|
||||
|
||||
startDate DateTime?
|
||||
endDate DateTime?
|
||||
hoursScheduled Float?
|
||||
duration Int? // The number of days in between the start and end date.
|
||||
hoursPerDay Float?
|
||||
reminderMinutes Int? @default(15)
|
||||
acknowledgedById String?
|
||||
acknowledgedAt DateTime?
|
||||
|
||||
startDate DateTime?
|
||||
endDate DateTime?
|
||||
hoursScheduled Float?
|
||||
duration Int? // The number of days in between the start and end date.
|
||||
hoursPerDay Float?
|
||||
reminderMinutes Int? @default(15)
|
||||
|
||||
statusId Int?
|
||||
status ScheduleStatus? @relation(fields: [statusId], references: [id])
|
||||
@@ -1189,9 +1197,274 @@ model Schedule {
|
||||
|
||||
updatedById String?
|
||||
createdById String?
|
||||
closedById String?
|
||||
closedById String?
|
||||
|
||||
closedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ------- Activities -------
|
||||
|
||||
model Activity {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
subject String // Activity Title/Summary
|
||||
|
||||
notes ActivityNotes?
|
||||
|
||||
startTime DateTime //Full Date Time Value
|
||||
endTime DateTime //Full Date Time Value
|
||||
|
||||
assignToId String
|
||||
assignedById String
|
||||
enteredBy String
|
||||
|
||||
automated Boolean @default(false)
|
||||
closedFlag Boolean @default(false)
|
||||
|
||||
notifyCompleteFlag Boolean @default(false) // Should we send a notification to the person assigned when activity is completed.
|
||||
notificationSentFlat Boolean @default(false) // Tracks to see if the completion notification has already been sent out.
|
||||
|
||||
opportunityId String?
|
||||
serviceTicketId String?
|
||||
|
||||
contactId Int?
|
||||
companyId Int?
|
||||
activityTypeId Int?
|
||||
activityStatusId Int?
|
||||
|
||||
contact Contact? @relation(fields: [contactId], references: [id])
|
||||
company Company? @relation(fields: [companyId], references: [id])
|
||||
activityType ActivityType? @relation(fields: [activityTypeId], references: [id])
|
||||
activityStatus ActivityStatus? @relation(fields: [activityStatusId], references: [id])
|
||||
|
||||
timeEntries TimeEntry[]
|
||||
|
||||
createdById String?
|
||||
updatedById String?
|
||||
closedById String?
|
||||
|
||||
closedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model ActivityNotes {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
notes String @default("")
|
||||
|
||||
activityId Int? @unique
|
||||
activity Activity? @relation(fields: [activityId], references: [id])
|
||||
|
||||
internalAnalysisFlag Boolean @default(false) // Does this note describing the internal analysis of the activity, such as root cause analysis or technical details that may not be relevant to the customer?
|
||||
|
||||
enteredById String?
|
||||
updatedById String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model ActivityType {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
name String @db.VarChar(15) // "SO_Activity_Type_ID" in CW
|
||||
description String
|
||||
|
||||
inactiveFlag Boolean @default(false)
|
||||
historyFlag Boolean @default(false) // Is this activity type just for historical record keeping, and should not be used for new activities?
|
||||
|
||||
defaultFlag Boolean @default(false)
|
||||
importFlag Boolean @default(false)
|
||||
emailFlag Boolean @default(false)
|
||||
memoFlag Boolean @default(false)
|
||||
|
||||
pointsValue Int?
|
||||
|
||||
activities Activity[]
|
||||
|
||||
updatedById String?
|
||||
createdById String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model ActivityStatus {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
name String
|
||||
description String? // Optima Only field, not synced to CW
|
||||
|
||||
closedFlag Boolean @default(false)
|
||||
inactiveFlag Boolean @default(false)
|
||||
defaultFlag Boolean @default(false)
|
||||
spawnFollowupFlag Boolean @default(false) // Should creating an activity with this status automatically spawn a follow-up activity with a different type and/or status?
|
||||
|
||||
activities Activity[]
|
||||
|
||||
updatedById String?
|
||||
createdById String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ------- Time Entries -------
|
||||
|
||||
model TimeEntry {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
// The CW member identifier of the person who logged this time
|
||||
memberId String?
|
||||
|
||||
// Relational Values
|
||||
serviceTicketId Int?
|
||||
activityId Int?
|
||||
projectId Int? // TODO: Implement this.
|
||||
chargeCodeId Int?
|
||||
companyId Int
|
||||
statusId Int?
|
||||
locationId Int?
|
||||
contactId Int?
|
||||
|
||||
contact Contact? @relation(fields: [contactId], references: [id])
|
||||
location CorporateLocation? @relation(fields: [locationId], references: [id])
|
||||
status TimeEntryStatus? @relation(fields: [statusId], references: [id])
|
||||
chargeCode TimeEntryChargeCode? @relation(fields: [chargeCodeId], references: [id])
|
||||
company Company @relation(fields: [companyId], references: [id])
|
||||
serviceTicket ServiceTicket? @relation(fields: [serviceTicketId], references: [id])
|
||||
activity Activity? @relation(fields: [activityId], references: [id])
|
||||
|
||||
// ------ Time Fields ------
|
||||
|
||||
dateStart DateTime?
|
||||
timeStart DateTime?
|
||||
timeEnd DateTime?
|
||||
|
||||
// ------ Notes ------
|
||||
|
||||
notes String? // Customer-visible notes about what was done
|
||||
notesMd String? // Markdown version of notes
|
||||
internalNote String? // Internal notes not visible to the customer
|
||||
|
||||
// ------ Hours ------
|
||||
|
||||
billableHours Float? // How many hours are being billed to the customer
|
||||
actualHours Float? // How many hours were actually worked
|
||||
invoicedHours Float? // How many hours have been included on an invoice
|
||||
deductedHours Float? // How many hours were deducted from billing, but not necessarily the same as actual hours if there are any adjustments or overrides.
|
||||
|
||||
// ------ Rates ------
|
||||
|
||||
hourlyRate Float? // The rate at which this time is billed to the customer
|
||||
effectiveRate Float? // The actual effective rate after any agreement or override adjustments
|
||||
|
||||
// ------ Flag Fields ------
|
||||
|
||||
issueFlag Boolean @default(false)
|
||||
mergedFlag Boolean @default(false) // Has this time entry been merged with another time entry, such as when multiple time entries are combined into one for billing purposes?
|
||||
invoiceFlag Boolean @default(false) // Has this time entry been included on an invoice?
|
||||
billableFlag Boolean @default(true) // Should this time entry be billed to the customer?
|
||||
documentFlag Boolean @default(false) // Is there a document associated with this time entry, such as a receipt for an expense or a report of the work done?
|
||||
teProblemFlag Boolean @default(false) // Does this note describe the problem?
|
||||
teResolutionFlag Boolean @default(false) // Does this note describe the resolution?
|
||||
teInternalAnalysisFlag Boolean @default(false) // Does this note contain internal analysis?
|
||||
|
||||
// ------ Audit Fields ------
|
||||
|
||||
chargeToRecId Int? // The record ID of the entity that this time entry should be charged to, which may be used for billing and reporting purposes, and may be different from the service ticket or activity it is associated with.
|
||||
chargeToType String? @db.VarChar(13)
|
||||
|
||||
createdById String?
|
||||
updatedById String?
|
||||
originalAuthorId String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model TimeEntryStatus {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
statusId Int @unique
|
||||
description String? @db.VarChar(50)
|
||||
action String?
|
||||
|
||||
timeEntries TimeEntry[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model TimeEntryChargeCode {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
chargeCodeId Int @unique
|
||||
description String? @db.VarChar(50)
|
||||
|
||||
expenseFlag Boolean @default(false)
|
||||
timeFlag Boolean @default(true)
|
||||
billableFlag Boolean @default(true)
|
||||
invoiceFlag Boolean @default(true)
|
||||
|
||||
timeEntries TimeEntry[]
|
||||
|
||||
updatedById String?
|
||||
createdById String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model TimeActivityClass {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
description String? @db.VarChar(50)
|
||||
hourlyRate Float?
|
||||
|
||||
inactiveFlag Boolean @default(false)
|
||||
taxExemptFlag Boolean @default(false)
|
||||
|
||||
createdById String?
|
||||
updatedById String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model TimeActivityType {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
description String? @db.VarChar(50)
|
||||
|
||||
minHours Float?
|
||||
maxHours Float?
|
||||
|
||||
rate Float? @default(1)
|
||||
costMultiplier Float @default(1)
|
||||
|
||||
inactiveFlag Boolean @default(false)
|
||||
invoiceFlag Boolean @default(false)
|
||||
billableFlag Boolean @default(false)
|
||||
utilizationFlag Boolean @default(false)
|
||||
defaultFlag Boolean @default(false)
|
||||
multiplierFlag Boolean @default(false)
|
||||
|
||||
createdById String?
|
||||
updatedById String?
|
||||
|
||||
closedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
@@ -1269,12 +1542,12 @@ model GeneratedQuotes {
|
||||
}
|
||||
|
||||
model TaxCode {
|
||||
id Int @unique
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
opportunities Opportunity[]
|
||||
|
||||
code String @unique
|
||||
code String @unique
|
||||
codeCaption String
|
||||
description String?
|
||||
|
||||
@@ -1307,3 +1580,18 @@ model CwMember {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model CwMemberType {
|
||||
id Int @unique
|
||||
uid String @id @default(uuid())
|
||||
|
||||
description String? @db.VarChar(30)
|
||||
|
||||
inactiveFlag Boolean @default(false)
|
||||
|
||||
updatedById String?
|
||||
createdById String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Hono } from "hono";
|
||||
import * as timeEntryRoutes from "../time-entries";
|
||||
|
||||
const timeEntryRouter = new Hono();
|
||||
Object.values(timeEntryRoutes).map((r) => timeEntryRouter.route("/", r));
|
||||
|
||||
export default timeEntryRouter;
|
||||
@@ -3,6 +3,7 @@ import { apiResponse } from "../../../../../modules/api-utils/apiResponse";
|
||||
import { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import { authMiddleware } from "../../../../middleware/authorization";
|
||||
import { opportunities } from "../../../../../managers/opportunities";
|
||||
import { timeEntries } from "../../../../../managers/timeEntries";
|
||||
import { activityCw } from "../../../../../modules/cw-utils/activities/activities";
|
||||
import { ActivityController } from "../../../../../controllers/ActivityController";
|
||||
import { OptimaType } from "../../../../../workflows/wf.opportunity";
|
||||
@@ -31,6 +32,9 @@ const QUOTE_ID_FIELD_ID = 48;
|
||||
/** Close Date custom field ID (matches wf.opportunity.ts CLOSE_DATE_FIELD_ID). */
|
||||
const CLOSE_DATE_FIELD_ID = 49;
|
||||
|
||||
/** Parent_Activity custom field ID. */
|
||||
const PARENT_ACTIVITY_FIELD_ID = 50;
|
||||
|
||||
/**
|
||||
* Extract the Optima_Type value from a CW activity's custom fields.
|
||||
* Returns the string value if present, or null.
|
||||
@@ -70,6 +74,22 @@ function extractCloseDate(
|
||||
return field.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the Parent_Activity custom field value from a CW activity.
|
||||
* Returns the numeric activity ID or null.
|
||||
*/
|
||||
function extractParentActivityId(
|
||||
customFields: { id: number; value: unknown }[] | undefined,
|
||||
): number | null {
|
||||
if (!customFields) return null;
|
||||
const field = customFields.find(
|
||||
(f) => f.id === PARENT_ACTIVITY_FIELD_ID || (f as any).caption === "Parent_Activity",
|
||||
);
|
||||
if (!field?.value) return null;
|
||||
const parsed = parseInt(String(field.value), 10);
|
||||
return isNaN(parsed) ? null : parsed;
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
// ROUTE
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
@@ -96,6 +116,7 @@ export default createRoute(
|
||||
activity: ReturnType<ActivityController["toJson"]>;
|
||||
optimaType: string;
|
||||
quoteId: string | null;
|
||||
parentActivityId: number | null;
|
||||
closed: boolean;
|
||||
closedAt: string | null;
|
||||
}[] = [];
|
||||
@@ -109,6 +130,7 @@ export default createRoute(
|
||||
if (filterType && optimaType !== filterType) continue;
|
||||
|
||||
const quoteId = extractQuoteId(raw.customFields);
|
||||
const parentActivityId = extractParentActivityId(raw.customFields);
|
||||
const closed = raw.status?.id === 2;
|
||||
const closedAt = extractCloseDate(raw.customFields);
|
||||
|
||||
@@ -116,6 +138,7 @@ export default createRoute(
|
||||
activity: json,
|
||||
optimaType,
|
||||
quoteId,
|
||||
parentActivityId,
|
||||
closed,
|
||||
closedAt,
|
||||
});
|
||||
@@ -132,13 +155,26 @@ export default createRoute(
|
||||
return dateB - dateA;
|
||||
});
|
||||
|
||||
// Attach time entries for each activity in parallel
|
||||
const activitiesWithTimeEntries = await Promise.all(
|
||||
workflowActivities.map(async (item) => {
|
||||
const entries = await timeEntries.fetchByActivity(
|
||||
item.activity.cwActivityId,
|
||||
);
|
||||
return {
|
||||
...item,
|
||||
timeEntries: entries.map((e) => e.toJson()),
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
const response = apiResponse.successful(
|
||||
"Workflow history fetched successfully.",
|
||||
{
|
||||
opportunityId: opportunity.id,
|
||||
cwOpportunityId: opportunity.cwOpportunityId,
|
||||
totalActivities: workflowActivities.length,
|
||||
activities: workflowActivities,
|
||||
totalActivities: activitiesWithTimeEntries.length,
|
||||
activities: activitiesWithTimeEntries,
|
||||
},
|
||||
);
|
||||
return c.json(response, response.status as ContentfulStatusCode);
|
||||
|
||||
@@ -16,6 +16,7 @@ import procurementRouter from "./routers/procurementRouter";
|
||||
import salesRouter from "./routers/salesRouter";
|
||||
import cwRouter from "./routers/cwRouter";
|
||||
import scheduleRouter from "./routers/scheduleRouter";
|
||||
import timeEntryRouter from "./routers/timeEntryRouter";
|
||||
|
||||
const app = new Hono();
|
||||
const v1 = new Hono();
|
||||
@@ -73,6 +74,7 @@ v1.route("/procurement", procurementRouter);
|
||||
v1.route("/sales", salesRouter);
|
||||
v1.route("/cw", cwRouter);
|
||||
v1.route("/schedule", scheduleRouter);
|
||||
v1.route("/time-entry", timeEntryRouter);
|
||||
app.route("/v1", v1);
|
||||
|
||||
export default app;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { createRoute } from "../../../modules/api-utils/createRoute";
|
||||
import { timeEntries } from "../../../managers/timeEntries";
|
||||
import { apiResponse } from "../../../modules/api-utils/apiResponse";
|
||||
import { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import { authMiddleware } from "../../middleware/authorization";
|
||||
|
||||
/* GET /v1/time-entry/time-entries/:identifier */
|
||||
export default createRoute(
|
||||
"get",
|
||||
["/time-entries/:identifier"],
|
||||
async (c) => {
|
||||
const entry = await timeEntries.fetch(c.req.param("identifier"));
|
||||
|
||||
const response = apiResponse.successful(
|
||||
"Time entry fetched successfully!",
|
||||
entry.toJson(),
|
||||
);
|
||||
|
||||
return c.json(response, response.status as ContentfulStatusCode);
|
||||
},
|
||||
authMiddleware({ permissions: ["time-entry.fetch"] }),
|
||||
);
|
||||
@@ -0,0 +1,22 @@
|
||||
import { createRoute } from "../../modules/api-utils/createRoute";
|
||||
import { timeEntries } from "../../managers/timeEntries";
|
||||
import { apiResponse } from "../../modules/api-utils/apiResponse";
|
||||
import { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import { authMiddleware } from "../middleware/authorization";
|
||||
|
||||
/* GET /v1/time-entry/count */
|
||||
export default createRoute(
|
||||
"get",
|
||||
["/count"],
|
||||
async (c) => {
|
||||
const count = await timeEntries.count();
|
||||
|
||||
const response = apiResponse.successful(
|
||||
"Time entry count fetched successfully!",
|
||||
{ count },
|
||||
);
|
||||
|
||||
return c.json(response, response.status as ContentfulStatusCode);
|
||||
},
|
||||
authMiddleware({ permissions: ["time-entry.fetch.many"] }),
|
||||
);
|
||||
@@ -0,0 +1,42 @@
|
||||
import { createRoute } from "../../modules/api-utils/createRoute";
|
||||
import { timeEntries } from "../../managers/timeEntries";
|
||||
import { apiResponse } from "../../modules/api-utils/apiResponse";
|
||||
import { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import { authMiddleware } from "../middleware/authorization";
|
||||
|
||||
/* GET /v1/time-entry/time-entries?page=&rpp=&search= */
|
||||
export default createRoute(
|
||||
"get",
|
||||
["/time-entries"],
|
||||
async (c) => {
|
||||
const page = new Number(c.req.query("page") ?? 1) as number;
|
||||
const rpp = new Number(c.req.query("rpp") ?? 30) as number;
|
||||
const search = c.req.query("search");
|
||||
|
||||
const data = search
|
||||
? await timeEntries.search(search, page, rpp)
|
||||
: await timeEntries.fetchPages(page, rpp);
|
||||
|
||||
const totalRecords = search
|
||||
? (await timeEntries.search(search, 1, 999999)).length
|
||||
: await timeEntries.count();
|
||||
|
||||
const response = apiResponse.successful(
|
||||
"Time entries fetched successfully!",
|
||||
data.map((e) => e.toJson()),
|
||||
{
|
||||
pagination: {
|
||||
previousPage: page == 1 ? null : page - 1,
|
||||
currentPage: page,
|
||||
nextPage: page >= totalRecords / rpp ? null : page + 1,
|
||||
totalPages: Math.ceil(totalRecords / rpp),
|
||||
totalRecords,
|
||||
listedRecords: rpp,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
return c.json(response, response.status as ContentfulStatusCode);
|
||||
},
|
||||
authMiddleware({ permissions: ["time-entry.fetch.many"] }),
|
||||
);
|
||||
@@ -0,0 +1,8 @@
|
||||
import { default as fetchAll } from "./fetchAll";
|
||||
import { default as count } from "./count";
|
||||
import { default as fetch } from "./[identifier]/fetch";
|
||||
import { default as fetchByMember } from "./member/fetchByMember";
|
||||
import { default as fetchByTicket } from "./ticket/fetchByTicket";
|
||||
import { default as fetchMyTimeEntries } from "./me/fetchMyTimeEntries";
|
||||
|
||||
export { count, fetch, fetchAll, fetchByMember, fetchByTicket, fetchMyTimeEntries };
|
||||
@@ -0,0 +1,69 @@
|
||||
import { createRoute } from "../../../modules/api-utils/createRoute";
|
||||
import { timeEntries } from "../../../managers/timeEntries";
|
||||
import { apiResponse } from "../../../modules/api-utils/apiResponse";
|
||||
import { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import { authMiddleware } from "../../middleware/authorization";
|
||||
import GenericError from "../../../Errors/GenericError";
|
||||
|
||||
/* GET /v1/time-entry/@me?start=<ISO>&end=<ISO> */
|
||||
export default createRoute(
|
||||
"get",
|
||||
["/@me"],
|
||||
async (c) => {
|
||||
const user = c.get("user");
|
||||
|
||||
if (!user?.cwIdentifier) {
|
||||
throw new GenericError({
|
||||
name: "BadRequest",
|
||||
message:
|
||||
"Your account is not linked to a ConnectWise member. Cannot fetch time entries.",
|
||||
status: 400,
|
||||
});
|
||||
}
|
||||
|
||||
const startParam = c.req.query("start");
|
||||
const endParam = c.req.query("end");
|
||||
|
||||
if (!startParam || !endParam) {
|
||||
throw new GenericError({
|
||||
name: "BadRequest",
|
||||
message:
|
||||
"Query params 'start' and 'end' are required (ISO 8601 date strings).",
|
||||
status: 400,
|
||||
});
|
||||
}
|
||||
|
||||
const startDate = new Date(startParam);
|
||||
const endDate = new Date(endParam);
|
||||
|
||||
if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
|
||||
throw new GenericError({
|
||||
name: "BadRequest",
|
||||
message: "Invalid date format. Use ISO 8601 (e.g. 2026-04-01T00:00:00Z).",
|
||||
status: 400,
|
||||
});
|
||||
}
|
||||
|
||||
if (startDate >= endDate) {
|
||||
throw new GenericError({
|
||||
name: "BadRequest",
|
||||
message: "'start' must be before 'end'.",
|
||||
status: 400,
|
||||
});
|
||||
}
|
||||
|
||||
const data = await timeEntries.fetchByDateRange(
|
||||
startDate,
|
||||
endDate,
|
||||
user.cwIdentifier,
|
||||
);
|
||||
|
||||
const response = apiResponse.successful(
|
||||
"Time entries fetched successfully!",
|
||||
data.map((e) => e.toJson()),
|
||||
);
|
||||
|
||||
return c.json(response, response.status as ContentfulStatusCode);
|
||||
},
|
||||
authMiddleware({ permissions: ["time-entry.fetch"] }),
|
||||
);
|
||||
@@ -0,0 +1,37 @@
|
||||
import { createRoute } from "../../../modules/api-utils/createRoute";
|
||||
import { timeEntries } from "../../../managers/timeEntries";
|
||||
import { apiResponse } from "../../../modules/api-utils/apiResponse";
|
||||
import { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import { authMiddleware } from "../../middleware/authorization";
|
||||
|
||||
/* GET /v1/time-entry/member/:memberId?page=&rpp= */
|
||||
export default createRoute(
|
||||
"get",
|
||||
["/member/:memberId"],
|
||||
async (c) => {
|
||||
const memberId = c.req.param("memberId");
|
||||
const page = new Number(c.req.query("page") ?? 1) as number;
|
||||
const rpp = new Number(c.req.query("rpp") ?? 30) as number;
|
||||
|
||||
const data = await timeEntries.fetchByMember(memberId, page, rpp);
|
||||
const totalRecords = await timeEntries.countByMember(memberId);
|
||||
|
||||
const response = apiResponse.successful(
|
||||
"Time entries fetched successfully!",
|
||||
data.map((e) => e.toJson()),
|
||||
{
|
||||
pagination: {
|
||||
previousPage: page == 1 ? null : page - 1,
|
||||
currentPage: page,
|
||||
nextPage: page >= totalRecords / rpp ? null : page + 1,
|
||||
totalPages: Math.ceil(totalRecords / rpp),
|
||||
totalRecords,
|
||||
listedRecords: rpp,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
return c.json(response, response.status as ContentfulStatusCode);
|
||||
},
|
||||
authMiddleware({ permissions: ["time-entry.fetch.many"] }),
|
||||
);
|
||||
@@ -0,0 +1,24 @@
|
||||
import { createRoute } from "../../../modules/api-utils/createRoute";
|
||||
import { timeEntries } from "../../../managers/timeEntries";
|
||||
import { apiResponse } from "../../../modules/api-utils/apiResponse";
|
||||
import { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import { authMiddleware } from "../../middleware/authorization";
|
||||
|
||||
/* GET /v1/time-entry/ticket/:ticketId */
|
||||
export default createRoute(
|
||||
"get",
|
||||
["/ticket/:ticketId"],
|
||||
async (c) => {
|
||||
const ticketId = parseInt(c.req.param("ticketId"), 10);
|
||||
|
||||
const data = await timeEntries.fetchByTicket(ticketId);
|
||||
|
||||
const response = apiResponse.successful(
|
||||
"Time entries fetched successfully!",
|
||||
data.map((e) => e.toJson()),
|
||||
);
|
||||
|
||||
return c.json(response, response.status as ContentfulStatusCode);
|
||||
},
|
||||
authMiddleware({ permissions: ["time-entry.fetch.many"] }),
|
||||
);
|
||||
@@ -0,0 +1,131 @@
|
||||
import {
|
||||
TimeEntry,
|
||||
TimeEntryStatus,
|
||||
TimeEntryChargeCode,
|
||||
Company,
|
||||
ServiceTicket,
|
||||
Activity,
|
||||
Contact,
|
||||
CorporateLocation,
|
||||
} from "../../generated/prisma/client";
|
||||
|
||||
type TimeEntryWithRelations = TimeEntry & {
|
||||
status?: TimeEntryStatus | null;
|
||||
chargeCode?: TimeEntryChargeCode | null;
|
||||
company?: Company | null;
|
||||
serviceTicket?: ServiceTicket | null;
|
||||
activity?: Activity | null;
|
||||
contact?: Contact | null;
|
||||
location?: CorporateLocation | null;
|
||||
};
|
||||
|
||||
export class TimeEntryController {
|
||||
public readonly id: number;
|
||||
public readonly uid: string;
|
||||
|
||||
private _data: TimeEntryWithRelations;
|
||||
|
||||
constructor(data: TimeEntryWithRelations) {
|
||||
this.id = data.id;
|
||||
this.uid = data.uid;
|
||||
this._data = data;
|
||||
}
|
||||
|
||||
public toJson() {
|
||||
const d = this._data;
|
||||
return {
|
||||
id: d.uid,
|
||||
cwId: d.id,
|
||||
memberId: d.memberId,
|
||||
|
||||
// ------ Time Fields ------
|
||||
dateStart: d.dateStart,
|
||||
timeStart: d.timeStart,
|
||||
timeEnd: d.timeEnd,
|
||||
|
||||
// ------ Notes ------
|
||||
notes: d.notes,
|
||||
notesMd: d.notesMd,
|
||||
internalNote: d.internalNote,
|
||||
|
||||
// ------ Hours ------
|
||||
billableHours: d.billableHours,
|
||||
actualHours: d.actualHours,
|
||||
invoicedHours: d.invoicedHours,
|
||||
deductedHours: d.deductedHours,
|
||||
|
||||
// ------ Rates ------
|
||||
hourlyRate: d.hourlyRate,
|
||||
effectiveRate: d.effectiveRate,
|
||||
|
||||
// ------ Flag Fields ------
|
||||
issueFlag: d.issueFlag,
|
||||
mergedFlag: d.mergedFlag,
|
||||
invoiceFlag: d.invoiceFlag,
|
||||
billableFlag: d.billableFlag,
|
||||
documentFlag: d.documentFlag,
|
||||
teProblemFlag: d.teProblemFlag,
|
||||
teResolutionFlag: d.teResolutionFlag,
|
||||
teInternalAnalysisFlag: d.teInternalAnalysisFlag,
|
||||
|
||||
// ------ Charge Info ------
|
||||
chargeToRecId: d.chargeToRecId,
|
||||
chargeToType: d.chargeToType,
|
||||
|
||||
// ------ Relations ------
|
||||
company: d.company
|
||||
? { id: d.company.uid, cwId: d.company.id, name: d.company.name }
|
||||
: null,
|
||||
serviceTicket: d.serviceTicket
|
||||
? {
|
||||
id: d.serviceTicket.uid,
|
||||
cwId: d.serviceTicket.id,
|
||||
summary: d.serviceTicket.summary,
|
||||
}
|
||||
: null,
|
||||
activity: d.activity
|
||||
? {
|
||||
id: d.activity.uid,
|
||||
cwId: d.activity.id,
|
||||
subject: d.activity.subject,
|
||||
}
|
||||
: null,
|
||||
contact: d.contact
|
||||
? {
|
||||
id: d.contact.uid,
|
||||
cwId: d.contact.id,
|
||||
name: `${d.contact.firstName} ${d.contact.lastName}`.trim(),
|
||||
}
|
||||
: null,
|
||||
location: d.location
|
||||
? { id: d.location.uid, cwId: d.location.id, name: d.location.name }
|
||||
: null,
|
||||
status: d.status
|
||||
? {
|
||||
id: d.status.uid,
|
||||
cwId: d.status.id,
|
||||
description: d.status.description,
|
||||
action: d.status.action,
|
||||
}
|
||||
: null,
|
||||
chargeCode: d.chargeCode
|
||||
? {
|
||||
id: d.chargeCode.uid,
|
||||
cwId: d.chargeCode.id,
|
||||
description: d.chargeCode.description,
|
||||
expenseFlag: d.chargeCode.expenseFlag,
|
||||
timeFlag: d.chargeCode.timeFlag,
|
||||
billableFlag: d.chargeCode.billableFlag,
|
||||
invoiceFlag: d.chargeCode.invoiceFlag,
|
||||
}
|
||||
: null,
|
||||
|
||||
// ------ Audit ------
|
||||
createdById: d.createdById,
|
||||
updatedById: d.updatedById,
|
||||
originalAuthorId: d.originalAuthorId,
|
||||
createdAt: d.createdAt,
|
||||
updatedAt: d.updatedAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
import { prisma } from "../constants";
|
||||
import { TimeEntryController } from "../controllers/TimeEntryController";
|
||||
|
||||
const timeEntryIncludes = {
|
||||
status: true,
|
||||
chargeCode: true,
|
||||
company: true,
|
||||
serviceTicket: true,
|
||||
activity: true,
|
||||
contact: true,
|
||||
location: true,
|
||||
} as const;
|
||||
|
||||
export const timeEntries = {
|
||||
async fetch(identifier: string | number): Promise<TimeEntryController> {
|
||||
const isNumeric =
|
||||
typeof identifier === "number" || /^\d+$/.test(String(identifier));
|
||||
|
||||
const entry = await prisma.timeEntry.findFirst({
|
||||
where: isNumeric
|
||||
? { id: Number(identifier) }
|
||||
: { uid: String(identifier) },
|
||||
include: timeEntryIncludes,
|
||||
});
|
||||
|
||||
if (!entry) throw new Error("Unknown time entry.");
|
||||
|
||||
return new TimeEntryController(entry);
|
||||
},
|
||||
|
||||
async count(): Promise<number> {
|
||||
return prisma.timeEntry.count();
|
||||
},
|
||||
|
||||
async fetchPages(page: number, rpp: number): Promise<TimeEntryController[]> {
|
||||
page = page.valueOf();
|
||||
rpp = rpp.valueOf();
|
||||
|
||||
const skip = (page > 1 ? page - 1 : 0) * rpp;
|
||||
const take = rpp ?? 30;
|
||||
|
||||
const data = await prisma.timeEntry.findMany({
|
||||
skip,
|
||||
take,
|
||||
include: timeEntryIncludes,
|
||||
orderBy: { dateStart: "desc" },
|
||||
});
|
||||
|
||||
return data.map((e) => new TimeEntryController(e));
|
||||
},
|
||||
|
||||
async search(
|
||||
query: string,
|
||||
page: number,
|
||||
rpp: number
|
||||
): Promise<TimeEntryController[]> {
|
||||
page = page.valueOf();
|
||||
rpp = rpp.valueOf();
|
||||
|
||||
const skip = (page > 1 ? page - 1 : 0) * rpp;
|
||||
const take = rpp ?? 30;
|
||||
|
||||
const numericQuery = parseInt(query, 10);
|
||||
|
||||
const data = await prisma.timeEntry.findMany({
|
||||
where: {
|
||||
OR: [
|
||||
{ notes: { contains: query, mode: "insensitive" } },
|
||||
{ internalNote: { contains: query, mode: "insensitive" } },
|
||||
{ uid: { contains: query, mode: "insensitive" } },
|
||||
...(!isNaN(numericQuery) ? [{ id: numericQuery }] : []),
|
||||
],
|
||||
},
|
||||
skip,
|
||||
take,
|
||||
include: timeEntryIncludes,
|
||||
orderBy: { dateStart: "desc" },
|
||||
});
|
||||
|
||||
return data.map((e) => new TimeEntryController(e));
|
||||
},
|
||||
|
||||
async fetchByMember(
|
||||
memberId: string,
|
||||
page: number,
|
||||
rpp: number
|
||||
): Promise<TimeEntryController[]> {
|
||||
page = page.valueOf();
|
||||
rpp = rpp.valueOf();
|
||||
|
||||
const skip = (page > 1 ? page - 1 : 0) * rpp;
|
||||
const take = rpp ?? 30;
|
||||
|
||||
const data = await prisma.timeEntry.findMany({
|
||||
where: { memberId },
|
||||
skip,
|
||||
take,
|
||||
include: timeEntryIncludes,
|
||||
orderBy: { dateStart: "desc" },
|
||||
});
|
||||
|
||||
return data.map((e) => new TimeEntryController(e));
|
||||
},
|
||||
|
||||
async countByMember(memberId: string): Promise<number> {
|
||||
return prisma.timeEntry.count({ where: { memberId } });
|
||||
},
|
||||
|
||||
async fetchByTicket(
|
||||
serviceTicketId: number
|
||||
): Promise<TimeEntryController[]> {
|
||||
const data = await prisma.timeEntry.findMany({
|
||||
where: { serviceTicketId },
|
||||
include: timeEntryIncludes,
|
||||
orderBy: { dateStart: "desc" },
|
||||
});
|
||||
|
||||
return data.map((e) => new TimeEntryController(e));
|
||||
},
|
||||
|
||||
async fetchByActivity(activityId: number): Promise<TimeEntryController[]> {
|
||||
const data = await prisma.timeEntry.findMany({
|
||||
where: { activityId },
|
||||
include: timeEntryIncludes,
|
||||
orderBy: { dateStart: "desc" },
|
||||
});
|
||||
|
||||
return data.map((e) => new TimeEntryController(e));
|
||||
},
|
||||
|
||||
async fetchByDateRange(
|
||||
startDate: Date,
|
||||
endDate: Date,
|
||||
memberId?: string
|
||||
): Promise<TimeEntryController[]> {
|
||||
const data = await prisma.timeEntry.findMany({
|
||||
where: {
|
||||
dateStart: { gte: startDate, lte: endDate },
|
||||
...(memberId ? { memberId } : {}),
|
||||
},
|
||||
include: timeEntryIncludes,
|
||||
orderBy: { dateStart: "asc" },
|
||||
});
|
||||
|
||||
return data.map((e) => new TimeEntryController(e));
|
||||
},
|
||||
};
|
||||
@@ -1616,6 +1616,32 @@ export async function createScheduleEntry(
|
||||
: undefined;
|
||||
const dateEnd = payload.endTime ? toCwDateTime(payload.endTime) : undefined;
|
||||
|
||||
// Find the currently open workflow activity (OpportunitySetup, OpportunityReview,
|
||||
// or Revision) to use as the parent for this schedule entry.
|
||||
let parentActivityCwId: number | null = null;
|
||||
try {
|
||||
const existingActivities = await activityCw.fetchByOpportunityDirect(
|
||||
opportunity.cwOpportunityId,
|
||||
);
|
||||
for (const raw of existingActivities) {
|
||||
if (raw.status?.id === 2) continue; // already closed
|
||||
const optimaField = raw.customFields?.find(
|
||||
(f: any) => f.id === OptimaType.FIELD_ID,
|
||||
);
|
||||
if (!optimaField?.value) continue;
|
||||
if (optimaField.value === OptimaType.ScheduleEntry) continue; // skip other schedule entries
|
||||
if (STAYS_OPEN_TYPES.has(optimaField.value as OptimaTypeValue)) {
|
||||
parentActivityCwId = raw.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
// Non-fatal — schedule entry will be created without a parent
|
||||
console.warn(
|
||||
`[Workflow:ScheduleEntry] Could not resolve parent activity: ${err}`,
|
||||
);
|
||||
}
|
||||
|
||||
const activity = await ActivityController.create({
|
||||
name: `[Schedule Entry] ${payload.activityTypeValue} — ${opportunity.name}`,
|
||||
type: { id: 3 }, // HistoricEntry
|
||||
@@ -1627,21 +1653,35 @@ export async function createScheduleEntry(
|
||||
...(dateEnd ? { dateEnd } : {}),
|
||||
});
|
||||
|
||||
// Set Optima_Type to Schedule Entry (stays open)
|
||||
// Build custom fields: always Optima_Type, plus Parent_Activity when resolved
|
||||
const customFields: any[] = [
|
||||
{
|
||||
id: OptimaType.FIELD_ID,
|
||||
caption: "Optima_Type",
|
||||
type: "Text",
|
||||
entryMethod: "List",
|
||||
numberOfDecimals: 0,
|
||||
value: OptimaType.ScheduleEntry,
|
||||
},
|
||||
];
|
||||
|
||||
if (parentActivityCwId != null) {
|
||||
customFields.push({
|
||||
id: PARENT_ACTIVITY_FIELD_ID,
|
||||
caption: "Parent_Activity",
|
||||
type: "Text",
|
||||
entryMethod: "EntryField",
|
||||
numberOfDecimals: 0,
|
||||
value: String(parentActivityCwId),
|
||||
});
|
||||
}
|
||||
|
||||
// Set Optima_Type (+ Parent_Activity) on the new schedule entry
|
||||
await activity.update([
|
||||
{
|
||||
op: "replace",
|
||||
path: "customFields",
|
||||
value: [
|
||||
{
|
||||
id: OptimaType.FIELD_ID,
|
||||
caption: "Optima_Type",
|
||||
type: "Text",
|
||||
entryMethod: "List",
|
||||
numberOfDecimals: 0,
|
||||
value: OptimaType.ScheduleEntry,
|
||||
},
|
||||
],
|
||||
value: customFields,
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user