6a918c2afc
Invoice SMS:
- Send Invoice modal now prompts Email/SMS/Both based on customer contact data
- New /invoice/{token} customer-facing view page with full line items and pay button
- PublicViewToken (permanent) added to Invoice; separate from expiring PaymentLinkToken
- InvoiceSent SMS default template added; customizable via Notification Templates settings
- {{viewUrl}} placeholder documented in template editor
Customer Intake Kiosk:
- Tablet kiosk flow: Contact → Job → Terms/Signature → Confirmation
- Remote link mode for off-site customers (lighter form, no signature)
- KioskHub (AllowAnonymous SignalR) for staff-to-tablet push without login
- Staff activates tablet via cookie; sends remote link manually
- Submitted sessions create Customer + Job automatically; fires in-app notification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
143 lines
6.6 KiB
C#
143 lines
6.6 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace PowderCoating.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddKioskIntakeSession : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "KioskActivationToken",
|
|
table: "Companies",
|
|
type: "nvarchar(max)",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "KioskSessions",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
SessionToken = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
SessionType = table.Column<int>(type: "int", nullable: false),
|
|
Status = table.Column<int>(type: "int", nullable: false),
|
|
CustomerFirstName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
CustomerLastName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
CustomerPhone = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
CustomerEmail = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
IsReturningCustomer = table.Column<bool>(type: "bit", nullable: false),
|
|
JobDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
HowDidYouHearAboutUs = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
AgreedToTerms = table.Column<bool>(type: "bit", nullable: false),
|
|
AgreedToTermsAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
SmsOptIn = table.Column<bool>(type: "bit", nullable: false),
|
|
SignatureDataBase64 = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
LinkedCustomerId = table.Column<int>(type: "int", nullable: true),
|
|
LinkedJobId = table.Column<int>(type: "int", nullable: true),
|
|
SubmittedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ExpiresAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
RemoteLinkEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
RemoteLinkSentAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
CompanyId = table.Column<int>(type: "int", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
|
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_KioskSessions", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_KioskSessions_Customers_LinkedCustomerId",
|
|
column: x => x.LinkedCustomerId,
|
|
principalTable: "Customers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
table.ForeignKey(
|
|
name: "FK_KioskSessions_Jobs_LinkedJobId",
|
|
column: x => x.LinkedJobId,
|
|
principalTable: "Jobs",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
});
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 1,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 5, 13, 18, 40, 15, 633, DateTimeKind.Utc).AddTicks(8207));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 2,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 5, 13, 18, 40, 15, 633, DateTimeKind.Utc).AddTicks(8213));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 3,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 5, 13, 18, 40, 15, 633, DateTimeKind.Utc).AddTicks(8215));
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_KioskSessions_LinkedCustomerId",
|
|
table: "KioskSessions",
|
|
column: "LinkedCustomerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_KioskSessions_LinkedJobId",
|
|
table: "KioskSessions",
|
|
column: "LinkedJobId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_KioskSessions_SessionToken",
|
|
table: "KioskSessions",
|
|
column: "SessionToken",
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "KioskSessions");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "KioskActivationToken",
|
|
table: "Companies");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 1,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 5, 13, 14, 57, 30, 15, DateTimeKind.Utc).AddTicks(5641));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 2,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 5, 13, 14, 57, 30, 15, DateTimeKind.Utc).AddTicks(5655));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 3,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 5, 13, 14, 57, 30, 15, DateTimeKind.Utc).AddTicks(5656));
|
|
}
|
|
}
|
|
}
|