# Supplier

**Kind:** Class

**Source:** `Frontend/src/app/models/person/supplier.model.ts` (line 9)

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

`Supplier` is a person model for supplier-related data in the frontend application. It supports creating copied instances through `clone()` and `cloneSupplier()`.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `clone` | `clone()` | `Supplier` |
| `cloneSupplier` | `cloneSupplier(spi: Supplier)` | `Supplier` |

## Properties

| Property | Type |
|---|---|
| `SupplierID` | `number` |
| `SupplierCurrencyCode` | `string` |
| `PersonID` | `number` |
| `UserID` | `number` |
| `ModificationDate` | `Date` |
| `CompanyBranchID` | `number` |
| `IsActive` | `boolean` |
| `SupplierName` | `string` |
| `FullName` | `string` |
| `SupplierTypeID` | `number` |
| `IsPrincipal` | `boolean` |
| `ContractualInfo` | `SupplierContractualInfo` |
| `Vat` | `string` |
| `Selected` | `boolean` |
| `ImgPath` | `string` |
| `MarketSegmentID` | `number` |
| `MarketSegmentIDs` | `number[]` |
| `Addresses` | `Address[]` |
| `ContactInfoList` | `Array<ContactInfo>` |
| `ContactPersonList` | `Array<ContactPersons>` |

## Diagram

```mermaid
graph LR
  Supplier[Supplier]
  Supplier --> Clone[clone(): Supplier]
  Supplier --> CloneSupplier[cloneSupplier(): Supplier]
  Clone --> SupplierCopy[Supplier copy]
  CloneSupplier --> SupplierCopy
```

## Usage

```ts
import { Supplier } from 'src/app/models/person/supplier.model';

function duplicateSupplier(supplier: Supplier): Supplier {
  const copy = supplier.clone();

  return copy;
}

function duplicateForSupplierFlow(supplier: Supplier): Supplier {
  return supplier.cloneSupplier();
}
```

## AI Coding Instructions

- Use `clone()` when code needs a copied `Supplier` instance without changing the source instance.
- Use `cloneSupplier()` in supplier-specific flows where the method name clarifies intent.
- Keep both cloning methods returning `Supplier` so callers retain the expected model type.
- Check related person-model classes before adding supplier fields or changing copy behavior.

## Relationships

- IMPORTS → `Address`
- IMPORTS → `SupplierContractualInfo`
- IMPORTS → `ContactInfo`
- IMPORTS → `ContactPersons`
- IMPORTS → `SupplierContractCountry`
- IMPORTS → `SupplierContractClient`
- IMPORTS → `SupplierMarketSegment`
- IMPORTS → `SupplierContractMarketSegment`
- IMPORTS → `DecreasedTable`

## Used by

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

### Imported by (11)

- `ProductCategoriesComponent` — `Frontend/src/app/components/configuration/products/product-categories/product-categories.component.ts`:1
- `ContactViewEditComponent` — `Frontend/src/app/components/market/contacts/contact-view-edit/contact-view-edit.component.ts`:1
- `ContactsComponent` — `Frontend/src/app/components/market/contacts/contacts.component.ts`:1
- `RegistrationsComponent` — `Frontend/src/app/components/market/registrations/registrations/registrations.component.ts`:1
- `CurrencyRate` — `Frontend/src/app/components/payments/payment-details/payment-details.component.ts`:1
- `PaymentsListComponent` — `Frontend/src/app/components/payments/payments-list/payments-list.component.ts`:1
- `TagComponent` — `Frontend/src/app/components/shared/tag/tag.component.ts`:1
- `ProductCategoryService` — `Frontend/src/app/services/common/product-category.service.ts`:1

…and 3 more.
