# File

**Kind:** Class

**Source:** `Pams/Web/Pams.WebApp/Client/app/models/common/files.model.ts` (line 5)

**Part of:** [Pams](subsystem-pams)

`File` is a client-side model for file-related data in the Pams web application. Its `clone` and `cloneList` methods create copied `File` instances for workflows that should not mutate an existing model.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `clone` | `clone(fi: File)` | `File` |
| `cloneList` | `cloneList(FL: File[])` | `File[]` |

## Properties

| Property | Type |
|---|---|
| `FileID` | `number` |
| `FileName` | `string` |
| `FileTitle` | `string` |
| `ParentFileID` | `number` |
| `FileType` | `string` |
| `FilePath` | `string` |
| `UploadedFileID` | `string` |
| `SizeInBytes` | `string` |
| `CreationDate` | `Date` |
| `ModificationDate` | `Date` |
| `CreatedByID` | `number` |
| `ModificatedByID` | `number` |
| `CompanyBranchID` | `number` |
| `selected` | `boolean` |
| `FileTags` | `Tag[]` |
| `FileComments` | `Comment[]` |

## Diagram

```mermaid
graph LR
  File[File model] --> Clone[clone(): File]
  File --> CloneList[cloneList(): File[]]
  Clone --> FileCopy[Copied File]
  CloneList --> FileCopies[Copied File list]
```

## Usage

```ts
import { File } from 'app/models/common/files.model';

function prepareFileCopies(sourceFile: File): File[] {
  const copiedFile: File = sourceFile.clone();
  const copiedFiles: File[] = sourceFile.cloneList();

  return [copiedFile, ...copiedFiles];
}
```

## AI Coding Instructions

- Call `clone()` before changing a `File` model that may still be referenced elsewhere.
- Use `cloneList()` when the calling code expects an array of copied `File` models.
- Avoid confusing this application model with the browser's native `File` type.
- Keep imports pointed at `app/models/common/files.model` when working with this model.

## Relationships

- IMPORTS → `Tag`
- IMPORTS → `Comment`

## Used by

5 references from 5 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (5)

- `FilesService` — `Pams/Web/Pams.WebApp/Client/app/services/common/files.service.ts`:1
- `PersonService` — `Pams/Web/Pams.WebApp/Client/app/services/person/person.service.ts`:1
- `FilesPortService` — `Pams/Web/Pams.WebApp/Client/app/services/shared/files-port-service.service.ts`:1
- `Person` — `Pams/Web/Pams.WebApp/Client/app/models/person/person.model.ts`:4
- `PortData` — `Pams/Web/Pams.WebApp/Client/app/models/shared/files-port.model.ts`:2
