@arcforgelabs/flow 2026.10.27 → 2026.10.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/server/api/invoicing.js +96 -40
- package/server/app.js +3 -1
- package/server/core/automations.js +46 -1
- package/server/core/invoice-rules.js +4 -2
- package/server/core/invoices.js +4 -2
- package/server/core/job-board.js +130 -0
- package/server/core/ledger.js +12 -5
- package/server/core/line-mapping.js +337 -0
- package/server/core/pipeline.js +18 -6
- package/server/core/queue.js +22 -0
- package/server/core/sending.js +20 -7
- package/server/db/migrate-all.js +26 -0
- package/server/db/migrations/0010_invoicing_rules.sql +34 -13
- package/server/db/migrations/0011_invoice_rules.sql +11 -5
- package/server/db/migrations/0012_invoice_sending.sql +18 -9
- package/server/db/migrations/0013_line_mappings.sql +35 -0
- package/server/db/migrations/meta/0013_snapshot.json +3568 -0
- package/server/db/migrations/meta/_journal.json +7 -0
- package/server/db/schema.js +43 -0
- package/server/import/at-start.js +64 -2
- package/server/index.js +5 -1
- package/server/integrations/port.js +4 -1
- package/server/integrations/seazona/client.js +6 -0
- package/server/integrations/seazona/feed.js +62 -4
- package/server/integrations/seazona/governor.js +138 -13
- package/server/integrations/seazona/index.js +21 -2
- package/server/integrations/seazona/lanes.js +69 -13
- package/server/integrations/seazona/migrations/0000_api_governor.sql +3 -3
- package/server/integrations/seazona/migrations/0001_mirror.sql +9 -9
- package/server/integrations/seazona/migrations/0002_call_safety.sql +15 -0
- package/server/integrations/seazona/migrations/meta/0002_snapshot.json +882 -0
- package/server/integrations/seazona/migrations/meta/_journal.json +7 -0
- package/server/integrations/seazona/scheduler.js +37 -1
- package/server/integrations/seazona/schema.js +22 -0
- package/server/integrations/seazona/settings.js +10 -0
- package/server/integrations/seazona/store.js +74 -0
- package/server/integrations/seazona/tables.js +1 -0
- package/server/integrations/xero/drafts.js +4 -1
- package/server/integrations/xero/import.js +1 -0
- package/server/integrations/xero/lookup.js +6 -2
- package/server/integrations/xero/migrations/0000_xero_connections.sql +1 -1
- package/server/integrations/xero/migrations/0001_xero_catalogue.sql +5 -5
- package/server/integrations/xero/migrations/0002_xero_invoice_pushes.sql +2 -2
- package/server/integrations/xero/migrations/0003_xero_payment_cursors.sql +1 -1
- package/server/integrations/xero/migrations/0004_xero_mirror.sql +7 -7
- package/server/integrations/xero/migrations/0005_xero_send_modes.sql +12 -6
- package/server/ui/app-page.js +6 -4
- package/server/ui/app.js +111 -8
- package/server/ui/clerk-appearance.js +21 -0
- package/server/ui/flow.css +155 -30
- package/server/ui/invoicing-settings.js +2 -0
- package/server/ui/job-board.js +155 -0
- package/server/ui/jobs.js +220 -91
- package/server/ui/line-mappings.js +60 -0
- package/server/ui/monitoring.js +29 -7
- package/server/ui/routes.js +1 -1
- package/server/ui/search.js +145 -0
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
ALTER TABLE "invoices" ADD COLUMN "ready_at" timestamp with time zone;--> statement-breakpoint
|
|
2
|
-
ALTER TABLE "invoices" ADD COLUMN "ready_by" uuid;--> statement-breakpoint
|
|
3
|
-
ALTER TABLE "invoices" ADD COLUMN "send_state" text;--> statement-breakpoint
|
|
4
|
-
ALTER TABLE "invoices" ADD COLUMN "send_error" jsonb;--> statement-breakpoint
|
|
5
|
-
ALTER TABLE "invoices" ADD COLUMN "send_requested_by" uuid;--> statement-breakpoint
|
|
6
|
-
ALTER TABLE "invoices" ADD COLUMN "send_updated_at" timestamp with time zone;--> statement-breakpoint
|
|
7
|
-
|
|
8
|
-
ALTER TABLE "invoices" ADD CONSTRAINT "
|
|
9
|
-
|
|
1
|
+
ALTER TABLE "invoices" ADD COLUMN IF NOT EXISTS "ready_at" timestamp with time zone;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "invoices" ADD COLUMN IF NOT EXISTS "ready_by" uuid;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "invoices" ADD COLUMN IF NOT EXISTS "send_state" text;--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "invoices" ADD COLUMN IF NOT EXISTS "send_error" jsonb;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE "invoices" ADD COLUMN IF NOT EXISTS "send_requested_by" uuid;--> statement-breakpoint
|
|
6
|
+
ALTER TABLE "invoices" ADD COLUMN IF NOT EXISTS "send_updated_at" timestamp with time zone;--> statement-breakpoint
|
|
7
|
+
DO $flow_guard$ BEGIN
|
|
8
|
+
ALTER TABLE "invoices" ADD CONSTRAINT "invoices_ready_by_people_id_fk" FOREIGN KEY ("ready_by") REFERENCES "public"."people"("id") ON DELETE set null ON UPDATE no action;
|
|
9
|
+
EXCEPTION WHEN duplicate_object OR duplicate_table OR invalid_table_definition THEN NULL;
|
|
10
|
+
END $flow_guard$;--> statement-breakpoint
|
|
11
|
+
DO $flow_guard$ BEGIN
|
|
12
|
+
ALTER TABLE "invoices" ADD CONSTRAINT "invoices_send_requested_by_people_id_fk" FOREIGN KEY ("send_requested_by") REFERENCES "public"."people"("id") ON DELETE set null ON UPDATE no action;
|
|
13
|
+
EXCEPTION WHEN duplicate_object OR duplicate_table OR invalid_table_definition THEN NULL;
|
|
14
|
+
END $flow_guard$;--> statement-breakpoint
|
|
15
|
+
DO $flow_guard$ BEGIN
|
|
16
|
+
ALTER TABLE "invoices" ADD CONSTRAINT "invoices_send_state_valid" CHECK ("invoices"."send_state" is null or "invoices"."send_state" in ('queued', 'sent', 'failed'));
|
|
17
|
+
EXCEPTION WHEN duplicate_object OR duplicate_table OR invalid_table_definition THEN NULL;
|
|
18
|
+
END $flow_guard$;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS "line_mappings" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"organisation_id" uuid NOT NULL,
|
|
4
|
+
"kind" text NOT NULL,
|
|
5
|
+
"match" text DEFAULT 'exact' NOT NULL,
|
|
6
|
+
"label" text NOT NULL,
|
|
7
|
+
"unit_amount_cents" integer,
|
|
8
|
+
"item_code" text,
|
|
9
|
+
"account_code" text,
|
|
10
|
+
"tax_code" text,
|
|
11
|
+
"description" text,
|
|
12
|
+
"enabled" boolean DEFAULT true NOT NULL,
|
|
13
|
+
"origin" text DEFAULT 'person' NOT NULL,
|
|
14
|
+
"updated_by" uuid,
|
|
15
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
16
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
17
|
+
CONSTRAINT "line_mappings_kind_valid" CHECK ("line_mappings"."kind" in ('alias', 'price_alias', 'saved', 'account')),
|
|
18
|
+
CONSTRAINT "line_mappings_match_valid" CHECK ("line_mappings"."match" in ('exact', 'starts_with')),
|
|
19
|
+
CONSTRAINT "line_mappings_tax_code_valid" CHECK ("line_mappings"."tax_code" is null or "line_mappings"."tax_code" in ('GST', 'GST_FREE')),
|
|
20
|
+
CONSTRAINT "line_mappings_target" CHECK (("line_mappings"."kind" = 'account' and "line_mappings"."account_code" is not null) or ("line_mappings"."kind" <> 'account' and "line_mappings"."item_code" is not null)),
|
|
21
|
+
CONSTRAINT "line_mappings_price" CHECK ("line_mappings"."kind" not in ('price_alias', 'saved') or "line_mappings"."unit_amount_cents" is not null),
|
|
22
|
+
CONSTRAINT "line_mappings_label_valid" CHECK (length("line_mappings"."label") between 1 and 200)
|
|
23
|
+
);
|
|
24
|
+
--> statement-breakpoint
|
|
25
|
+
ALTER TABLE "invoice_lines" ADD COLUMN IF NOT EXISTS "account_code" text;--> statement-breakpoint
|
|
26
|
+
ALTER TABLE "price_items" ADD COLUMN IF NOT EXISTS "description" text;--> statement-breakpoint
|
|
27
|
+
DO $flow_guard$ BEGIN
|
|
28
|
+
ALTER TABLE "line_mappings" ADD CONSTRAINT "line_mappings_organisation_id_organisations_id_fk" FOREIGN KEY ("organisation_id") REFERENCES "public"."organisations"("id") ON DELETE no action ON UPDATE no action;
|
|
29
|
+
EXCEPTION WHEN duplicate_object OR duplicate_table OR invalid_table_definition THEN NULL;
|
|
30
|
+
END $flow_guard$;--> statement-breakpoint
|
|
31
|
+
DO $flow_guard$ BEGIN
|
|
32
|
+
ALTER TABLE "line_mappings" ADD CONSTRAINT "line_mappings_updated_by_people_id_fk" FOREIGN KEY ("updated_by") REFERENCES "public"."people"("id") ON DELETE set null ON UPDATE no action;
|
|
33
|
+
EXCEPTION WHEN duplicate_object OR duplicate_table OR invalid_table_definition THEN NULL;
|
|
34
|
+
END $flow_guard$;--> statement-breakpoint
|
|
35
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "line_mappings_unique" ON "line_mappings" USING btree ("organisation_id","kind","match","label",coalesce("unit_amount_cents", -1));
|