update permit schema, change token expiry to 7 days

This commit is contained in:
2025-03-05 12:07:52 +05:30
parent 382a392d56
commit c00e68bb47
3 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ export async function createSession(userId: string, ip?: string, ua?: string) {
ip: ip, ip: ip,
userAgent: ua, userAgent: ua,
createdAt: new Date(), createdAt: new Date(),
expiresAt: new Date(Date.now() + 3600 * 24 * 30 * 1000), expiresAt: new Date(Date.now() + 3600 * 24 * 7 * 1000),
}); });
return newSession; return newSession;

View File

@@ -13,14 +13,12 @@ const permitSchema = new mongoose.Schema({
unique: true, unique: true,
}, },
permitNumber: String, permitNumber: String,
county: { county: Object,
type: mongoose.Types.ObjectId,
ref: "organization",
},
client: { client: {
type: mongoose.Types.ObjectId, type: mongoose.Types.ObjectId,
ref: "organization", ref: "organization",
}, },
clientData: Object,
permitDate: Date, permitDate: Date,
stage: new mongoose.Schema( stage: new mongoose.Schema(
{ {

View File

@@ -125,8 +125,9 @@ export async function listPermits(params: PageQueryParams, tenantId: string) {
relatedRecords: 1, relatedRecords: 1,
accelaStatus: 1, accelaStatus: 1,
createdAt: 1, createdAt: 1,
client: 1,
county: 1, county: 1,
client: 1,
clientData: 1,
/* county: { /* county: {
$let: { $let: {
vars: { county: { $arrayElemAt: ["$countyRec", 0] } }, vars: { county: { $arrayElemAt: ["$countyRec", 0] } },
@@ -339,6 +340,7 @@ export async function searchPermit(params: PageQueryParams, tenantId: string) {
createdAt: 1, createdAt: 1,
county: 1, county: 1,
client: 1, client: 1,
clientData: 1,
/* county: { /* county: {
$let: { $let: {
vars: { county: { $arrayElemAt: ["$countyRec", 0] } }, vars: { county: { $arrayElemAt: ["$countyRec", 0] } },