DDL: dodavanje.sql

File dodavanje.sql, 5.2 KB (added by 163080, 2 months ago)
Line 
1-- Insert data into Company table
2INSERT INTO Company (
3 company_id, company_name, company_representative, company_address, company_bank_accounts, company_vat,
4 company_email, company_logo_url, created_at, updated_at
5) VALUES
6(1, 'AgencyOS Inc.', 'Naum Shapkarovski',
7 '{"street": "123 Main St", "city": "Skopje", "state": "Macedonia", "zip": "1000"}',
8 '[{"bank_name": "NLB", "iban": "MK123456789", "swift": "NLBMK22"}]',
9 'MK12345678', 'info@agencyos.com', '/logos/agencyos.png', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
10(2, 'TechMasters', 'Ivan Petrovski',
11 '{"street": "45 Innovation Lane", "city": "Tetovo", "state": "Macedonia", "zip": "1200"}',
12 '[{"bank_name": "Halkbank", "iban": "MK987654321", "swift": "HALKMK22"}]',
13 'MK98765432', 'contact@techmasters.com', '/logos/techmasters.png', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
14
15-- Insert data into User table
16INSERT INTO "User" (
17 user_id, user_name, user_email, user_role, company_id, created_at, updated_at
18) VALUES
19(1, 'John Doe', 'john.doe@agencyos.com', 'Admin', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
20(2, 'Jane Smith', 'jane.smith@agencyos.com', 'HR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
21(3, 'Mark Lee', 'mark.lee@techmasters.com', 'Finance Manager', 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
22
23-- Insert data into Employee table
24INSERT INTO Employee (
25 employee_id, employee_name, employee_email, employee_role, employee_status,
26 employee_address, employee_bank_info, employee_cv_ref, employee_photo_ref,
27 company_id, created_at, updated_at
28) VALUES
29(1, 'Alice Brown', 'alice.brown@agencyos.com', 'Backend Developer', 'Active',
30 '{"street":"123 Main St","city":"Skopje","state":"Macedonia","zip":"1000"}',
31 'MK123456789',
32 '/cvs/alice_brown.pdf', '/photos/alice.jpg', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
33(2, 'Bob Green', 'bob.green@agencyos.com', 'Backend Developer', 'Active',
34 '{"street":"123 Main St","city":"Skopje","state":"Macedonia","zip":"1000"}',
35 'MK987654321',
36 '/cvs/bob_green.pdf', '/photos/bob.jpg', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
37(3, 'Charlie White', 'charlie.white@techmasters.com', 'Frontend Engineer', 'Active',
38 '{"street":"45 Innovation Lane","city":"Tetovo","state":"Macedonia","zip":"1200"}',
39 'MK112233445',
40 '/cvs/charlie_white.pdf', '/photos/charlie.jpg', 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
41
42-- Insert data into Candidate table
43INSERT INTO Candidate (
44 candidate_id, candidate_name, candidate_email, candidate_status,
45 candidate_cv_ref, candidate_stage, candidate_notes, company_id, created_at, updated_at
46) VALUES
47(1, 'Eve Taylor', 'eve.taylor@gmail.com', 'Applied',
48 '/cvs/eve_taylor.pdf', 'Initial Screening', 'Highly recommended', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
49(2, 'Frank Harris', 'frank.harris@gmail.com', 'Interview',
50 '/cvs/frank_harris.pdf', 'Technical Interview', 'Strong technical skills', 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
51
52-- Insert data into Client table
53INSERT INTO Client (
54 client_id, client_name, client_representative, client_email,
55 client_address, client_vat, client_logo_url, company_id, created_at, updated_at
56) VALUES
57(1, 'Global Enterprises', 'Sophia Johnson', 'sophia.johnson@globalent.com',
58 '{"street":"456 Business Rd","city":"Bitola","state":"Macedonia","zip":"7000"}',
59 'MK55443322', '/logos/global_ent.jpg', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
60(2, 'NextGen Solutions', 'Michael Carter', 'michael.carter@nextgen.com',
61 '{"street":"789 Innovation Blvd","city":"Ohrid","state":"Macedonia","zip":"6000"}',
62 'MK66778899', '/logos/nextgen.jpg', 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
63
64-- Insert data into Invoice table
65INSERT INTO Invoice (
66 invoice_id,
67 invoice_no,
68 invoice_issue_date,
69 invoice_due_date,
70 invoice_notes,
71 invoice_status,
72 invoice_currency,
73 invoice_taxes,
74 invoice_quantity_type,
75 invoice_discount,
76 invoice_month,
77 invoice_pdf_ref,
78 company_id,
79 client_id,
80 created_at,
81 updated_at
82) VALUES
83(
84 1,
85 202501,
86 '2025-01-15',
87 '2025-02-15',
88 'Payment for Project Alpha',
89 'Pending',
90 'EUR',
91 18.50,
92 'Hours',
93 0.00,
94 '2025-01',
95 'invoices/202501.pdf',
96 1,
97 1,
98 CURRENT_TIMESTAMP,
99 CURRENT_TIMESTAMP
100),
101(
102 2,
103 202502,
104 '2025-01-10',
105 '2025-02-10',
106 'Payment for Project Gamma',
107 'Draft',
108 'USD',
109 12.00,
110 'Deliverables',
111 50.00,
112 '2025-01',
113 'invoices/202502.pdf',
114 2,
115 2,
116 CURRENT_TIMESTAMP,
117 CURRENT_TIMESTAMP
118);
119
120-- Insert data into LineItem table
121INSERT INTO LineItem (
122 item_id, description, quantity, unit_price, currency, total, invoice_id
123) VALUES
124(1, 'Custom Software Development', 100, 50.00, 'USD', 5000.00, 1),
125(2, 'Maintenance and Support', 20, 75.00, 'USD', 1500.00, 1),
126(3, 'Website Development', 50, 100.00, 'USD', 5000.00, 2);
127
128-- Insert data into EmailTemplate table
129INSERT INTO EmailTemplate (
130 template_id, type, subject, body, company_id, created_at, updated_at
131) VALUES
132(1, 'New Invoice', 'Invoice Issued',
133 'Dear {{client_name}},\n\nYour invoice #{{invoice_id}} has been issued.', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
134(2, 'Welcome Employee', 'Welcome to AgencyOS',
135 'Dear {{employee_name}},\n\nWelcome to the team at {{company_name}}!', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);