cleanup and notes
This commit is contained in:
@ -3,12 +3,15 @@ using System;
|
||||
|
||||
namespace BinaryDad.AggregateDal
|
||||
{
|
||||
public class EfSettlementAttemptDataAccess : ISettlementAttemptDataAccess
|
||||
public class EFSettlementAttemptDataAccess : ISettlementAttemptDataAccess
|
||||
{
|
||||
public bool AddAttempt(SettlementAttempt attempt)
|
||||
{
|
||||
// create attempt in SQL
|
||||
// 1. create attempt in SQL using entity framework
|
||||
// 2. update the "Id" property/PK of attempt upon insertion
|
||||
// 3. return if operation is successful
|
||||
|
||||
// auto-generated value from PK insert
|
||||
attempt.Id = 12376;
|
||||
|
||||
Console.WriteLine($"Adding attempt ID {attempt.Id} to SQL");
|
||||
@ -18,13 +21,17 @@ namespace BinaryDad.AggregateDal
|
||||
|
||||
public SettlementAttempt GetAttempt(int recordId)
|
||||
{
|
||||
// get the attempt from SQL
|
||||
|
||||
Console.WriteLine($"Getting attempt {recordId} from SQL");
|
||||
|
||||
// get the attempt from SQL/EF
|
||||
return new SettlementAttempt
|
||||
{
|
||||
Id = recordId
|
||||
Id = recordId,
|
||||
RecordId = 9999, // will already be in SQL via webhook
|
||||
ClientFirstName = "Ryan",
|
||||
ClientLastName = "Peters",
|
||||
Created = DateTime.Parse("9/1/2020"),
|
||||
CreatedBy = "rpeters"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -7,25 +7,19 @@ namespace BinaryDad.AggregateDal
|
||||
{
|
||||
public bool AddAttempt(SettlementAttempt attempt)
|
||||
{
|
||||
attempt.RecordId = 9999;
|
||||
// 1. create attempt in QuickBase ("Id" SQL PK should already be populated)
|
||||
// 2. update the "RecordId" property/PK of attempt upon insertion
|
||||
// 3. return if operation is successful
|
||||
|
||||
// create attempt in Quickbase
|
||||
// auto-generated value from QB record insert
|
||||
attempt.RecordId = 9999;
|
||||
|
||||
Console.WriteLine($"Adding attempt ID {attempt.RecordId} to Quickbase with SQL ID {attempt.Id}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public SettlementAttempt GetAttempt(int recordId)
|
||||
{
|
||||
// get the attempt from Quickbase
|
||||
|
||||
Console.WriteLine($"Getting attempt {recordId} from Quickbase");
|
||||
|
||||
return new SettlementAttempt
|
||||
{
|
||||
Id = recordId
|
||||
};
|
||||
}
|
||||
// NOTE: we have no need to retrieve a record from QB, as it will come from SQL
|
||||
public SettlementAttempt GetAttempt(int recordId) => null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user