Kobus 5 роки тому
джерело
коміт
3892977698

+ 2
- 0
UnivateProperties_API/Context/DataContext.cs Переглянути файл

@@ -8,6 +8,7 @@ using System.Linq;
8 8
 using UnivateProperties_API.Model;
9 9
 using UnivateProperties_API.Model.Bank;
10 10
 using UnivateProperties_API.Model.Misc;
11
+using UnivateProperties_API.Model.ProcessFlow;
11 12
 
12 13
 namespace UnivateProperties_API.Context
13 14
 {
@@ -55,6 +56,7 @@ namespace UnivateProperties_API.Context
55 56
         public DbSet<Season> Seasons { get; set; }
56 57
         public DbSet<Bank> Banks { get; set; }
57 58
         public DbSet<BankAccount> BankAccounts { get; set; }
59
+        public DbSet<ProcessFlow> ProcessFlows { get; set; }
58 60
         #endregion Timeshare
59 61
 
60 62
         public override int SaveChanges()

+ 951
- 0
UnivateProperties_API/Migrations/20190905133540_BanksAddresses.Designer.cs Переглянути файл

@@ -0,0 +1,951 @@
1
+// <auto-generated />
2
+using System;
3
+using Microsoft.EntityFrameworkCore;
4
+using Microsoft.EntityFrameworkCore.Infrastructure;
5
+using Microsoft.EntityFrameworkCore.Migrations;
6
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
8
+using UnivateProperties_API.Context;
9
+
10
+namespace UnivateProperties_API.Migrations
11
+{
12
+    [DbContext(typeof(DataContext))]
13
+    [Migration("20190905133540_BanksAddresses")]
14
+    partial class BanksAddresses
15
+    {
16
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
17
+        {
18
+#pragma warning disable 612, 618
19
+            modelBuilder
20
+                .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
21
+                .HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
22
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
23
+
24
+            modelBuilder.Entity("UnivateProperties_API.Model.Bank.Bank", b =>
25
+                {
26
+                    b.Property<int>("Id")
27
+                        .ValueGeneratedOnAdd();
28
+
29
+                    b.Property<DateTime>("Created");
30
+
31
+                    b.Property<DateTime>("Modified");
32
+
33
+                    b.Property<string>("ModifiedBy");
34
+
35
+                    b.Property<string>("Name");
36
+
37
+                    b.Property<string>("UniversalBranchCode");
38
+
39
+                    b.HasKey("Id");
40
+
41
+                    b.ToTable("Banks");
42
+                });
43
+
44
+            modelBuilder.Entity("UnivateProperties_API.Model.Bank.BankAccount", b =>
45
+                {
46
+                    b.Property<int>("Id")
47
+                        .ValueGeneratedOnAdd();
48
+
49
+                    b.Property<string>("AccountHolder");
50
+
51
+                    b.Property<string>("AccountNumber");
52
+
53
+                    b.Property<int>("BankId");
54
+
55
+                    b.Property<DateTime>("Created");
56
+
57
+                    b.Property<DateTime>("Modified");
58
+
59
+                    b.Property<string>("ModifiedBy");
60
+
61
+                    b.Property<int?>("OwnerId");
62
+
63
+                    b.HasKey("Id");
64
+
65
+                    b.HasIndex("BankId");
66
+
67
+                    b.HasIndex("OwnerId");
68
+
69
+                    b.ToTable("BankAccounts");
70
+                });
71
+
72
+            modelBuilder.Entity("UnivateProperties_API.Model.Communication.Email", b =>
73
+                {
74
+                    b.Property<int>("Id")
75
+                        .ValueGeneratedOnAdd();
76
+
77
+                    b.Property<string>("BCC");
78
+
79
+                    b.Property<string>("Body");
80
+
81
+                    b.Property<string>("CC");
82
+
83
+                    b.Property<string>("Comment");
84
+
85
+                    b.Property<DateTime>("Created");
86
+
87
+                    b.Property<bool>("IsBodyHtml");
88
+
89
+                    b.Property<DateTime>("Modified");
90
+
91
+                    b.Property<string>("ModifiedBy");
92
+
93
+                    b.Property<int>("SenderId");
94
+
95
+                    b.Property<string>("Subject");
96
+
97
+                    b.Property<string>("To");
98
+
99
+                    b.Property<string>("ToDisplay");
100
+
101
+                    b.HasKey("Id");
102
+
103
+                    b.HasIndex("SenderId");
104
+
105
+                    b.ToTable("Emails");
106
+                });
107
+
108
+            modelBuilder.Entity("UnivateProperties_API.Model.Communication.SMTPAccount", b =>
109
+                {
110
+                    b.Property<int>("Id")
111
+                        .ValueGeneratedOnAdd();
112
+
113
+                    b.Property<string>("Address");
114
+
115
+                    b.Property<DateTime>("Created");
116
+
117
+                    b.Property<string>("DisplayName");
118
+
119
+                    b.Property<DateTime>("Modified");
120
+
121
+                    b.Property<string>("ModifiedBy");
122
+
123
+                    b.Property<int>("SMTPHostId");
124
+
125
+                    b.HasKey("Id");
126
+
127
+                    b.HasIndex("SMTPHostId");
128
+
129
+                    b.ToTable("Accounts");
130
+                });
131
+
132
+            modelBuilder.Entity("UnivateProperties_API.Model.Communication.SMTPHost", b =>
133
+                {
134
+                    b.Property<int>("Id")
135
+                        .ValueGeneratedOnAdd();
136
+
137
+                    b.Property<DateTime>("Created");
138
+
139
+                    b.Property<string>("Host");
140
+
141
+                    b.Property<DateTime>("Modified");
142
+
143
+                    b.Property<string>("ModifiedBy");
144
+
145
+                    b.Property<bool>("NeedsAuthorize");
146
+
147
+                    b.Property<string>("Password");
148
+
149
+                    b.Property<bool>("UseSSL");
150
+
151
+                    b.Property<string>("User");
152
+
153
+                    b.HasKey("Id");
154
+
155
+                    b.ToTable("Hosts");
156
+                });
157
+
158
+            modelBuilder.Entity("UnivateProperties_API.Model.Misc.Address", b =>
159
+                {
160
+                    b.Property<int>("Id")
161
+                        .ValueGeneratedOnAdd();
162
+
163
+                    b.Property<string>("City");
164
+
165
+                    b.Property<DateTime>("Created");
166
+
167
+                    b.Property<DateTime>("Modified");
168
+
169
+                    b.Property<string>("ModifiedBy");
170
+
171
+                    b.Property<string>("PostalCode");
172
+
173
+                    b.Property<string>("Street");
174
+
175
+                    b.Property<string>("StreetNumber");
176
+
177
+                    b.Property<string>("Suburb");
178
+
179
+                    b.HasKey("Id");
180
+
181
+                    b.ToTable("Addresses");
182
+                });
183
+
184
+            modelBuilder.Entity("UnivateProperties_API.Model.ProcessFlow.ProcessFlow", b =>
185
+                {
186
+                    b.Property<int>("Id")
187
+                        .ValueGeneratedOnAdd();
188
+
189
+                    b.Property<DateTime>("Created");
190
+
191
+                    b.Property<DateTime>("Modified");
192
+
193
+                    b.Property<string>("ModifiedBy");
194
+
195
+                    b.Property<int?>("PropertyID");
196
+
197
+                    b.Property<int>("StatusID");
198
+
199
+                    b.Property<int?>("TimeshareID");
200
+
201
+                    b.HasKey("Id");
202
+
203
+                    b.HasIndex("PropertyID");
204
+
205
+                    b.HasIndex("StatusID");
206
+
207
+                    b.HasIndex("TimeshareID");
208
+
209
+                    b.ToTable("ProcessFlows");
210
+                });
211
+
212
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.Property", b =>
213
+                {
214
+                    b.Property<int>("Id")
215
+                        .ValueGeneratedOnAdd();
216
+
217
+                    b.Property<string>("AddressLine1");
218
+
219
+                    b.Property<string>("AddressLine2");
220
+
221
+                    b.Property<string>("AddressLine3");
222
+
223
+                    b.Property<int?>("AgencyId");
224
+
225
+                    b.Property<int?>("AgentId");
226
+
227
+                    b.Property<int>("CityId");
228
+
229
+                    b.Property<DateTime>("Created");
230
+
231
+                    b.Property<string>("CreatedBy");
232
+
233
+                    b.Property<string>("Description");
234
+
235
+                    b.Property<bool>("IsSale");
236
+
237
+                    b.Property<DateTime>("Modified");
238
+
239
+                    b.Property<string>("ModifiedBy");
240
+
241
+                    b.Property<decimal>("OperationalCosts");
242
+
243
+                    b.Property<int?>("OwnerId");
244
+
245
+                    b.Property<decimal>("Price");
246
+
247
+                    b.Property<string>("PricePer");
248
+
249
+                    b.Property<string>("PropertyName");
250
+
251
+                    b.Property<int>("PropertyTypeId");
252
+
253
+                    b.Property<int>("ProvinceId");
254
+
255
+                    b.Property<bool>("Published");
256
+
257
+                    b.Property<string>("ShortDescription");
258
+
259
+                    b.Property<int?>("StatusId");
260
+
261
+                    b.Property<int>("SuburbId");
262
+
263
+                    b.Property<string>("Unit");
264
+
265
+                    b.HasKey("Id");
266
+
267
+                    b.HasIndex("AgencyId");
268
+
269
+                    b.HasIndex("AgentId");
270
+
271
+                    b.HasIndex("CityId");
272
+
273
+                    b.HasIndex("OwnerId");
274
+
275
+                    b.HasIndex("PropertyTypeId");
276
+
277
+                    b.HasIndex("ProvinceId");
278
+
279
+                    b.HasIndex("StatusId");
280
+
281
+                    b.HasIndex("SuburbId");
282
+
283
+                    b.ToTable("Properties");
284
+                });
285
+
286
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyImage", b =>
287
+                {
288
+                    b.Property<int>("Id")
289
+                        .ValueGeneratedOnAdd();
290
+
291
+                    b.Property<DateTime>("Created");
292
+
293
+                    b.Property<string>("Image");
294
+
295
+                    b.Property<bool>("IsDefault");
296
+
297
+                    b.Property<DateTime>("Modified");
298
+
299
+                    b.Property<string>("ModifiedBy");
300
+
301
+                    b.Property<int>("PropertyId");
302
+
303
+                    b.HasKey("Id");
304
+
305
+                    b.HasIndex("PropertyId");
306
+
307
+                    b.ToTable("PropertyImages");
308
+                });
309
+
310
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyType", b =>
311
+                {
312
+                    b.Property<int>("Id")
313
+                        .ValueGeneratedOnAdd();
314
+
315
+                    b.Property<DateTime>("Created");
316
+
317
+                    b.Property<string>("Description");
318
+
319
+                    b.Property<DateTime>("Modified");
320
+
321
+                    b.Property<string>("ModifiedBy");
322
+
323
+                    b.Property<int>("UsageType");
324
+
325
+                    b.HasKey("Id");
326
+
327
+                    b.ToTable("PropertyTypes");
328
+                });
329
+
330
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyUserField", b =>
331
+                {
332
+                    b.Property<int>("Id")
333
+                        .ValueGeneratedOnAdd();
334
+
335
+                    b.Property<DateTime>("Created");
336
+
337
+                    b.Property<string>("Description");
338
+
339
+                    b.Property<DateTime>("Modified");
340
+
341
+                    b.Property<string>("ModifiedBy");
342
+
343
+                    b.Property<int>("PropertyId");
344
+
345
+                    b.Property<int>("UserDefinedFieldId");
346
+
347
+                    b.Property<string>("Value");
348
+
349
+                    b.HasKey("Id");
350
+
351
+                    b.HasIndex("PropertyId");
352
+
353
+                    b.HasIndex("UserDefinedFieldId");
354
+
355
+                    b.ToTable("PropertyUserFields");
356
+                });
357
+
358
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.UserDefinedField", b =>
359
+                {
360
+                    b.Property<int>("Id")
361
+                        .ValueGeneratedOnAdd();
362
+
363
+                    b.Property<DateTime>("Created");
364
+
365
+                    b.Property<string>("FieldName");
366
+
367
+                    b.Property<string>("FieldType");
368
+
369
+                    b.Property<int>("GroupId");
370
+
371
+                    b.Property<DateTime>("Modified");
372
+
373
+                    b.Property<string>("ModifiedBy");
374
+
375
+                    b.Property<int>("Rank");
376
+
377
+                    b.HasKey("Id");
378
+
379
+                    b.HasIndex("GroupId");
380
+
381
+                    b.ToTable("UserDefinedFields");
382
+                });
383
+
384
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.UserDefinedGroup", b =>
385
+                {
386
+                    b.Property<int>("Id")
387
+                        .ValueGeneratedOnAdd();
388
+
389
+                    b.Property<DateTime>("Created");
390
+
391
+                    b.Property<string>("Description");
392
+
393
+                    b.Property<DateTime>("Modified");
394
+
395
+                    b.Property<string>("ModifiedBy");
396
+
397
+                    b.Property<int>("Rank");
398
+
399
+                    b.Property<int>("UsageType");
400
+
401
+                    b.HasKey("Id");
402
+
403
+                    b.ToTable("UserDefinedGroups");
404
+                });
405
+
406
+            modelBuilder.Entity("UnivateProperties_API.Model.Region.City", b =>
407
+                {
408
+                    b.Property<int>("Id")
409
+                        .ValueGeneratedOnAdd();
410
+
411
+                    b.Property<string>("Code");
412
+
413
+                    b.Property<DateTime>("Created");
414
+
415
+                    b.Property<string>("Description");
416
+
417
+                    b.Property<DateTime>("Modified");
418
+
419
+                    b.Property<string>("ModifiedBy");
420
+
421
+                    b.Property<int>("ProvinceId");
422
+
423
+                    b.HasKey("Id");
424
+
425
+                    b.HasIndex("ProvinceId");
426
+
427
+                    b.ToTable("Cities");
428
+                });
429
+
430
+            modelBuilder.Entity("UnivateProperties_API.Model.Region.Province", b =>
431
+                {
432
+                    b.Property<int>("Id")
433
+                        .ValueGeneratedOnAdd();
434
+
435
+                    b.Property<string>("Code");
436
+
437
+                    b.Property<DateTime>("Created");
438
+
439
+                    b.Property<string>("Description");
440
+
441
+                    b.Property<DateTime>("Modified");
442
+
443
+                    b.Property<string>("ModifiedBy");
444
+
445
+                    b.HasKey("Id");
446
+
447
+                    b.ToTable("Provinces");
448
+                });
449
+
450
+            modelBuilder.Entity("UnivateProperties_API.Model.Region.Suburb", b =>
451
+                {
452
+                    b.Property<int>("Id")
453
+                        .ValueGeneratedOnAdd();
454
+
455
+                    b.Property<int>("CityId");
456
+
457
+                    b.Property<DateTime>("Created");
458
+
459
+                    b.Property<string>("Description");
460
+
461
+                    b.Property<DateTime>("Modified");
462
+
463
+                    b.Property<string>("ModifiedBy");
464
+
465
+                    b.Property<string>("PostalCode");
466
+
467
+                    b.HasKey("Id");
468
+
469
+                    b.HasIndex("CityId");
470
+
471
+                    b.ToTable("Suburbs");
472
+                });
473
+
474
+            modelBuilder.Entity("UnivateProperties_API.Model.Timeshare.Season", b =>
475
+                {
476
+                    b.Property<int>("Id")
477
+                        .ValueGeneratedOnAdd();
478
+
479
+                    b.Property<DateTime>("Created");
480
+
481
+                    b.Property<DateTime>("Modified");
482
+
483
+                    b.Property<string>("ModifiedBy");
484
+
485
+                    b.Property<string>("Name");
486
+
487
+                    b.HasKey("Id");
488
+
489
+                    b.ToTable("Seasons");
490
+                });
491
+
492
+            modelBuilder.Entity("UnivateProperties_API.Model.Timeshare.Status", b =>
493
+                {
494
+                    b.Property<int>("Id")
495
+                        .ValueGeneratedOnAdd();
496
+
497
+                    b.Property<string>("Code");
498
+
499
+                    b.Property<DateTime>("Created");
500
+
501
+                    b.Property<string>("Description");
502
+
503
+                    b.Property<DateTime>("Modified");
504
+
505
+                    b.Property<string>("ModifiedBy");
506
+
507
+                    b.Property<int>("StatusType");
508
+
509
+                    b.HasKey("Id");
510
+
511
+                    b.ToTable("Status");
512
+                });
513
+
514
+            modelBuilder.Entity("UnivateProperties_API.Model.Timeshare.TimeshareWeek", b =>
515
+                {
516
+                    b.Property<int>("Id")
517
+                        .ValueGeneratedOnAdd();
518
+
519
+                    b.Property<int?>("AgencyId");
520
+
521
+                    b.Property<bool>("AgentAsRep");
522
+
523
+                    b.Property<int?>("AgentId");
524
+
525
+                    b.Property<DateTime>("ArrivalDate");
526
+
527
+                    b.Property<string>("BankedWith");
528
+
529
+                    b.Property<int>("Bedrooms");
530
+
531
+                    b.Property<DateTime>("Created");
532
+
533
+                    b.Property<bool>("CurrentYearBanked");
534
+
535
+                    b.Property<DateTime>("DepartureDate");
536
+
537
+                    b.Property<bool>("LeviesPaidInFull");
538
+
539
+                    b.Property<double>("LevyAmount");
540
+
541
+                    b.Property<int>("MaxSleep");
542
+
543
+                    b.Property<DateTime>("Modified");
544
+
545
+                    b.Property<string>("ModifiedBy");
546
+
547
+                    b.Property<string>("Module");
548
+
549
+                    b.Property<DateTime>("OriginalPurchaseDate");
550
+
551
+                    b.Property<double>("OriginalPurchasePrice");
552
+
553
+                    b.Property<bool>("OtherResort");
554
+
555
+                    b.Property<int>("OwnerId");
556
+
557
+                    b.Property<bool>("ReferedByAgent");
558
+
559
+                    b.Property<int>("RegionId");
560
+
561
+                    b.Property<string>("ResortCode");
562
+
563
+                    b.Property<string>("ResortName");
564
+
565
+                    b.Property<string>("Season");
566
+
567
+                    b.Property<double>("SellPrice");
568
+
569
+                    b.Property<int>("StatusId");
570
+
571
+                    b.Property<string>("WeekNumber");
572
+
573
+                    b.Property<bool>("WeekPlacedForRental");
574
+
575
+                    b.HasKey("Id");
576
+
577
+                    b.HasIndex("AgencyId");
578
+
579
+                    b.HasIndex("AgentId");
580
+
581
+                    b.HasIndex("OwnerId");
582
+
583
+                    b.HasIndex("RegionId");
584
+
585
+                    b.HasIndex("StatusId");
586
+
587
+                    b.ToTable("Weeks");
588
+                });
589
+
590
+            modelBuilder.Entity("UnivateProperties_API.Model.Timeshare.UnitConfiguration", b =>
591
+                {
592
+                    b.Property<int>("Id")
593
+                        .ValueGeneratedOnAdd();
594
+
595
+                    b.Property<int>("Adults");
596
+
597
+                    b.Property<int>("Bedrooms");
598
+
599
+                    b.Property<int>("Children");
600
+
601
+                    b.Property<string>("Code");
602
+
603
+                    b.Property<DateTime>("Created");
604
+
605
+                    b.Property<DateTime>("Modified");
606
+
607
+                    b.Property<string>("ModifiedBy");
608
+
609
+                    b.HasKey("Id");
610
+
611
+                    b.HasIndex("Code")
612
+                        .IsUnique();
613
+
614
+                    b.ToTable("UnitConfigurations");
615
+                });
616
+
617
+            modelBuilder.Entity("UnivateProperties_API.Model.Timeshare.UnitConfigurationType", b =>
618
+                {
619
+                    b.Property<int>("Id")
620
+                        .ValueGeneratedOnAdd();
621
+
622
+                    b.Property<DateTime>("Created");
623
+
624
+                    b.Property<string>("Description");
625
+
626
+                    b.Property<DateTime>("Modified");
627
+
628
+                    b.Property<string>("ModifiedBy");
629
+
630
+                    b.Property<int>("UnitConfigurationId");
631
+
632
+                    b.HasKey("Id");
633
+
634
+                    b.HasIndex("UnitConfigurationId");
635
+
636
+                    b.ToTable("UnitConfigurationTypes");
637
+                });
638
+
639
+            modelBuilder.Entity("UnivateProperties_API.Model.Users.Agency", b =>
640
+                {
641
+                    b.Property<int>("Id")
642
+                        .ValueGeneratedOnAdd();
643
+
644
+                    b.Property<string>("AgencyName");
645
+
646
+                    b.Property<string>("CompanyRegNumber");
647
+
648
+                    b.Property<DateTime>("Created");
649
+
650
+                    b.Property<string>("EAABEFFCNumber");
651
+
652
+                    b.Property<DateTime>("Modified");
653
+
654
+                    b.Property<string>("ModifiedBy");
655
+
656
+                    b.HasKey("Id");
657
+
658
+                    b.ToTable("Agencies");
659
+                });
660
+
661
+            modelBuilder.Entity("UnivateProperties_API.Model.Users.Agent", b =>
662
+                {
663
+                    b.Property<int>("Id")
664
+                        .ValueGeneratedOnAdd();
665
+
666
+                    b.Property<int?>("AgencyId");
667
+
668
+                    b.Property<string>("CellNumber");
669
+
670
+                    b.Property<DateTime>("Created");
671
+
672
+                    b.Property<string>("Email");
673
+
674
+                    b.Property<DateTime>("Modified");
675
+
676
+                    b.Property<string>("ModifiedBy");
677
+
678
+                    b.Property<string>("Name");
679
+
680
+                    b.Property<string>("Surname");
681
+
682
+                    b.Property<string>("Telephone");
683
+
684
+                    b.Property<int?>("UserId");
685
+
686
+                    b.HasKey("Id");
687
+
688
+                    b.HasIndex("AgencyId");
689
+
690
+                    b.HasIndex("UserId");
691
+
692
+                    b.ToTable("Agents");
693
+                });
694
+
695
+            modelBuilder.Entity("UnivateProperties_API.Model.Users.Individual", b =>
696
+                {
697
+                    b.Property<int>("Id")
698
+                        .ValueGeneratedOnAdd();
699
+
700
+                    b.Property<int?>("AddressId");
701
+
702
+                    b.Property<string>("CellNumber");
703
+
704
+                    b.Property<string>("CompanyRegNumber");
705
+
706
+                    b.Property<DateTime>("Created");
707
+
708
+                    b.Property<string>("Email");
709
+
710
+                    b.Property<string>("IdNumber");
711
+
712
+                    b.Property<string>("IncomeTaxNumber");
713
+
714
+                    b.Property<string>("MaritalStatus");
715
+
716
+                    b.Property<DateTime>("Modified");
717
+
718
+                    b.Property<string>("ModifiedBy");
719
+
720
+                    b.Property<string>("Name");
721
+
722
+                    b.Property<string>("Surname");
723
+
724
+                    b.Property<string>("Telephone");
725
+
726
+                    b.Property<int?>("UserId");
727
+
728
+                    b.HasKey("Id");
729
+
730
+                    b.HasIndex("AddressId");
731
+
732
+                    b.HasIndex("UserId");
733
+
734
+                    b.ToTable("Individuals");
735
+                });
736
+
737
+            modelBuilder.Entity("UnivateProperties_API.Model.Users.User", b =>
738
+                {
739
+                    b.Property<int>("Id")
740
+                        .ValueGeneratedOnAdd();
741
+
742
+                    b.Property<DateTime>("Created");
743
+
744
+                    b.Property<DateTime>("Modified");
745
+
746
+                    b.Property<string>("ModifiedBy");
747
+
748
+                    b.Property<byte[]>("PasswordHash");
749
+
750
+                    b.Property<byte[]>("PasswordSalt");
751
+
752
+                    b.Property<string>("Role");
753
+
754
+                    b.Property<string>("Token");
755
+
756
+                    b.Property<string>("Username");
757
+
758
+                    b.Property<bool>("Verified");
759
+
760
+                    b.HasKey("Id");
761
+
762
+                    b.ToTable("Users");
763
+                });
764
+
765
+            modelBuilder.Entity("UnivateProperties_API.Model.Bank.BankAccount", b =>
766
+                {
767
+                    b.HasOne("UnivateProperties_API.Model.Bank.Bank", "Bank")
768
+                        .WithMany()
769
+                        .HasForeignKey("BankId")
770
+                        .OnDelete(DeleteBehavior.Cascade);
771
+
772
+                    b.HasOne("UnivateProperties_API.Model.Users.Individual", "Owner")
773
+                        .WithMany()
774
+                        .HasForeignKey("OwnerId");
775
+                });
776
+
777
+            modelBuilder.Entity("UnivateProperties_API.Model.Communication.Email", b =>
778
+                {
779
+                    b.HasOne("UnivateProperties_API.Model.Communication.SMTPAccount", "Sender")
780
+                        .WithMany("Emails")
781
+                        .HasForeignKey("SenderId")
782
+                        .OnDelete(DeleteBehavior.Cascade);
783
+                });
784
+
785
+            modelBuilder.Entity("UnivateProperties_API.Model.Communication.SMTPAccount", b =>
786
+                {
787
+                    b.HasOne("UnivateProperties_API.Model.Communication.SMTPHost", "SMTPHost")
788
+                        .WithMany("SMTPAccounts")
789
+                        .HasForeignKey("SMTPHostId")
790
+                        .OnDelete(DeleteBehavior.Cascade);
791
+                });
792
+
793
+            modelBuilder.Entity("UnivateProperties_API.Model.ProcessFlow.ProcessFlow", b =>
794
+                {
795
+                    b.HasOne("UnivateProperties_API.Model.Properties.Property", "Property")
796
+                        .WithMany()
797
+                        .HasForeignKey("PropertyID");
798
+
799
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.Status", "Status")
800
+                        .WithMany()
801
+                        .HasForeignKey("StatusID")
802
+                        .OnDelete(DeleteBehavior.Cascade);
803
+
804
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.TimeshareWeek", "Timeshare")
805
+                        .WithMany()
806
+                        .HasForeignKey("TimeshareID");
807
+                });
808
+
809
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.Property", b =>
810
+                {
811
+                    b.HasOne("UnivateProperties_API.Model.Users.Agency", "Agency")
812
+                        .WithMany("Properties")
813
+                        .HasForeignKey("AgencyId");
814
+
815
+                    b.HasOne("UnivateProperties_API.Model.Users.Agent", "Agent")
816
+                        .WithMany("Properties")
817
+                        .HasForeignKey("AgentId");
818
+
819
+                    b.HasOne("UnivateProperties_API.Model.Region.City", "City")
820
+                        .WithMany()
821
+                        .HasForeignKey("CityId")
822
+                        .OnDelete(DeleteBehavior.Cascade);
823
+
824
+                    b.HasOne("UnivateProperties_API.Model.Users.Individual", "Owner")
825
+                        .WithMany("Properties")
826
+                        .HasForeignKey("OwnerId");
827
+
828
+                    b.HasOne("UnivateProperties_API.Model.Properties.PropertyType", "PropertyType")
829
+                        .WithMany()
830
+                        .HasForeignKey("PropertyTypeId")
831
+                        .OnDelete(DeleteBehavior.Cascade);
832
+
833
+                    b.HasOne("UnivateProperties_API.Model.Region.Province", "Province")
834
+                        .WithMany()
835
+                        .HasForeignKey("ProvinceId")
836
+                        .OnDelete(DeleteBehavior.Cascade);
837
+
838
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.Status", "Status")
839
+                        .WithMany()
840
+                        .HasForeignKey("StatusId");
841
+
842
+                    b.HasOne("UnivateProperties_API.Model.Region.Suburb", "Suburb")
843
+                        .WithMany()
844
+                        .HasForeignKey("SuburbId")
845
+                        .OnDelete(DeleteBehavior.Cascade);
846
+                });
847
+
848
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyImage", b =>
849
+                {
850
+                    b.HasOne("UnivateProperties_API.Model.Properties.Property", "Property")
851
+                        .WithMany("PropertyImages")
852
+                        .HasForeignKey("PropertyId")
853
+                        .OnDelete(DeleteBehavior.Cascade);
854
+                });
855
+
856
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyUserField", b =>
857
+                {
858
+                    b.HasOne("UnivateProperties_API.Model.Properties.Property", "Property")
859
+                        .WithMany("PropertyUserFields")
860
+                        .HasForeignKey("PropertyId")
861
+                        .OnDelete(DeleteBehavior.Cascade);
862
+
863
+                    b.HasOne("UnivateProperties_API.Model.Properties.UserDefinedField", "UserDefinedField")
864
+                        .WithMany()
865
+                        .HasForeignKey("UserDefinedFieldId")
866
+                        .OnDelete(DeleteBehavior.Cascade);
867
+                });
868
+
869
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.UserDefinedField", b =>
870
+                {
871
+                    b.HasOne("UnivateProperties_API.Model.Properties.UserDefinedGroup", "Group")
872
+                        .WithMany("Fields")
873
+                        .HasForeignKey("GroupId")
874
+                        .OnDelete(DeleteBehavior.Cascade);
875
+                });
876
+
877
+            modelBuilder.Entity("UnivateProperties_API.Model.Region.City", b =>
878
+                {
879
+                    b.HasOne("UnivateProperties_API.Model.Region.Province", "Province")
880
+                        .WithMany()
881
+                        .HasForeignKey("ProvinceId")
882
+                        .OnDelete(DeleteBehavior.Cascade);
883
+                });
884
+
885
+            modelBuilder.Entity("UnivateProperties_API.Model.Region.Suburb", b =>
886
+                {
887
+                    b.HasOne("UnivateProperties_API.Model.Region.City", "City")
888
+                        .WithMany()
889
+                        .HasForeignKey("CityId")
890
+                        .OnDelete(DeleteBehavior.Cascade);
891
+                });
892
+
893
+            modelBuilder.Entity("UnivateProperties_API.Model.Timeshare.TimeshareWeek", b =>
894
+                {
895
+                    b.HasOne("UnivateProperties_API.Model.Users.Agency", "Agency")
896
+                        .WithMany()
897
+                        .HasForeignKey("AgencyId");
898
+
899
+                    b.HasOne("UnivateProperties_API.Model.Users.Agent", "Agent")
900
+                        .WithMany()
901
+                        .HasForeignKey("AgentId");
902
+
903
+                    b.HasOne("UnivateProperties_API.Model.Users.Individual", "Owner")
904
+                        .WithMany()
905
+                        .HasForeignKey("OwnerId")
906
+                        .OnDelete(DeleteBehavior.Cascade);
907
+
908
+                    b.HasOne("UnivateProperties_API.Model.Region.Province", "Region")
909
+                        .WithMany()
910
+                        .HasForeignKey("RegionId")
911
+                        .OnDelete(DeleteBehavior.Cascade);
912
+
913
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.Status", "Status")
914
+                        .WithMany()
915
+                        .HasForeignKey("StatusId")
916
+                        .OnDelete(DeleteBehavior.Cascade);
917
+                });
918
+
919
+            modelBuilder.Entity("UnivateProperties_API.Model.Timeshare.UnitConfigurationType", b =>
920
+                {
921
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.UnitConfiguration", "UnitConfiguration")
922
+                        .WithMany("Types")
923
+                        .HasForeignKey("UnitConfigurationId")
924
+                        .OnDelete(DeleteBehavior.Cascade);
925
+                });
926
+
927
+            modelBuilder.Entity("UnivateProperties_API.Model.Users.Agent", b =>
928
+                {
929
+                    b.HasOne("UnivateProperties_API.Model.Users.Agency", "Agency")
930
+                        .WithMany("Agents")
931
+                        .HasForeignKey("AgencyId");
932
+
933
+                    b.HasOne("UnivateProperties_API.Model.Users.User", "User")
934
+                        .WithMany()
935
+                        .HasForeignKey("UserId");
936
+                });
937
+
938
+            modelBuilder.Entity("UnivateProperties_API.Model.Users.Individual", b =>
939
+                {
940
+                    b.HasOne("UnivateProperties_API.Model.Misc.Address", "Address")
941
+                        .WithMany()
942
+                        .HasForeignKey("AddressId");
943
+
944
+                    b.HasOne("UnivateProperties_API.Model.Users.User", "User")
945
+                        .WithMany()
946
+                        .HasForeignKey("UserId");
947
+                });
948
+#pragma warning restore 612, 618
949
+        }
950
+    }
951
+}

+ 416
- 0
UnivateProperties_API/Migrations/20190905133540_BanksAddresses.cs Переглянути файл

@@ -0,0 +1,416 @@
1
+using System;
2
+using Microsoft.EntityFrameworkCore.Migrations;
3
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
4
+
5
+namespace UnivateProperties_API.Migrations
6
+{
7
+    public partial class BanksAddresses : Migration
8
+    {
9
+        protected override void Up(MigrationBuilder migrationBuilder)
10
+        {
11
+            migrationBuilder.DropForeignKey(
12
+                name: "FK_Agents_Users_UserId",
13
+                table: "Agents");
14
+
15
+            migrationBuilder.DropForeignKey(
16
+                name: "FK_Individuals_Users_UserId",
17
+                table: "Individuals");
18
+
19
+            migrationBuilder.AddColumn<int>(
20
+                name: "AgencyId",
21
+                table: "Properties",
22
+                nullable: true);
23
+
24
+            migrationBuilder.AddColumn<int>(
25
+                name: "AgentId",
26
+                table: "Properties",
27
+                nullable: true);
28
+
29
+            migrationBuilder.AddColumn<int>(
30
+                name: "OwnerId",
31
+                table: "Properties",
32
+                nullable: true);
33
+
34
+            migrationBuilder.AddColumn<int>(
35
+                name: "StatusId",
36
+                table: "Properties",
37
+                nullable: true);
38
+
39
+            migrationBuilder.AlterColumn<int>(
40
+                name: "UserId",
41
+                table: "Individuals",
42
+                nullable: true,
43
+                oldClrType: typeof(int));
44
+
45
+            migrationBuilder.AddColumn<int>(
46
+                name: "AddressId",
47
+                table: "Individuals",
48
+                nullable: true);
49
+
50
+            migrationBuilder.AddColumn<string>(
51
+                name: "CompanyRegNumber",
52
+                table: "Individuals",
53
+                nullable: true);
54
+
55
+            migrationBuilder.AddColumn<string>(
56
+                name: "IdNumber",
57
+                table: "Individuals",
58
+                nullable: true);
59
+
60
+            migrationBuilder.AddColumn<string>(
61
+                name: "IncomeTaxNumber",
62
+                table: "Individuals",
63
+                nullable: true);
64
+
65
+            migrationBuilder.AddColumn<string>(
66
+                name: "MaritalStatus",
67
+                table: "Individuals",
68
+                nullable: true);
69
+
70
+            migrationBuilder.AlterColumn<int>(
71
+                name: "UserId",
72
+                table: "Agents",
73
+                nullable: true,
74
+                oldClrType: typeof(int));
75
+
76
+            migrationBuilder.CreateTable(
77
+                name: "Addresses",
78
+                columns: table => new
79
+                {
80
+                    Id = table.Column<int>(nullable: false)
81
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
82
+                    Created = table.Column<DateTime>(nullable: false),
83
+                    Modified = table.Column<DateTime>(nullable: false),
84
+                    ModifiedBy = table.Column<string>(nullable: true),
85
+                    StreetNumber = table.Column<string>(nullable: true),
86
+                    Street = table.Column<string>(nullable: true),
87
+                    Suburb = table.Column<string>(nullable: true),
88
+                    City = table.Column<string>(nullable: true),
89
+                    PostalCode = table.Column<string>(nullable: true)
90
+                },
91
+                constraints: table =>
92
+                {
93
+                    table.PrimaryKey("PK_Addresses", x => x.Id);
94
+                });
95
+
96
+            migrationBuilder.CreateTable(
97
+                name: "Banks",
98
+                columns: table => new
99
+                {
100
+                    Id = table.Column<int>(nullable: false)
101
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
102
+                    Created = table.Column<DateTime>(nullable: false),
103
+                    Modified = table.Column<DateTime>(nullable: false),
104
+                    ModifiedBy = table.Column<string>(nullable: true),
105
+                    Name = table.Column<string>(nullable: true),
106
+                    UniversalBranchCode = table.Column<string>(nullable: true)
107
+                },
108
+                constraints: table =>
109
+                {
110
+                    table.PrimaryKey("PK_Banks", x => x.Id);
111
+                });
112
+
113
+            migrationBuilder.CreateTable(
114
+                name: "ProcessFlows",
115
+                columns: table => new
116
+                {
117
+                    Id = table.Column<int>(nullable: false)
118
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
119
+                    Created = table.Column<DateTime>(nullable: false),
120
+                    Modified = table.Column<DateTime>(nullable: false),
121
+                    ModifiedBy = table.Column<string>(nullable: true),
122
+                    TimeshareID = table.Column<int>(nullable: true),
123
+                    PropertyID = table.Column<int>(nullable: true),
124
+                    StatusID = table.Column<int>(nullable: false)
125
+                },
126
+                constraints: table =>
127
+                {
128
+                    table.PrimaryKey("PK_ProcessFlows", x => x.Id);
129
+                    table.ForeignKey(
130
+                        name: "FK_ProcessFlows_Properties_PropertyID",
131
+                        column: x => x.PropertyID,
132
+                        principalTable: "Properties",
133
+                        principalColumn: "Id",
134
+                        onDelete: ReferentialAction.Restrict);
135
+                    table.ForeignKey(
136
+                        name: "FK_ProcessFlows_Status_StatusID",
137
+                        column: x => x.StatusID,
138
+                        principalTable: "Status",
139
+                        principalColumn: "Id",
140
+                        onDelete: ReferentialAction.Cascade);
141
+                    table.ForeignKey(
142
+                        name: "FK_ProcessFlows_Weeks_TimeshareID",
143
+                        column: x => x.TimeshareID,
144
+                        principalTable: "Weeks",
145
+                        principalColumn: "Id",
146
+                        onDelete: ReferentialAction.Restrict);
147
+                });
148
+
149
+            migrationBuilder.CreateTable(
150
+                name: "BankAccounts",
151
+                columns: table => new
152
+                {
153
+                    Id = table.Column<int>(nullable: false)
154
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
155
+                    Created = table.Column<DateTime>(nullable: false),
156
+                    Modified = table.Column<DateTime>(nullable: false),
157
+                    ModifiedBy = table.Column<string>(nullable: true),
158
+                    AccountHolder = table.Column<string>(nullable: true),
159
+                    AccountNumber = table.Column<string>(nullable: true),
160
+                    BankId = table.Column<int>(nullable: false),
161
+                    OwnerId = table.Column<int>(nullable: true)
162
+                },
163
+                constraints: table =>
164
+                {
165
+                    table.PrimaryKey("PK_BankAccounts", x => x.Id);
166
+                    table.ForeignKey(
167
+                        name: "FK_BankAccounts_Banks_BankId",
168
+                        column: x => x.BankId,
169
+                        principalTable: "Banks",
170
+                        principalColumn: "Id",
171
+                        onDelete: ReferentialAction.Cascade);
172
+                    table.ForeignKey(
173
+                        name: "FK_BankAccounts_Individuals_OwnerId",
174
+                        column: x => x.OwnerId,
175
+                        principalTable: "Individuals",
176
+                        principalColumn: "Id",
177
+                        onDelete: ReferentialAction.Restrict);
178
+                });
179
+
180
+            migrationBuilder.CreateIndex(
181
+                name: "IX_Properties_AgencyId",
182
+                table: "Properties",
183
+                column: "AgencyId");
184
+
185
+            migrationBuilder.CreateIndex(
186
+                name: "IX_Properties_AgentId",
187
+                table: "Properties",
188
+                column: "AgentId");
189
+
190
+            migrationBuilder.CreateIndex(
191
+                name: "IX_Properties_OwnerId",
192
+                table: "Properties",
193
+                column: "OwnerId");
194
+
195
+            migrationBuilder.CreateIndex(
196
+                name: "IX_Properties_StatusId",
197
+                table: "Properties",
198
+                column: "StatusId");
199
+
200
+            migrationBuilder.CreateIndex(
201
+                name: "IX_Individuals_AddressId",
202
+                table: "Individuals",
203
+                column: "AddressId");
204
+
205
+            migrationBuilder.CreateIndex(
206
+                name: "IX_BankAccounts_BankId",
207
+                table: "BankAccounts",
208
+                column: "BankId");
209
+
210
+            migrationBuilder.CreateIndex(
211
+                name: "IX_BankAccounts_OwnerId",
212
+                table: "BankAccounts",
213
+                column: "OwnerId");
214
+
215
+            migrationBuilder.CreateIndex(
216
+                name: "IX_ProcessFlows_PropertyID",
217
+                table: "ProcessFlows",
218
+                column: "PropertyID");
219
+
220
+            migrationBuilder.CreateIndex(
221
+                name: "IX_ProcessFlows_StatusID",
222
+                table: "ProcessFlows",
223
+                column: "StatusID");
224
+
225
+            migrationBuilder.CreateIndex(
226
+                name: "IX_ProcessFlows_TimeshareID",
227
+                table: "ProcessFlows",
228
+                column: "TimeshareID");
229
+
230
+            migrationBuilder.AddForeignKey(
231
+                name: "FK_Agents_Users_UserId",
232
+                table: "Agents",
233
+                column: "UserId",
234
+                principalTable: "Users",
235
+                principalColumn: "Id",
236
+                onDelete: ReferentialAction.Restrict);
237
+
238
+            migrationBuilder.AddForeignKey(
239
+                name: "FK_Individuals_Addresses_AddressId",
240
+                table: "Individuals",
241
+                column: "AddressId",
242
+                principalTable: "Addresses",
243
+                principalColumn: "Id",
244
+                onDelete: ReferentialAction.Restrict);
245
+
246
+            migrationBuilder.AddForeignKey(
247
+                name: "FK_Individuals_Users_UserId",
248
+                table: "Individuals",
249
+                column: "UserId",
250
+                principalTable: "Users",
251
+                principalColumn: "Id",
252
+                onDelete: ReferentialAction.Restrict);
253
+
254
+            migrationBuilder.AddForeignKey(
255
+                name: "FK_Properties_Agencies_AgencyId",
256
+                table: "Properties",
257
+                column: "AgencyId",
258
+                principalTable: "Agencies",
259
+                principalColumn: "Id",
260
+                onDelete: ReferentialAction.Restrict);
261
+
262
+            migrationBuilder.AddForeignKey(
263
+                name: "FK_Properties_Agents_AgentId",
264
+                table: "Properties",
265
+                column: "AgentId",
266
+                principalTable: "Agents",
267
+                principalColumn: "Id",
268
+                onDelete: ReferentialAction.Restrict);
269
+
270
+            migrationBuilder.AddForeignKey(
271
+                name: "FK_Properties_Individuals_OwnerId",
272
+                table: "Properties",
273
+                column: "OwnerId",
274
+                principalTable: "Individuals",
275
+                principalColumn: "Id",
276
+                onDelete: ReferentialAction.Restrict);
277
+
278
+            migrationBuilder.AddForeignKey(
279
+                name: "FK_Properties_Status_StatusId",
280
+                table: "Properties",
281
+                column: "StatusId",
282
+                principalTable: "Status",
283
+                principalColumn: "Id",
284
+                onDelete: ReferentialAction.Restrict);
285
+        }
286
+
287
+        protected override void Down(MigrationBuilder migrationBuilder)
288
+        {
289
+            migrationBuilder.DropForeignKey(
290
+                name: "FK_Agents_Users_UserId",
291
+                table: "Agents");
292
+
293
+            migrationBuilder.DropForeignKey(
294
+                name: "FK_Individuals_Addresses_AddressId",
295
+                table: "Individuals");
296
+
297
+            migrationBuilder.DropForeignKey(
298
+                name: "FK_Individuals_Users_UserId",
299
+                table: "Individuals");
300
+
301
+            migrationBuilder.DropForeignKey(
302
+                name: "FK_Properties_Agencies_AgencyId",
303
+                table: "Properties");
304
+
305
+            migrationBuilder.DropForeignKey(
306
+                name: "FK_Properties_Agents_AgentId",
307
+                table: "Properties");
308
+
309
+            migrationBuilder.DropForeignKey(
310
+                name: "FK_Properties_Individuals_OwnerId",
311
+                table: "Properties");
312
+
313
+            migrationBuilder.DropForeignKey(
314
+                name: "FK_Properties_Status_StatusId",
315
+                table: "Properties");
316
+
317
+            migrationBuilder.DropTable(
318
+                name: "Addresses");
319
+
320
+            migrationBuilder.DropTable(
321
+                name: "BankAccounts");
322
+
323
+            migrationBuilder.DropTable(
324
+                name: "ProcessFlows");
325
+
326
+            migrationBuilder.DropTable(
327
+                name: "Banks");
328
+
329
+            migrationBuilder.DropIndex(
330
+                name: "IX_Properties_AgencyId",
331
+                table: "Properties");
332
+
333
+            migrationBuilder.DropIndex(
334
+                name: "IX_Properties_AgentId",
335
+                table: "Properties");
336
+
337
+            migrationBuilder.DropIndex(
338
+                name: "IX_Properties_OwnerId",
339
+                table: "Properties");
340
+
341
+            migrationBuilder.DropIndex(
342
+                name: "IX_Properties_StatusId",
343
+                table: "Properties");
344
+
345
+            migrationBuilder.DropIndex(
346
+                name: "IX_Individuals_AddressId",
347
+                table: "Individuals");
348
+
349
+            migrationBuilder.DropColumn(
350
+                name: "AgencyId",
351
+                table: "Properties");
352
+
353
+            migrationBuilder.DropColumn(
354
+                name: "AgentId",
355
+                table: "Properties");
356
+
357
+            migrationBuilder.DropColumn(
358
+                name: "OwnerId",
359
+                table: "Properties");
360
+
361
+            migrationBuilder.DropColumn(
362
+                name: "StatusId",
363
+                table: "Properties");
364
+
365
+            migrationBuilder.DropColumn(
366
+                name: "AddressId",
367
+                table: "Individuals");
368
+
369
+            migrationBuilder.DropColumn(
370
+                name: "CompanyRegNumber",
371
+                table: "Individuals");
372
+
373
+            migrationBuilder.DropColumn(
374
+                name: "IdNumber",
375
+                table: "Individuals");
376
+
377
+            migrationBuilder.DropColumn(
378
+                name: "IncomeTaxNumber",
379
+                table: "Individuals");
380
+
381
+            migrationBuilder.DropColumn(
382
+                name: "MaritalStatus",
383
+                table: "Individuals");
384
+
385
+            migrationBuilder.AlterColumn<int>(
386
+                name: "UserId",
387
+                table: "Individuals",
388
+                nullable: false,
389
+                oldClrType: typeof(int),
390
+                oldNullable: true);
391
+
392
+            migrationBuilder.AlterColumn<int>(
393
+                name: "UserId",
394
+                table: "Agents",
395
+                nullable: false,
396
+                oldClrType: typeof(int),
397
+                oldNullable: true);
398
+
399
+            migrationBuilder.AddForeignKey(
400
+                name: "FK_Agents_Users_UserId",
401
+                table: "Agents",
402
+                column: "UserId",
403
+                principalTable: "Users",
404
+                principalColumn: "Id",
405
+                onDelete: ReferentialAction.Cascade);
406
+
407
+            migrationBuilder.AddForeignKey(
408
+                name: "FK_Individuals_Users_UserId",
409
+                table: "Individuals",
410
+                column: "UserId",
411
+                principalTable: "Users",
412
+                principalColumn: "Id",
413
+                onDelete: ReferentialAction.Cascade);
414
+        }
415
+    }
416
+}

+ 197
- 21
UnivateProperties_API/Migrations/DataContextModelSnapshot.cs Переглянути файл

@@ -19,6 +19,54 @@ namespace UnivateProperties_API.Migrations
19 19
                 .HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
20 20
                 .HasAnnotation("Relational:MaxIdentifierLength", 63);
21 21
 
22
+            modelBuilder.Entity("UnivateProperties_API.Model.Bank.Bank", b =>
23
+                {
24
+                    b.Property<int>("Id")
25
+                        .ValueGeneratedOnAdd();
26
+
27
+                    b.Property<DateTime>("Created");
28
+
29
+                    b.Property<DateTime>("Modified");
30
+
31
+                    b.Property<string>("ModifiedBy");
32
+
33
+                    b.Property<string>("Name");
34
+
35
+                    b.Property<string>("UniversalBranchCode");
36
+
37
+                    b.HasKey("Id");
38
+
39
+                    b.ToTable("Banks");
40
+                });
41
+
42
+            modelBuilder.Entity("UnivateProperties_API.Model.Bank.BankAccount", b =>
43
+                {
44
+                    b.Property<int>("Id")
45
+                        .ValueGeneratedOnAdd();
46
+
47
+                    b.Property<string>("AccountHolder");
48
+
49
+                    b.Property<string>("AccountNumber");
50
+
51
+                    b.Property<int>("BankId");
52
+
53
+                    b.Property<DateTime>("Created");
54
+
55
+                    b.Property<DateTime>("Modified");
56
+
57
+                    b.Property<string>("ModifiedBy");
58
+
59
+                    b.Property<int?>("OwnerId");
60
+
61
+                    b.HasKey("Id");
62
+
63
+                    b.HasIndex("BankId");
64
+
65
+                    b.HasIndex("OwnerId");
66
+
67
+                    b.ToTable("BankAccounts");
68
+                });
69
+
22 70
             modelBuilder.Entity("UnivateProperties_API.Model.Communication.Email", b =>
23 71
                 {
24 72
                     b.Property<int>("Id")
@@ -105,7 +153,61 @@ namespace UnivateProperties_API.Migrations
105 153
                     b.ToTable("Hosts");
106 154
                 });
107 155
 
108
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.Property", b =>
156
+            modelBuilder.Entity("UnivateProperties_API.Model.Misc.Address", b =>
157
+                {
158
+                    b.Property<int>("Id")
159
+                        .ValueGeneratedOnAdd();
160
+
161
+                    b.Property<string>("City");
162
+
163
+                    b.Property<DateTime>("Created");
164
+
165
+                    b.Property<DateTime>("Modified");
166
+
167
+                    b.Property<string>("ModifiedBy");
168
+
169
+                    b.Property<string>("PostalCode");
170
+
171
+                    b.Property<string>("Street");
172
+
173
+                    b.Property<string>("StreetNumber");
174
+
175
+                    b.Property<string>("Suburb");
176
+
177
+                    b.HasKey("Id");
178
+
179
+                    b.ToTable("Addresses");
180
+                });
181
+
182
+            modelBuilder.Entity("UnivateProperties_API.Model.ProcessFlow.ProcessFlow", b =>
183
+                {
184
+                    b.Property<int>("Id")
185
+                        .ValueGeneratedOnAdd();
186
+
187
+                    b.Property<DateTime>("Created");
188
+
189
+                    b.Property<DateTime>("Modified");
190
+
191
+                    b.Property<string>("ModifiedBy");
192
+
193
+                    b.Property<int?>("PropertyID");
194
+
195
+                    b.Property<int>("StatusID");
196
+
197
+                    b.Property<int?>("TimeshareID");
198
+
199
+                    b.HasKey("Id");
200
+
201
+                    b.HasIndex("PropertyID");
202
+
203
+                    b.HasIndex("StatusID");
204
+
205
+                    b.HasIndex("TimeshareID");
206
+
207
+                    b.ToTable("ProcessFlows");
208
+                });
209
+
210
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.Property", b =>
109 211
                 {
110 212
                     b.Property<int>("Id")
111 213
                         .ValueGeneratedOnAdd();
@@ -116,6 +218,10 @@ namespace UnivateProperties_API.Migrations
116 218
 
117 219
                     b.Property<string>("AddressLine3");
118 220
 
221
+                    b.Property<int?>("AgencyId");
222
+
223
+                    b.Property<int?>("AgentId");
224
+
119 225
                     b.Property<int>("CityId");
120 226
 
121 227
                     b.Property<DateTime>("Created");
@@ -132,6 +238,8 @@ namespace UnivateProperties_API.Migrations
132 238
 
133 239
                     b.Property<decimal>("OperationalCosts");
134 240
 
241
+                    b.Property<int?>("OwnerId");
242
+
135 243
                     b.Property<decimal>("Price");
136 244
 
137 245
                     b.Property<string>("PricePer");
@@ -146,24 +254,34 @@ namespace UnivateProperties_API.Migrations
146 254
 
147 255
                     b.Property<string>("ShortDescription");
148 256
 
257
+                    b.Property<int?>("StatusId");
258
+
149 259
                     b.Property<int>("SuburbId");
150 260
 
151 261
                     b.Property<string>("Unit");
152 262
 
153 263
                     b.HasKey("Id");
154 264
 
265
+                    b.HasIndex("AgencyId");
266
+
267
+                    b.HasIndex("AgentId");
268
+
155 269
                     b.HasIndex("CityId");
156 270
 
271
+                    b.HasIndex("OwnerId");
272
+
157 273
                     b.HasIndex("PropertyTypeId");
158 274
 
159 275
                     b.HasIndex("ProvinceId");
160 276
 
277
+                    b.HasIndex("StatusId");
278
+
161 279
                     b.HasIndex("SuburbId");
162 280
 
163 281
                     b.ToTable("Properties");
164 282
                 });
165 283
 
166
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.PropertyImage", b =>
284
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyImage", b =>
167 285
                 {
168 286
                     b.Property<int>("Id")
169 287
                         .ValueGeneratedOnAdd();
@@ -187,7 +305,7 @@ namespace UnivateProperties_API.Migrations
187 305
                     b.ToTable("PropertyImages");
188 306
                 });
189 307
 
190
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.PropertyType", b =>
308
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyType", b =>
191 309
                 {
192 310
                     b.Property<int>("Id")
193 311
                         .ValueGeneratedOnAdd();
@@ -207,7 +325,7 @@ namespace UnivateProperties_API.Migrations
207 325
                     b.ToTable("PropertyTypes");
208 326
                 });
209 327
 
210
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.PropertyUserField", b =>
328
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyUserField", b =>
211 329
                 {
212 330
                     b.Property<int>("Id")
213 331
                         .ValueGeneratedOnAdd();
@@ -235,7 +353,7 @@ namespace UnivateProperties_API.Migrations
235 353
                     b.ToTable("PropertyUserFields");
236 354
                 });
237 355
 
238
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.UserDefinedField", b =>
356
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.UserDefinedField", b =>
239 357
                 {
240 358
                     b.Property<int>("Id")
241 359
                         .ValueGeneratedOnAdd();
@@ -261,7 +379,7 @@ namespace UnivateProperties_API.Migrations
261 379
                     b.ToTable("UserDefinedFields");
262 380
                 });
263 381
 
264
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.UserDefinedGroup", b =>
382
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.UserDefinedGroup", b =>
265 383
                 {
266 384
                     b.Property<int>("Id")
267 385
                         .ValueGeneratedOnAdd();
@@ -561,7 +679,7 @@ namespace UnivateProperties_API.Migrations
561 679
 
562 680
                     b.Property<string>("Telephone");
563 681
 
564
-                    b.Property<int>("UserId");
682
+                    b.Property<int?>("UserId");
565 683
 
566 684
                     b.HasKey("Id");
567 685
 
@@ -577,12 +695,22 @@ namespace UnivateProperties_API.Migrations
577 695
                     b.Property<int>("Id")
578 696
                         .ValueGeneratedOnAdd();
579 697
 
698
+                    b.Property<int?>("AddressId");
699
+
580 700
                     b.Property<string>("CellNumber");
581 701
 
702
+                    b.Property<string>("CompanyRegNumber");
703
+
582 704
                     b.Property<DateTime>("Created");
583 705
 
584 706
                     b.Property<string>("Email");
585 707
 
708
+                    b.Property<string>("IdNumber");
709
+
710
+                    b.Property<string>("IncomeTaxNumber");
711
+
712
+                    b.Property<string>("MaritalStatus");
713
+
586 714
                     b.Property<DateTime>("Modified");
587 715
 
588 716
                     b.Property<string>("ModifiedBy");
@@ -593,10 +721,12 @@ namespace UnivateProperties_API.Migrations
593 721
 
594 722
                     b.Property<string>("Telephone");
595 723
 
596
-                    b.Property<int>("UserId");
724
+                    b.Property<int?>("UserId");
597 725
 
598 726
                     b.HasKey("Id");
599 727
 
728
+                    b.HasIndex("AddressId");
729
+
600 730
                     b.HasIndex("UserId");
601 731
 
602 732
                     b.ToTable("Individuals");
@@ -630,6 +760,18 @@ namespace UnivateProperties_API.Migrations
630 760
                     b.ToTable("Users");
631 761
                 });
632 762
 
763
+            modelBuilder.Entity("UnivateProperties_API.Model.Bank.BankAccount", b =>
764
+                {
765
+                    b.HasOne("UnivateProperties_API.Model.Bank.Bank", "Bank")
766
+                        .WithMany()
767
+                        .HasForeignKey("BankId")
768
+                        .OnDelete(DeleteBehavior.Cascade);
769
+
770
+                    b.HasOne("UnivateProperties_API.Model.Users.Individual", "Owner")
771
+                        .WithMany()
772
+                        .HasForeignKey("OwnerId");
773
+                });
774
+
633 775
             modelBuilder.Entity("UnivateProperties_API.Model.Communication.Email", b =>
634 776
                 {
635 777
                     b.HasOne("UnivateProperties_API.Model.Communication.SMTPAccount", "Sender")
@@ -646,14 +788,42 @@ namespace UnivateProperties_API.Migrations
646 788
                         .OnDelete(DeleteBehavior.Cascade);
647 789
                 });
648 790
 
649
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.Property", b =>
791
+            modelBuilder.Entity("UnivateProperties_API.Model.ProcessFlow.ProcessFlow", b =>
650 792
                 {
793
+                    b.HasOne("UnivateProperties_API.Model.Properties.Property", "Property")
794
+                        .WithMany()
795
+                        .HasForeignKey("PropertyID");
796
+
797
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.Status", "Status")
798
+                        .WithMany()
799
+                        .HasForeignKey("StatusID")
800
+                        .OnDelete(DeleteBehavior.Cascade);
801
+
802
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.TimeshareWeek", "Timeshare")
803
+                        .WithMany()
804
+                        .HasForeignKey("TimeshareID");
805
+                });
806
+
807
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.Property", b =>
808
+                {
809
+                    b.HasOne("UnivateProperties_API.Model.Users.Agency", "Agency")
810
+                        .WithMany("Properties")
811
+                        .HasForeignKey("AgencyId");
812
+
813
+                    b.HasOne("UnivateProperties_API.Model.Users.Agent", "Agent")
814
+                        .WithMany("Properties")
815
+                        .HasForeignKey("AgentId");
816
+
651 817
                     b.HasOne("UnivateProperties_API.Model.Region.City", "City")
652 818
                         .WithMany()
653 819
                         .HasForeignKey("CityId")
654 820
                         .OnDelete(DeleteBehavior.Cascade);
655 821
 
656
-                    b.HasOne("UnivateProperties_API.Model.Property.PropertyType", "PropertyType")
822
+                    b.HasOne("UnivateProperties_API.Model.Users.Individual", "Owner")
823
+                        .WithMany("Properties")
824
+                        .HasForeignKey("OwnerId");
825
+
826
+                    b.HasOne("UnivateProperties_API.Model.Properties.PropertyType", "PropertyType")
657 827
                         .WithMany()
658 828
                         .HasForeignKey("PropertyTypeId")
659 829
                         .OnDelete(DeleteBehavior.Cascade);
@@ -663,36 +833,40 @@ namespace UnivateProperties_API.Migrations
663 833
                         .HasForeignKey("ProvinceId")
664 834
                         .OnDelete(DeleteBehavior.Cascade);
665 835
 
836
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.Status", "Status")
837
+                        .WithMany()
838
+                        .HasForeignKey("StatusId");
839
+
666 840
                     b.HasOne("UnivateProperties_API.Model.Region.Suburb", "Suburb")
667 841
                         .WithMany()
668 842
                         .HasForeignKey("SuburbId")
669 843
                         .OnDelete(DeleteBehavior.Cascade);
670 844
                 });
671 845
 
672
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.PropertyImage", b =>
846
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyImage", b =>
673 847
                 {
674
-                    b.HasOne("UnivateProperties_API.Model.Property.Property", "Property")
848
+                    b.HasOne("UnivateProperties_API.Model.Properties.Property", "Property")
675 849
                         .WithMany("PropertyImages")
676 850
                         .HasForeignKey("PropertyId")
677 851
                         .OnDelete(DeleteBehavior.Cascade);
678 852
                 });
679 853
 
680
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.PropertyUserField", b =>
854
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyUserField", b =>
681 855
                 {
682
-                    b.HasOne("UnivateProperties_API.Model.Property.Property", "Property")
856
+                    b.HasOne("UnivateProperties_API.Model.Properties.Property", "Property")
683 857
                         .WithMany("PropertyUserFields")
684 858
                         .HasForeignKey("PropertyId")
685 859
                         .OnDelete(DeleteBehavior.Cascade);
686 860
 
687
-                    b.HasOne("UnivateProperties_API.Model.Property.UserDefinedField", "UserDefinedField")
861
+                    b.HasOne("UnivateProperties_API.Model.Properties.UserDefinedField", "UserDefinedField")
688 862
                         .WithMany()
689 863
                         .HasForeignKey("UserDefinedFieldId")
690 864
                         .OnDelete(DeleteBehavior.Cascade);
691 865
                 });
692 866
 
693
-            modelBuilder.Entity("UnivateProperties_API.Model.Property.UserDefinedField", b =>
867
+            modelBuilder.Entity("UnivateProperties_API.Model.Properties.UserDefinedField", b =>
694 868
                 {
695
-                    b.HasOne("UnivateProperties_API.Model.Property.UserDefinedGroup", "Group")
869
+                    b.HasOne("UnivateProperties_API.Model.Properties.UserDefinedGroup", "Group")
696 870
                         .WithMany("Fields")
697 871
                         .HasForeignKey("GroupId")
698 872
                         .OnDelete(DeleteBehavior.Cascade);
@@ -756,16 +930,18 @@ namespace UnivateProperties_API.Migrations
756 930
 
757 931
                     b.HasOne("UnivateProperties_API.Model.Users.User", "User")
758 932
                         .WithMany()
759
-                        .HasForeignKey("UserId")
760
-                        .OnDelete(DeleteBehavior.Cascade);
933
+                        .HasForeignKey("UserId");
761 934
                 });
762 935
 
763 936
             modelBuilder.Entity("UnivateProperties_API.Model.Users.Individual", b =>
764 937
                 {
938
+                    b.HasOne("UnivateProperties_API.Model.Misc.Address", "Address")
939
+                        .WithMany()
940
+                        .HasForeignKey("AddressId");
941
+
765 942
                     b.HasOne("UnivateProperties_API.Model.Users.User", "User")
766 943
                         .WithMany()
767
-                        .HasForeignKey("UserId")
768
-                        .OnDelete(DeleteBehavior.Cascade);
944
+                        .HasForeignKey("UserId");
769 945
                 });
770 946
 #pragma warning restore 612, 618
771 947
         }

+ 5
- 0
UnivateProperties_API/Model/Properties/Property.cs Переглянути файл

@@ -9,6 +9,11 @@ namespace UnivateProperties_API.Model.Properties
9 9
 {
10 10
     public class Property : BaseEntity
11 11
     {
12
+        private Property()
13
+        {
14
+
15
+        }
16
+
12 17
         #region Properties
13 18
         public string CreatedBy { get; set; }
14 19
         [ForeignKey("PropertyType")]        

+ 2
- 2
UnivateProperties_API/Model/Users/Agency.cs Переглянути файл

@@ -1,5 +1,5 @@
1
-using Castle.MicroKernel.Registration;
2
-using System.Collections.Generic;
1
+using System.Collections.Generic;
2
+using UnivateProperties_API.Model.Properties;
3 3
 
4 4
 namespace UnivateProperties_API.Model.Users
5 5
 {

+ 2
- 2
UnivateProperties_API/Model/Users/Agent.cs Переглянути файл

@@ -1,6 +1,6 @@
1
-using Castle.MicroKernel.Registration;
2
-using System.Collections.Generic;
1
+using System.Collections.Generic;
3 2
 using System.ComponentModel.DataAnnotations.Schema;
3
+using UnivateProperties_API.Model.Properties;
4 4
 
5 5
 namespace UnivateProperties_API.Model.Users
6 6
 {

+ 1
- 0
UnivateProperties_API/Startup.cs Переглянути файл

@@ -98,6 +98,7 @@ namespace UnivateProperties_API
98 98
             services.AddTransient<IRepository<PropertyUserField>, PropertyUserFieldRepository>();
99 99
             services.AddTransient<IRepository<UserDefinedField>, UserDefinedFieldRepository>();
100 100
             services.AddTransient<IUserDefinedGroupRepository, UserDefinedGroupRepository>();
101
+
101 102
             #endregion Property
102 103
             #region Region
103 104
             services.AddTransient<IRepository<Province>, ProvinceRepository>();

+ 1
- 1
UnivateProperties_API/appsettings.json Переглянути файл

@@ -9,6 +9,6 @@
9 9
   },
10 10
   "AllowedHosts": "*",
11 11
   "ConnectionStrings": {
12
-    "DefaultConnection": "Server=192.168.6.188;Port=5432;Database=Univate;User Id=postgres;Password=prov1s1on;"
12
+    "DefaultConnection": "Server=localhost;Port=5432;Database=Univate;User Id=postgres;Password=Prov1s1on;"
13 13
   }
14 14
 }

Завантаження…
Відмінити
Зберегти