generated from azures04/Base-REST-API
Refactor license and permission management, add services
Renamed licenceRepository.js to licenseRepository.js and updated its API to use status instead of userId for licenses. Moved permission checking logic from userRepository to permissionsRepository. Added new service layers for license, permissions, and user management, implementing error handling and business logic. Removed the old register.js service and cleaned up test.js. Updated database schema to remove userId from licenses.
This commit is contained in:
@@ -64,16 +64,11 @@ function initializeDatabase() {
|
||||
key TEXT NOT NULL UNIQUE,
|
||||
productId INTEGER NOT NULL,
|
||||
targetIhannel TEXT NOT NULL,
|
||||
userId INTEGER DEFAULT NULL,
|
||||
usedAt TEXT,
|
||||
|
||||
FOREIGN KEY(productId)
|
||||
REFERENCES products(id)
|
||||
ON DELETE CASCADE,
|
||||
|
||||
FOREIGN KEY(userId)
|
||||
REFERENCES accounts(id)
|
||||
ON DELETE SET NULL
|
||||
)
|
||||
`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user