# Person

**Kind:** Class

**Source:** `Pams/Logic/Pams.Business/Entity/Person/Person.Model.cs` (line 11)

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

`Person` is a C# entity model for storing identity and naming data for an individual. It links a person to optional company, branch, and person type records through nullable identifier fields.

## Diagram

```mermaid
graph LR
  Person[Person]
  Person --> PersonID[PersonID: long]
  Person --> RowGuid[RowGuid: Guid?]
  Person --> CompanyID[CompanyID: int?]
  Person --> CompanyBranchID[CompanyBranchID: long?]
  Person --> PersonTypeID[PersonTypeID: int?]
  Person --> Name[Name fields]
  Name --> Title[Title]
  Name --> FirstName[FirstName]
  Name --> MiddleName[MiddleName]
  Name --> LastName[LastName]
  Name --> DisplayName[DisplayName]
```

## Usage

```ts
type Person = {
  personID: number;
  rowGuid?: string | null;
  companyID?: number | null;
  companyBranchID?: number | null;
  personTypeID?: number | null;
  title?: string | null;
  firstName?: string | null;
  middleName?: string | null;
  lastName?: string | null;
  displayName?: string | null;
};

const person: Person = {
  personID: 42,
  companyID: 10,
  firstName: "Ada",
  lastName: "Lovelace",
  displayName: "Ada Lovelace"
};

await fetch("/api/person", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify(person)
});
```

## AI Coding Instructions

- Keep identifier field types aligned with the C# model: `PersonID` and `CompanyBranchID` are `long`, while `CompanyID` and `PersonTypeID` are `int`.
- Treat `RowGuid`, company fields, branch fields, and person type fields as nullable when mapping API payloads.
- Preserve the separate name fields instead of deriving `FirstName`, `MiddleName`, or `LastName` from `DisplayName`.
- Confirm JSON property casing with the API serializer before sending TypeScript request payloads.

## Relationships

- IMPORTS → `PostedFile`
- IMPORTS → `PersonUser`
- IMPORTS → `PersonUserBindingModel`
- IMPORTS → `Company`
- IMPORTS → `CompanyBranchLightBindingModel`
- IMPORTS → `LookUpCommonBindingModel`
- IMPORTS → `UserPremissionsModel`
- IMPORTS → `LogProperties`
- IMPORTS → `PersonUserDataBindingModel`
- IMPORTS → `ClientAllowedFeaturesBindingModel`
- IMPORTS → `Person`
- IMPORTS → `EntityBase`
- IMPORTS → `PamsLinqDataContext`

## Used by

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

### Imported by (76)

- `BaseController` — `Pams/API/Pams.API/Controllers/BaseController.cs`:515
- `EmployeeBonusController` — `Pams/API/Pams.API/Controllers/BookingTarget/EmployeeBonusController.cs`:11
- `CurrencyController` — `Pams/API/Pams.API/Controllers/Common/CurrencyController.cs`:20
- `FilesController` — `Pams/API/Pams.API/Controllers/Common/FilesController.cs`:27
- `CompanyBranchController` — `Pams/API/Pams.API/Controllers/Organization/CompanyBranchController.cs`:21
- `CompanyController` — `Pams/API/Pams.API/Controllers/Organization/CompanyController.cs`:26
- `EmployeeController` — `Pams/API/Pams.API/Controllers/Person/EmployeeController.cs`:29
- `AccountsController` — `Pams/API/Pams.API/Controllers/Person/AccountsController.cs`:23

…and 68 more.
