Browse Source

Timeshare Admin Update

master
30117125 4 years ago
parent
commit
ba44c83ea9

+ 6
- 0
UnivateProperties_API/Containers/Timeshare/Detailed/DetailedWeekDto.cs View File

@@ -43,6 +43,9 @@ namespace UnivateProperties_API.Containers.Timeshare.Detailed
43 43
             Status = week.Status.Display;
44 44
             Owner = week.Owner != null ? new DetailedOwner(week.Owner) : new DetailedOwner();
45 45
             Region = new RegionDto(week.Region.Code, week.Region.Description);
46
+            WeekStatus = week.WeekStatus;
47
+            Publish = week.Publish;
48
+            PulbishedDate = week.PulbishedDate;
46 49
         }
47 50
 
48 51
         public int Id { get; set; }
@@ -76,5 +79,8 @@ namespace UnivateProperties_API.Containers.Timeshare.Detailed
76 79
         public string Status { get; set; }
77 80
         public DetailedOwner Owner { get; set; }
78 81
         public RegionDto Region { get; set; }
82
+        public string WeekStatus { get; set; }
83
+        public bool Publish { get; set; }
84
+        public DateTime PulbishedDate { get; set; }
79 85
     }
80 86
 }

+ 6
- 0
UnivateProperties_API/Containers/Timeshare/WeekDto.cs View File

@@ -120,6 +120,9 @@ namespace UnivateProperties_API.Containers.Timeshare
120 120
             IsTender = false;
121 121
             ReferedByAgent = week.ReferedByAgent;
122 122
             WeekType = week.WeekType.ToString();
123
+            WeekStatus = week.WeekStatus;
124
+            Publish = week.Publish;
125
+            PulbishedDate = week.PulbishedDate;
123 126
         }
124 127
 
125 128
         public int Id { get; set; }
@@ -147,5 +150,8 @@ namespace UnivateProperties_API.Containers.Timeshare
147 150
         public string WeekType { get; set; }
148 151
         public string Display => $"{Resort.Display}  ({ArrivalDate.ToShortDateString()} - {DepartureDate.ToShortDateString()})";
149 152
         public string WeekUni => $"{Resort.ResortCode}-{UnitNumber}-{WeekNumber}";
153
+        public string WeekStatus { get; set; }
154
+        public bool Publish { get; set; }
155
+        public DateTime PulbishedDate { get; set; }
150 156
     }    
151 157
 }

+ 2
- 0
UnivateProperties_API/Migrations/DataContextModelSnapshot.cs View File

@@ -1017,6 +1017,8 @@ namespace UnivateProperties_API.Migrations
1017 1017
 
1018 1018
                     b.Property<DateTime>("ArrivalDate");
1019 1019
 
1020
+                    b.Property<double>("AskingPrice");
1021
+
1020 1022
                     b.Property<string>("BankedWith");
1021 1023
 
1022 1024
                     b.Property<int>("Bedrooms");

+ 3
- 1
UnivateProperties_API/Model/Timeshare/TimeshareWeek.cs View File

@@ -14,7 +14,7 @@ namespace UnivateProperties_API.Model.Timeshare
14 14
         {
15 15
         }
16 16
 
17
-        public TimeshareWeek(bool referedByAgent, int? agentId, int? agencyId, int ownerId, bool agentAsRep, bool otherResort, string otherResortName, string resortCode, string resortName, int regionId, string season, string module, int bedrooms, int maxSleep, string unitNumber, string weekNumber, double levyAmount, bool currentYearBanked, string bankedWith, bool leviesPaidInFull, bool weekPlacedForRental, double originalPurchasePrice, DateTime originalPurchaseDate, DateTime arrivalDate, DateTime departureDate, double sellPrice, double agentCommision, bool mandate, int statusId, Status status, Province region, Individual owner, Agent agent, Agency agency, ICollection<BidItem> bidItems, ICollection<ProcessFlow.ProcessFlow> processFlows, string weekStatus, DateTime datePublished, bool published)
17
+        public TimeshareWeek(bool referedByAgent, int? agentId, int? agencyId, int ownerId, bool agentAsRep, bool otherResort, string otherResortName, string resortCode, string resortName, int regionId, string season, string module, int bedrooms, int maxSleep, string unitNumber, string weekNumber, double levyAmount, bool currentYearBanked, string bankedWith, bool leviesPaidInFull, bool weekPlacedForRental, double originalPurchasePrice, DateTime originalPurchaseDate, DateTime arrivalDate, DateTime departureDate, double sellPrice, double askingPrice, double agentCommision, bool mandate, int statusId, Status status, Province region, Individual owner, Agent agent, Agency agency, ICollection<BidItem> bidItems, ICollection<ProcessFlow.ProcessFlow> processFlows, string weekStatus, DateTime datePublished, bool published)
18 18
         {
19 19
             ReferedByAgent = referedByAgent;
20 20
             AgentId = agentId;
@@ -42,6 +42,7 @@ namespace UnivateProperties_API.Model.Timeshare
42 42
             ArrivalDate = arrivalDate;
43 43
             DepartureDate = departureDate;
44 44
             SellPrice = sellPrice;
45
+            AskingPrice = askingPrice;
45 46
             AgentCommision = agentCommision;
46 47
             Mandate = mandate;
47 48
             StatusId = statusId;
@@ -92,6 +93,7 @@ namespace UnivateProperties_API.Model.Timeshare
92 93
         public DateTime DepartureDate { get; set; }
93 94
         
94 95
         public double SellPrice { get; set; }
96
+        public double AskingPrice { get; set; }
95 97
         public double AgentCommision { get; set; }
96 98
         public bool Mandate { get; set; }
97 99
         public DateTime DateMandated { get; set; }

+ 12
- 0
UnivateProperties_API/Repository/Timeshare/WeekRepository.cs View File

@@ -296,6 +296,18 @@ namespace UnivateProperties_API.Repository.Timeshare
296 296
                 if (item.Mandate)
297 297
                     saved.DateMandated = DateTime.Now;
298 298
             }
299
+            if (saved.WeekStatus != item.WeekStatus)
300
+            {
301
+                saved.WeekStatus = item.WeekStatus;
302
+            }
303
+            if (saved.Publish != item.Publish)
304
+            {
305
+                saved.Publish = item.Publish;
306
+            }
307
+            if (saved.PulbishedDate != item.PulbishedDate)
308
+            {
309
+                saved.PulbishedDate = item.PulbishedDate;
310
+            }
299 311
             _dbContext.Entry(saved).State = EntityState.Modified;
300 312
             Save();
301 313
         }

Loading…
Cancel
Save