feat: add create standing instructions (#1142)

Fixes: #268
This commit is contained in:
Muskan Khedia
2020-07-19 18:27:17 +05:30
committed by GitHub
parent c134026030
commit af6cdbaa9f
15 changed files with 588 additions and 9 deletions
@@ -0,0 +1,244 @@
<div class="container">
<mat-card>
<form [formGroup]="createStandingInstructionsForm">
<mat-card-content>
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Name</mat-label>
<input matInput required formControlName="name">
<mat-error *ngIf="createStandingInstructionsForm.controls.name.hasError('required')">
Name is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Applicant</mat-label>
<input matInput formControlName="applicant">
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Type</mat-label>
<mat-select required formControlName="transferType" (selectionChange)="changeEvent()">
<mat-option *ngFor="let transferType of transferTypeData" [value]="transferType.id">
{{ transferType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.transferType.hasError('required')">
Transfer Type is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Priority</mat-label>
<mat-select required formControlName="priority">
<mat-option *ngFor="let priorityType of priorityTypeData" [value]="priorityType.id">
{{ priorityType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.priority.hasError('required')">
Priority is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Status</mat-label>
<mat-select required formControlName="status">
<mat-option *ngFor="let statusType of statusTypeData" [value]="statusType.id">
{{ statusType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.status.hasError('required')">
Status is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>From Account Type</mat-label>
<mat-select required formControlName="fromAccountType" (selectionChange)="changeEvent()">
<mat-option *ngFor="let fromAccountType of fromAccountTypeData" [value]="fromAccountType.id">
{{ fromAccountType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.fromAccountType.hasError('required')">
From Account Type is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>From Account</mat-label>
<mat-select required formControlName="fromAccountId" (selectionChange)="changeEvent()">
<mat-option *ngFor="let fromAccount of fromAccountData" [value]="fromAccount.id">
{{ fromAccount.productName }} - {{ fromAccount.accountNo }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.fromAccountId.hasError('required')">
From Account is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Destination</mat-label>
<mat-select required formControlName="destination">
<mat-option *ngFor="let destinationType of destinationTypeData" [value]="destinationType.id">
{{ destinationType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.destination.hasError('required')">
Destination is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>To Office</mat-label>
<mat-select required formControlName="toOfficeId" (selectionChange)="changeEvent()">
<mat-option *ngFor="let toOfficeType of toOfficeTypeData" [value]="toOfficeType.id">
{{ toOfficeType.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.toOfficeId.hasError('required')">
To Office is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Beneficiary</mat-label>
<mat-select required formControlName="toClientId" (selectionChange)="changeEvent()">
<mat-option *ngFor="let toClientType of toClientTypeData" [value]="toClientType.id">
{{ toClientType.displayName }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.toClientId.hasError('required')">
Beneficiary is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>To Account Type</mat-label>
<mat-select required formControlName="toAccountType" (selectionChange)="changeEvent()">
<mat-option *ngFor="let toAccountType of toAccountTypeData" [value]="toAccountType.id">
{{ toAccountType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.toAccountType.hasError('required')">
To Account Type is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>To Account</mat-label>
<mat-select required formControlName="toAccountId" (selectionChange)="changeEvent()">
<mat-option *ngFor="let toAccount of toAccountData" [value]="toAccount.id">
{{ toAccount.productName }} - {{ toAccount.accountNo }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.toAccountId.hasError('required')">
To Account is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Standing Instruction Type</mat-label>
<mat-select formControlName="instructionType">
<mat-option *ngFor="let instructionsType of instructionTypeData" [value]="instructionsType.id">
{{ instructionsType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.instructionType.hasError('required')">
Standing Instruction Type is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Amount</mat-label>
<input type="number" matInput required formControlName="amount">
<mat-error *ngIf="createStandingInstructionsForm.controls.amount.hasError('required')">
Amount is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Validity From</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="validFromDatePicker" required
formControlName="validFrom">
<mat-datepicker-toggle matSuffix [for]="validFromDatePicker"></mat-datepicker-toggle>
<mat-datepicker #validFromDatePicker></mat-datepicker>
<mat-error *ngIf="createStandingInstructionsForm.controls.validFrom.hasError('required')">
Valid From Date is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Validity To</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="validTillDatePicker" required
formControlName="validTill">
<mat-datepicker-toggle matSuffix [for]="validTillDatePicker"></mat-datepicker-toggle>
<mat-datepicker #validTillDatePicker></mat-datepicker>
<mat-error *ngIf="createStandingInstructionsForm.controls.validTill.hasError('required')">
Valid Till Date is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Recurrence Type</mat-label>
<mat-select required formControlName="recurrenceType">
<mat-option *ngFor="let recurrenceType of recurrenceTypeData" [value]="recurrenceType.id">
{{ recurrenceType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.recurrenceType.hasError('required')">
Recurrence Type is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Interval</mat-label>
<input type="number" matInput required formControlName="recurrenceInterval">
<mat-error *ngIf="createStandingInstructionsForm.controls.recurrenceInterval.hasError('required')">
Recurrence Interval is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Recurrence Frequency</mat-label>
<mat-select required formControlName="recurrenceFrequency">
<mat-option *ngFor="let recurrenceFrequencyType of recurrenceFrequencyTypeData"
[value]="recurrenceFrequencyType.id">
{{ recurrenceFrequencyType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="createStandingInstructionsForm.controls.recurrenceFrequency.hasError('required')">
Recurrence Frequency is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>On Month Day</mat-label>
<input required matInput [min]="minDate" [max]="maxDate" [matDatepicker]="recurrenceOnMonthDayDatePicker"
formControlName="recurrenceOnMonthDay">
<mat-datepicker-toggle matSuffix [for]="recurrenceOnMonthDayDatePicker"></mat-datepicker-toggle>
<mat-datepicker #recurrenceOnMonthDayDatePicker></mat-datepicker>
<mat-error *ngIf="createStandingInstructionsForm.controls.recurrenceOnMonthDay.hasError('required')">
On Month Day is <strong>required</strong>
</mat-error>
</mat-form-field>
</div>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!createStandingInstructionsForm.valid"
(click)="submit()">Submit</button>
</mat-card-actions>
</form>
</mat-card>
</div>