feat: add more field for use later
This commit is contained in:
parent
1753ac65da
commit
4091c0b38c
2 changed files with 26 additions and 7 deletions
|
|
@ -482,6 +482,8 @@ model User {
|
|||
notificationRead Notification[]
|
||||
taskOrderCreated TaskOrder[] @relation("TaskOrderCreatedByUser")
|
||||
taskOrderAccepted TaskOrder[]
|
||||
|
||||
requestWorkStepStatus RequestWorkStepStatus[]
|
||||
}
|
||||
|
||||
model UserResponsibleArea {
|
||||
|
|
@ -1452,6 +1454,16 @@ model RequestWorkStepStatus {
|
|||
|
||||
attributes Json?
|
||||
|
||||
customerDuty Boolean?
|
||||
customerDutyCost Float?
|
||||
companyDuty Boolean?
|
||||
companyDutyCost Float?
|
||||
individualDuty Boolean?
|
||||
individualDutyCost Float?
|
||||
|
||||
responsibleUserId String?
|
||||
responsibleUser User? @relation(fields: [responsibleUserId], references: [id])
|
||||
|
||||
taskOrder TaskOrder? @relation(fields: [taskOrderId], references: [id])
|
||||
taskOrderId String?
|
||||
|
||||
|
|
|
|||
|
|
@ -299,7 +299,18 @@ export class RequestListController extends Controller {
|
|||
async updateRequestWorkStepStatus(
|
||||
@Path() requestWorkId: string,
|
||||
@Path() step: number,
|
||||
@Body() payload: { requestWorkStatus?: RequestWorkStatus; attributes?: Record<string, any> },
|
||||
@Body()
|
||||
payload: {
|
||||
requestWorkStatus?: RequestWorkStatus;
|
||||
attributes?: Record<string, any>;
|
||||
customerDuty?: boolean;
|
||||
customerDutyCost?: number;
|
||||
companyDuty?: boolean;
|
||||
companyDutyCost?: number;
|
||||
individualDuty?: boolean;
|
||||
individualDutyCost?: number;
|
||||
responsibleUserId?: string;
|
||||
},
|
||||
@Query() successAll?: boolean,
|
||||
) {
|
||||
const record = await prisma.requestWorkStepStatus.upsert({
|
||||
|
|
@ -313,15 +324,11 @@ export class RequestListController extends Controller {
|
|||
},
|
||||
},
|
||||
create: {
|
||||
...payload,
|
||||
step: step,
|
||||
requestWorkId,
|
||||
workStatus: payload.requestWorkStatus,
|
||||
attributes: payload.attributes,
|
||||
},
|
||||
update: {
|
||||
workStatus: payload.requestWorkStatus,
|
||||
attributes: payload.attributes,
|
||||
},
|
||||
update: payload,
|
||||
});
|
||||
|
||||
switch (payload.requestWorkStatus) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue