# AppSettings

**Kind:** Class

**Source:** `Pams/Web/Pams.WebApp/Client/app/settings/app/app.settings.ts` (line 6)

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

`AppSettings` is a client-side settings model in `Pams.WebApp` that handles size calculation, origin URL lookup, validation error access, error parsing, equality checks, change detection, and date/time formatting. Components can call it when displaying, validating, or comparing application settings.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `CalculateSize` | `CalculateSize()` | `void` |
| `getOriginUrl` | `getOriginUrl()` | `void` |
| `getValidationErrorList` | `getValidationErrorList(errors: ValidationError[])` | `void` |
| `getValidationError` | `getValidationError(error: ValidationError, messageList: string[])` | `string[]` |
| `ParseError` | `ParseError(error: any)` | `string` |
| `TimeDifferenceString` | `TimeDifferenceString(days: number, Sperator: string, title: string)` | `void` |
| `checkEquality` | `checkEquality(source: any, target: any, pro: string, CalculatedFields: any[])` | `boolean` |
| `DataChanged` | `DataChanged(source: any, target: any, CalculatedFields: any[])` | `boolean` |
| `ConvertDateToString` | `ConvertDateToString(dateX: Date)` | `string` |
| `ConvertDateToStringEU` | `ConvertDateToStringEU(dateX: Date)` | `string` |
| `ConvertStringToDate` | `ConvertStringToDate(data: string)` | `Date` |
| `ConvertStringToDateEU` | `ConvertStringToDateEU(data: string)` | `Date` |
| `NumeralConversionDefault` | `NumeralConversionDefault(data: undefined, format: undefined)` | `string` |
| `NumeralConversion` | `NumeralConversion(data: undefined, format: undefined, currency: undefined)` | `string` |
| `NumeralUnConversion` | `NumeralUnConversion(data: undefined)` | `number` |
| `UlitizeTime` | `UlitizeTime(i: number, Sperator: string, title: string)` | `void` |

## Properties

| Property | Type |
|---|---|
| `API_Url_Local` | `any` |
| `API_Url_Remote` | `any` |
| `APIUrl` | `any` |
| `ImgPath` | `any` |
| `API_ProjectProcessWorkflowTypeController` | `any` |
| `API_CategoryController` | `any` |
| `API_AuthController` | `any` |
| `API_UnitController` | `any` |
| `API_CountryController` | `any` |
| `API_CompanyCurrencyController` | `any` |
| `API_OfferController` | `any` |
| `API_OfferItemController` | `any` |
| `API_ItemController` | `any` |
| `API_TimePeriodController` | `any` |
| `API_OfferMileStoneController` | `any` |
| `API_OfferItemVersionController` | `any` |
| `API_InquiryController` | `any` |
| `API_GuaranteeTypeController` | `any` |
| `API_JobGuaranteeController` | `any` |
| `API_CurrencyController` | `any` |
| `API_ContactInfoTypesController` | `any` |
| `API_ContactInfoRelatedTypeController` | `any` |
| `API_JobProcessController` | `any` |
| `API_JobItemController` | `any` |
| `API_JobVersionController` | `any` |
| `API_CityController` | `any` |
| `API_GovernateController` | `any` |
| `API_SerialStatusController` | `any` |
| `API_SerialCombinationsController` | `any` |
| `API_SerialComponentsController` | `any` |
| `API_SerialTypeController` | `any` |
| `API_PaymentMethodController` | `any` |
| `API_DeliveryTermController` | `any` |
| `API_ClientsController` | `any` |
| `API_PersonController` | `any` |
| `API_ClientTypesController` | `any` |
| `API_SupplierTypesController` | `any` |
| `API_MarketSegmentController` | `any` |
| `API_PersonEmailController` | `any` |
| `API_PersonPhoneController` | `any` |
| `API_SupplierController` | `any` |
| `API_CompanyBranchContactInfoController` | `any` |
| `API_ContactInfoController` | `any` |
| `API_CompanyBranchController` | `any` |
| `API_CompanyController` | `any` |
| `API_AddressController` | `any` |
| `API_AddressTypeController` | `any` |
| `API_CompanyBranchSettingController` | `any` |
| `API_ProcessReasonontroller` | `any` |
| `API_InquiryTypesController` | `any` |

## Where it refuses work

- `AppSettings` stops the work with an early return when `source && target && source[pro] && source[pro] != target[pro] && CalculatedFields.findInd…`.
- `AppSettings` stops the work with an early return when `!i`.

## Diagram

```mermaid
graph LR
  Component[Client Component] --> Settings[AppSettings]
  Settings --> Origin[getOriginUrl]
  Settings --> Validation[getValidationErrorList / getValidationError]
  Settings --> Errors[ParseError]
  Settings --> Changes[checkEquality / DataChanged]
  Settings --> Dates[ConvertDateToString / ConvertDateToStringEU / TimeDifferenceString]
  Settings --> Size[CalculateSize]
```

## Usage

```ts
import { AppSettings } from './app.settings';

const settings = new AppSettings();

const originUrl = settings.getOriginUrl();
const validationErrors: string[] = settings.getValidationError();
const hasChanges = settings.DataChanged();

if (!hasChanges && validationErrors.length === 0) {
  console.log(`Settings are ready for ${originUrl}`);
}

console.log(settings.ConvertDateToString());
console.log(settings.ParseError());
```

## AI Coding Instructions

- Keep method names and casing unchanged, including `CalculateSize`, `DataChanged`, and `ConvertDateToStringEU`.
- Check `getValidationError()` or `getValidationErrorList()` before displaying parsed error text from `ParseError()`.
- Use `DataChanged()` and `checkEquality()` for settings comparisons instead of duplicating comparison logic in components.
- Keep date display logic in `ConvertDateToString()` and `ConvertDateToStringEU()` rather than formatting settings dates in each caller.

## Relationships

- IMPORTS → `environment`
- CALLS → `FilesController`
- CALLS → `MarketSegmentController`
- CALLS → `CategoryController`
- CALLS → `UnitController`
- CALLS → `CountryController`
- CALLS → `CompanyCurrencyController`
- CALLS → `OfferController`
- CALLS → `ItemController`
- CALLS → `TimePeriodController`
- CALLS → `OfferMileStoneController`
- CALLS → `InquiryController`
- CALLS → `GuaranteeTypesController`
- CALLS → `JobGuaranteesController`
- CALLS → `CurrencyController`
- CALLS → `ContactInfoTypeController`
- CALLS → `ContactInfoRelatedTypeController`
- CALLS → `JobProcessController`
- CALLS → `JobItemController`
- CALLS → `JobVersionController`
- CALLS → `CityController`
- CALLS → `GovernateController`
- CALLS → `SerialStatusController`
- CALLS → `SerialCombinationsController`
- CALLS → `SerialComponentsController`
- CALLS → `SerialTypeController`
- CALLS → `PaymentMethodController`
- CALLS → `DeliveryTermController`
- CALLS → `PersonController`
- CALLS → `ClientTypeController`
- CALLS → `SupplierTypeController`
- CALLS → `PersonEmailController`
- CALLS → `PersonPhoneController`
- CALLS → `CompanyBranchContactInfoController`
- CALLS → `ContactInfoController`
- CALLS → `CompanyBranchController`
- CALLS → `CompanyController`
- CALLS → `AddressController`
- CALLS → `AddressTypeController`
- CALLS → `CompanyBranchSettingController`
- CALLS → `ProcessReasonController`
- CALLS → `InquiryTypesController`
- CALLS → `OfferStatusController`
- CALLS → `OrderChanceController`
- CALLS → `OrderStatusController`
- CALLS → `JobListLayoutController`
- CALLS → `DefaultJobListLayoutController`
- CALLS → `ProductTypeController`
- CALLS → `BookingTargetController`
- CALLS → `NationalityController`
- CALLS → `EmployeeTypesController`
- CALLS → `MaritalStatusController`
- CALLS → `CompanyBranchDepartmentController`
- CALLS → `ProjectCommentController`
- CALLS → `ProjectRegisteredController`
- CALLS → `ShareholdersController`
- CALLS → `ContactPersonController`
- CALLS → `ContactPersonRelatedTypeController`
- CALLS → `RegistrationStatusController`
- CALLS → `DataSourceController`
- CALLS → `DashboardController`
- CALLS → `ReactivationReasonsController`
- CALLS → `DefaultSerialStatusController`
- CALLS → `ConnectionTypeController`
- CALLS → `MailToController`
- CALLS → `NotificationController`
- CALLS → `NotificationTypeController`
- CALLS → `ReminderController`
- CALLS → `SentEmailsController`
- CALLS → `TimeUnitTypeController`
- CALLS → `UserEmailSettingController`
- CALLS → `AssigneeController`
- CALLS → `AssigneeAccessTypeController`
- CALLS → `StatusController`
- CALLS → `TaskController`
- CALLS → `CommentsController`
- CALLS → `RelatedToTypesController`
- CALLS → `TagsController`
- CALLS → `ClientDelayController`
- CALLS → `DashboardWidgetController`
- CALLS → `AccountsController`
- CALLS → `PersonUserController`
- CALLS → `RoleController`
- CALLS → `PersonTypeController`
- CALLS → `PermissionController`
- CALLS → `RolePermissionsController`
- CALLS → `JobVersionStatusLogController`
- CALLS → `JobItemStatusController`
- CALLS → `JobItemStatusDataController`
- CALLS → `ProjectController`
- CALLS → `ProjectStatusController`
- CALLS → `JobDocumentController`

## Used by

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

### Imported by (110)

- `BaseEdit` — `Pams/Web/Pams.WebApp/Client/app/core/components/base-edit.component.ts`:1
- `CoreModule` — `Pams/Web/Pams.WebApp/Client/app/core/core.module.ts`:1
- `BaseApi` — `Pams/Web/Pams.WebApp/Client/app/core/services/api/base-api.service.ts`:1
- `PreviousPageService` — `Pams/Web/Pams.WebApp/Client/app/core/services/previous-page.service.ts`:1
- `AssigneeAccessTypeService` — `Pams/Web/Pams.WebApp/Client/app/services/Tasks/assignee-access-type.service.ts`:1
- `AssigneeService` — `Pams/Web/Pams.WebApp/Client/app/services/Tasks/assignee.service.ts`:1
- `PrioritiesService` — `Pams/Web/Pams.WebApp/Client/app/services/Tasks/priorities.service.ts`:1
- `StatusService` — `Pams/Web/Pams.WebApp/Client/app/services/Tasks/status.service.ts`:1

…and 102 more.
