Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add invoice me link functionality #8

Merged
merged 9 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions drizzle/0001_brown_sebastian_shaw.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE IF NOT EXISTS "easyinvoice_invoice_me" (
"id" text PRIMARY KEY NOT NULL,
"label" text NOT NULL,
"userId" text NOT NULL,
"created_at" timestamp DEFAULT now()
);
--> statement-breakpoint
ALTER TABLE "easyinvoice_request" ADD COLUMN "creatorName" text NOT NULL;--> statement-breakpoint
ALTER TABLE "easyinvoice_request" ADD COLUMN "creatorEmail" text NOT NULL;--> statement-breakpoint
ALTER TABLE "easyinvoice_request" ADD COLUMN "invoicedTo" text;--> statement-breakpoint
ALTER TABLE "easyinvoice_user" ADD COLUMN "email" text;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "easyinvoice_invoice_me" ADD CONSTRAINT "easyinvoice_invoice_me_userId_easyinvoice_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."easyinvoice_user"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "easyinvoice_user" ADD CONSTRAINT "easyinvoice_user_email_unique" UNIQUE("email");
306 changes: 306 additions & 0 deletions drizzle/meta/0001_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,306 @@
{
"id": "b0e311c5-8cb5-4c2e-bda0-1ed6726f9b5f",
"prevId": "5661da60-478f-4b91-9329-7555a7f85663",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.easyinvoice_invoice_me": {
"name": "easyinvoice_invoice_me",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": true
},
"userId": {
"name": "userId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"easyinvoice_invoice_me_userId_easyinvoice_user_id_fk": {
"name": "easyinvoice_invoice_me_userId_easyinvoice_user_id_fk",
"tableFrom": "easyinvoice_invoice_me",
"tableTo": "easyinvoice_user",
"columnsFrom": ["userId"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.easyinvoice_request": {
"name": "easyinvoice_request",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"dueDate": {
"name": "dueDate",
"type": "text",
"primaryKey": false,
"notNull": true
},
"issuedDate": {
"name": "issuedDate",
"type": "text",
"primaryKey": false,
"notNull": true
},
"clientName": {
"name": "clientName",
"type": "text",
"primaryKey": false,
"notNull": true
},
"clientEmail": {
"name": "clientEmail",
"type": "text",
"primaryKey": false,
"notNull": true
},
"creatorName": {
"name": "creatorName",
"type": "text",
"primaryKey": false,
"notNull": true
},
"creatorEmail": {
"name": "creatorEmail",
"type": "text",
"primaryKey": false,
"notNull": true
},
"invoiceNumber": {
"name": "invoiceNumber",
"type": "text",
"primaryKey": false,
"notNull": true
},
"items": {
"name": "items",
"type": "json",
"primaryKey": false,
"notNull": true
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"amount": {
"name": "amount",
"type": "text",
"primaryKey": false,
"notNull": true
},
"invoiceCurrency": {
"name": "invoiceCurrency",
"type": "text",
"primaryKey": false,
"notNull": true
},
"paymentCurrency": {
"name": "paymentCurrency",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true
},
"payee": {
"name": "payee",
"type": "text",
"primaryKey": false,
"notNull": true
},
"requestId": {
"name": "requestId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"paymentReference": {
"name": "paymentReference",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"userId": {
"name": "userId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"invoicedTo": {
"name": "invoicedTo",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"easyinvoice_request_userId_easyinvoice_user_id_fk": {
"name": "easyinvoice_request_userId_easyinvoice_user_id_fk",
"tableFrom": "easyinvoice_request",
"tableTo": "easyinvoice_user",
"columnsFrom": ["userId"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.easyinvoice_session": {
"name": "easyinvoice_session",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"userId": {
"name": "userId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"easyinvoice_session_userId_easyinvoice_user_id_fk": {
"name": "easyinvoice_session_userId_easyinvoice_user_id_fk",
"tableFrom": "easyinvoice_session",
"tableTo": "easyinvoice_user",
"columnsFrom": ["userId"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.easyinvoice_user": {
"name": "easyinvoice_user",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"googleId": {
"name": "googleId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"easyinvoice_user_googleId_unique": {
"name": "easyinvoice_user_googleId_unique",
"nullsNotDistinct": false,
"columns": ["googleId"]
},
"easyinvoice_user_email_unique": {
"name": "easyinvoice_user_email_unique",
"nullsNotDistinct": false,
"columns": ["email"]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
7 changes: 7 additions & 0 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"when": 1739369813298,
"tag": "0000_chunky_albert_cleary",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1739480940151,
"tag": "0001_brown_sebastian_shaw",
"breakpoints": true
}
]
}
Loading