Spaces:
Running
Running
feat: implement core backend POS API with authentication, role-based access control, menu management, and order processing logic.
1e480b5 Download src/models/ActivityLog.js from aliroohan179/face: direct link, hf CLI and curl.
- Browser
- Download file 769 Bytes
-
https://huggingface.co/spaces/aliroohan179/face/resolve/main/src/models/ActivityLog.js
- Command line
-
hf download hf://spaces/aliroohan179/face/src/models/ActivityLog.js
-
curl -L -o ActivityLog.js https://huggingface.co/spaces/aliroohan179/face/resolve/main/src/models/ActivityLog.js
769 Bytes
| const mongoose = require('mongoose'); | |
| // Simple activity log for accountability: who did what, when | |
| const activityLogSchema = new mongoose.Schema( | |
| { | |
| user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, | |
| userName: { type: String, required: true }, // snapshot | |
| action: { type: String, required: true }, // e.g. "LOGIN", "CREATE_ORDER", "VOID_ORDER", "ADD_EXPENSE" | |
| entity: { type: String, default: null }, // e.g. "Order", "Expense" | |
| entityId: { type: mongoose.Schema.Types.ObjectId, default: null }, | |
| detail: { type: String, default: '' }, | |
| ip: { type: String, default: '' }, | |
| }, | |
| { timestamps: true } | |
| ); | |
| activityLogSchema.index({ createdAt: -1 }); | |
| module.exports = mongoose.model('ActivityLog', activityLogSchema); | |