Add branch_user table and branch-user assignment endpoints
Introduces a branch_user join table linking branches to users, plus create/delete API endpoints under the auth module for managing branch assignments. The create response includes the branch's localized name via a join. Regenerated swagger docs to include the new endpoints. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
DROP TABLE IF EXISTS branch_user;
|
||||
DROP TABLE IF EXISTS roles;
|
||||
DROP TABLE IF EXISTS loan_order_required_docs;
|
||||
DROP TABLE IF EXISTS loan_types;
|
||||
|
||||
@@ -110,4 +110,12 @@ CREATE TABLE IF NOT EXISTS permissions (
|
||||
guard_name character varying(255) NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL,
|
||||
updated_at TIMESTAMP DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS branch_user (
|
||||
id bigserial PRIMARY KEY,
|
||||
branch_id bigint REFERENCES branches(id) ON DELETE CASCADE,
|
||||
user_id bigint REFERENCES users(id) ON DELETE CASCADE,
|
||||
created_at TIMESTAMP DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL,
|
||||
updated_at TIMESTAMP DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL
|
||||
);
|
||||
Reference in New Issue
Block a user