Assignment Modal
This section describes the BfmServiceAssignmentModalComponent component.
Composition
The BfmServiceAssignmentModalComponent is composed of the following components:
- BfmServiceQuantityInputComponent - Component for service quantity input.
- BfmOfferedServicesAutocompleteComponent - Component for offered services autocomplete.
Usage
You must import the BfmServiceAssignmentModalComponent and provide it to ModalService to open the modal.
info
Modals are not components. They must be used with the ModalService to be opened.
To a better understanding, check the Modals documentation.
service-assignment-modal.component.ts
import { BfmServiceAssignmentModalComponent } from '@celerofinancas/ui-charges';
import { ModalService } from "@celerofinancas/ui-modals";
import { Component, inject } from '@angular/core';
@Component({
standalone: true,
selector: 'service-assignment',
templateUrl: './service-assignment.component.html',
})
export class ServiceAssignmentComponent {
/**
* Modal service for handling modals
*/
private modalService = inject(ModalService);
/**
* Open the modal
*/
public openModal(): void {
this.modalService.open(BfmServiceAssignmentModalComponent, {
modalType: RECURRENCE_OPERATION.CREATE,
company: { pk: '1', fantasy_name: 'Company' },
charge: {
pk: '1',
description: 'Charge',
value: 100,
due_date: '2022-12-31',
status: 'PENDING',
company: { pk: '1', fantasy_name: 'Company' },
},
index: 0,
isCharges: true,
service: OfferedService,
serviceIndex: 0,
});
};
}
Inputs
The BfmServiceAssignmentModalComponent modalRef has the following inputs:
modalType
Type of recurrence operation.
| Type | Default |
|---|---|
RECURRENCE_OPERATION | N/A |
company
Company details.
| Type | Default |
|---|---|
{ pk: string; fantasy_name: string; } | N/A |
charge
Charge details.
| Type | Default |
|---|---|
Charge.List.ItemDetails | N/A |
index
Index of the service.
| Type | Default |
|---|---|
number | N/A |
isCharges
Flag indicating if it is a charge.
| Type | Default |
|---|---|
boolean | N/A |
service
Service details.
| Type | Default |
|---|---|
OfferedService | N/A |
serviceIndex
Index of the service in the list.
| Type | Default |
|---|---|
number | N/A |
Events
The BfmServiceAssignmentModalComponent modalRef has no events.