Appearance
dbo.primeEstimates
Info Generated by
scripts/Generate-DataDictionary.ps1- do not edit by hand. Edit descriptions inschemas/tables/dbo.primeEstimates.jsonand regenerate.
Columns
| # | Column | Type | Nullable | Flags | Description |
|---|---|---|---|---|---|
| 1 | estimateId | uniqueidentifier | no | Foreign key to the related estimate | |
| 2 | jobId | uniqueidentifier | no | Foreign key to primeJobs | |
| 3 | label | nvarchar(255) | no | Display label | |
| 4 | description | nvarchar(MAX) | yes | Free-text description | |
| 5 | estimateStatus | nvarchar(50) | no | Status of the estimate (e.g. Draft, Locked, Authorised) | |
| 6 | isVariation | bit | no | Flag indicating this is a variation to the original scope of work | |
| 7 | estimateType | nvarchar(100) | no | Type/category of the estimate | |
| 8 | totalIncludingTax | decimal(18,2) | no | Total amount including tax | |
| 9 | assignedId | uniqueidentifier | yes | Foreign key to primeUsers - the user this record is assigned to | |
| 10 | createdAt | datetime2(0) | no | Timestamp the record was created | |
| 11 | createdBy | nvarchar(200) | no | User/system that created the record | |
| 12 | updatedAt | datetime2(0) | no | Timestamp the record was last updated | |
| 13 | updatedBy | nvarchar(200) | no | User/system that last updated the record | |
| 14 | version | bigint | no | Optimistic-concurrency row version number |
Indexes
| Name | Type | Unique | PK | Key columns | Included | Filter |
|---|---|---|---|---|---|---|
| PK_primeEstimates | CLUSTERED | yes | yes | estimateId | ||
| IX_primeEstimates_jobId | NONCLUSTERED | jobId | ||||
| IX_primeEstimates_estimateStatus | NONCLUSTERED | estimateStatus | ||||
| IX_primeEstimates_createdAt | NONCLUSTERED | createdAt | ||||
| IX_primeEstimates_Jobid_Status | NONCLUSTERED | jobId, estimateStatus |
Relationships (inferred)
| From | To | Confidence |
|---|---|---|
| dbo.primeEstimates.estimateId | dbo.primeEstimateCategories.estimateId | high |
| dbo.primeEstimates.jobId | dbo.primeJobs.Id | high |
| dbo.primeStatusHistories_Job.JobId | dbo.primeEstimates.jobId | medium |
Referenced by
Views: dbo.vprimefirstquote
Procedures: dbo.spEthGetEstimateReview, dbo.spPrimeDeleteEstimatesForJob, dbo.spPrimePeerReviewEstimatedetails, dbo.spPrimeUpsertEstimate

