feat: let bot R/W RTS, add fileValidationStatus to RTS
This commit is contained in:
@@ -55,6 +55,7 @@ const rtsSchema = new mongoose.Schema({
|
||||
ref: "user",
|
||||
},
|
||||
taggedUsers: Array,
|
||||
fileValidationStatus: String,
|
||||
});
|
||||
|
||||
export const rtsFields = Object.keys(rtsSchema.paths).filter(
|
||||
@@ -110,6 +111,7 @@ const rtsUpdateInput = z.object({
|
||||
.optional(),
|
||||
assignedTo: z.string().optional(),
|
||||
status: z.string().optional(),
|
||||
fileValidationStatus: z.string().optional(),
|
||||
});
|
||||
|
||||
const rtsNewUpload = z.object({
|
||||
|
||||
@@ -37,6 +37,7 @@ export async function createRts(
|
||||
client: user.role == "client" ? defaultClient : input.client,
|
||||
createdAt: new Date(),
|
||||
createdBy: user.userId ?? null,
|
||||
fileValidationStatus: "pending",
|
||||
});
|
||||
|
||||
await createAlert(
|
||||
@@ -162,6 +163,7 @@ export async function listRts(
|
||||
priority: 1,
|
||||
dueDate: 1,
|
||||
taggedUsers: 1,
|
||||
fileValidationStatus: 1,
|
||||
county: {
|
||||
$let: {
|
||||
vars: { county: { $arrayElemAt: ["$countyRec", 0] } },
|
||||
|
||||
@@ -164,7 +164,7 @@ export const rules: Record<
|
||||
},
|
||||
},
|
||||
bot: {
|
||||
claims: ["file:download", "note:write"],
|
||||
claims: ["file:download", "note:write", "rts:read", "rts:write"],
|
||||
hiddenFields: {
|
||||
orgs: ["__v"],
|
||||
permits: ["__v"],
|
||||
|
||||
Reference in New Issue
Block a user