diff --git a/backend/models/owner.js b/backend/models/owner.js
index 08fd47a..e3ba19a 100644
--- a/backend/models/owner.js
+++ b/backend/models/owner.js
@@ -8,6 +8,8 @@ const ownerSchema = mongoose.Schema({
taxValue: {type: Number },
vat: {type: Boolean, required:true, default: false},
vatValue: {type: Number },
+ first: {type: String, required:true},
+ last: {type: String, required:true},
email: {type: String, required:true},
street: {type: String, required:true},
city: {type: String, required: true},
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 9b564aa..5d82831 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -15,6 +15,7 @@ import { MatListModule } from '@angular/material/list';
import { MatSelectModule } from '@angular/material/select';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatStepperModule } from '@angular/material/stepper';
+import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@@ -34,6 +35,7 @@ import { ScanComponent } from './scan/scan.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { BusinessComponent } from './business/business.component';
import { SearchOptionsPipe } from './searchoptions.pipe';
+import { TermsComponent } from './terms/terms.component';
@NgModule({
declarations: [
@@ -52,7 +54,8 @@ import { SearchOptionsPipe } from './searchoptions.pipe';
ScanComponent,
ListOrdersComponent,
BusinessComponent,
- SearchOptionsPipe
+ SearchOptionsPipe,
+ TermsComponent
],
imports: [
BrowserModule,
@@ -73,6 +76,7 @@ import { SearchOptionsPipe } from './searchoptions.pipe';
MatProgressBarModule,
MatStepperModule,
MatAutocompleteModule,
+ MatSlideToggleModule,
BrowserAnimationsModule
],
exports: [
diff --git a/src/app/business/business.component.css b/src/app/business/business.component.css
index 7f5fde1..0dfb096 100644
--- a/src/app/business/business.component.css
+++ b/src/app/business/business.component.css
@@ -9,3 +9,10 @@ mat-card.centercard{
::ng-deep .mat-step-label{
font-size: 13px;
}
+::ng-deep .mat-slide-toggle-content{
+ font-family: 'Spartan', sans-serif;
+ font-size: 11px;
+}
+a.link{
+ text-decoration: underline;
+}
diff --git a/src/app/business/business.component.html b/src/app/business/business.component.html
index 406f70c..59cbcb1 100644
--- a/src/app/business/business.component.html
+++ b/src/app/business/business.component.html
@@ -10,6 +10,14 @@
Business Name
+
+ Contact First Name
+
+
+
+ Contact Last Name
+
+
Address
@@ -43,8 +51,11 @@
Website
+
+ I accept the Terms of Use
+
-
+
diff --git a/src/app/business/business.component.ts b/src/app/business/business.component.ts
index d0a5cf0..daffb0f 100644
--- a/src/app/business/business.component.ts
+++ b/src/app/business/business.component.ts
@@ -6,6 +6,7 @@ import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import { filter, startWith, map, switchMap } from 'rxjs/operators';
import { MatStepper } from '@angular/material/stepper';
+import { MatSlideToggleChange } from '@angular/material/slide-toggle';
import { Country } from '../country.model';
import { Owner } from '../owner.model';
import { User } from '../user.model';
@@ -13,6 +14,7 @@ import { UserService } from '../user.service';
import { FullnodeService } from '../fullnode.service';
import { SearchOptionsPipe } from '../searchoptions.pipe';
import { ScanComponent } from '../scan/scan.component';
+import { TermsComponent } from '../terms/terms.component';
@Component({
selector: 'app-business',
@@ -50,6 +52,8 @@ export class BusinessComponent implements OnInit {
vatValue: 0,
phone: '',
paid: false,
+ first: '',
+ last: '',
name: '',
street: '',
city: '',
@@ -65,6 +69,7 @@ export class BusinessComponent implements OnInit {
public userUpdate: Observable;
sessionId = '';
ownerKnown = false;
+ termsChecked = false;
constructor(
private fb: FormBuilder,
@@ -85,13 +90,16 @@ export class BusinessComponent implements OnInit {
});
this.bizForm = fb.group({
name: ['', Validators.required],
+ first: ['', Validators.required],
+ last: ['', Validators.required],
street: ['', Validators.required],
city: ['', Validators.required],
state: ['', Validators.required],
postal: ['', Validators.required],
country: ['', Validators.required],
email: ['', [Validators.email, Validators.required]],
- website: ['']
+ website: [''],
+ terms: [false]
});
this.payForm= fb.group({
session: ['', Validators.required]
@@ -116,6 +124,22 @@ export class BusinessComponent implements OnInit {
});
}
+ onChange(ob: MatSlideToggleChange){
+ console.log(ob.checked);
+ this.termsChecked = ob.checked;
+ }
+
+ showTerms() {
+ const dialogConfig = new MatDialogConfig();
+ dialogConfig.disableClose = true;
+ dialogConfig.autoFocus = true;
+
+ const dialogRef = this.dialog.open(TermsComponent, dialogConfig);
+ dialogRef.afterClosed().subscribe(val => {
+ console.log('Terms read');
+ });
+ }
+
save() {
this.owner = {
address: '',
@@ -124,6 +148,8 @@ export class BusinessComponent implements OnInit {
taxValue: 0,
vat: false,
vatValue: 0,
+ first: '',
+ last: '',
phone: '',
paid: false,
name: this.bizForm.get('name')!.value,
diff --git a/src/app/fullnode.service.ts b/src/app/fullnode.service.ts
index 1d186d4..69f469f 100644
--- a/src/app/fullnode.service.ts
+++ b/src/app/fullnode.service.ts
@@ -31,6 +31,8 @@ export class FullnodeService{
taxValue: 0,
vat: false,
vatValue: 0,
+ first: '',
+ last: '',
email: '',
street: '',
city: '',
diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts
index f47f239..09d04e9 100644
--- a/src/app/header/header.component.ts
+++ b/src/app/header/header.component.ts
@@ -24,6 +24,8 @@ export class HeaderComponent implements OnInit, OnDestroy {
taxValue: 0,
vat: false,
vatValue: 0,
+ first: '',
+ last: '',
email: '',
street: '',
city: '',
diff --git a/src/app/items/item-list/item-list.component.ts b/src/app/items/item-list/item-list.component.ts
index 951594f..1b3dad7 100644
--- a/src/app/items/item-list/item-list.component.ts
+++ b/src/app/items/item-list/item-list.component.ts
@@ -29,6 +29,8 @@ export class ItemListComponent implements OnInit{
taxValue: 0,
vat: false,
vatValue: 0,
+ first: '',
+ last: '',
email: '',
street: '',
city: '',
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts
index 0785074..84e9bf6 100644
--- a/src/app/login/login.component.ts
+++ b/src/app/login/login.component.ts
@@ -47,6 +47,8 @@ export class LoginComponent implements OnInit, AfterViewInit {
taxValue:0,
vat: false,
vatValue: 0,
+ first: '',
+ last: '',
email: '',
street: '',
city: '',
diff --git a/src/app/order/order.service.ts b/src/app/order/order.service.ts
index 1767895..f4b0ce2 100644
--- a/src/app/order/order.service.ts
+++ b/src/app/order/order.service.ts
@@ -31,6 +31,8 @@ export class OrderService {
taxValue: 0,
vat: false,
vatValue: 0,
+ first: '',
+ last: '',
email: '',
street: '',
city: '',
diff --git a/src/app/owner.model.ts b/src/app/owner.model.ts
index 6194c42..73771c8 100644
--- a/src/app/owner.model.ts
+++ b/src/app/owner.model.ts
@@ -7,6 +7,8 @@ export interface Owner {
taxValue: number;
vat: boolean;
vatValue: number;
+ first: string;
+ last: string;
email: string;
street: string;
city: string;
diff --git a/src/app/user.service.ts b/src/app/user.service.ts
index 00e2a27..d98abdf 100644
--- a/src/app/user.service.ts
+++ b/src/app/user.service.ts
@@ -27,6 +27,8 @@ export class UserService{
taxValue: 0,
vat: false,
vatValue: 0,
+ first: '',
+ last: '',
email: '',
street: '',
city: '',
diff --git a/src/app/viewer/viewer.component.ts b/src/app/viewer/viewer.component.ts
index 9725032..67ec89a 100644
--- a/src/app/viewer/viewer.component.ts
+++ b/src/app/viewer/viewer.component.ts
@@ -37,6 +37,8 @@ export class ViewerComponent implements OnInit {
taxValue: 0,
vat: false,
vatValue: 0,
+ first: '',
+ last: '',
email: '',
street: '',
city: '',
@@ -115,7 +117,7 @@ export class ViewerComponent implements OnInit {
loginCheck(){
var today = new Date().getTime() / 1000;
//console.log('User check', this.user.validated);
- if (this.user.expiration < today || !this.user.validated) {
+ if (!this.owner.paid || !this.user.validated) {
console.log('Log in expired!');
this.router.navigate(['/login']);
}