# File

**Kind:** Class

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

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

`File` is a client-side model for representing file-related data in the PAMS web application. It supports creating a copied instance with `clone()` and creating copied file entries with `cloneList()`.

## Methods

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

## Properties

| Property | Type |
|---|---|
| `FileID` | `number` |
| `FileName` | `string` |
| `WebId` | `string` |
| `WebParentId` | `string` |
| `WebFullName` | `string` |
| `WebUrl` | `string` |
| `Users` | `DriveUser[]` |
| `CloudItemId` | `string` |
| `CloudItemPath` | `string` |
| `CloudTypeId` | `number` |
| `FileTitle` | `string` |
| `ParentFileID` | `number` |
| `FileType` | `string` |
| `FileTypeId` | `number` |
| `FilePath` | `string` |
| `UploadedFileID` | `string` |
| `SizeInBytes` | `number` |
| `CreationDate` | `Date` |
| `ModificationDate` | `Date` |
| `CreatedByID` | `number` |
| `ModificatedByID` | `number` |
| `CompanyBranchID` | `number` |
| `CompanyID` | `number` |
| `UserId` | `number` |
| `selected` | `boolean` |
| `IsDefaultLibrary` | `boolean` |
| `FileTags` | `Tag[]` |
| `VersionNo` | `number` |
| `NameSuffix` | `string` |
| `FileComments` | `Comment[]` |
| `_FilesRoles` | `FilesRoles[]` |
| `_LibraryPermision` | `FilesRoles` |

## Diagram

```mermaid
graph LR
    File[File model]
    Clone[clone(): File]
    CloneList[cloneList(): File[]]

    File --> Clone
    File --> CloneList
```

## Usage

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

const file = new File();

const copiedFile = file.clone();
const copiedFiles = file.cloneList();

// Modify copiedFile without changing the original instance.
```

## AI Coding Instructions

- Use `clone()` when passing a file model to code that may modify it.
- Use `cloneList()` when a caller expects copied `File` instances in an array.
- Keep file-model fields synchronized between the source instance and clone logic.
- Check the model definition before adding fields so cloning behavior includes new data.

## Used by

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

### Imported by (31)

- `MrqDetailsComponent` — `Pams/Web/Pams.Web/Client/app/components/MRQ/mrq-details/mrq-details.component.ts`:1
- `NewBranchComponent` — `Pams/Web/Pams.Web/Client/app/components/configuration/company/main-branch/new.branch.component.ts`:1
- `ProductCategoriesComponent` — `Pams/Web/Pams.Web/Client/app/components/configuration/products/product-categories/product-categories.component.ts`:1
- `NewActivityComponent` — `Pams/Web/Pams.Web/Client/app/components/dashboard/my-desk/activities/new-activity/new-activity.component.ts`:1
- `TopicComponent` — `Pams/Web/Pams.Web/Client/app/components/dashboard/my-desk/activities/topic/topic.component.ts`:1
- `NewTasksComponent` — `Pams/Web/Pams.Web/Client/app/components/dashboard/my-desk/tasks/new-tasks/new-tasks.component.ts`:1
- `FilesComponent` — `Pams/Web/Pams.Web/Client/app/components/files/files.component.ts`:1
- `FileNameAndExtension` — `Pams/Web/Pams.Web/Client/app/components/files/upload-file/upload-file.component.ts`:1

…and 23 more.
