Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
22db10a31e
|
|||
4f88ac5d0e
|
|||
3ae92c020c
|
|||
d098317331
|
|||
641565d8ff
|
|||
25d016c154
|
|||
39703dca22
|
|||
c06184d1b1
|
|||
1450c8fdd7
|
|||
72a3241286
|
|||
d2cf532a0e
|
|||
dbb9686312
|
|||
05823a1829
|
@ -2,6 +2,7 @@ stages:
|
|||||||
- check
|
- check
|
||||||
- build
|
- build
|
||||||
- dockerize
|
- dockerize
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
|
||||||
check:
|
check:
|
||||||
@ -55,6 +56,7 @@ build-ui:
|
|||||||
- cd ui/hv2-ui
|
- cd ui/hv2-ui
|
||||||
- if [ "$CI_COMMIT_TAG" != "" ]; then
|
- if [ "$CI_COMMIT_TAG" != "" ]; then
|
||||||
sed -i -e 's/GITTAGVERSION/'"$CI_COMMIT_TAG"':'"$CI_COMMIT_SHORT_SHA"'/' ./src/app/navigation/navigation.component.html;
|
sed -i -e 's/GITTAGVERSION/'"$CI_COMMIT_TAG"':'"$CI_COMMIT_SHORT_SHA"'/' ./src/app/navigation/navigation.component.html;
|
||||||
|
sed -i -e 's,http://localhost:8080,https://api.hv.nober.de,' ./src/app/config.ts;
|
||||||
fi
|
fi
|
||||||
- npm install
|
- npm install
|
||||||
- ./node_modules/.bin/ng build --prod
|
- ./node_modules/.bin/ng build --prod
|
||||||
@ -80,4 +82,40 @@ dockerize-ui:
|
|||||||
docker push $IMAGE_NAME:${CI_COMMIT_TAG};
|
docker push $IMAGE_NAME:${CI_COMMIT_TAG};
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
.deploy:
|
||||||
|
image: registry.hottis.de/dockerized/docker-bash:latest
|
||||||
|
stage: deploy
|
||||||
|
tags:
|
||||||
|
- hottis
|
||||||
|
- linux
|
||||||
|
- docker
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- docker stop $CONTAINER_NAME || echo "container not running, never mind"
|
||||||
|
- docker rm $CONTAINER_NAME || echo "container not existing, never mind"
|
||||||
|
- docker run -d --network docker-server
|
||||||
|
--ip $CONTAINER_IP
|
||||||
|
$VOLUMEOPT
|
||||||
|
--name $CONTAINER_NAME
|
||||||
|
--restart always
|
||||||
|
$IMAGE_NAME:$CI_COMMIT_TAG
|
||||||
|
|
||||||
|
deploy-api:
|
||||||
|
extends:
|
||||||
|
- .deploy
|
||||||
|
variables:
|
||||||
|
IMAGE_NAME: ${CI_REGISTRY}/${CI_PROJECT_PATH}/api
|
||||||
|
CONTAINER_NAME: hv2-api
|
||||||
|
CONTAINER_IP: 172.16.10.38
|
||||||
|
VOLUMEOPT: -v hv2-api-conf:/opt/app/config
|
||||||
|
|
||||||
|
deploy-ui:
|
||||||
|
extends:
|
||||||
|
- .deploy
|
||||||
|
variables:
|
||||||
|
IMAGE_NAME: ${CI_REGISTRY}/${CI_PROJECT_PATH}/ui
|
||||||
|
CONTAINER_NAME: hv2-ui
|
||||||
|
CONTAINER_IP: 172.16.10.39
|
||||||
|
@ -1519,26 +1519,37 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
salutation:
|
salutation:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
firstname:
|
firstname:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
lastname:
|
lastname:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
address1:
|
address1:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
address2:
|
address2:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
address3:
|
address3:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
zip:
|
zip:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
city:
|
city:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
phone1:
|
phone1:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
phone2:
|
phone2:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
iban:
|
iban:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
account:
|
account:
|
||||||
type: integer
|
type: integer
|
||||||
premise:
|
premise:
|
||||||
@ -1549,6 +1560,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
street:
|
street:
|
||||||
type: string
|
type: string
|
||||||
zip:
|
zip:
|
||||||
@ -1563,12 +1575,15 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
premise:
|
premise:
|
||||||
type: integer
|
type: integer
|
||||||
|
nullable: true
|
||||||
area:
|
area:
|
||||||
type: number
|
type: number
|
||||||
flat_no:
|
flat_no:
|
||||||
type: integer
|
type: integer
|
||||||
|
nullable: true
|
||||||
overhead_advance:
|
overhead_advance:
|
||||||
description: overhead_advance
|
description: overhead_advance
|
||||||
type: object
|
type: object
|
||||||
@ -1577,12 +1592,15 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
amount:
|
amount:
|
||||||
type: number
|
type: number
|
||||||
startdate:
|
startdate:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
enddate:
|
enddate:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
overhead_advance_flat_mapping:
|
overhead_advance_flat_mapping:
|
||||||
description: overhead_advance_flat_mapping
|
description: overhead_advance_flat_mapping
|
||||||
type: object
|
type: object
|
||||||
@ -1601,8 +1619,10 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
premise:
|
premise:
|
||||||
type: integer
|
type: integer
|
||||||
|
nullable: true
|
||||||
commercial_premise:
|
commercial_premise:
|
||||||
description: commercial_premise
|
description: commercial_premise
|
||||||
type: object
|
type: object
|
||||||
@ -1611,8 +1631,10 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
premise:
|
premise:
|
||||||
type: integer
|
type: integer
|
||||||
|
nullable: true
|
||||||
tenancy:
|
tenancy:
|
||||||
description: tenancy
|
description: tenancy
|
||||||
type: object
|
type: object
|
||||||
@ -1621,18 +1643,23 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
tenant:
|
tenant:
|
||||||
type: integer
|
type: integer
|
||||||
flat:
|
flat:
|
||||||
type: integer
|
type: integer
|
||||||
|
nullable: true
|
||||||
parking:
|
parking:
|
||||||
type: integer
|
type: integer
|
||||||
|
nullable: true
|
||||||
commercial_premise:
|
commercial_premise:
|
||||||
type: integer
|
type: integer
|
||||||
|
nullable: true
|
||||||
startdate:
|
startdate:
|
||||||
type: string
|
type: string
|
||||||
enddate:
|
enddate:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
fee:
|
fee:
|
||||||
description: fee
|
description: fee
|
||||||
type: object
|
type: object
|
||||||
@ -1641,14 +1668,17 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
amount:
|
amount:
|
||||||
type: number
|
type: number
|
||||||
fee_type:
|
fee_type:
|
||||||
type: string
|
type: string
|
||||||
startdate:
|
startdate:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
enddate:
|
enddate:
|
||||||
type: string
|
type: string
|
||||||
|
nullable: true
|
||||||
tenancy_fee_mapping:
|
tenancy_fee_mapping:
|
||||||
description: tenancy_fee_mapping
|
description: tenancy_fee_mapping
|
||||||
type: object
|
type: object
|
||||||
|
@ -151,5 +151,8 @@ components:
|
|||||||
#for $column in $table.columns
|
#for $column in $table.columns
|
||||||
$column.name:
|
$column.name:
|
||||||
type: $column.apitype
|
type: $column.apitype
|
||||||
|
#if (('notnull' not in $column) or (not $column.notnull))
|
||||||
|
nullable: true
|
||||||
|
#end if
|
||||||
#end for
|
#end for
|
||||||
#end for
|
#end for
|
||||||
|
@ -3,10 +3,16 @@ from flask_cors import CORS
|
|||||||
|
|
||||||
# instantiate the webservice
|
# instantiate the webservice
|
||||||
app = connexion.App(__name__)
|
app = connexion.App(__name__)
|
||||||
app.add_api('openapi.yaml')
|
app.add_api('openapi.yaml', options = {"swagger_ui": False})
|
||||||
|
|
||||||
# CORSify it - otherwise Angular won't accept it
|
# CORSify it - otherwise Angular won't accept it
|
||||||
CORS(app.app)
|
CORS(app.app,
|
||||||
|
origins=[
|
||||||
|
"http://localhost:4200",
|
||||||
|
"https://base.hv.nober.de"
|
||||||
|
],
|
||||||
|
supports_credentials=True
|
||||||
|
)
|
||||||
|
|
||||||
# provide the webservice application to uwsgi
|
# provide the webservice application to uwsgi
|
||||||
application = app.app
|
application = app.app
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
<mat-sidenav #drawer class="sidenav" fixedInViewport
|
<mat-sidenav #drawer class="sidenav" fixedInViewport
|
||||||
[attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
|
[attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
|
||||||
[mode]="(isHandset$ | async) ? 'over' : 'side'"
|
[mode]="(isHandset$ | async) ? 'over' : 'side'"
|
||||||
[opened]="(isHandset$ | async) === false">
|
[opened]="(isHandset$ | async) === false"
|
||||||
|
*ngIf="authenticated">
|
||||||
<mat-toolbar>Menu</mat-toolbar>
|
<mat-toolbar>Menu</mat-toolbar>
|
||||||
<mat-nav-list>
|
<mat-nav-list>
|
||||||
<a mat-list-item href="/tenants">Meine Mieter/innen</a>
|
<a mat-list-item href="/tenants">Meine Mieter/innen</a>
|
||||||
|
@ -98,7 +98,8 @@
|
|||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<mat-accordion>
|
<mat-accordion>
|
||||||
<mat-expansion-panel (opened)="collapseTenancies = true"
|
<mat-expansion-panel #panelTenancies
|
||||||
|
(opened)="collapseTenancies = true"
|
||||||
(closed)="collapseTenancies = false">
|
(closed)="collapseTenancies = false">
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title *ngIf="!collapseTenancies">
|
<mat-panel-title *ngIf="!collapseTenancies">
|
||||||
@ -138,6 +139,54 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
|
<mat-expansion-panel #panelAddMapping
|
||||||
|
(opened)="openTenancyMapping()"
|
||||||
|
(closed)="closeTenancyMapping()">
|
||||||
|
<mat-expansion-panel-header>
|
||||||
|
<mat-panel-title *ngIf="!collapseTenancyMapping">
|
||||||
|
Mietverhältnis hinzufügen
|
||||||
|
</mat-panel-title>
|
||||||
|
<mat-panel-description>
|
||||||
|
</mat-panel-description>
|
||||||
|
</mat-expansion-panel-header>
|
||||||
|
<div>
|
||||||
|
<form (ngSubmit)="addTenancyToTenant()">
|
||||||
|
<div>
|
||||||
|
<mat-form-field appearance="outline" id="setenddatefield">
|
||||||
|
<mat-label>Beginn</mat-label>
|
||||||
|
<input matInput name="startdate" [(ngModel)]="newTenancy.startdate" [matDatepicker]="newtenancystartdatepicker"/>
|
||||||
|
<mat-datepicker-toggle matSuffix [for]="newtenancystartdatepicker"></mat-datepicker-toggle>
|
||||||
|
<mat-datepicker #newtenancystartdatepicker></mat-datepicker>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Beschreibung</mat-label>
|
||||||
|
<input matInput name="description" [(ngModel)]="newTenancy.description"/>
|
||||||
|
</mat-form-field>
|
||||||
|
</div><div>
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-select #mapSelect [(ngModel)]="newTenancy.flat" name="flat" (selectionChange)="flatSelected()">
|
||||||
|
<mat-label>Wohnung</mat-label>
|
||||||
|
<mat-option *ngFor="let p of allFlats" [value]="p.rawFlat.id">{{p.rawFlat.description}} {{p.premise}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Garage</mat-label>
|
||||||
|
<mat-select #mapSelect [(ngModel)]="newTenancy.parking" name="parking" (selectionChange)="parkingSelected()">
|
||||||
|
<mat-option *ngFor="let p of allParkings" [value]="p.rawParking.id">{{p.rawParking.description}} {{p.premise}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Büro</mat-label>
|
||||||
|
<mat-select #mapSelect [(ngModel)]="newTenancy.commercial_premise" name="commercial_premise" (selectionChange)="commercialPremiseSelected()">
|
||||||
|
<mat-option *ngFor="let p of allCommercialPremises" [value]="p.rawCommercialPremise.id">{{p.rawCommercialPremise.description}} {{p.premise}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<button #addTenancyToTenantButton type="submit" mat-raised-button color="primary">Anlegen</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</mat-expansion-panel>
|
||||||
</mat-accordion>
|
</mat-accordion>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
@ -6,6 +6,7 @@ import { MessageService } from '../message.service';
|
|||||||
import { MatButton } from '@angular/material/button';
|
import { MatButton } from '@angular/material/button';
|
||||||
import { MatTableDataSource } from '@angular/material/table';
|
import { MatTableDataSource } from '@angular/material/table';
|
||||||
import { ExtApiService } from '../ext-data-object-service';
|
import { ExtApiService } from '../ext-data-object-service';
|
||||||
|
import { MatExpansionPanel } from '@angular/material/expansion';
|
||||||
|
|
||||||
|
|
||||||
interface DN_Tenancy {
|
interface DN_Tenancy {
|
||||||
@ -15,6 +16,21 @@ interface DN_Tenancy {
|
|||||||
commercialPremise: string
|
commercialPremise: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface DN_Flat {
|
||||||
|
rawFlat: Flat
|
||||||
|
premise: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DN_Parking {
|
||||||
|
rawParking: Parking
|
||||||
|
premise: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DN_CommercialPremise {
|
||||||
|
rawCommercialPremise: CommercialPremise
|
||||||
|
premise: string
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-tenant-details',
|
selector: 'app-tenant-details',
|
||||||
templateUrl: './tenant-details.component.html',
|
templateUrl: './tenant-details.component.html',
|
||||||
@ -27,12 +43,15 @@ export class TenantDetailsComponent implements OnInit {
|
|||||||
|
|
||||||
account: Account = NULL_Account
|
account: Account = NULL_Account
|
||||||
|
|
||||||
|
premisesMap: Map<number, Premise>
|
||||||
|
|
||||||
tenancies: DN_Tenancy[]
|
tenancies: DN_Tenancy[]
|
||||||
tenancyDataSource: MatTableDataSource<DN_Tenancy>
|
tenancyDataSource: MatTableDataSource<DN_Tenancy>
|
||||||
tenancyDisplayColumns: string[] = [ "description", "flat", "parking", "commercial_premise", "startdate", "enddate" ]
|
tenancyDisplayColumns: string[] = [ "description", "flat", "parking", "commercial_premise", "startdate", "enddate" ]
|
||||||
|
|
||||||
collapseTenantDetails: boolean = false
|
collapseTenantDetails: boolean = false
|
||||||
collapseTenancies: boolean = false
|
collapseTenancies: boolean = false
|
||||||
|
collapseTenancyMapping: boolean = false
|
||||||
|
|
||||||
selectedTenancy: Tenancy = undefined
|
selectedTenancy: Tenancy = undefined
|
||||||
mappedFees: Fee[]
|
mappedFees: Fee[]
|
||||||
@ -41,9 +60,15 @@ export class TenantDetailsComponent implements OnInit {
|
|||||||
allFees: Fee[]
|
allFees: Fee[]
|
||||||
selectedFee: number
|
selectedFee: number
|
||||||
|
|
||||||
|
newTenancy: Tenancy = NULL_Tenancy
|
||||||
|
allFlats: DN_Flat[]
|
||||||
|
allParkings: DN_Parking[]
|
||||||
|
allCommercialPremises: DN_CommercialPremise[]
|
||||||
|
|
||||||
@ViewChild('submitButton') submitButton: MatButton
|
@ViewChild('submitButton') submitButton: MatButton
|
||||||
@ViewChild('mapFeeButton') mapFeeButton: MatButton
|
@ViewChild('mapFeeButton') mapFeeButton: MatButton
|
||||||
|
@ViewChild('panelTenancies') panelTenancies: MatExpansionPanel
|
||||||
|
@ViewChild('panelAddMapping') panelAddMapping: MatExpansionPanel
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private tenantService: TenantService,
|
private tenantService: TenantService,
|
||||||
@ -78,20 +103,16 @@ export class TenantDetailsComponent implements OnInit {
|
|||||||
async getTenancies(): Promise<void> {
|
async getTenancies(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
this.tenancies = []
|
this.tenancies = []
|
||||||
const premises: Premise[] = await this.premiseService.getPremises()
|
await this.getPremises()
|
||||||
const premisesDict = new Map<number, Premise>()
|
|
||||||
for (let p of premises) {
|
|
||||||
premisesDict.set(p.id, p)
|
|
||||||
}
|
|
||||||
for (let t of await this.tenancyService.getTenancysByTenant(this.tenant.id)) {
|
for (let t of await this.tenancyService.getTenancysByTenant(this.tenant.id)) {
|
||||||
const flat: Flat = (t.flat) ? await this.flatService.getFlat(t.flat) : NULL_Flat
|
const flat: Flat = (t.flat) ? await this.flatService.getFlat(t.flat) : NULL_Flat
|
||||||
const parking: Parking = (t.parking) ? await this.parkingService.getParking(t.parking) : NULL_Parking
|
const parking: Parking = (t.parking) ? await this.parkingService.getParking(t.parking) : NULL_Parking
|
||||||
const commercialPremise: CommercialPremise = (t.commercial_premise) ? await this.commercialPremiseService.getCommercialPremise(t.commercial_premise) : NULL_CommercialPremise
|
const commercialPremise: CommercialPremise = (t.commercial_premise) ? await this.commercialPremiseService.getCommercialPremise(t.commercial_premise) : NULL_CommercialPremise
|
||||||
this.tenancies.push({
|
this.tenancies.push({
|
||||||
rawTenancy: t,
|
rawTenancy: t,
|
||||||
flat: (flat != NULL_Flat) ? `${flat.description} (${premisesDict.get(flat.premise).description})` : '',
|
flat: (flat != NULL_Flat) ? `${flat.description} (${this.premisesMap.get(flat.premise).description})` : '',
|
||||||
parking: (parking != NULL_Parking) ? `${parking.description} (${premisesDict.get(parking.premise).description})` : '',
|
parking: (parking != NULL_Parking) ? `${parking.description} (${this.premisesMap.get(parking.premise).description})` : '',
|
||||||
commercialPremise: (commercialPremise != NULL_CommercialPremise) ? `${commercialPremise.description} (${premisesDict.get(commercialPremise.premise).description})` : ''
|
commercialPremise: (commercialPremise != NULL_CommercialPremise) ? `${commercialPremise.description} (${this.premisesMap.get(commercialPremise.premise).description})` : ''
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.tenancyDataSource = new MatTableDataSource<DN_Tenancy>(this.tenancies)
|
this.tenancyDataSource = new MatTableDataSource<DN_Tenancy>(this.tenancies)
|
||||||
@ -156,7 +177,25 @@ export class TenantDetailsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async addFee() {
|
async getPremises(): Promise<void> {
|
||||||
|
if ((! this.premisesMap) || (this.premisesMap.size == 0)) {
|
||||||
|
try {
|
||||||
|
this.messageService.add("Trying to load premises")
|
||||||
|
const premises = await this.premiseService.getPremises()
|
||||||
|
this.premisesMap = new Map<number, Premise>()
|
||||||
|
for (let p of premises) {
|
||||||
|
this.premisesMap.set(p.id, p)
|
||||||
|
}
|
||||||
|
this.messageService.add("Premises loaded")
|
||||||
|
} catch (err) {
|
||||||
|
this.messageService.add(`Error in getPremises: ${ JSON.stringify(err, undefined, 4) }`)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.messageService.add("Premises already loaded")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async addFee(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
this.mapFeeButton.disabled = true
|
this.mapFeeButton.disabled = true
|
||||||
this.messageService.add(`fee: ${ JSON.stringify(this.selectedFee, undefined, 4) }`)
|
this.messageService.add(`fee: ${ JSON.stringify(this.selectedFee, undefined, 4) }`)
|
||||||
@ -174,6 +213,79 @@ export class TenantDetailsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async openTenancyMapping(): Promise<void> {
|
||||||
|
this.messageService.add("TenancyMapping opened")
|
||||||
|
this.collapseTenancyMapping = true
|
||||||
|
await this.getPremises()
|
||||||
|
if (! this.allFlats) {
|
||||||
|
let flats = await this.flatService.getFlats()
|
||||||
|
this.allFlats = []
|
||||||
|
for (let p of flats) {
|
||||||
|
this.allFlats.push({
|
||||||
|
rawFlat: p,
|
||||||
|
premise: this.premisesMap.get(p.premise).description
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! this.allParkings) {
|
||||||
|
let parkings = await this.parkingService.getParkings()
|
||||||
|
this.allParkings = []
|
||||||
|
for (let p of parkings) {
|
||||||
|
this.allParkings.push({
|
||||||
|
rawParking: p,
|
||||||
|
premise: this.premisesMap.get(p.premise).description
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! this.allCommercialPremises) {
|
||||||
|
let commercialPremises = await this.commercialPremiseService.getCommercialPremises()
|
||||||
|
this.allCommercialPremises = []
|
||||||
|
for (let p of commercialPremises) {
|
||||||
|
this.allCommercialPremises.push({
|
||||||
|
rawCommercialPremise: p,
|
||||||
|
premise: this.premisesMap.get(p.premise).description
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async closeTenancyMapping(): Promise<void> {
|
||||||
|
this.messageService.add("TenancyMapping closed")
|
||||||
|
this.collapseTenancyMapping = false
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
flatSelected(): void {
|
||||||
|
this.newTenancy.parking = null
|
||||||
|
this.newTenancy.commercial_premise = null
|
||||||
|
}
|
||||||
|
|
||||||
|
parkingSelected(): void {
|
||||||
|
this.newTenancy.flat = null
|
||||||
|
this.newTenancy.commercial_premise = null
|
||||||
|
}
|
||||||
|
|
||||||
|
commercialPremiseSelected(): void {
|
||||||
|
this.newTenancy.parking = null
|
||||||
|
this.newTenancy.flat = null
|
||||||
|
}
|
||||||
|
|
||||||
|
async addTenancyToTenant(): Promise<void> {
|
||||||
|
try {
|
||||||
|
this.messageService.add(`Going to mapping ${JSON.stringify(this.newTenancy, undefined, 4)}`)
|
||||||
|
this.newTenancy.tenant = this.tenant.id
|
||||||
|
this.messageService.add(`new tenancy is ${JSON.stringify(this.newTenancy, undefined, 4)}`)
|
||||||
|
this.newTenancy = await this.tenancyService.postTenancy(this.newTenancy)
|
||||||
|
this.messageService.add(`New tenancy added with id ${this.newTenancy.id}`)
|
||||||
|
this.panelAddMapping.close()
|
||||||
|
this.panelTenancies.open()
|
||||||
|
this.getTenancies()
|
||||||
|
} catch (err) {
|
||||||
|
this.messageService.add(`Error in addTenancyToTenant: ${ JSON.stringify(err, undefined, 4)}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.getTenant()
|
this.getTenant()
|
||||||
this.getFees()
|
this.getFees()
|
||||||
|
Reference in New Issue
Block a user