Full backend implementation with custom Odoo modules: - encoach_api: Core API, user management, JWT auth - encoach_exam: Exam generation (reading, writing, listening, speaking) - encoach_evaluate: AI-powered evaluation (writing, speaking) - encoach_training: Training tips and walkthrough - encoach_storage: File storage management - encoach_payment: Stripe, PayPal, Paymob integration - encoach_mail: Email notifications Made-with: Cursor
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
from odoo import models, fields
|
|
|
|
|
|
class EncoachSubscriptionPayment(models.Model):
|
|
_name = "encoach.subscription.payment"
|
|
_description = "EnCoach Subscription Payment"
|
|
|
|
user_id = fields.Many2one("res.users", string="User", ondelete="set null")
|
|
package_id = fields.Many2one(
|
|
"encoach.package", string="Package", ondelete="set null",
|
|
)
|
|
provider = fields.Selection(
|
|
[
|
|
("stripe", "Stripe"),
|
|
("paypal", "PayPal"),
|
|
("paymob", "Paymob"),
|
|
],
|
|
string="Payment Provider",
|
|
)
|
|
status = fields.Selection(
|
|
[
|
|
("pending", "Pending"),
|
|
("completed", "Completed"),
|
|
("failed", "Failed"),
|
|
],
|
|
default="pending",
|
|
)
|
|
amount = fields.Float(digits=(12, 2))
|
|
currency = fields.Char()
|
|
transaction_id = fields.Char(index=True)
|
|
created_at = fields.Datetime(default=fields.Datetime.now)
|
|
entity_id = fields.Many2one(
|
|
"encoach.entity", string="Entity", ondelete="set null",
|
|
)
|
|
legacy_id = fields.Char(index=True)
|