Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Mapster;
using Pims.Core.Extensions;
using Entity = Pims.Dal.Entities;

namespace Pims.Api.Models.Concepts.AcquisitionFile
Expand All @@ -21,6 +22,9 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.ContactPhoneNum, src => src.ContactPhoneNum)
.Map(dest => dest.IncorporationNumber, src => src.IncorporationNumber)
.Map(dest => dest.RegistrationNumber, src => src.RegistrationNumber)
.Map(dest => dest.IsFromLtsa, src => src.IsFromLtsa ?? false)
.Map(dest => dest.LtsaPid, src => src.LtsaPid)
.Map(dest => dest.LtsaSourcedDate, src => src.LtsaSourcedDate.ToNullableDateOnly())
.Map(dest => dest.Address, src => src.Address);

config
Expand All @@ -37,6 +41,9 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.ContactPhoneNum, src => src.ContactPhoneNum)
.Map(dest => dest.IncorporationNumber, src => src.IncorporationNumber)
.Map(dest => dest.RegistrationNumber, src => src.RegistrationNumber)
.Map(dest => dest.IsFromLtsa, src => src.IsFromLtsa)
.Map(dest => dest.LtsaPid, src => src.LtsaPid)
.Map(dest => dest.LtsaSourcedDate, src => src.LtsaSourcedDate.ToNullableDateTime())
.Map(dest => dest.AddressId, src => src.Address.Id)
.Map(dest => dest.Address, src => src.Address);

Expand All @@ -53,6 +60,9 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.ContactPhoneNum, src => src.ContactPhoneNum)
.Map(dest => dest.IncorporationNumber, src => src.IncorporationNumber)
.Map(dest => dest.RegistrationNumber, src => src.RegistrationNumber)
.Map(dest => dest.IsFromLtsa, src => src.IsFromLtsa)
.Map(dest => dest.LtsaPid, src => src.LtsaPid)
.Map(dest => dest.LtsaSourcedDate, src => src.LtsaSourcedDate)
.Map(dest => dest.AddressId, src => src.AddressId);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.Address;

Expand Down Expand Up @@ -28,5 +29,11 @@ public class AcquisitionFileOwnerModel : BaseAuditModel
public string ContactPhoneNum { get; set; }

public AddressModel Address { get; set; }

public bool? IsFromLtsa { get; set; }

public string LtsaPid { get; set; }

public DateOnly? LtsaSourcedDate { get; set; }
}
}
5 changes: 5 additions & 0 deletions source/backend/entities/PimsBaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1947,9 +1947,14 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.ExpiryDate).HasComment("Date the owner record expired.");
entity.Property(e => e.GivenName).HasComment("Given name of the owner (person).");
entity.Property(e => e.IncorporationNumber).HasComment("Incorporation number of the organization.");
entity.Property(e => e.IsFromLtsa)
.HasDefaultValue(false)
.HasComment("User Story: As a PIMS user, I need to pre-populate the owner name(s) from LTSA title, as I’m required to use the LTSA title owner as the owner for an Acquisition file, and having that populate automatically based on properties in the file saves me time an");
entity.Property(e => e.IsOrganization).HasComment("Indicates if the owner is an organization. Default value is FALSE, indicating that the owner is a person.");
entity.Property(e => e.IsPrimaryOwner).HasComment("Indicates that this is the file's primary owner.");
entity.Property(e => e.LastNameAndCorpName).HasComment("Name of the owner (person or organization). If person, surname.");
entity.Property(e => e.LtsaPid).HasComment("PID of the originating LTSA file.");
entity.Property(e => e.LtsaSourcedDate).HasComment("Date that LTSA data was imported into the PIMS system.");
entity.Property(e => e.OtherName).HasComment("Optional name field if required.");
entity.Property(e => e.RegistrationNumber).HasComment("Registration number of the organization.");

Expand Down
19 changes: 19 additions & 0 deletions source/backend/entities/ef/PimsAcquisitionOwner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,25 @@ public partial class PimsAcquisitionOwner
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }

/// <summary>
/// User Story: As a PIMS user, I need to pre-populate the owner name(s) from LTSA title, as I’m required to use the LTSA title owner as the owner for an Acquisition file, and having that populate automatically based on properties in the file saves me time an
/// </summary>
[Column("IS_FROM_LTSA")]
public bool? IsFromLtsa { get; set; }

/// <summary>
/// PID of the originating LTSA file.
/// </summary>
[Column("LTSA_PID")]
[StringLength(9)]
public string LtsaPid { get; set; }

/// <summary>
/// Date that LTSA data was imported into the PIMS system.
/// </summary>
[Column("LTSA_SOURCED_DATE", TypeName = "datetime")]
public DateTime? LtsaSourcedDate { get; set; }

[ForeignKey("AcquisitionFileId")]
[InverseProperty("PimsAcquisitionOwners")]
public virtual PimsAcquisitionFile AcquisitionFile { get; set; }
Expand Down
10 changes: 10 additions & 0 deletions source/backend/entities/ef/PimsAcquisitionOwnerHist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,14 @@ public partial class PimsAcquisitionOwnerHist
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }

[Column("IS_FROM_LTSA")]
public bool? IsFromLtsa { get; set; }

[Column("LTSA_PID")]
[StringLength(9)]
public string LtsaPid { get; set; }

[Column("LTSA_SOURCED_DATE", TypeName = "datetime")]
public DateTime? LtsaSourcedDate { get; set; }
}
24 changes: 12 additions & 12 deletions source/backend/entities/ef/PimsAgreement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ public partial class PimsAgreement
[Column("COMMENCEMENT_DATE")]
public DateOnly? CommencementDate { get; set; }

/// <summary>
/// Date the agreement was signed.
/// </summary>
[Column("AGREEMENT_SIGNED_DATE")]
public DateOnly? AgreementSignedDate { get; set; }

/// <summary>
/// Amount of the deposit on the agreement.
/// </summary>
Expand All @@ -86,6 +92,12 @@ public partial class PimsAgreement
[Column("PURCHASE_PRICE", TypeName = "money")]
public decimal? PurchasePrice { get; set; }

/// <summary>
/// Date of the advance payment.
/// </summary>
[Column("ADVANCE_PAYMENT_DATE")]
public DateOnly? AdvancePaymentDate { get; set; }

/// <summary>
/// Legal survey plan number,
/// </summary>
Expand Down Expand Up @@ -226,18 +238,6 @@ public partial class PimsAgreement
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }

/// <summary>
/// Date the agreement was signed.
/// </summary>
[Column("AGREEMENT_SIGNED_DATE")]
public DateOnly? AgreementSignedDate { get; set; }

/// <summary>
/// Date of the advance payment.
/// </summary>
[Column("ADVANCE_PAYMENT_DATE")]
public DateOnly? AdvancePaymentDate { get; set; }

[ForeignKey("AcquisitionFileId")]
[InverseProperty("PimsAgreements")]
public virtual PimsAcquisitionFile AcquisitionFile { get; set; }
Expand Down
12 changes: 6 additions & 6 deletions source/backend/entities/ef/PimsAgreementHist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public partial class PimsAgreementHist
[Column("COMMENCEMENT_DATE")]
public DateOnly? CommencementDate { get; set; }

[Column("AGREEMENT_SIGNED_DATE")]
public DateOnly? AgreementSignedDate { get; set; }

[Column("DEPOSIT_AMOUNT", TypeName = "money")]
public decimal? DepositAmount { get; set; }

Expand All @@ -57,6 +60,9 @@ public partial class PimsAgreementHist
[Column("PURCHASE_PRICE", TypeName = "money")]
public decimal? PurchasePrice { get; set; }

[Column("ADVANCE_PAYMENT_DATE")]
public DateOnly? AdvancePaymentDate { get; set; }

[Column("LEGAL_SURVEY_PLAN_NUM")]
[StringLength(250)]
public string LegalSurveyPlanNum { get; set; }
Expand Down Expand Up @@ -133,10 +139,4 @@ public partial class PimsAgreementHist
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }

[Column("AGREEMENT_SIGNED_DATE")]
public DateOnly? AgreementSignedDate { get; set; }

[Column("ADVANCE_PAYMENT_DATE")]
public DateOnly? AdvancePaymentDate { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export class AcquisitionOwnerFormModel {
contactEmailAddress: string | '' = '';
contactPhoneNumber: string | '' = '';
address?: OwnerAddressFormModel = new OwnerAddressFormModel();
isFromLtsa: boolean | null;
ltsaPid: string | null;
ltsaSourcedDate: string | null;

isEmpty(): boolean {
if (this.isOrganization === 'true') {
Expand Down Expand Up @@ -149,6 +152,9 @@ export class AcquisitionOwnerFormModel {
contactPhoneNum:
this.contactPhoneNumber.trim() === '' ? null : this.contactPhoneNumber.trim(),
address: OwnerAddressFormModel.toApi(this.address),
isFromLtsa: this.isFromLtsa,
ltsaPid: this.ltsaPid,
ltsaSourcedDate: this.ltsaSourcedDate,
...getEmptyBaseAudit(this.rowVersion),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ describe('UpdateAcquisitionOwnersSubForm component', () => {
isEmpty: noop as any,
toApi: noop as any,
address: { countryId: 4, countryOther: 'fake country' },
isFromLtsa: null,
ltsaPid: null,
ltsaSourcedDate: null,
},
],
},
Expand Down
3 changes: 3 additions & 0 deletions source/frontend/src/mocks/ExpropriationPayment.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export const mockGetExpropriationPaymentApi = (
districtCode: null,
regionCode: null,
},
isFromLtsa: false,
ltsaPid: null,
ltsaSourcedDate: null,
...getEmptyBaseAudit(3),
},
interestHolderId: null,
Expand Down
12 changes: 12 additions & 0 deletions source/frontend/src/mocks/acquisitionFiles.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ export const mockAcquisitionFileResponse = (
postal: 'IH8 B0B',
rowVersion: 1,
},
isFromLtsa: null,
ltsaPid: null,
ltsaSourcedDate: null,
appCreateTimestamp: '2023-02-06T22:27:22.01',
appLastUpdateTimestamp: '2023-02-06T22:27:22.01',
appLastUpdateUserid: 'dbo',
Expand Down Expand Up @@ -339,6 +342,9 @@ export const mockAcquisitionFileResponse = (
postal: 'I4M B0B',
rowVersion: 1,
},
isFromLtsa: null,
ltsaPid: null,
ltsaSourcedDate: null,
appCreateTimestamp: '2023-02-08T18:11:12.303',
appLastUpdateTimestamp: '2023-02-08T18:11:12.303',
appLastUpdateUserid: 'dbo',
Expand Down Expand Up @@ -485,6 +491,9 @@ export const getMockApiAcquisitionFileOwnerPerson = (
regionCode: null,
districtCode: null,
},
isFromLtsa: null,
ltsaPid: null,
ltsaSourcedDate: null,
appCreateTimestamp: '0001-01-01T00:00:00',
appLastUpdateTimestamp: '0001-01-01T00:00:00',
appCreateUserGuid: null,
Expand Down Expand Up @@ -529,6 +538,9 @@ export const getMockApiAcquisitionFileOwnerOrganization = (
districtCode: null,
regionCode: null,
},
isFromLtsa: null,
ltsaPid: null,
ltsaSourcedDate: null,
appCreateTimestamp: '0001-01-01T00:00:00',
appLastUpdateTimestamp: '0001-01-01T00:00:00',
appCreateUserGuid: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* File autogenerated by TsGenerator.
* Do not manually modify, changes made to this file will be lost when this file is regenerated.
*/
import { UtcIsoDate } from '@/models/api/UtcIsoDateTime';

import { ApiGen_Base_BaseAudit } from './ApiGen_Base_BaseAudit';
import { ApiGen_Concepts_Address } from './ApiGen_Concepts_Address';

Expand All @@ -19,4 +21,7 @@ export interface ApiGen_Concepts_AcquisitionFileOwner extends ApiGen_Base_BaseAu
contactEmailAddr: string | null;
contactPhoneNum: string | null;
address: ApiGen_Concepts_Address | null;
isFromLtsa: boolean | null;
ltsaPid: string | null;
ltsaSourcedDate: UtcIsoDate | null;
}
Loading