feat(charge-points): add pricing mode for charge points with validation
feat(pricing): implement tariff management with peak, valley, and flat pricing feat(api): add tariff API for fetching and updating pricing configurations feat(tariff-schema): create database schema for tariff configuration feat(pricing-page): create UI for displaying and managing pricing tiers fix(sidebar): update sidebar to include pricing settings link
This commit is contained in:
17
apps/csms/drizzle/0003_milky_supreme_intelligence.sql
Normal file
17
apps/csms/drizzle/0003_milky_supreme_intelligence.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE "tariff" (
|
||||
"id" varchar PRIMARY KEY NOT NULL,
|
||||
"slots" jsonb NOT NULL,
|
||||
"peak_electricity_price" integer DEFAULT 0 NOT NULL,
|
||||
"peak_service_fee" integer DEFAULT 0 NOT NULL,
|
||||
"valley_electricity_price" integer DEFAULT 0 NOT NULL,
|
||||
"valley_service_fee" integer DEFAULT 0 NOT NULL,
|
||||
"flat_electricity_price" integer DEFAULT 0 NOT NULL,
|
||||
"flat_service_fee" integer DEFAULT 0 NOT NULL,
|
||||
"is_active" boolean DEFAULT true NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "charge_point" ADD COLUMN "pricing_mode" varchar DEFAULT 'fixed' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "transaction" ADD COLUMN "electricity_fee" integer;--> statement-breakpoint
|
||||
ALTER TABLE "transaction" ADD COLUMN "service_fee" integer;
|
||||
1936
apps/csms/drizzle/meta/0003_snapshot.json
Normal file
1936
apps/csms/drizzle/meta/0003_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,13 @@
|
||||
"when": 1773293422460,
|
||||
"tag": "0002_sweet_the_professor",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 3,
|
||||
"version": "7",
|
||||
"when": 1773307380017,
|
||||
"tag": "0003_milky_supreme_intelligence",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user