add NULL objects to template

This commit is contained in:
Wolfgang Hottgenroth 2021-09-02 15:37:43 +02:00
parent 13c9cb4d96
commit ce4ff75bca
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
2 changed files with 96 additions and 0 deletions

View File

@ -10,6 +10,10 @@ export interface Account {
id: number
description: string
}
export const NULL_Account: Account = {
id: 0
,description: ''
}
export interface Tenant {
id: number
@ -26,6 +30,21 @@ export interface Tenant {
iban: string
account: number
}
export const NULL_Tenant: Tenant = {
id: 0
,salutation: ''
,firstname: ''
,lastname: ''
,address1: ''
,address2: ''
,address3: ''
,zip: ''
,city: ''
,phone1: ''
,phone2: ''
,iban: ''
,account: 0
}
export interface Premise {
id: number
@ -34,6 +53,13 @@ export interface Premise {
zip: string
city: string
}
export const NULL_Premise: Premise = {
id: 0
,description: ''
,street: ''
,zip: ''
,city: ''
}
export interface Flat {
id: number
@ -42,6 +68,13 @@ export interface Flat {
area: number
flat_no: number
}
export const NULL_Flat: Flat = {
id: 0
,description: ''
,premise: 0
,area: 0
,flat_no: 0
}
export interface OverheadAdvance {
id: number
@ -50,24 +83,46 @@ export interface OverheadAdvance {
startdate: string
enddate: string
}
export const NULL_OverheadAdvance: OverheadAdvance = {
id: 0
,description: ''
,amount: 0
,startdate: ''
,enddate: ''
}
export interface OverheadAdvanceFlatMapping {
id: number
overhead_advance: number
flat: number
}
export const NULL_OverheadAdvanceFlatMapping: OverheadAdvanceFlatMapping = {
id: 0
,overhead_advance: 0
,flat: 0
}
export interface Parking {
id: number
description: string
premise: number
}
export const NULL_Parking: Parking = {
id: 0
,description: ''
,premise: 0
}
export interface CommercialPremise {
id: number
description: string
premise: number
}
export const NULL_CommercialPremise: CommercialPremise = {
id: 0
,description: ''
,premise: 0
}
export interface Tenancy {
id: number
@ -79,6 +134,16 @@ export interface Tenancy {
startdate: string
enddate: string
}
export const NULL_Tenancy: Tenancy = {
id: 0
,description: ''
,tenant: 0
,flat: 0
,parking: 0
,commercial_premise: 0
,startdate: ''
,enddate: ''
}
export interface Fee {
id: number
@ -88,12 +153,25 @@ export interface Fee {
startdate: string
enddate: string
}
export const NULL_Fee: Fee = {
id: 0
,description: ''
,amount: 0
,fee_type: ''
,startdate: ''
,enddate: ''
}
export interface TenancyFeeMapping {
id: number
tenancy: number
fee: number
}
export const NULL_TenancyFeeMapping: TenancyFeeMapping = {
id: 0
,tenancy: 0
,fee: 0
}
export interface AccountEntry {
id: number
@ -102,5 +180,12 @@ export interface AccountEntry {
created_at: string
amount: number
}
export const NULL_AccountEntry: AccountEntry = {
id: 0
,description: ''
,account: 0
,created_at: ''
,amount: 0
}

View File

@ -9,6 +9,17 @@ export interface $JsNameConverter($table.name) {
${column.name}: ${column.jstype}
#end for
}
export const NULL_$JsNameConverter($table.name): $JsNameConverter($table.name) = {
id: 0
#for $column in $table.columns
,${column.name}: #slurp
#if $column.jstype == "string"
''
#else if $column.jstype == "number"
0
#end if
#end for
}
#end for