Kind: Class
Source: Pams/Web/Pams.WebApp/Client/app/services/sales/date-validation-service.service.ts (line 15)
Part of: Pams
DateValidationServiceService coordinates date validation and mandatory-field checks in the sales client. It triggers date validation, registers validators, and applies mandatory rules for general fields, entities, and types.
Methods
| Method | Signature | Returns |
|---|---|---|
FireDateValidation | FireDateValidation(data: number) | void |
AddValidator | AddValidator(type: number, Validator: validator) | void |
validateMandatory | validateMandatory(type: number) | void |
validateMandatoryByEntity | validateMandatoryByEntity(type: number, inquiry: Inquiry) | void |
validateMandatorybyType | validateMandatorybyType(type: number) | void |
Properties
| Property | Type |
|---|---|
validation$ | any |
Where it refuses work
DateValidationServiceServicestops the work with an early return whentype < 10.
Diagram
mermaidgraph LR SalesForm[Sales UI] --> Service[DateValidationServiceService] Service --> AddValidator[AddValidator] Service --> FireDateValidation[FireDateValidation] Service --> Mandatory[validateMandatory] Mandatory --> ByEntity[validateMandatoryByEntity] Mandatory --> ByType[validateMandatorybyType]
Usage
tsimport { Component, inject } from '@angular/core';
import { DateValidationServiceService } from '../services/sales/date-validation-service.service';
@Component({
selector: 'app-sales-entry',
template: `<button (click)="validateDates()">Validate dates</button>`,
})
export class SalesEntryComponent {
private readonly dateValidationService = inject(DateValidationServiceService);
validateDates(): void {
this.dateValidationService.FireDateValidation();
}
}
AI Coding Instructions
- Call
FireDateValidation()when sales form date values change or before submitting date-dependent data. - Register validation behavior through
AddValidator()rather than duplicating date checks in components. - Keep mandatory validation rules aligned with
validateMandatoryByEntity()andvalidateMandatorybyType()scopes. - Preserve the existing method names, including their casing, when adding callers or tests.
Used by
1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (1)
SharedServicesModule—Pams/Web/Pams.WebApp/Client/app/services/shared-service.module.ts:1
Was this page helpful?