mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 00:45:41 +00:00
New Transit Agents admin table (name, valid-from/to, active/suspended, validity badge) — DJ assign step now picks from it, active+valid only.
This commit is contained in:
@@ -15,6 +15,11 @@ export interface CreateFileInput {
|
||||
resource: string;
|
||||
code: string;
|
||||
file: Express.Multer.File;
|
||||
/** Optional metadata for free-form uploads (GL exchange) — see FileRecord. */
|
||||
title?: string | null;
|
||||
visibleToCustomer?: boolean;
|
||||
uploadedByUserId?: string | null;
|
||||
uploadedByName?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,9 +106,27 @@ export class FilesService {
|
||||
url,
|
||||
size: file.size,
|
||||
mimeType: file.mimetype,
|
||||
title: input.title ?? null,
|
||||
visibleToCustomer: input.visibleToCustomer ?? false,
|
||||
uploadedByUserId: input.uploadedByUserId ?? null,
|
||||
uploadedByName: input.uploadedByName ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit the uploader-authored metadata of a stored file (title, customer
|
||||
* visibility). Bytes are untouched — callers replacing content upload a new
|
||||
* record instead.
|
||||
*/
|
||||
async updateMeta(
|
||||
id: string,
|
||||
patch: { title?: string; visibleToCustomer?: boolean },
|
||||
): Promise<FileRecord> {
|
||||
const updated = await this.filesRepository.update(id, patch);
|
||||
if (!updated) throw new NotFoundException(`File ${id} not found`);
|
||||
return updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the file stored under a resource + code (e.g. contract PDF). The
|
||||
* previous version is retired, not destroyed — pass `replacedBy` to record who
|
||||
|
||||
Reference in New Issue
Block a user