# AttachedfileView

**Kind:** Class

**Source:** `Frontend/src/app/models/common/files.model.ts` (line 181)

**Part of:** [Frontend](subsystem-frontend-src-app)

`AttachedfileView` represents an attached file in the common file model layer. It supports copying file data with `cloneFile()` and copying the view model with `clone()` so callers can work with separate instances.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `cloneFile` | `cloneFile(file: File)` | `void` |
| `clone` | `clone(e: AttachedfileView)` | `void` |

## Properties

| Property | Type |
|---|---|
| `FileName` | `string` |
| `CompanyBranchID` | `number` |
| `FileID` | `number` |
| `refrenceToID` | `number` |
| `refrenceToTypeID` | `number` |
| `FileTypeId` | `number` |
| `FileCategoryId` | `number` |
| `FileCategory` | `string` |
| `VersionNo` | `number` |
| `NameSuffix` | `string` |
| `MarkDelete` | `boolean` |
| `TagID` | `number` |
| `FileType` | `string` |
| `FilePath` | `string` |
| `CloudTypeId` | `number` |
| `CloudItemId` | `string` |
| `SizeInBytes` | `string` |
| `ModificationDate` | `Date` |
| `downloading` | `boolean` |

## Diagram

```mermaid
graph LR
  A[AttachedfileView] --> B[cloneFile()]
  A --> C[clone()]
  B --> D[Copied file data]
  C --> E[Copied AttachedfileView]
```

## Usage

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

const attachedFile = new AttachedfileView();

const copiedFile = attachedFile.cloneFile();
const copiedView = attachedFile.clone();

// Modify a copied instance without changing the original reference.
console.log(copiedFile, copiedView);
```

## AI Coding Instructions

- Use `cloneFile()` when code needs a separate copy of the attached file data.
- Use `clone()` when passing an `AttachedfileView` instance to code that may modify it.
- Keep clone behavior aligned with any fields added to `AttachedfileView`.
- Avoid mutating shared file-view instances when a copied instance is required.

## Used by

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

### Imported by (6)

- `DocsListComponent` — `Frontend/src/app/components/shared/attached-docs/shared-attached-docs/docs-list/docs-list.component.ts`:1
- `SharedAttachedDocsComponent` — `Frontend/src/app/components/shared/attached-docs/shared-attached-docs/shared-attached-docs.component.ts`:1
- `AttachmentDropdownComponent` — `Frontend/src/app/components/shared/dropdown/attachment-dropdown/attachment-dropdown.component.ts`:1
- `InspectionDetailsComponent` — `Frontend/src/app/components/warehouse/inspection-details/inspection-details.component.ts`:1
- `UploadFilePopup` — `Frontend/src/app/services/common/files.service.ts`:1
- `ClientDelay` — `Frontend/src/app/models/sales/client-delay.model.ts`:2
